2

Can someone suggest me a tutorial or explain how to verify ethereum transactions in a non financial use case of blockchain. For example, I am using blockchain to distribute access tokens for my IoT and the miners should verify if the access token is valid or expired and such. what are the changes to be made in order for blockchain miners to verify for this information in a transaction.

  • How will your users access the IoT? Will they use password or do you want to use private/public pair key to log in? Is this going to be done on a private blockchain or on Ethereum's main net? Who is going to decide who has access and who doesn't? And where is this info stored? – Nulik Apr 4 '18 at 20:18
  • @Nulik These are all valid questions. The question as phrased is too broad – davinci26 Apr 4 '18 at 20:53
  • Hi Nulik, yes i am trying to use a private blockchain instead of main net, to put it in simple terms, i have a contract with different functions and each function call can be seen as a transaction on network. so, can we make changes to miners so that if a particular function is called (transaction is mined) then it should verify particular things before it sign the transaction. if suppose, a function such as getAgeof(string name) is called, so miners should check a valid name is given (a set of alphabets rather than special chars or num). How to do this is my question – K Kolluru Apr 5 '18 at 7:48
  • should the logic goes into smart contract in this case? – K Kolluru Apr 5 '18 at 7:51
0

There are two cases:

Assuming that you use Ethereum Blockchain (or any other blockchain that supports smart contracts)

Then you can write a smart contract to realize your business logic. In the IoT example, you can have a function claim token that the user calls to claim a token and a function is_token_valid that checks if the pk of the user is associated with a token. This example is purely illustrative but you can extend it with your logic:

mapping (address => bool) private valid_tokens;

function claim_token() external {
    valid_tokens[msg.sender] = true;   
}

function is_token_valid() external returns(bool){
    return valid_tokens[msg.sender];
}

If you develop your own private blockchain (I advise against this) you should implement what valid transaction means in your chain and develop the client to check that.

  • Hi, I tried to have my whole logic in the smart contract, but i just wonder if we can have some smart miners too in a private blockchain? – K Kolluru Apr 11 '18 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.