Documentation Index
Fetch the complete documentation index at: https://docs.getbindu.com/llms.txt
Use this file to discover all available pages before exploring further.
What ships today. Bindu’s payment layer is the x402 protocol — a stablecoin paywall over HTTP 402, originally from Coinbase, formalized as an A2A extension. The W3C Payment Request shapes (
PaymentMandate, IntentMandate, CartMandate, etc.) sometimes referenced in AP2 drafts are not implemented in this codebase. If you find references to them anywhere in Bindu, treat those references as spec sketches rather than runtime types.paymentRequirements payload, the client signs an EIP-3009 transfer-with-authorization, and the server forwards the signed payload to a facilitator that verifies signature + balance + replay. Settlement happens on-chain when the task completes.
Concretely, in Bindu:
- Default network:
base-sepolia(Base Sepolia testnet) - Default token: USDC
- Default facilitator:
https://x402.org/facilitator(Coinbase-hosted) - Default protected method: JSON-RPC
message/send - Extension URI:
https://github.com/google-a2a/a2a-x402/v0.1
X402Settings.
Declaring payment on an agent
Add anexecution_cost block to your agent config. Source: examples/beginner/agno_paywall_example.py:
X402AgentExtension.__init__:
| Field | Required | Notes |
|---|---|---|
amount | yes (if no payment_options) | Either a USD string ("$0.0001") or atomic units as a string ("1000000" = 1 USDC). |
token | no (default "USDC") | Token symbol the facilitator knows about. |
network | no (default "base-sepolia") | Any network the configured facilitator advertises. See extra_networks below for adding custom ones. |
pay_to_address | yes (when payment is required) | EVM address that receives the funds. Required when required=True. |
protected_methods | no | JSON-RPC methods that demand payment. Default ["message/send"] from settings.py:378-381. |
payment_options | no | A list of dicts for multi-network / multi-token offers. The first entry becomes the primary; the full list is published as payment requirements. |
The request/response flow
This is implemented inbindu/server/middleware/x402/x402_middleware.py. The order — claim nonce before facilitator verify — is deliberate: replays cost zero facilitator round-trips, and we never rely on the on-chain contract to reject replays.
Headers
X-A2A-Extensions (activation)
Clients that want x402 to engage echo the extension URI on their request:
X402ActivationHandler.
X-PAYMENT (the signed payload)
The serialized x402 PaymentPayload, base64-encoded:
parse_payment_payload. v1 payloads are explicitly rejected — only v2 (signed EIP-3009) is accepted.
Payment-related task states
x402 introduces task states beyond standard A2A. FromX402Settings:
| State | Meaning |
|---|---|
payment-required | Server returned 402; client must sign and re-send with X-PAYMENT. |
payment-submitted | Client posted an X-PAYMENT header; verification is in flight. |
payment-verified | Facilitator returned is_valid: true; task proceeds to execution. |
payment-completed | Task finished; on-chain settlement receipt recorded. |
payment-failed | Verification or settlement failed; receipt or error in metadata. |
Task.metadata under well-known keys (settings.py:384-388):
bindu/extensions/x402/utils.py build these dicts:
402 response shape (what your client gets)
When payment is missing or invalid, the middleware returns HTTP 402 with a JSON body the x402 SDK can consume. The minimal contract:accepts array contains every PaymentRequirements your agent published — one per entry in payment_options (or one synthesized from the single amount/token/network).
Configuring the facilitator and networks
The Coinbase default (https://x402.org/facilitator) supports Base mainnet and Base Sepolia out of the box. For other EVM networks the SDK doesn’t know about, add an entry to X402Settings.extra_networks:
facilitator_url at one that does (e.g. https://facilitator.x402.fi).
All knobs are environment-driven (X402__FACILITATOR_URL, X402__DEFAULT_NETWORK, …) — see the env_prefix="X402__" on X402Settings.
What’s not in this implementation
So you know where the boundaries are:- No
PaymentRequest/PaymentResponse/PaymentMandate/IntentMandate/CartMandatetypes — those AP2 shapes don’t exist as Python types in this repo. If you’ve seen them in older Bindu docs, they were spec sketches. - No multi-currency fiat support — payments are stablecoin transfers on EVM chains via x402.
- No subscription model — every protected call is a one-shot payment authorization. Long-running tasks bind one payment to one task ID; renewals are not handled by the protocol.
- Settlement currently happens at task completion. There is no partial-credit / metered billing within a single task.