A BLS signature aggregation protocol with onchain execution for EigenLayer AVS operators.
The router coordinates multiple operators to sign messages, aggregates their signatures when a threshold is reached, and executes the result onchain.
- Docker and Docker Compose
- Rust
- Git
- Configure environment:
cp example.env .env
# Edit .env to set your configuration
cp config/config.example.json config/config.json
# Edit "config/config.json" if you need different operator socket addresses
- Start services:
docker compose up
# Add -d flag to run in background
If you need to run nodes outside of Docker, you can use the following process.
- Configure environment:
cd commonware-avs-node
cp example.env .env
# Edit .env to set your configuration
- Build binaries:
cargo build --release
- Run nodes (one per terminal):
# Node 1
cargo run --release -- --key-file $CONTRIBUTOR_1_KEYFILE --port 3001 --orchestrator orchestrator.json
# Node 2
cargo run --release -- --key-file $CONTRIBUTOR_2_KEYFILE --port 3002 --orchestrator orchestrator.json
# Node 3
cargo run --release -- --key-file $CONTRIBUTOR_3_KEYFILE --port 3003 --orchestrator orchestrator.json
If you need to run a router outside of Docker, you can use the following process.
- Configure environment:
cp example.env .env
# Edit .env to set your configuration
cp config/config.example.json config/config.json
# Edit "config/config.json" if you need different operator socket addresses
- Build binaries:
cargo build --release
- Start router:
# Orchestrator mode
cargo run --release -- --key-file config/orchestrator.json --port 3000
# Or with ingress enabled
cargo run --release -- --ingress
The system consists of:
- Orchestrator: Coordinates the aggregation process
- Creator: Generates payloads and manages rounds
- Executor: Handles onchain execution
- Validator: Validates messages and signatures
- Contributors: Operator nodes that sign messages (implemented in
commonware-avs-node
submodule)
The router supports multiple usecases for different onchain operations:
- Counter Usecase: Simple counter increment with BLS signature aggregation
- More usecases can be added by implementing the
Creator
andExecutor
traits
See individual usecase READMEs for detailed architecture diagrams and implementation details.
Required environment variables:
HTTP_RPC
: HTTP RPC endpointWS_RPC
: WebSocket RPC endpointAVS_DEPLOYMENT_PATH
: Path to deployment JSON fileCONTRIBUTOR_X_KEYFILE
: BLS key files for contributorsPRIVATE_KEY
: Private key for transactions. NOTE: Address must be funded on Holesky testnet
Contract addresses are automatically loaded from the deployment JSON file.
Pull the latest image:
docker pull ghcr.io/breadchaincoop/commonware-avs-router:latest
Run with Docker Compose:
version: '3.8'
services:
orchestrator:
image: ghcr.io/breadchaincoop/commonware-avs-router:latest
volumes:
- ./config:/app/config
- ./keys:/app/keys
environment:
- HTTP_RPC=${HTTP_RPC}
- WS_RPC=${WS_RPC}
- AVS_DEPLOYMENT_PATH=/app/config/avs_deploy.json
- PRIVATE_KEY=${PRIVATE_KEY}
- CONTRIBUTOR_1_KEYFILE=/app/keys/contributor1.bls.key.json
- CONTRIBUTOR_2_KEYFILE=/app/keys/contributor2.bls.key.json
- CONTRIBUTOR_3_KEYFILE=/app/keys/contributor3.bls.key.json
ports:
- "3000:3000"
command: ["--key-file", "/app/config/orchestrator.json", "--port", "3000"]
Enable HTTP endpoints for external task requests:
INGRESS=true cargo run --release -- --key-file config/orchestrator.json --port 3000
Trigger tasks via HTTP:
curl -X POST http://localhost:8080/trigger \
-H "Content-Type: application/json" \
-d '{"body": {"var1": "value1", "var2": "value2", "var3": "value3"}}'
alloy
: Ethereum interactionbn254
: BLS signature operationscommonware_cryptography
: Cryptographic operationscommonware_p2p
: P2P networkingcommonware_runtime
: Runtime utilities
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
Run unit tests:
cargo test --lib
Run end-to-end tests:
chmod +x scripts/router_e2e_local.sh
./scripts/router_e2e_local.sh