On-chain Ethereum light client built with SP1.
/program
: The SP1 Helios program/contracts
: Contracts for the Helios light client/primitives
: Common types shared between the program, contract, and script/script
: Scripts for getting the contract's genesis parameters and generating proofs
Holesky -> Sepolia Bridge: 0x53544ba8e5504Df8569E1F2fEd8b39af9e7F5B71
cp .env.example .env
- Modify .env if needed.
- Source chain:
- Mainnet by default
SOURCE_CHAIN_ID
SOURCE_CONSENSUS_RPC_URL
- Use values under Supported Networks.
- Proofs:
- Mock by default for testing
- Generate real proofs on cluster (for prod):
SP1_PROVER
:network
SP1_VERIFIER_ADDRESS
: use a deployed verifier found hereSP1_PRIVATE_KEY
: your whitelisted cluster private key.
- The other .env values will be filled out at a later step.
- Source chain:
RUST_LOG=info cargo run --release --bin genesis
-
cd ../contracts
-
cp .env.example .env
-
Paste the genesis parameters into
.env
and manually fill in the other parameters -
forge install
-
source .env
-
forge script script/Deploy.s.sol --rpc-url $RPC_URL --private-key $PRIVATE_KEY --etherscan-api-key $ETHERSCAN_API_KEY --broadcast --verify --via-ir
-
Take note of the light client contract address printed by the script
Continuously generate proofs & keep light client updated with chain
- Paste in the contract address in
.env
and fill out the rest of the parameters. RUST_LOG=info cargo run --release --bin operator
To run sp1-helios
we recommend getting a Beacon Chain node from Quicknode, or one of the providers from this list of L1 Ethereum beacon chain RPC providers.
Source (bridging from):
- Mainnet
SOURCE_CHAIN_ID=1
SOURCE_CONSENSUS_RPC_URL=<ETHEREUM_BEACON_CHAIN_RPC_URL>
- Sepolia Testnet
SOURCE_CHAIN_ID=11155111
SOURCE_CONSENSUS_RPC_URL=<SEPOLIA_BEACON_CHAIN_RPC_URL>
- Holesky Testnet
SOURCE_CHAIN_ID=17000
SOURCE_CONSENSUS_RPC_URL=<HOLESKY_BEACON_CHAIN_RPC_URL>
Destination (bridging to):
- Helios supports bridging to any arbitrary EVM chain.
Once you've configured your environment, you can test that the light client program can update to a new consensus state by running:
RUST_LOG=info cargo run --bin test --release
or to test a specific slot:
RUST_LOG=info cargo run --bin test --release -- --slot your_slot_number
This will fetch the relevant data from the source chain and execute the program with the generated inputs. If this runs successfully, the program can update to a new consensus state.