nervosnetwork / sparse-merkle-tree

46 stars 37 forks source link

incorrect example rightmost key #50

Open shaojunda opened 1 year ago

shaojunda commented 1 year ago

https://github.com/nervosnetwork/sparse-merkle-tree/tree/master#construction

# N = 256 sparse merkle tree
height:
                   0
                /     \
255            0        1

.............................

           /   \          /  \
1         0     1        0    1
         / \   / \      / \   / \
0       0   1 0  1 ... 0   1 0   1
       0x00..00 0x00..01   ...   0x11..11

The correct value for the rightmost key should be 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, not 0x11..11.