FourthState / plasma-mvp-rootchain

smart contract implementation according to the Plasma MVP spec.
Apache License 2.0
79 stars 24 forks source link

Update TMSimpleMerkleTree.sol #111

Open colin-axner opened 5 years ago

colin-axner commented 5 years ago

Tendermint updated their simple merkle tree to the following:

leaf nodes and inner nodes have different hashes. 
This is for "second pre-image resistance", to prevent the proof to an inner node being valid as the proof of a leaf. 
The leaf nodes are SHA256(0x00 || leaf_data), and inner nodes are SHA256(0x01 || left_hash || right_hash)

This can be seen here