13

Reading through the Yellow paper, I can see that each block header includes the Keccak 256 hash of the root of the trie for transactions and transaction receipts. I am struggling to understand how and where they are created.

How are the Transactions Trie and the Transaction Receipts Trie related for a given block?

Is it the case that, as the world state is updated by going through the transactions, the transactions and transaction receipts are stored in their respective tries?

11

Transaction Tries and Transaction Receipt Tries are indeed independent data structures with distinct roots stored on the blockchain header and differ in both purpose and content.

Purpose:

  • Transaction Tries: records transaction request vectors

  • Transaction Receipt Tries: records the transaction outcome

Content:

Parameters used in composing a Transaction Trie [details in section 4.3 of the yellow paper]:

  • nonce,
  • gas price,
  • gas limit,
  • recipient,
  • transfer value,
  • transaction signature values, and
  • account initialization (if transaction is of contract creation type), or transaction data (if transaction is a message call)

Parameters used in composing a Transaction Receipt Trie [details in section 4.4.1 of the yellow paper]:

  • post-transaction state,
  • the cumulative gas used,
  • the set of logs created through execution of the transaction, and
  • the Bloom filter composed from information in those logs
  • Thanks zanzu, are the recepts always for the transactions in the same block? If so, are they stored in the same order? – atomh33ls Jun 13 '16 at 15:16
  • 1
    @atomh33ls. Yes and yes. This is clear from the equations for the transactions root, Ht, and receipts root, Hr, in Eq 29, both of which are indexed on block transaction index, i. – zanzu Jun 13 '16 at 15:48
  • Ah yes thanks; I think you mean He for receipt root? The Ht and He components of Eq 28 are also relevant. – atomh33ls Jun 13 '16 at 16:23
  • 1
    @atomh33ls. Yes, sorry, replace Hr with He in my above comment (it would have been too easy if receipts root would have been denoted by Hr! :o)) – zanzu Jun 13 '16 at 16:28
  • What do you mean by transaction request vectors @zanzu – alper Dec 10 '17 at 16:12

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.