0

I am trying to implement POE model based on Ethereum blockchain. Basically, I get sha-256 hash from a document, then I send a 0 ether transaction to myself and add document's hash to the "Data" field. Transaction gets validated and I can see it: https://ropsten.etherscan.io/tx/0x1f4d3136b16de5ca56e04edfbb5139e902d624a200846374f7cba8b598f6dd82 (currently I am doing it on testnet)

However, my input data was 15e2b0d3c3..... and in receipt data is 0x53369b7315e2b0...... Everything is okay, except that I don't understand why these 8 digits were inserted, what they stand for? And what's the purpose of this 0x in front of everything?

If someone could explain this in simple terms, I would be really grateful.

2

The 0x just indicates that the data is in hexadecimal. It's just a presentation convention and not part of the data.

The 53369b73 part is more interesting. This looks like the signature of a function call in the Ethereum ABI. When you created the transaction, it looks like you called a method on a contract. The "signature" of this method always forms the first four bytes of the call data as per the ABI spec - it is how a contract can work out which of its methods you are calling. (If you provide more info on how you created the transcation in the first place I can probably expand on this.)

You can send data as a transaction without calling a method. For example web3.js you can use sendTransaction and specify exactly what data you want to send using the data parameter. But if you are working with contracts written in Solidity you probably don't want to be doing this directly.

  • thanks for your detailed answer. I just use myetherwallet to send transactions. I don't have a contract deployed. Also I have tried stamp.io POE service and it seems that they do it in the same way and get the same result (result also has this 53369b73 prefix) so it's still unclear for me how/why these 8 numbers are formed... – Honor LT Aug 17 '17 at 9:08
  • Hmm. I just sent you a generous 0.0001 Ropsten Eth transaction via the MyEtherWallet "Send Ether & Tokens" tab. As the transaction data I just entered "0x15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225" (no quote marks) - as you can see it came through unchanged in the transaction itself, so I don't know why it's different for you. Make sure you are sending Ropsten Eth (any amount, 0 is OK), not a token as token transfers are really function calls in disguise. – benjaminion Aug 17 '17 at 9:32
  • Could you please also try to uppload a file to stamp.io (just create simple .txt file for example) and use their proof of existence service. Once you uppload the file, you can see its SHA-256 code. When the existence of your document is confirmed, you can click on a link (transaction code) to see the details. Is the "Input data" the same as sha-256 code of your file or it has these 8 numbers infront? – Honor LT Aug 17 '17 at 11:09
  • 1
    OK - done that. I see the "53369B73" prefix. Their certificate page for the document (technical details part) says that they are adding this prefix, so that's reasonable (I don't know why, though). However, I can't see where this would come from if you are using MyEtherWallet to create your transaction. – benjaminion Aug 17 '17 at 12:07
  • Thank you very much! This prefix really comes from their service so (I guess) it isn't necessary when implementing my own POE service. You are the real genius, your explanations helped me to understand lots of new things (what's happening behind the scenes) – Honor LT Aug 17 '17 at 12: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.