Skip to content

Commit 6c4aab5

Browse files
authored
add reference for second preimage attack
1 parent ecb4ce9 commit 6c4aab5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ A "standard" merkle tree has a few characteristics that make it good for on-chai
5050
- The tree is shaped as a [complete binary tree](https://xlinux.nist.gov/dads/HTML/completeBinaryTree.html).
5151
- The leaves are sorted.
5252
- The leaves are the result of ABI encoding a series of values.
53-
- The leaves are double-hashed to prevent attacks.
53+
- The leaves are double-hashed to prevent [second preimage attacks].
54+
55+
[second preimage attacks]: https://flawed.net.nz/2018/02/21/attacking-merkle-trees-with-a-second-preimage-attack/
5456

5557
The last two points imply that the hash of a leaf in the tree, with example values `addr, amount`, can be computed in Solidity as follows:
5658

0 commit comments

Comments
 (0)