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
Table of Contents
- Architecture
- Key Features
- Chain Configuration
- Directory Structure
- Technology Stack
- Quick Start
- Smart Contracts
- Anchor Service
- Integration with stateset-sequencer
- Docker Deployment
- Testing
- Deployment Checklist
- Monitoring
- Security
- Decentralization and Fault Proofs
- Scorecard
- Troubleshooting
- Resources
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)
tokio- Async runtimealloy- Ethereum interactionsaxum- HTTP server for health endpointstracing- Structured loggingserde- Serializationreqwest- HTTP client
Quick Start
Local Development (Anvil)
The fastest way to get started for development and testing: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)
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
Example Usage:
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
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:Docker Deployment
Local Devnet
Sepolia Testnet
With Optional Services
Alternative L1 Clients
Testing
Contract Tests
Anchor Service Tests
Deployment Checklist
Accounts Setup
-
Generate 5 Ethereum accounts:
- Admin (owns contracts)
- Batcher (submits batches to L1)
- Proposer (submits state roots)
- Challenger (dispute resolution)
- Sequencer (L2 block production)
- Fund each account with 0.5+ Sepolia ETH
Infrastructure
- Configure Sepolia RPC endpoint (Infura/Alchemy)
- Set up JWT secret for engine API authentication
- Prepare data directories for persistent storage
Deployment
- Run
deploy-l1.sh- Deploy OP Stack contracts to Sepolia - Run
generate-genesis.sh- Create L2 genesis block - Start L2 nodes (op-geth, op-node)
- Start op-batcher and op-proposer
- Deploy SetRegistry to L2
- Deploy SetPaymaster to L2
- Start anchor service
Verification
- Verify L2 is producing blocks (2s intervals)
- Verify batches are being submitted to L1
- Test anchor service connectivity
- Verify contract deployments with
cast
Monitoring
Seedocs/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.mdcurrent with incident response steps - Governance policy: Maintain
docs/security.mdfor 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
Seedocs/decentralization.md and docs/fault-proofs.md for the phased
decentralization plan and fault-proof operations. Validate production config with:
Scorecard
Seedocs/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:Resources
Documentation
Project Documentation
- Local Testing Guide
- Architecture Overview
- Scorecard
- Toolchain Versions
- Monitoring and SLOs
- Security and Governance
- Node Operator Guide
- Integration Example
- Block Explorer and Indexing
- Bridge and Onramp Support
- Operations History
- SDK
- Audit Report
- Governance Evidence
- Fault Proof Exercise Log
- Decentralization Roadmap
- Fault Proof Operations
- Threat Model
- Operations Runbook
Related Projects
- StateSet Sequencer - Off-chain commerce event processing
- StateSet Network - Parent project documentation
License
MITNext 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.