Skip to main content

hash_node

Function hash_node 

Source
pub fn hash_node(left: &Bytes32, right: &Bytes32) -> Bytes32
Expand description

Internal node digest: SHA-256( HASH_TREE_PREFIXleftright ) (SPEC §3.3).

Combines two already-hashed child digests (typically outputs of hash_leaf or nested hash_node results). Prevents second-preimage attacks where a valid Merkle proof for a leaf could be reinterpreted as an internal node (SPEC §1.3 Decision 13).

Chia source: merkle_tree.rs HASH_TREE_PREFIX.