shuijian-xu / bitcoin

0 stars 0 forks source link

How light nodes can get proofs that transactions of interest were included in a block without having to know all the transactions of a block? #237

Open shuijian-xu opened 4 years ago

shuijian-xu commented 4 years ago

The full node can send a limited amount of information about the block and the light client can recalculate the Merkle root, which can then be verified against the Merkle root in the block header.

shuijian-xu commented 4 years ago

When a full node sends a proof of inclusion, there are two pieces of information that need to be included. First, the light client needs the Merkle tree structure, and second, the light client needs to know which hash is at which position in the Merkle tree. Once both pieces of information are given, the light client can reconstruct the partial Merkle tree to reconstruct the Merkle root and validate the proof of inclusion.