0

I am reading this and now wondering why the blockchain isn't just implemented as a Merkle tree, or the reverse, why you can't just have a single data structure (i.e. a transaction chain) instead of the block chain with nested Merkle tree of transactions.

  • It seems to me the block is just there to make the merkle tree work, since it requires bottom-up calculation and doesn't support appending to the tree very well, so instead you want to create a small compact tree and group it into blocks. Please correct if wrong. – Lance Pollard Feb 17 at 20:50
  • Don't understand why you need to "prove that a specific transaction is included in a block". – Lance Pollard Feb 17 at 20:51
1

A bitcoin full node independently validates the history of the network. To do so, it must validate each block in sequence (which includes all transactions in each block).

A merkle tree provides a cryptographic commitment to some data, but does not hold that data itself (it just holds hashes of the data). So a merkle tree alone is insufficient to validate the history of the network. Nodes need block and transaction data to do so, not just the merkle tree commitment.

  • I don't see it yet. I could imagine just putting the data as another field in the merkle tree nodes (leaf nodes). Or why not just have blocks and no merkle tree. Basically, why not just have one data structure instead of these two or three. – Lance Pollard Feb 17 at 18:09
  • The merkle tree is not included in a block, only the merkle root is. The merkle root serves as a cryptographic commitment to the transactions being included in the block (it is part of the block header, and the block header is what is hashed to find a valid PoW). Including it allows lightwallets a mechanism to verify that certain transactions are included in the longest valid chain, in a much less resource intensive way than a full node’s full validation process. – chytrik Feb 17 at 20:19
  • Merkle tree IS in the block. The Merkle root is in the header only (which is what you meant by the looks of it). – Jannes Feb 18 at 13:37
  • 1
    @Jannes I meant that all intermediate nodes in the merkle tree are not stored explicitly, as a node can use the block to compute the entire tree itself. Storing the entire tree explicitly would be redundant, a waste of blockspace. – chytrik Feb 18 at 19:08

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.