x402-exec is a programmable settlement framework for x402 protocol, combining payment verification, Hook-based business logic, and facilitator incentives in atomic transactions.
x402-exec is an early-stage TypeScript project in the AI payments / x402 ecosystem, focused on basechain, solidity, x402. It currently has 13 GitHub stars and 7 forks, and sits alongside related tools like chaingpt-claude-skill, agoramesh, helixa.
English | 简体中文
x402x (short for x402-exec) is a programmable settlement framework for x402 protocol, combining payment verification, Hook-based business logic, and facilitator incentives in atomic transactions.
Programmable Settlement with Real Atomicity - Not just payment routing, but a complete settlement execution framework that combines payment verification, business logic execution, and facilitator incentives in a single atomic transaction.
🔌 Infinite Extensibility through Hooks
💰 Native Facilitator Fee Support
⚡ Minimal Integration Overhead
🔄 Native Idempotency & Observability
✅ Revenue Splitting - Automatic multi-party payment distribution
✅ NFT Commerce - Atomic mint-on-payment with revenue split
✅ Loyalty Programs - Real-time reward points distribution
Multi-Layer Protection
Client (EIP-3009 Signature)
↓
Facilitator
↓
SettlementRouter ──→ Hook ──→ Recipients
│ (Split/Fulfill)
└→ Events (Observability)
SettlementRouter: Core settlement contract
TransferHook (Built-in): Default transfer Hook
ISettlementHook: Hook interface
x402-exec/
├── contracts/ # Solidity smart contracts
│ ├── src/
│ │ ├── SettlementRouter.sol # Core settlement contract
│ │ └── interfaces/ # Contract interfaces
│ ├── examples/ # Hook examples
│ ├── script/ # Deployment scripts
│ ├── test/ # Contract tests
│ └── docs/ # Contract documentation
├── facilitator/ # Production-ready facilitator service
├── examples/
│ └── showcase/ # Full-stack demo application
└── docs/ # Project documentation
Install the official x402 SDK and the x402x extensions:
For Server (Resource Server):
npm install @x402/hono @x402/evm @x402x/extensions
# or pnpm
pnpm add @x402/hono @x402/evm @x402x/extensions
For Client (Browser/Node):
npm install @x402/client @x402x/extensions
# or pnpm
pnpm add @x402/client @x402x/extensions
💡 Migration Note: Previous versions required a patched version of
x402. This is no longer needed with x402 v2. We now use standard official packages extended via@x402x/extensions.
# Install Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup
# Clone project
git clone https://github.com/nuwa-protocol/x402-exec.git
cd x402-exec
cd contracts
forge build
forge test
cd contracts
./deploy-contract.sh [NETWORK] [OPTIONS] # Configure .env first
# Examples:
./deploy-contract.sh eip155:84532 --all --verify # Deploy everything on testnet (Base Sepolia)
./deploy-contract.sh eip155:8453 --settlement --verify # Deploy SettlementRouter on mainnet (Base)
./deploy-contract.sh eip155:196 --hooks --verify # Deploy built-in hooks (X-Layer)
The facilitator is a production-ready service that automatically supports both:
See the Facilitator README for installation, deployment, and configuration guide, or the Facilitator Developer Guide for extending your own facilitator.
Check out the full-stack showcase application:
examples/showcase/Protocol-level Hooks deployed once per network for universal use:
Educational templates and reference implementations in contracts/examples/:
| Network | SettlementRouter | Status |
|---|---|---|
| Base Sepolia (Testnet) | 0x817e4f0ee2fbdaac426f1178e149f7dc98873ecb |
✅ Active |
| X-Layer Testnet | 0xba9980fb08771e2fd10c17450f52d39bcb9ed576 |
✅ Active |
| SKALE Base Sepolia | 0x1Ae0E196dC18355aF3a19985faf67354213F833D |
✅ Active |
| BSC Testnet | 0x1Ae0E196dC18355aF3a19985faf67354213F833D |
✅ Active |
| Base Mainnet | 0x73fc659Cd5494E69852bE8D9D23FE05Aab14b29B |
🎉 Live |
| X-Layer Mainnet | 0x73fc659Cd5494E69852bE8D9D23FE05Aab14b29B |
🎉 Live |
| BSC Mainnet | 0x1Ae0E196dC18355aF3a19985faf67354213F833D |
🎉 Live |
| Ethereum Mainnet | - | 🚧 Planned |
| Network | TransferHook | Status |
|---|---|---|
| Base Sepolia (Testnet) | 0x4DE234059C6CcC94B8fE1eb1BD24804794083569 |
✅ Active |
| X-Layer Testnet | 0xD4b98dd614c1Ea472fC4547a5d2B93f3D3637BEE |
✅ Active |
| SKALE Base Sepolia | 0x2f05fe5674aE756E25C26855258B4877E9e021Fd |
✅ Active |
| BSC Testnet | 0x2f05fe5674aE756E25C26855258B4877E9e021Fd |
✅ Active |
| Base Mainnet | 0x081258287F692D61575387ee2a4075f34dd7Aef7 |
🎉 Live |
| X-Layer Mainnet | 0x081258287F692D61575387ee2a4075f34dd7Aef7 |
🎉 Live |
| BSC Mainnet | 0x2f05fe5674aE756E25C26855258B4877E9e021Fd |
🎉 Live |
| Ethereum Mainnet | - | 🚧 Planned |
Example deployments for testing and reference:
Showcase Demo: https://demo.x402x.dev/
Interactive demo with 3 payment scenarios (referral split, NFT mint, loyalty rewards)
Example Facilitator: https://facilitator.x402x.dev
Reference facilitator implementation (see Facilitator Guide)
💡 Note: These are example deployments. For production use, deploy your own facilitator using the Facilitator package and configure it according to your needs.
Contributions are welcome! Please check the Contributing Guide.
For AI Agents: Before making any code changes, you MUST read the Development Workflow Rules which define mandatory Git workflow practices.
Apache-2.0 License - see LICENSE for details
154 Web3 MCP tools for Claude Code, custody-free. Plus an agent wallet prompt injection can't drain: per-tx, daily, and on-chain (ERC-4337) spending caps the model can't bypass. EVM + Solana + Tron DEX/DeFi, perps, prediction markets, contract deploy + audit.
"Machines must run." — Open-source protocol & trust layer for AI agent commerce. Discover, verify, transact — no middlemen.
Original Helixa / AgentDNA / Cred implementation and reference materials. New Multipass development: github.com/Bendr-20/multipass.