⚠️ Not maintained anymore, migrated here⚠️
This demo showcases all the parts needed to create a privacy preserving DApp with good UX which are:
- A circuit
- A smart contract
- A relayer
- A webapp
On this example we do a simple anonymous message board but it can be extended for other DApps in other fields such as DeFi, voting & governance, identity, etc..
Feature | Supported |
---|---|
Aztec Noir circuit | ✅ |
Solidity verifier | ✅ |
ECDSA verification circuit | ✅ |
EIP712 enabled | ✅ |
Prover on browser (WASM) | ✅ |
Ethers.js 6.9 relayer | ✅ |
MIT license | ✅ |
Make sure you installed Nargo 0.19.4
as detailed below:
On Linux
mkdir -p $HOME/.nargo/bin && \
curl -o $HOME/.nargo/bin/nargo-x86_64-unknown-linux-gnu.tar.gz -L https://github.com/noir-lang/noir/releases/download/v0.19.4/nargo-x86_64-unknown-linux-gnu.tar.gz && \
tar -xvf $HOME/.nargo/bin/nargo-x86_64-unknown-linux-gnu.tar.gz -C $HOME/.nargo/bin/ && \
echo 'export PATH=$PATH:$HOME/.nargo/bin' >> ~/.bashrc && \
source ~/.bashrc
On MAC
mkdir -p $HOME/.nargo/bin && \
curl -o $HOME/.nargo/bin/nargo-x86_64-apple-darwin.tar.gz -L https://github.com/noir-lang/noir/releases/download/v0.19.4/nargo-x86_64-apple-darwin.tar.gz && \
tar -xvf $HOME/.nargo/bin/nargo-x86_64-apple-darwin.tar.gz -C $HOME/.nargo/bin/ && \
echo '\nexport PATH=$PATH:$HOME/.nargo/bin' >> ~/.zshrc && \
source ~/.zshrc
Now generate the Solidity verifier.
cd circuit
nargo codegen-verifier
This will generate a Solidity file located at circuit/contract/circuit/plonk_vk.sol
. Deploy it on an EVM on-chain.
Now deploy the CommentVerifier
contract located at contracts/CommentVerifier.sol
. Pass the Verifier contract you just generated as constructor parameter.
Let's launch the relayer first. Fill the .env
file based on .env.example
on the relayer/
directory and run the following.
cd relayer
npm install
npm start
Open a new terminal and launch the webapp. Now fill the .env
file based on .env.example
on the webapp/
, the run the following.
cd webapp
npm install
npm start
The webapp will automatically open on your browser. Now you will be able to generate proofs on your browser and send them to the relayer for on-chain verification.