ZKCamp / stealthdrop-assignment

5 stars 31 forks source link

ZK Stealth Drop Assignment

What is a stealth drop?

StealthDrop is an airdrop utility that enables token airdrops to be claimed by completely anonymous accounts. The purpose of StealthDrop is to address the privacy and identity issues associated with traditional token airdrops, where recipients' identities and actions are often known and visible to others.

The mechanism of StealthDrop involves a combination of techniques such as zero-knowledge proofs, proof of inclusion, and cryptographic signatures. Here's a summary of how it works:

The airdropper creates a polynomial with roots as addresses eligible for the airdrop. The polynomials commitment (hash of polynomial) is publically available. The eligibility of an address to claim the airdrop can be checked by evaluating the polynomial at that point and proving that it is 0. ZKPs are used to establish the following:

Instructions

Use the below steps to form the logic of circuit:

npm run generate-example-inputs

Note: The file being used to populate the inputs is also very useful for understanding how the inputs are being formed.

How do polynomial commitments work?

Setup

yarn
nargo --version
noirup -v 0.7.1

Evaluation

Note: The hash of the signature is non-deterministic and thus it is improper to use it as a nullifier. This is only a toy example and not to be used directly in production.

Reference