Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

MerkleDrop v1

A Merkle root gates an airdrop that pays real ugnot. Successor to v0, which moved no coins and whose proof scheme was safe only by accident of encoding lengths.

Drop

Field Value
Root 6964baa99da23b9d8c76774c6f1122b250040e29c1d75823dda15c043dc65755
Allocations 4
Closes at height never
Claimed 0
Paid out 0 ugnot
Funding address g1jvh5ukk07dvd57fxefcp5aa29xaydxmxs7myyp

How it differs from v0

  1. Domain separated leaves. v0 hashed leaves bare and combined nodes commutatively, so an inner-node hash was also a valid leaf hash. It was not exploitable, but only because a v0 leaf preimage tops out at 61 bytes while an inner preimage is always 64. v1 tags leaves 0x00 and inner nodes 0x01.
  2. Proofs bound to a position. v0 folded a sibling list of any length. v1 carries index and total, rebuilds the tree shape, and caps the depth.
  3. A settable root and a closing height. v0's root was a const.
  4. Real coins. v0 kept a uint64 ledger and moved nothing.

Leaf encoding

Reproduce this off chain to rebuild the tree:

leaf = "gno.land/r/moul/x/daily/merkledrop/v1|<index>|<address>|<amount>"
tree = Tendermint simple tree, leaf 0x00, inner 0x01

Example allocations

Seeded at deploy so the drop can be exercised without a generator. A live drop commits only a root and stores none of this.

# Address Amount Claimed
0 g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5 100 no
1 g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj 250 no
2 g1manfred47kzduec920z88wfr64ylksmdcedlf5 500 no
3 g1sss9uxef4l6lwc0mxq8n5v0e4vqpml7c39cxq2 750 no