Switch to CDP facilitator with CAIP-2 network format

- Update default facilitator URL to Coinbase CDP
- Change network format from 'base' to CAIP-2 'eip155:8453'
- Add documentation for CDP credential requirements
- Fix network variable scope issue in x402.js

This enables auto-registration in the x402 Bazaar discovery layer
when the first payment is processed through the CDP facilitator.
This commit is contained in:
Ben Troutner
2026-03-23 10:09:13 -07:00
parent d213a67c42
commit b613b06b60
4 changed files with 66 additions and 8 deletions
+14 -4
View File
@@ -25,14 +25,24 @@ export PORT=5942
export X402_ENABLED=true
export SERVER_BASE_ADDRESS=0xd32585CE60815654C50CAf350e18de8096061e63
export X402_PRICE_USDC=0.1
export x402_NETWORK=base
export x402_FACILITATOR_URL=http://localhost:4022
# Network configuration (CAIP-2 format required by CDP)
# Use 'eip155:8453' for Base mainnet
# Use 'eip155:84532' for Base Sepolia (testnet)
export x402_NETWORK=eip155:8453
# Facilitator URL
# For Coinbase CDP (recommended): https://api.cdp.coinbase.com/platform/v2/x402
# For custom/local facilitator: http://localhost:4022
export x402_FACILITATOR_URL=https://api.cdp.coinbase.com/platform/v2/x402
# CDP API Credentials (required when using CDP facilitator)
# Get these from https://cdp.coinbase.com - API Keys section
export FACILITATOR_KEY_ID=your_key_id_here
export FACILITATOR_SECRET_KEY=your_secret_key_here
# Basic Authentication required to access this API?
export USE_BASIC_AUTH=true
export BASIC_AUTH_TOKEN=some-random-token
# END ACCESS CONTROL
npm start