Tenzro Testnet is live —request testnet TNZO

Payment Protocols

Tenzro supports multiple payment protocols for machine-to-machine and human-to-machine transactions. All protocols use HTTP 402 (Payment Required) challenge/credential flows and settle on-chain in TNZO.

Supported Protocols

MPP (Machine Payments Protocol)

Co-authored by Stripe and Tempo. Session-based streaming payments with HTTP 402 challenge/credential/receipt flow. Supports Ed25519 signature verification on credentials and HMAC-SHA256 webhook verification for Stripe integration.

Components: MppChallenge, MppCredential, MppReceipt, MppSession, MppSessionManager, MppPaymentServer, MppClient

x402 (Coinbase)

Coinbase's HTTP 402 payment protocol for stateless one-shot payments. Uses EIP-3009 transferWithAuthorization calldata encoding, EIP-712 typed data, and CAIP-2 chain identifiers. Integrates with Coinbase CDP Facilitator for verify/settle.

Components: X402PaymentRequired, X402PaymentPayload, X402Facilitator, X402PaymentServer, X402Client

Tempo Integration

Direct participation in the Tempo network for stablecoin settlement. Includes EIP-155 Secp256k1 transaction signing, RLP encoding, and raw transaction submission via eth_sendRawTransaction.

Components: TempoConfig, TempoBridgeAdapter, Tip20Token, Tip20Balance, TempoParticipant

Payment Flow

  1. Challenge — Server returns HTTP 402 with payment requirements (protocol, amount, recipient)
  2. Credential — Client creates a payment credential (signed proof of payment authorization)
  3. Verify — Server verifies the credential against the original challenge
  4. Settle — Payment is settled on-chain via the settlement engine
  5. Receipt — Server returns a receipt confirming the payment and granting access

HTTP 402 Middleware

The payment gate middleware is wired into both the JSON-RPC and Web API servers via axum. It intercepts requests to paid endpoints and requires a valid Payment-Credential or Authorization header:

# Request without credentials returns 402
curl -X POST https://rpc.tenzro.network/v1/chat/completions
# Response: 402 Payment Required
# Headers: X-Payment-Protocol: mpp
#          X-Payment-Challenge: ch_abc123...

# Request with MPP credential
curl -X POST https://rpc.tenzro.network/v1/chat/completions \
  -H "Payment-Credential: mpp:cred_xyz789..." \
  -H "Content-Type: application/json" \
  -d '{"model": "gemma3-270m", "messages": [...]}'

Micropayments

For per-token billing during streaming inference, Tenzro uses off-chain micropayment channels managed by the MicropaymentChannelManager in the settlement crate. Channels are opened with a deposit, payments are exchanged off-chain, and the final balance is settled on-chain when the channel closes.

Escrow

The settlement engine supports escrow-based payments where funds are locked until proof of delivery. This is used for AI inference (pay-on-completion) and task marketplace settlements.

CLI Usage

# Create a payment challenge
tenzro payment challenge --protocol mpp --amount 1000000000000000000

# Pay via MPP
tenzro payment pay --protocol mpp --challenge-id ch_123...

# Pay via x402
tenzro payment pay --protocol x402 --challenge-id ch_456...

# List active payment sessions
tenzro payment sessions

# View payment gateway info
tenzro payment info

Identity Binding

Payments are linked to TDIP identities via the IdentityPaymentBinder. Machine identities must have sufficient delegation scope (allowed operations, max transaction value, allowed payment protocols) to make payments. Delegation violations return a typed error so the caller can distinguish authorization failures from payment failures.