Privacy within the Ethereum Virtual Machine (EVM) is critical for fostering a secure, decentralized, and equitable blockchain ecosystem. As decentralized applications (dApps) and decentralized finance (DeFi) protocols grow, protecting user privacy becomes increasingly important. Privacy is a fundamental human right that safeguards individual autonomy and freedom.
Tornado Cash 2.0 is a next-generation Ethereum privacy solution designed to address these concerns. Building upon the original Tornado Cash protocol, it introduces significant enhancements to improve security, efficiency, and user experience. Key innovations include adopting the Poseidon hash function, utilizing the Noir language and PlonK proofs, integrating with Aave for liquidity provision, and enforcing a verifiable one-day liquidity lock.
- Install Noir
curl -L noirup.dev | bash
noirup
- Install Proving Backend:
curl -L bbup.dev | bash
bbup
cd circuits/deposit
nargo execute
bb prove -b ./target/deposit.json -w ./target/deposit.gz -o ./target/proof
bb write_vk -b ./target/deposit.json -o ./target/vk
cd ..
cd ..
cd tornado-cli
cargo run --package tornado-cli --bin deposit_proof_convert
cd ..
forge test --match-test test_write_nullifier
@DEV WAIT 10 seconds here!!! This is the min deposit time proof logic (set for 10 seconds for the hackathon).
forge test --match-test test_deposit_proof_vault_generate_data
cd tornado-cli
cargo run --package tornado-cli --bin withdraw_prover_formatter
cd ..
cd circuits/withdraw
nargo execute
bb prove -b ./target/withdraw.json -w ./target/withdraw.gz -o ./target/proof
bb write_vk -b ./target/withdraw.json -o ./target/vk
cd ..
cd ..
cd tornado-cli
cargo run --package tornado-cli --bin withdraw_proof_convert
cd ..
forge test --match-test test_withdraw_proof
- deploy contracts & run anvil
anvil --accounts 10 --timestamp $(date +%s) --block-time 5
- in new terminal deploy the vault & verifier contracts:
forge script script/Deploy.s.sol --fork-url http://127.0.0.1:8545 --private-key 2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6 --broadcast
cd circuits/deposit
nargo execute
bb prove -b ./target/deposit.json -w ./target/deposit.gz -o ./target/proof
bb write_vk -b ./target/deposit.json -o ./target/vk
cd ..
cd ..
cd tornado-cli
cargo run --package tornado-cli --bin deposit_proof_convert
cd ..
forge test --match-test test_write_nullifier
sleep 11
forge test --match-test test_deposit_proof_vault_generate_data
cd tornado-cli
cargo run --package tornado-cli --bin withdraw_prover_formatter
cd ..
cd circuits/withdraw
nargo execute
bb prove -b ./target/withdraw.json -w ./target/withdraw.gz -o ./target/proof
bb write_vk -b ./target/withdraw.json -o ./target/vk
cd ..
cd ..
cd tornado-cli
cargo run --package tornado-cli --bin withdraw_proof_convert
cd ..
forge test --match-test test_withdraw_proof
forge test --match-test test_withdraw_proof