Expand description
Rust implementation of the x402 protocol.
This crate provides the core data structures and logic for working with the x402 protocol, including a reference facilitator implementation for on-chain verification and settlement.
It is designed for reuse across all x402 roles:
- Facilitator: a server that verifies and settles x402 payments (see
facilitatorandfacilitator_local) - Seller: a payment-gated service that consumes shared types from
types - Buyer: a client that constructs and submits x402-compliant payments
Modules:
facilitator— defines thefacilitator::Facilitatortrait used to validate and settle x402 payments.facilitator_local— a concrete implementation offacilitator::Facilitator.network— enumerates supported Ethereum-compatible networks and known token deployments.provider_cache— dynamic initialization and caching of Ethereum JSON-RPC providers.telemetry— OpenTelemetry instrumentation setup for tracing and observability.types— all shared x402 protocol structures and payload formats.
Modules§
- chain
- facilitator
- Core trait defining the verification and settlement interface for x402 facilitators.
- facilitator_
local - Facilitator implementation for x402 payments using on-chain verification and settlement.
- from_
env - handlers
- HTTP endpoints implemented by the x402 facilitator.
- network
- Network definitions and known token deployments.
- provider_
cache - Ethereum provider cache and initialization logic.
- sig_
down - telemetry
- timestamp
- types
- Type definitions for the x402 protocol.