Tokamak zk-EVM is a tool that converts TokamakL2JS transactions into ZKPs.
TokamakL2JS, which is a variant of EthereumJS, specifies a layer 2 protocol of Tokamak Network.
If you are interested in converting Ethereum transactions to ZKP, check out branch "archive-airdrop-Sep25" (incomplete development).
This section describes how to use the main CLI named tokamak-cli.
- Create an Alchemy account and log in to the dashboard (https://dashboard.alchemy.com/).
- Create a new app/project for Ethereum Mainnet.
- Copy the API Key (the short token).
You will pass this key to the CLI as--install <API_KEY>.
Note: You can paste the full RPC URL obtained from any provider other than Alchemy.
- Install Docker Desktop for Windows – https://docs.docker.com/desktop/install/windows-install/
- (If you want to use CUDA/GPU) Install NVIDIA GPU driver on Windows and verify Docker GPU pass-through.
- Install the latest NVIDIA driver.
- Ensure Docker Desktop is using Linux containers with the WSL 2 backend.
- (Optional) Test that CUDA is visible inside containers (at the host):
nvidia-smi docker run --rm --gpus all nvidia/cuda:12.2.0-runtime-ubuntu22.04 nvidia-smi
- Run Docker
- Make sure that you are in the root directory,
Tokamak-zk-EVM.docker build -f dockerfile -t tokamak-zkevm:win . # If you will use CUDA/GPU docker run --gpus all --rm -it -v "$(cygpath -m "$PWD"):/workspace" tokamak-zkevm:win bash # Else docker run --rm -it -v "$(cygpath -m "$PWD"):/workspace" tokamak-zkevm:win bash
- Make sure that you are in the root directory,
Option 1: Automatic Setup (Recommended)
Run the setup script to automatically check and install all prerequisites:
./scripts/setup-macos.shThis script will detect the following dependencies and install any missing automatically.
Option 2: Manual Installation
- Install Node.js – https://nodejs.org/
- Install Circom – https://docs.circom.io/getting-started/installation/
- Install Rust – https://www.rust-lang.org/tools/install
- Install CMake – https://cmake.org/download/
- Install Bun – https://bun.sh/ (required for Synthesizer binary build)
- Install dos2unix
brew install dos2unix
- Install Node.js – https://nodejs.org/
- Install Circom – https://docs.circom.io/getting-started/installation/
- Install Rust – https://www.rust-lang.org/tools/install
- Install CMake – https://cmake.org/download/
- Install dos2unix
- For example, Ubuntu/Debian:
sudo apt-get update && sudo apt-get install -y dos2unix
- For example, Ubuntu/Debian:
- If you want to use CUDA for GPU acceleration:
- Install the NVIDIA GPU driver appropriate for your distro (verify with
nvidia-smi).
Docs: https://docs.nvidia.com/cuda/ - Install CUDA runtime libraries (matching your driver’s supported CUDA version).
Follow the CUDA Installation Guide for Linux in the docs above. - (Optional) Quick checks:
nvidia-smi ldconfig -p | grep -E 'libcudart|libcublas|libcudnn' || true
- Install the NVIDIA GPU driver appropriate for your distro (verify with
To avoid compatibility/permission issues on the main script itself:
-
Convert CRLF → LF on the CLI script:
# Run from the repo root dos2unix tokamak-cli -
Make the CLI executable:
chmod +x tokamak-cli
From the repository root:
- Install (Install deps, compile circuits, write RPC URL using your Alchemy API key, run trusted setup, then run OS-specific backend packaging)
./tokamak-cli --install <YOUR_ALCHEMY_API_KEY | FULL_RPC_URL>- Synthesize (prepare inputs using a transaction config JSON)
./tokamak-cli --synthesize <PATH_TO_CONFIG_JSON>A template for the config JSON lives in
synthesizer-input-template/.
- Preprocess (backend preprocess stage)
./tokamak-cli --preprocess- Prove (backend prove stage; outputs stay under
dist/<platform>/resource/prove/output)
./tokamak-cli --prove- Verify (verify proof artifacts in dist; optional resource overlay path)
# Uses dist/<platform>/resource by default
./tokamak-cli --verify
# Or provide a directory containing a resource/ folder to overlay into dist before verifying
./tokamak-cli --verify <PATH_WITH_RESOURCE>- Extract proof bundle (optional; zip key artifacts)
./tokamak-cli --extract-proof <OUTPUT_DIR>- The Tokamak‑zk‑EVM project and its maintainers are not responsible for any leakage or misuse of your API keys or credentials.
- For local testing, use a free, non‑sensitive Alchemy API key. Do not use production or paid keys, or keys tied to sensitive data.
- During
--install, the CLI writes your RPC endpoint topackages/frontend/synthesizer/.env. We recommend deleting.envafter use (or rotating the key) and ensuring it is not committed to version control.
| Package | Description | Language | Status |
|---|---|---|---|
qap-compiler |
Library of subcircuits for basic EVM operations | Circom | 🧪 Beta |
synthesizer |
Compiler that converts an Ethereum transaction into a circuit for Tokamak zk-SNARK | TypeScript | 🧪 Beta |
| Package | Description | Language | Status |
|---|---|---|---|
mpc-setup |
Tokamak zk-SNARK's setup algorithm (multi-party computation version) | Rust | 🧪 Beta |
trusted-setup |
Tokamak zk-SNARK's setup algorithm (trusted single entity version) | Rust | 🧪 Beta |
prover |
Tokamak zk-SNARK's proving algorithm | Rust | 🧪 Beta |
verify |
Tokamak zk-SNARK's verifying algorithm | Rust, Solidity | 🧪 Beta |
Notes:
- 🔥 Alpha: Initial proof-of-concept for testing
- 🧪 Beta: Fully featured, but unstable and unoptimized
- ⭐️ Stable (v1.0.0): Fully featured, stable, and optimized
- Archived in branch "archive-airdrop-Sep25".
- Incomplete conversion of Ethereum transactions into ZKPs.
- What does "incomplete" mean? ZKPs only include the execution of a transaction's opcodes. Verification of input state and the transaction signature, as well as reconstruction of output state, are excluded.
- The Tokamak zk-SNARK backend is ready to use:
- MSM and NTT are accelerated by ICICLE APIs.
- It requires < 10GB memory.
- A ZKP can be generated in 1-2 mins on CUDA or Apple silicon.
- The current main branch.
- Complete conversion of Tokamak Layer 2 transactions into ZKPs, which covers:
- Verification of transaction signatures,
- Verification of input state,
- Execution of transaction opcodes,
- Reconstruction of output state.
- Compatible with Tokamak Private App Channels.
- Project Tokamak Network ZKP (Medium) (Last updated in Nov. 2025)
- Project Tokamak zk-EVM(Slide) (Last updated in Jul. 2025)
- Tokamak zk-SNARK Paper (Last updated in Apr. 2025)
- Frontend - Synthesizer (work in progress)
We welcome contributions! Please see our Contributing Guidelines for details.
This project is dual-licensed under:
You may choose either license when using this software. This dual-licensing approach is standard in the Rust ecosystem and provides maximum compatibility with other open-source projects.
