Skip to content

polytope-labs/sp1-beefy

Repository files navigation

SP1 BEEFY

License

SP1 program for generating zero-knowledge proofs of BEEFY (Bridge Efficiency Enabling Finality Yielder) commitments using the SP1 zkVM.

Overview

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.

What is BEEFY?

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.

Requirements

Core Dependencies

For GPU Proving (Optional but Recommended)

For Cluster Proving (Optional)

Additional Tools

  • Docker (for containerized builds)

Installation

Install SP1

curl -L https://sp1.succinct.xyz | bash
sp1up

Clone the Repository

git clone https://github.com/polytope-labs/sp1-beefy.git
cd sp1-beefy

Build the SP1 Program

cd program && cargo prove build --output-directory ../elf

This compiles the SP1 program and places the ELF binary at elf/, where it is embedded into the prover at compile time.

Build the Prover

cargo build --release

Verifying Key

0x007d1720c695842ed647a1a72e981751f9b5e26fc5ca038523b23430a1292f08

You can regenerate it with:

cargo prove vkey --elf ./elf/sp1-beefy-program

Components

  • program/: The RISC-V zkVM program that verifies BEEFY commitments
  • prover/: Rust library for proof generation with multiple backends
    • local.rs: GPU-accelerated local proving
    • cluster.rs: Local Docker-based multi-GPU cluster proving
  • primitives/: Shared types and data structures
  • elf/: Compiled zkVM program binary (generated during build)
  • infra/: Docker Compose setup for local cluster (8 GPU workers)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Acknowledgments

Built by Polytope Labs using SP1 from Succinct Labs.

Contact

About

SP1 proofs of BEEFY commitments

Resources

License

Stars

Watchers

Forks

Contributors

Languages