[Ethereum] Relationship between Transaction Trie and Receipts Trie

blockchainblocksreceiptstransactions

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?

Best Answer

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
Related Topic