SP1 program for generating zero-knowledge proofs of BEEFY (Bridge Efficiency Enabling Finality Yielder) commitments using the SP1 zkVM.
This project provides a complete infrastructure for generating succinct zero-knowledge proofs of Polkadot BEEFY consensus commitments. The proofs can be efficiently verified on-chain in EVM smart contracts, enabling trustless bridging between Polkadot parachains and Ethereum or other EVM chains.
BEEFY (Bridge Efficiency Enabling Finality Yielder) is a secondary consensus protocol for Polkadot that allows for efficient light client implementations. BEEFY commitments contain:
- MMR Proofs: Merkle Mountain Range proofs for efficient light client state updates
- Authority Signatures: Cryptographic signatures from the validator set
- Parachain Headers: Finalized parachain block headers
- Validator Set Commitments: Merkle commitments to the active validator set
This project uses SP1 to generate Groth16 proofs that verify these commitments, producing a constant-size proof (~200 bytes) that can be verified on-chain with minimal gas costs.
- CUDA Toolkit (12.0 or later)
- NVIDIA GPU with CUDA support
- CUDA Container Toolkit (for Docker builds)
- Docker with Docker Compose
- Multiple NVIDIA GPUs (supports up to 8 GPUs)
- NVIDIA Container Toolkit
- Docker (for containerized builds)
curl -L https://sp1.succinct.xyz | bash
sp1upgit clone https://github.com/polytope-labs/sp1-beefy.git
cd sp1-beefycd program && cargo prove build --output-directory ../elfThis compiles the SP1 program and places the ELF binary at elf/, where it is embedded into the prover at compile time.
cargo build --release0x007d1720c695842ed647a1a72e981751f9b5e26fc5ca038523b23430a1292f08
You can regenerate it with:
cargo prove vkey --elf ./elf/sp1-beefy-programprogram/: The RISC-V zkVM program that verifies BEEFY commitmentsprover/: Rust library for proof generation with multiple backendslocal.rs: GPU-accelerated local provingcluster.rs: Local Docker-based multi-GPU cluster proving
primitives/: Shared types and data structureself/: Compiled zkVM program binary (generated during build)infra/: Docker Compose setup for local cluster (8 GPU workers)
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Built by Polytope Labs using SP1 from Succinct Labs.
- Email: hello@polytope.technology