Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ronanyeah/sui-zk-airdrop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sui-zk-airdrop

This is a demonstration of using a Merkle Tree to contain a list of Sui wallet addresses. These wallets can verify their inclusion in this list onchain, by submitting offchain proofs.

Onchain verification is managed by Groth16.

This infrastructure could be useful for airdrops where the number of wallets makes the gas costs of wallet-to-wallet transfers unfeasible, or if it it preferred that claimants interact in order to participate.

The wallet lists and Merkle roots can be stored on Walrus, to enable a fully decentralized user journey.



Build Instructions

Compile the Circom circuit

Requires installing Circom

circom src/leanimt.circom -l ./path/to/circomlib/circuits --r1cs --wasm -o ./dist

Display the Merkle root

This root will be saved onchain (and can also be stored alongside the leaves on Walrus)

cargo run --bin create_root

Generate claim values

Any wallet in ./wallets.json can be used

WALLET=0x5354085bc8a8d3f96383483a9ba42410476af916d42ff5dd4f05bad55608f2ce cargo run --bin generate_claim_proof

These output values should be passed to the Sui contract and the claim can be validated.

Further resources:

About

Sui / Groth16 / Merkle Tree

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published