Skip to content

taikoxyz/boundless-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

RISC0 Boundless Agent

A command-line application for generating RISC0 Boundless proofs with support for both batch and aggregation proof types.

Features

  • Batch Proof Generation: Generate proofs for individual blocks
  • Aggregation Proof Generation: Aggregate multiple batch proofs
  • Flexible Input/Output: Support for custom input and output files
  • Configuration: JSON-based configuration support
  • ELF Support: Custom ELF file support (optional)
  • Verbose Logging: Detailed output for debugging

Installation

cargo build --release

Usage

Basic Usage

# Generate a batch proof
./target/release/boundless-agent -i input.bin -o proof.bin -t batch

# Generate an aggregation proof
./target/release/boundless-agent -i input.bin -o proof.bin -t agg

# With verbose output
./target/release/boundless-agent -i input.bin -o proof.bin -t batch -v

Advanced Usage

# With custom configuration
./target/release/boundless-agent -i input.bin -o proof.bin -c config.json -t batch

# Full example with all options
./target/release/boundless-agent \
  -i input.bin \
  -o proof.bin \
  -t agg \
  -c config.json \
  -v

Command Line Options

Option Short Long Description Required
Input file -i --input Path to input file Yes
Output file -o --output Path to output file (proof will be saved here) Yes
Proof type -t --proof-type batch or agg No (default: batch)
Config file -c --config Path to JSON config file No
Verbose -v --verbose Enable verbose output No

Configuration

The application supports JSON-based configuration. See config.example.json for a complete example.

Configuration Structure

{
  "boundless": {
    "rpc_url": "https://ethereum-sepolia-rpc.publicnode.com",
    "deployment": "sepolia",
    "max_price": "0.0005",
    "min_price": "0.0001",
    "timeout": 4000,
    "lock_timeout": 2000,
    "ramp_up": 1000
  },
  "prover": {
    "execution_po2": 18,
    "profile": false
  }
}

Deployment Types

The agent supports two deployment types:

  1. Sepolia (default): Uses the Sepolia testnet deployment
  2. Base: Uses the Base mainnet deployment

The order_stream_url can be used to override the default order stream URL for any deployment type.

For detailed configuration examples, see DEPLOYMENT_CONFIG_EXAMPLES.md.

Environment Variables

  • BOUNDLESS_SIGNER_KEY: Private key for signing transactions (required)
  • SQLITE_DB_PATH: (Optional) Path to SQLite database for persistent request storage (default: ./boundless_requests.db)

Command Line Arguments

  • --deployment-type: Deployment type to use (sepolia or base, default: sepolia)
  • --rpc-url: RPC URL for the deployment (default: https://ethereum-sepolia-rpc.publicnode.com)
  • --order-stream-url: Order stream URL (optional)
  • --offchain: Enable offchain mode (default: false)
  • --pull-interval: Pull interval in seconds (default: 10)
  • --signer-key: Signer private key (optional, can also be set via BOUNDLESS_SIGNER_KEY env var)

Output

The application saves the generated proof data to the specified output file in binary format.

# The proof will be saved to proof.bin
./target/release/boundless-agent -i input.bin -o proof.bin -t batch

Error Handling

The application provides detailed error messages for:

  • File read/write errors
  • Invalid configuration
  • Network errors
  • Proof generation failures

Examples

Generate a Batch Proof

# Simple batch proof
./target/release/boundless-agent -i block_input.bin -o batch_proof.bin -t batch

# With verbose output
./target/release/boundless-agent -i block_input.bin -o batch_proof.bin -t batch -v

Generate an Aggregation Proof

# Simple aggregation proof
./target/release/boundless-agent -i agg_input.bin -o agg_proof.bin -t agg

# With custom configuration
./target/release/boundless-agent -i agg_input.bin -o agg_proof.bin -t agg -c my_config.json

ELF upload workflow

The agent does not ship or store guest ELF binaries on disk. A client (for example, Raiko) must upload the batch and aggregation ELFs to the agent via the /upload-image/{batch|aggregation} endpoint before submitting proofs. The agent uploads them to Boundless Market and keeps them in memory for TTL refreshes. There are no baked-in image IDs or local ELF files in this repo.

Using Different Deployment Types

# Use Sepolia deployment (default)
./target/release/boundless-agent --deployment-type sepolia

# Use Base deployment
./target/release/boundless-agent --deployment-type base

# Use custom order stream URL
./target/release/boundless-agent --deployment-type sepolia --order-stream-url https://custom-order-stream.com

# Use offchain mode
./target/release/boundless-agent --deployment-type base --offchain --order-stream-url https://offchain-order-stream.com

Using Custom SQLite Database Path (Optional)

By default, the database is stored at ./boundless_requests.db in the current working directory. To use a different location:

# Example: Store database in a different directory
SQLITE_DB_PATH="/var/lib/boundless/requests.db" ./target/release/boundless-agent

# Example: Store in user's home directory
SQLITE_DB_PATH="$HOME/.boundless/requests.db" ./target/release/boundless-agent

Development

Building

# Debug build
cargo build

# Release build
cargo build --release

Testing

cargo test

Running Tests with Logging

RUST_LOG=debug cargo test

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published