All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
x402-chain-eip155:AssetTransferMethod::Permit2changed from a unit variant to a struct variantPermit2 { name: String, version: String }. Any code that pattern-matches onAssetTransferMethod::Permit2must be updated to bind or ignore the newnameandversionfields. The wire format now requiresnameandversionfields in Permit2 payment payloads.x402-types:PaymentPayload::extensionsfield type changed fromOption<serde_json::Value>toExtensionsJson(non-optional). Code that accessedextensionsasOption<serde_json::Value>must be updated to use the newExtensionsJsonAPI.x402-types:MoneyAmount::parsenow rejects inputs with embedded non-numeric text (e.g."1abc","USD 10"previously accepted by stripping non-numeric characters are now errors). Currency prefixes$and€and comma separators remain supported.
x402-types: NewExtensionsJsontype — a typed JSON-object map for optional protocol extension data, used inPaymentPayloadandPaymentRequired. Supports typedinsert<T>/get<T>methods keyed byT::EXTENSION_KEY.x402-types: NewExtensionKeytrait — associates a Rust type with its wire-format string key in theextensionsmap.x402-types:PaymentRequirednow carries anextensionsfield (ExtensionsJson) for server-provided protocol extension declarations.x402-chain-eip155: NewEip2612GasSponsoringextension with dedicated client and server types, allowing clients to request EIP-2612 permit-based gas sponsoring from the facilitator.x402-chain-eip155: NewDoRead2612Noncetrait and multiple provider implementations for reading EIP-2612 nonces on-chain.x402-chain-eip155:EIP2612ProviderLikenow supports reading ERC-20 allowances;try_eip2612_gas_sponsoringchecks existing allowance before creating a permit.x402-chain-eip155: Full Rust client support for the EIP-155 "upto" payment scheme (V2Eip155UptoClient), including provider-backed nonce reading and generic provider support.x402-axum: Newwith_extensionmethod onX402MiddlewareandX402LayerBuilderto declare V2 protocol extensions inPaymentRequired.extensions.- New example
x402-reqwest-upto-eip155demonstrating the EIP-155 "upto" payment scheme client.
- Example
x402-reqwest-examplerenamed tox402-reqwest-exactto better reflect the payment scheme it demonstrates.
x402-types:MoneyAmount::parsenow correctly validates format — leading$/€prefixes and comma-separated thousands are accepted; inputs containing embedded alphabetic text are rejected withMoneyAmountParseError::InvalidFormat.
x402-chain-eip155: Internal cleanup — removed unusedEOASignatureExtimport from the EIP-2612 facilitator module.
x402-chain-eip155: ImplementedsettleWithPermitandassert_onchain_upto_permit2_with_eip2612for on-chain EIP-2612 gas-sponsored Permit2 settlement.x402-chain-eip155: AddedEip2612GasSponsoringInfostruct andeip2612_gas_sponsoringsupport inV2Eip155Uptofacilitator configuration.x402-chain-eip155: Addedextensionsfield toUptoSupportedExtrafor communicating facilitator-supported features to clients.x402-chain-eip155: Replacedx402BasePermit2Proxywithx402UptoPermit2ProxyABI and updated internal types accordingly.x402-chain-eip155: ImplementedFrom<StructuredSignature>foralloy::Bytes.
x402-chain-eip155:V2Eip155ExactFacilitatorExtra::extensionsfield changed fromOption<Vec<String>>toVec<String>— callers constructing this struct must update accordingly.
x402-chain-eip155: Random facilitator address selection in thev2_eip155_uptomodule using therandcrate.x402-chain-eip155:UptoSupportedExtrastruct is now generic over thefacilitator_addressfield type for increased flexibility.
x402-chain-eip155: Fixed upto scheme to correctly use the facilitator address from server-provided metadata.
x402-chain-eip155: AddedUptoSupportedExtrastruct for describing server-provided facilitator metadata in the upto scheme.x402-chain-eip155: Enforced facilitator authorization in Permit2 witness validation, hardening the upto scheme against unauthorized settlement.
x402-chain-eip155: Renamed internalHavingEip155SignerAddressestrait toEip155SignerAddressesfor consistency.x402-chain-eip155: Refactored facilitator address handling across upto and exact facilitators to useUptoSupportedExtradeserialization.
x402-axum:SettleResponseis now injected as a request extension after successful settlement, giving handlers access to settlement metadata (e.g. transaction hash, payer address).
x402-axum: Enhanced logging in payment settlement paths for improved observability.
x402-chain-eip155: Added optionalfromfield toMetaTransactionand awith_from()builder method, allowing callers to override the sender address.Eip155MetaTransactionProvider::send_transactionnow usestx.fromwhen set, falling back tonext_signer_address().x402-chain-eip155: Refactored internal transaction construction inv1_eip155_exactandv2_eip155_exactfacilitators to use theMetaTransaction::new()constructor instead of struct-literal syntax, eliminating boilerplate and aligning with the newfromfield default.
x402-chain-eip155: Bumped Alloy dependencies to 2.0.x402-chain-eip155: Bumpedranddependency to 0.10 and updated imports to use the newRngExtmodule across EIP-155 clients.x402-chain-eip155: ChangedREQUIRED_CONTRACT_ADDRESSESfromconsttostaticinprovider.rs.x402-facilitator-local: Bumped OpenTelemetry dependencies to 0.32.x402-chain-solana: Upgradedspl-token-2022to v11.0.0.- Raised minimum supported Rust version to 1.93.0.
- Various transitive dependency version bumps across the workspace.
x402-axum: AddedX402Middleware::from_facilitatorconstructor for building middleware directly from a facilitator URL string.x402-chain-eip155: Added Radius Network and Radius Testnet chain configurations with SBC as the default stablecoin.
- Minor community patch (PR #89).
x402-facilitator-local: Corrected error type reported for unsupported payment schemes fromVerificationtoSettlement.
x402-facilitator-local: ImplementedAsJsonValuetrait forFacilitatorLocalErrorto allow structured error serialization.
x402-facilitator-local: AddedFacilitatorContracttrait to decouple facilitator implementations from specific request/response types, improving extensibility.
x402-chain-eip155: Required contract addresses are now validated during provider initialization, surfacing misconfiguration early at startup.x402-types: AddedDecimalU256type for decimal string serialization, used inPaymentRequirements.
x402-facilitator-local: Renamederror_reason_detailstoerror_messagein scheme handler error responses for clarity.
- Validate
SettleResponse.successbefore serving resources in paygate to prevent serving protected content on failed settlement (PR #74, fixes #65)
- Made
resourcefields optional inpaygate.rs,v2.rs,v2_eip155_exact, andv2_solana_exactto useOption<ResourceInfo>, improving flexibility and consistency.
x402-chain-eip155: Added EIP-2612 gas sponsoring support for Permit2-based payments with newPermit2PaymentPayloadExttrait for unified EIP-2612 gas sponsoring handling.x402-chain-eip155: Added newEOASignaturetype for improved signature handling.docs: Added x402 specification v1 and v2 documentation.
x402-chain-eip155: Consolidated Permit2 settlement logic with shared execution flow, eliminating duplication in signature and EIP-712 handling between exact/upto schemes.x402-chain-eip155: UpdatedX402ExactPermit2Proxy.jsonto current SDK version.
x402-chain-eip155: Enabled thetraceparentfeature onalloy-transport-http, so outgoing EVM RPC calls now propagate W3Ctraceparentheaders for distributed tracing.
facilitator: Refactored telemetry layer initialization —Telemetry::register()now returns the providers handle directly, andhttp_tracing()is called on it in a separate#[cfg(feature = "telemetry")]statement, making the initialization sequence clearer and easier to extend.
x402-types:LiteralOrEnv<T>now stores the original environment variable name alongside the resolved value, soDisplayreconstructs the$VAR_NAMEsyntax instead of rendering the resolved value. This prevents sensitive values from being exposed in logs or serialized output and enables config round-tripping.
x402-types: ImplementedDisplayforLiteralOrEnv<T>, allowing env-var-wrapped config values to be formatted directly.
x402-chain-eip155:RpcConfig::httpfield type changed fromUrltoLiteralOrEnv<Url>, enabling the RPC endpoint URL to be supplied via an environment variable reference in config files.x402-chain-solana:SolanaChainConfigInner::rpcandpubsubfields changed fromUrl/Option<Url>toLiteralOrEnv<Url>/Option<LiteralOrEnv<Url>>, enabling RPC and pubsub endpoint URLs to be supplied via environment variable references in config files.x402-chain-solana:SolanaChainConfig::pubsub()return type changed from&Option<Url>toOption<&Url>for a more idiomatic API.
- Fixed a "value" serde bug that caused incorrect deserialization of payment values.
- BREAKING: Refactored from a single monolithic crate into a modular workspace architecture. The
x402-rscrate is no longer published as a single package. - BREAKING: Import paths have changed from
x402_rs::*tox402_types::*and specific chain crates.
- New
x402-typescrate: Core protocol types, facilitator traits, and utilities. - New
x402-chain-eip155crate: EVM/EIP-155 chain support (Ethereum, Base, Polygon, etc.) with feature flags forclient,server, andfacilitator. - New
x402-chain-solanacrate: Solana blockchain support with feature flags forclient,server, andfacilitator. - New
x402-chain-aptoscrate: Aptos blockchain support with feature flags forclient,server, andfacilitator. - New
x402-facilitator-localcrate: Local facilitator implementation for payment verification and settlement. - New
facilitatorbinary crate: Production-ready facilitator server (not published to crates.io). - New documentation:
docs/build-your-own-facilitator.mdguide. - Workspace-level dependency management in root
Cargo.toml.
Before (v0.12.x):
[dependencies]
x402-rs = { version = "0.12", features = ["eip155", "solana"] }After (v1.0.0):
[dependencies]
x402-types = "1.0"
x402-chain-eip155 = { version = "1.0", features = ["client"] }
x402-chain-solana = { version = "1.0", features = ["client"] }- Added Aptos chain support.
- Previous monolithic crate version before workspace refactor.