get-nft.circom verifies that a certain account in the rollup given a snaphot (state-root) has been done more than 10 transactions.
This is a proof of rollup usability and if a user is able to prover that it will receive a NFT as a reward
- check
nonceprovided is greater than 10 with GreaterThan - build state with HashState
- verify state in the snapshot root with SMTVerifier
root: snapshot of the hermez rollup state rootidx: unique identifier of the state-tree. Used as a nullifier to avoid double mintingethereumAddress:msg.senderused a a proof of account ownership
- state leaf parameters:
tokenID,nonce,sign,balance&ay siblings
circom get-NFT-test.circom --r1cs --wasm --sym --c
snarkjs powersoftau new bn128 13 pot13_0000.ptau -v
snarkjs powersoftau contribute pot13_0000.ptau pot13_0001.ptau --name="First contribution" -v
snarkjs powersoftau prepare phase2 pot13_0001.ptau pot13_final.ptau -v
snarkjs groth16 setup get-NFT-test.r1cs pot13_final.ptau get-NFT-test_0000.zkey
snarkjs zkey contribute get-NFT-test_0000.zkey get-NFT-test_0001.zkey --name="1st Contributor Name" -v
snarkjs zkey export verificationkey get-NFT-test_0001.zkey verification_key.json
snarkjs zkey export solidityverifier get-NFT-test_0001.zkey verifier.sol
- Setup different tiers of NFT depending on the nonce
nonceshould be public thenmintNFT depending onnonceselected
- Similar circuit but proving that a certain account has more balance than X