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
- Git
- Configure environment:
cp example.env .envFor LOCAL mode (default), the example.env is pre-configured. You'll need to set a private key:
# Use Anvil's default test key for local development
echo "PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" >> .env
echo "FUNDED_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" >> .env- Start all services:
docker compose up -dThis will automatically pull the latest pre-built images from the GitHub Container Registry (ghcr.io) and start:
- Ethereum node (Anvil fork)
- EigenLayer contract deployment
- 3 operator nodes
- Router/orchestrator
- Signer service
- Monitor services:
# View logs
docker compose logs -f router
# Check service status
docker compose ps# Stop all services
docker compose down
# Stop and remove volumes (clean state)
docker compose down -vIf you're developing the router and want to test local changes:
# Build the router image locally
docker build -t ghcr.io/breadchaincoop/commonware-avs-router:dev .
# Run with locally built image
docker compose up -dThe 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-nodesubmodule)
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
CreatorandExecutortraits
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
Optional environment variables:
AGGREGATION_FREQUENCY: Signature aggregation frequency in seconds, supports fractional values (default: 30)- Examples:
30(30 seconds),1(1 second),0.1(100ms),0.5(500ms)
- Examples:
THRESHOLD: Minimum signatures required for aggregationINGRESS: Enable HTTP ingress mode (true/false)INGRESS_ADDRESS: Address for ingress server (default: 0.0.0.0:8080)INGRESS_TIMEOUT_MS: Timeout for waiting for ingress tasks in milliseconds (default: 30000)
Contract addresses are automatically loaded from the deployment JSON file.
Pull the latest image:
docker pull ghcr.io/breadchaincoop/commonware-avs-router:latestRun 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}
- AGGREGATION_FREQUENCY=${AGGREGATION_FREQUENCY:-30}
- 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:
- Enable ingress in .env:
INGRESS=true- Restart the router:
docker compose restart router- Trigger tasks via HTTP:
curl -X POST http://localhost:8080/trigger \
-H "Content-Type: application/json" \
-d '{"body": {"metadata": {"request_id": "1", "action": "increment"}}}'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 warningsRun unit tests:
cargo test --libRun end-to-end tests:
chmod +x scripts/router_e2e_local.sh
./scripts/router_e2e_local.shThis repository is dual-licensed under both the Apache 2.0 and MIT licenses. You may choose either license when employing this code.