ZK Nullifier Snap: Enabling the next generation of pseudonymous apps

An ETHBogota Hackathon Winner

by MetaMaskNovember 17, 2022
ZK Nullifier

MetaMask Snaps is the roadmap to making MetaMask the most extensible wallet in the world. As a developer, you can bring your features and APIs to MetaMask in totally new ways. Web3 developers are the core of this growth and this series aims to showcase the novel MetaMask Snaps being built today.

ZK Nullifier Snap

Snap Repo: https://github.com/piotr-roslaniec/ethbogota-2022

Why did you build it?

We want to enable the next generation of pseudonymous apps that require uniqueness like ZK airdrops, ZK message boards, and ZK voting. To do this, we need a tight wallet integration, starting with a MetaMask Snap.

Can you walk us through the technical implementation?

We built a generic snap script that allows us to execute arbitrary WASM inside the snap. We then added WASM bindings to the existing Rust signature code, and hooked it up to the MetaMask Snaps call to the private key. We then output all the appropriate signals for the user to enter into a ZK-SNARK to verify the determinism of the signature.

To read more about why this allows us to create effective unique, anonymous identifiers or anonymous nullifiers, check out our full blog post here.

What are the next steps if you would implement this?

We want to integrate it end to end with the necessary ZK proofs, which are currently being written in Circom, and soon a PLONK based language. We also expect some apps like heyanon and stealthdrop to integrate it upon release, and hope that more folks will use it!

We also want to write an ERC to standardize what we found so that wallets like MetaMask and Ledger can integrate it into their core libraries.

Can you tell us a little bit about yourself and your team?

yush_g is exploring next gen ZK identity with Personae Labs and helped write the original paper, and Piotr is a wicked engineer with a passion for new wallet primitives and cutting edge zero knowledge advances.

When were you first introduced to MetaMask Snaps and what was your experience like?

Piotr initially learned about MetaMask Snaps in Osaka Devcon, and has been working with them since then. Aayush was just introduced to MetaMask Snaps this Devcon by Piotr.

What makes MetaMask Snaps different from other wallets?

Arbitrary WASM inside a wallet is currently quite nascent, and we are excited to get to try it.

Tell us about what building MetaMask Snaps with MetaMask is like for you and your team?

Development is fairly smooth and efficient. There are still some difficulties with deployment, since users have to disable their regular MetaMask to be able to use MetaMask Snaps.

What does MetaMask Snaps mean to you?

MetaMask Snaps is an interesting new wallet primitive, and great to be able to quickly prototype new cryptographic ideas.

What opportunities do you see with MetaMask Snaps and the possibilities it unlocks for the Web3 space?

We think the ability to roll your own cryptography is powerful: for instance, our project, which deploys verifiably deterministic signatures on Ethereum, will unlock things like being able to uniquely vote within any anonymity set you can dream of, anonymous airdrops to unlinked accounts, or threads where you can repeatedly post under the same anonymous name.

Any advice you would like to share with developers keen to try MetaMask Snaps?

We designed our snap to run arbitrary WASM so we could just plug in our existing Rust code -- we recommend looking at our code if you're interested in doing the same!

Building with MetaMask Snaps

To get started with MetaMask Snaps:

  1. Checkout the developer docs
  2. Install MetaMask Flask
  3. Check out a MetaMask Snaps guide
  4. Stay connected with us on Twitter, GitHub discussions, and Discord

Keep an eye out for our team at the next hackathon in an area near you! Happy BUIDLing ⚒️

Disclaimer: MetaMask Snaps are generally developed by third parties other the ConsenSys Software. Use of third-party-developed MetaMask Snaps is done at your own discretion and risk and with agreement that you will solely be responsible for any loss or damage that results from such activities. ConsenSys makes no express or implied warranty, whether oral or written, regarding any third-party-developed MetaMask Snaps and disclaims all liability for third-party developed MetaMask Snaps. Use of blockchain-related software carries risks, and you assume them in full when using MetaMask Snaps.

Receive our Newsletter