Skip to main content
Early preview. This section describes a surface that is not generally available; interfaces here may change without notice. Talk to us before building against it.

Set

Set is an Ethereum Layer-2 (L2) network built on the OP Stack, designed for commerce. It offers faster, cheaper, and cryptographically verifiable transactions by leveraging optimistic rollups with Merkle root anchoring.

Table of Contents

Architecture

Key Features

Chain configuration is consensus-critical: every validator must agree on it exactly. A node started with a different chain id, genesis hash or set of parameters does not run in a degraded mode — it fails to sync at all, which is the intended behaviour and the usual explanation for a node that never leaves catching-up.

Chain Configuration

Directory Structure

Technology Stack

Languages & Frameworks

OP Stack Components

Dependencies

Solidity:
  • OpenZeppelin Contracts (Upgradeable patterns)
  • Forge-std (Testing)
Rust:
  • tokio - Async runtime
  • alloy - Ethereum interactions
  • axum - HTTP server for health endpoints
  • tracing - Structured logging
  • serde - Serialization
  • reqwest - HTTP client

Quick Start

Local Development (Anvil)

The fastest way to get started for development and testing:
Pre-funded Test Accounts:

Full Devnet

For a complete L2 environment with all OP Stack components: Prerequisites:
  • Go 1.21+
  • Rust 1.70+
  • Docker & Docker Compose
  • 2+ ETH on Sepolia (for deployment)
Verify Chain is Running:

Smart Contracts

SetRegistry

The SetRegistry contract stores batch commitments from the stateset-sequencer, enabling on-chain verification of off-chain commerce events. Key Features:
  • Multi-sequencer authorization
  • State chain continuity verification
  • Merkle inclusion proof verification
  • Per-tenant/store isolation
Core Functions: Example Usage:
Interact via CLI:

SetPaymaster

Gas abstraction for sponsored commerce transactions, allowing merchants to pay for user gas fees. Sponsorship Tiers: Supported Operation Types: Features:
  • Per-transaction and daily/monthly spend limits
  • Automatic refund of unused gas
  • Category-based sponsorship
  • Merchant dashboards

Anchor Service

The anchor service (set-anchor) is a Rust service that bridges the stateset-sequencer to the SetRegistry contract on-chain.

Building

Running

Local devnet:
Smoke overrides (optional):

Health Endpoints

The anchor service exposes health and metrics endpoints: Example:

Integration with stateset-sequencer

Set integrates with the stateset-sequencer through a two-phase process:
API Endpoints:

Docker Deployment

Local Devnet

Sepolia Testnet

With Optional Services

Alternative L1 Clients

Testing

Contract Tests

Anchor Service Tests

Deployment Checklist

Accounts Setup

  1. Generate 5 Ethereum accounts:
    • Admin (owns contracts)
    • Batcher (submits batches to L1)
    • Proposer (submits state roots)
    • Challenger (dispute resolution)
    • Sequencer (L2 block production)
  2. Fund each account with 0.5+ Sepolia ETH

Infrastructure

  1. Configure Sepolia RPC endpoint (Infura/Alchemy)
  2. Set up JWT secret for engine API authentication
  3. Prepare data directories for persistent storage

Deployment

  1. Run deploy-l1.sh - Deploy OP Stack contracts to Sepolia
  2. Run generate-genesis.sh - Create L2 genesis block
  3. Start L2 nodes (op-geth, op-node)
  4. Start op-batcher and op-proposer
  5. Deploy SetRegistry to L2
  6. Deploy SetPaymaster to L2
  7. Start anchor service

Verification

  1. Verify L2 is producing blocks (2s intervals)
  2. Verify batches are being submitted to L1
  3. Test anchor service connectivity
  4. Verify contract deployments with cast

Monitoring

See docs/monitoring.md for SLOs, alert suggestions, and metric definitions.

Key Metrics

Viewing Logs

Anchor Service Metrics

Security

Best Practices

  • Multi-sig admin: Use a multisig wallet for admin/owner roles in production
  • Key management: Never commit private keys; use environment variables or secret managers
  • Sequencer authorization: Only authorize trusted sequencer addresses
  • Strict mode: Enable strict mode in production to prevent state gaps
  • Threat model: Review and maintain docs/threat-model.md
  • Operations runbook: Keep docs/runbook.md current with incident response steps
  • Governance policy: Maintain docs/security.md for upgrade and key management

Pre-Production Checklist

  • Smart contract audit completed
  • Penetration testing of anchor service
  • Key rotation procedures documented
  • Incident response plan prepared
  • Monitoring and alerting configured

Decentralization and Fault Proofs

See docs/decentralization.md and docs/fault-proofs.md for the phased decentralization plan and fault-proof operations. Validate production config with:
Verify L1 settlement contracts:

Scorecard

See docs/scorecard.md for the 10/10 rubric and progress tracking. Supporting docs include docs/threat-model.md, docs/security.md, docs/runbook.md, and docs/architecture.md.

Troubleshooting

Common Issues

L2 not producing blocks:
Anchor service not connecting:
Contract deployment failing:
Tests failing:

Resources

Documentation

Project Documentation

License

MIT

Next steps

Set L2

The L2 in overview.

Verification

Proving an event was anchored.

Compliance proofs

Proving a policy held over data you never reveal.

Sequencer architecture

What feeds the chain.
Last modified on August 31, 2026