Standard Plonk Verifier written in Cairo.
- This verifier is keccak based and currently supports the BN-254 curve.
- This verifier also includes a pairing function that does not need extra prover side computations.
- The field and group operations use towered fields with built-in circuits generated by the cairo circuit code generator.
Cairo Circuit Code Generator
- A helper program written in Rust to generate large and complex circuits to be used inline within the verifier.
CLI Tool
- A tool written in Rust to help facilitate reading the verifier inputs (proof, verification key, public signals) to call the smart contract. The tool can read in json formats similar to the output of snarkjs.
Contract
- A Starknet Smart Contract that implements the verifier.
- Within the Starknet limits for contract deployment.
Contract
curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh -s -- -v 2.9.2
Testing
curl -L https://raw.githubusercontent.com/software-mansion/universal-sierra-compiler/master/scripts/install.sh | sh
- The easiest way will be to call the deployed contract through Starknet's syscalls (see example).
- Otherwise, for testing purposes or development purposes, import the library and call the exposed verify function.
Type | Network | Address |
---|---|---|
Verifier | Sepolia | 0x040fa51f373511141dfd7009267540b6cc33717b80c1c555cb5aacde1b6ca9dd |
Pairing | Sepolia | 0x01e2e7868e826ea937791f4baa3d0cef977632234856ec24cb6d33f5d519f0c6 |
Circuit | Steps |
---|---|
Fq12 Square | 506 |
Fq12 Multiply | 686 |
BN254 Pairing n=1 | 528143 |
BN254 Pairing n=2 | 1056340 |
Final Verification | 2998910 |
- Cairo pairing library - towered field implementation in Cairo.