1. 引言
前序博客有:
Merkle proof又名Merkle path,为重新计算merkle root所需的最小节点数。
如上图,为了证明node2在root hash为65C7C87E2731AE97D0BE89EA3299A544FD28DE6A
的Merkle tree中,仅需提供Node 1,Node 34和Node 567,即可生成root Node 1234567。
Merkle tree proof相关代码实现有:
- https://github.com/iden3/iden3js(JavaScript)
- https://github.com/weijiekoh/semaphore-merkle-tree(TypeScript)
- https://github.com/appliedzkp/incrementalquintree(TypeScript)
- https://github.com/filecoin-project/merkletree(Rust)
- https://github.com/sitano/merkle_light(Rust)
- https://github.com/0xProject/OpenZKP/tree/master/crypto/merkle-tree (Rust)
- https://github.com/ing-bank/zkrp(Go)
- https://github.com/zcash/librustzcash/blob/master/zcash_primitives/src/merkle_tree.rs (Rust)
- https://github.com/wealdtech/go-merkletree/(Go)
- https://github.com/mit-dci/utreexo(Go),详细参看博客 Utreexo:比特币UTXO merkle tree proof以节约节点存储空间。
参考资料
[1] Merkle proofs Explained.
[2] Zero-knowledge proofs in identity systems
[3] ZKProof Zero-Knowledge Proofs for Set Membership
[4] Zero Knowledge Proofs and Merkle Trees – An overview before diving into it
[5] Data Validation
[6] Understanding Merkle pollards