The Credit Sequencer is the authoritative service for multi-chain credit authorization in Shielded x402. It enforces per-agent nonce and balance invariants in real-time, issues signed authorization payloads, and processes relayer execution reports.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nhestrompia/shielded-x402/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The sequencer is responsible for:- Credit Authorization - Enforce per-agent nonce/balance invariants in real time
- Signature Issuance - Issue signed
AuthorizationV1payloads for relayer execution - Execution Processing - Process relayer execution reports with idempotency checks
- Reclaim Management - Handle reclaim transitions for expired issued authorizations
- Commitment Building - Build periodic commitment epochs and optional Base postings
Installation
From the monorepo root:Required Configuration
The following environment variables are required to run the sequencer:PostgreSQL connection string for the sequencer database.Example:
postgresql://user:password@localhost:5432/sequencerEd25519 private key for signing authorizations. Accepts either 32-byte seed or 64-byte secret key as hex.Example:
0x1234567890abcdef... (64 hex characters for seed, 128 for full key)Recommended Configuration
Logical identifier for the signing key used in authorization payloads.
32-byte hex secret used for salting commitment tree leaves.Example:
0xabcdef1234567890... (64 hex characters)Comma-separated list of supported chain references in CAIP-2 format.Example:
eip155:84532,solana:devnetDuration of each commitment epoch in seconds (default: 1 hour).
Grace period for execution reports after authorization expiry (default: 5 minutes).
Interval for the background sweeper process to reclaim expired authorizations.
Bearer token required for administrative endpoints (e.g.,
/v1/admin/credit).JSON map of relayer public keys for signature verification, organized by chain reference.Example:
Base Commitment Posting
Optionally post commitment roots to Base for on-chain audit trails:Address of the
CommitmentRegistryV1 contract on Base (see contracts/src/CommitmentRegistryV1.sol).Private key for the account that will submit commitment transactions to Base.
RPC endpoint for Base network.Example:
https://sepolia.base.org (Base Sepolia testnet)API Endpoints
The sequencer exposes the following HTTP endpoints:Health & Monitoring
GET /health- Basic health checkGET /health/ready- Readiness probe (checks database connectivity)GET /metrics- Prometheus-compatible metrics
Credit Operations
POST /v1/admin/credit- Admin endpoint to allocate credit to an agentPOST /v1/credit/authorize- Request a signed authorization for spendingPOST /v1/credit/executions- Report execution by relayer (called by relayer)POST /v1/credit/reclaim- Reclaim expired or unused authorization
Commitments
GET /v1/commitments/latest- Retrieve the latest commitment epochGET /v1/commitments/proof?authId=...- Get Merkle proof for an authorizationPOST /v1/commitments/run- Manually trigger commitment epoch build
Configuration Example
.env
Testing
To run integration tests with PostgreSQL:Integration tests are skipped if
SEQUENCER_TEST_DATABASE_URL is not set.Architecture Notes
- Execution Correctness - Enforced at authorization/report time by sequencer state transitions
- Commitment Roots - Base commitment roots are audit checkpoints and do not gate relayer execution in MVP
- Idempotency - All execution reports are processed with idempotency checks to prevent double-spending
- Nonce Management - Per-agent nonces ensure ordered, sequential authorization consumption
Next Steps
Payment Relayer
Configure relayers to execute authorized payments
Smart Contracts
Learn about the on-chain contracts