# Railgun Markdown version of https://l2beat.com/zk-catalog/railgun ## Summary - Creator: Railgun - Total Value Secured: $108.90 M (-1.27% compared to seven days ago) - Trusted setups for Snarkjs (Groth16): - Railgun, risk yellow (medium risk) per the [Trusted Setups Risk Framework](https://forum.l2beat.com/t/the-trusted-setups-framework-for-zk-catalog/381): Circuit-specific trusted setup for 54 Groth16 Railgun circuits over BN254. It was built on top of 55 phase 1 contributions, with 304 phase 2 participants. Proving system could be broken if either phase 1 or 2 is compromised. - Used in: [Railgun](https://l2beat.com/privacy/projects/railgun) - Verifiers: 1 successful (verified by [L2BEAT](https://l2beat.com)) - zkVM: BN254 (curve), Snarkjs (Groth16) ### About A shielded ledger on Ethereum for ERC-20 tokens, with private transfers and DeFi calls, run by no operator and governed by RAIL stakers. ### Links - Website: https://railgun.org ## Value Secured The interactive TVS chart is shown on [the HTML page](https://l2beat.com/zk-catalog/railgun#tvs). ## Milestones & Incidents - 2022-05-08: [Current pool goes live on Ethereum](https://etherscan.io/tx/0x2bd98cd135e2eaf7b7239bb4951a043f655629b5d0f0ca12334ce05718512361). The proxy that holds today's pool is unpaused with the RailgunLogic implementation. ## Trusted Setups Risk levels follow the [Trusted Setups Risk Framework](https://forum.l2beat.com/t/the-trusted-setups-framework-for-zk-catalog/381). Yellow (medium risk): all contributions are published and the final output can be verified, the ceremony client is open source, there were at least 30 contributions, participation was open to the public and announced, and participants are publicly identified. Green (lowest risk): everything required for yellow, with at least 150 contributions. Red (highest risk): at least one requirement for yellow is not met. N/A: the proof system needs no trusted setup. ### Railgun - Risk: yellow (medium risk) - Proof systems: Snarkjs (Groth16) Circuit-specific Phase 2 trusted setup for Railgun's 54 Groth16 circuits (parameterised by transaction input/output counts) over the BN254 curve. It [builds on the Polygon zkEVM ceremony](https://github.com/Railgun-Privacy/circuits-v2/blob/d0ec02dea0cbc8cd02a3b727b28de16e51f9a741/prepare_for_ceremony.sh#L13) as phase 1, which contains 55 participants. A separate Phase 2 ceremony was publicly announced, open to anonymous and identified participants, and wrapped up in late December 2022. Verified against the ceremony artifact IPFS hash `QmWAySHYhaZqioKi1ufrPJC1n1ZVtHP2w4hLA9XqqJCFne`: the `/contributors` directory contains 328 sequentially-numbered attestation files with GitHub or Twitter handles, and the `/zkeys` directory contains 54 final zkey files (one per circuit). Parsing the final zkey binary for the 1x1 circuit shows 304 Phase 2 contributions on that circuit. - Phase 1 ceremony: . - Ceremony artifacts on IPFS: [https://ipfs.io/ipfs/QmWAySHYhaZqioKi1ufrPJC1n1ZVtHP2w4hLA9XqqJCFne](https://ipfs.io/ipfs/QmWAySHYhaZqioKi1ufrPJC1n1ZVtHP2w4hLA9XqqJCFne) - Ceremony announcement: [https://medium.com/@Railgun_Project/railgun-project-begins-setup-ceremony-with-an-emphasis-on-security-d1c63117c312](https://medium.com/@Railgun_Project/railgun-project-begins-setup-ceremony-with-an-emphasis-on-security-d1c63117c312) - Advanced Circuit ceremony user guide: [https://medium.com/@Railgun_Project/railgun-advanced-circuit-setup-ceremony-user-guide-32361c54242](https://medium.com/@Railgun_Project/railgun-advanced-circuit-setup-ceremony-user-guide-32361c54242) - Docs overview of the trusted setup: [https://docs.railgun.org/wiki/learn/privacy-system/trusted-setup-ceremony](https://docs.railgun.org/wiki/learn/privacy-system/trusted-setup-ceremony) - Railgun circuits repository with ceremony scripts: [https://github.com/Railgun-Privacy/circuits-v2](https://github.com/Railgun-Privacy/circuits-v2) ## Verifier IDs List of different onchain verifiers for this proving system. Unique ID distinguishes different deployments of the same verifier from different verifiers (e.g. different versions). ### Groth16: Snarkjs Circom / iden3 implementation of Groth16 proving system written in JS. #### Railgun verifier - Verifier ID: `Railgun 91 circuit verifier 03.07.2026` - Source: https://github.com/Railgun-Privacy/circuits-v2/tree/0aa2d13763a9fcfbb7b7ea9c02e004e71f1394bb/src/library - Verification: successful (verified by [L2BEAT](https://l2beat.com)) - Used in: [Railgun](https://l2beat.com/privacy/projects/railgun) **Known deployments** - [0xFA7093CDD9EE6932B4eb2c9e1cde7CE00B1FA4b9](https://etherscan.io/address/0xFA7093CDD9EE6932B4eb2c9e1cde7CE00B1FA4b9#code) on Ethereum, used in: [Railgun](https://l2beat.com/privacy/projects/railgun) ##### Verification steps Railgun smart contract acts as a verifier for ZK proofs for all 91 Railgun circuits. 91 different verification keys for these circuits are stored onchain in the verifier smart contract. This regeneration attests that the verification keys stored onchain correspond to circuits published in Railgun repo. Generally, to regenerate all Railgun verification keys, the following has to be done: 1. Checkout the `main` branch of the [Railgun circuits-v2 repo](https://github.com/Railgun-Privacy/circuits-v2) (commit hash `0aa2d13763a9fcfbb7b7ea9c02e004e71f1394bb`). 2. Download Railgun trusted setup artifacts, which could be found at IPFS CID `QmUsmnK4PFc7zDp2cmC4wBZxYLjNyRgWfs5GNcJJ2uLcpU` or [on L2BEAT trusted setup hosting](https://trusted-setup-hosting.l2beat.com/privacy/railgun/trusted_setup_railgun.zip). It contains the proving keys for all 91 circuits, which contain circuit information and Groth16 phase 2 trusted setup information. 3. Build required version of circom and compile circuit sources into `.r1cs` binaries. 4. Download the phase 1 trusted setup files and use it to verify that all published prover keys correspond to the compiled circuits. This step will implicitly check the integrity of phase 2 contributions. 5. Generate all 91 verification keys from all prover keys, and make sure that it is identical to the ones in the onchain smart contract. Helper scripts that implement the flow above and more detailed explanations could be found in this [script .zip archive](https://trusted-setup-hosting.l2beat.com/privacy/railgun/verification_railgun.zip). This .zip must be extracted in `circuits-v2` dir checked out on commit `0aa2d13763a9fcfbb7b7ea9c02e004e71f1394bb` before the execution.