Repository navigation
Conversation
… verification Enforce live 402 pre-sign policy guardrails and offline Ed25519 Payment-Receipt verification in TypeScript X402ActionProvider. Refs coinbase#1539, coinbase#1576, coinbase#1582
…ification Add 1:1 Python X402ActionProvider parity for live 402 pre-sign spend policy guardrails and offline Payment-Receipt verification. Refs coinbase#1539, coinbase#1576, coinbase#1582
Sync Python example lockfiles with paxiom-receipts dependency.
Sync Python example lockfiles with paxiom-receipts dependency.
Sync Python example lockfiles with paxiom-receipts dependency.
Sync Python example lockfiles with paxiom-receipts dependency.
Sync Python example lockfiles with paxiom-receipts dependency.
Sync Python example lockfiles with paxiom-receipts dependency.
Sync Python example lockfiles with paxiom-receipts dependency.
Sync Python example lockfiles with paxiom-receipts dependency.
Sync Python example lockfiles with paxiom-receipts dependency.
Sync Python example lockfiles with paxiom-receipts dependency.
Sync Python example lockfiles with paxiom-receipts dependency.
Sync Python example lockfiles with paxiom-receipts dependency.
Sync Python example lockfiles with paxiom-receipts dependency.
🟡 Heimdall Review Status
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds deterministic pre-sign spend policy enforcement and offline cryptographic delivery receipt verification to
X402ActionProvideracross both TypeScript (@coinbase/agentkit) and Python (coinbase-agentkit), using the zero-dependency MIT reference implementation (@paxiom/receipts/paxiom-receiptsv0.3.0).Why
X402ActionProvider:make_http_request_with_x402previously invokedwrapFetchWithPayment/x402_requestswithout validatingmaxPaymentUsdc, USDC-only asset restrictions, or wallet network compatibility against the live402challenge.retry_http_request_with_x402validatedselectedPaymentOptionfrom the prior step, whilewrapFetchWithPayment/x402_requestsfetched a fresh402challenge before signing—allowing dynamic price escalation orpayTobait-and-switch between the initial402and the retry.spendPolicy+ reservation-safeSpendLedger(X402Config):402selectedRequirementsinsideonBeforePaymentCreation/on_before_payment_creationbefore any wallet signature is created (allowedPayTo,pinnedPayToByOrigin,maxPerCallAtomic,maxPerOriginWindowAtomic,maxSessionAtomic,maxUnescrowedExactAtomic,allowedSchemes,trustedOperators, and per-origin failure circuit breakers).Payment-Receipt(paxiom.receipt.v0) &AuthCaptureEscrowverification:Payment-Receipt/X-Paxiom-ReceiptEd25519 signatures and JCS / raw SHA-256 response payload bindings (outputHash) offline, returning structuredCAPTURE/VOIDarbitration and non-repudiablefraudEvidence(enforced fail-closed whenrequireDeliveryReceipt: true).verify_x402_delivery_receiptaction for offline receipt inspection and escrow arbitration without network calls.@paxiom/receiptsandpaxiom-receiptsare MIT-licensed with zero transitive dependencies.Refs #1539, #1576, #1582
Tests
typescript/agentkit):pnpm run format:check,pnpm run lint,pnpm run check(tsc --noEmit), and Jest unit tests (x402ActionProvider.test.ts):onBeforePaymentCreationaborts unauthorizedpayTo/ bait-and-switch challenges before signing.Payment-Receiptheaders returnaction: "CAPTURE"and commit atomic spend toSpendLedger, while tampered response payloads fail closed withaction: "VOID"(receipt_output_hash_mismatch).verify_x402_delivery_receipt.python/coinbase-agentkit):uv run ruff format . --check,uv run ruff check .,uv run check-description-length, anduv run pytest tests/action_providers/x402/test_x402_action_provider.py:spend_policypre-sign aborts,MemorySpendLedgerreservation/commit,CAPTURE/VOIDreceipt verification, andverify_x402_delivery_receipt.Checklist