This project re-builds Tornado Cash for educational purposes. This project focuses on replacing Circom with Noir as the language for writing circuits. It has been rebuilt from the ground up with a modern technology stack, including ZK-friendly hash function, while retaining the original Tornado Cash workflow as much as possible.
While Circom has been widely used in many production-ready projects due to its performance, power, and flexibility, it comes with a steep learning curve. We need a cryptography brain to understand how circuits (or proof systems) work at a low-level, if not, you’re going to run into trouble.
Noir is a Rust-based domain specific language (DSL) for creating and verifying zero-knowledge proofs. It’s the easiest way to write zk applications in simply and familiar syntax while retaining all the power and flexibility.
Tornoirdo Mixer is an experimental project created for educational purposes only. This project is not intended for use in production environments, nor is it designed for real-world deployment.
By using this project, you acknowledge and agree that:
- The authors and contributors of Tornoirdo Mixer are not responsible for any incidents, damages, or legal issues arising from the use, misuse, or modification of this project.
- The code is provided “as-is,” without any warranties or guarantees of security, privacy, or functionality.
- This project is strictly intended for research and learning purposes. Any use of this project for illegal or unethical activities is strictly prohibited.
follow these simple steps to work on your own machine:
-
Install foundryup and follow the instructions on screen. You should then have all the foundry tools like
forge,cast,anvilandchisel.curl -L https://foundry.paradigm.xyz | bashthen
foundryup --install 1.2.3
-
Install noirup:
curl -L https://raw.githubusercontent.com/noir-lang/noirup/main/install | bashthen
noirup -v 1.0.0-beta.9
-
Install the correct version of the Barretenberg proving backend for Noir (bb).
curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/master/barretenberg/bbup/install | bashthen
bbup -v 1.2.1 # compatible with nargo 1.0.0-beta.9
-
Clone this repository
git clone https://github.com/jokerstudio/tornoirdo-mixer.git
-
Install dependencies:
forge install
bun install
This command do these tasks for you:
-
Compile circuits
-
Generate verifier key
-
Generate verifier Solidity smart contract
These three steps are written as bash commands in the makefile. Run the following to perform these steps:
make
This will create circuit artifacts that needed to run tests.
There are two test scripts /test/ETHTornado.t.sol and /test/ERC20Tornado.t.sol for Native mixer and ERC20 mixer respectively.
Run the following command to run tests:
forge testPlease note that, these tests may take a minute for proving computation.
- Install docker
- Install Visual Studio Code and the devcontainer extension
- Checkout this repository:
git clone https://github.com/jokerstudio/tornoirdo-mixer.git
- Open the folder with VS Code:
Once VS Code started, it will offer you to "Reopen in Container".
code ./tornoirdo-mixer
This command do these tasks for you:
-
Compile circuits
-
Generate verifier key
-
Generate verifier Solidity smart contract
These three steps are written as bash commands in the makefile. Run the following to perform these steps:
make
After building the images, now you are ready to run test within Visual Studio Code Terminal.
forge test