add covenant-blockrun: trust receipts for BlockRun x402 calls (crate + daemon + TS/Python SDKs + paid verify) - #116
add covenant-blockrun: trust receipts for BlockRun x402 calls (crate + daemon + TS/Python SDKs + paid verify)#116mizuki0x wants to merge 22 commits into
Conversation
…ipt on paid calls)
…ipt + signs the result
…ceipt + basescan link
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
…_KEY), not just inline hex
…ider-namespaced model as delivered
…gests match rust/ts; pin whole-float cross-language canary
… validate endpoint path, drop non-finite savings
…error sink, python async+stream-safe transport
… boot, rename settled->hasSettlementTx
…nly in demo and sdk readmes
…unpaid requests; document the flag
|
Nice — the "missing delivery/provenance record" is exactly the gap we filled with |
What
A trust overlay for BlockRun's x402 API. BlockRun settles an agent's paid calls over x402 and proves the money moved; it does not bind that payment to what was requested, which model actually served the request, or what came back. This adds a Covenant receipt for every call, the missing delivery and provenance record, without ever touching BlockRun's payment flow.
The receipt binds one x402 exchange into one hash-addressable record: endpoint, requested model, the model actually served, input/output hashes, the routing claim (turning "cheapest capable model" from an unfalsifiable assertion into a checkable
delivered/substituted/unverifiedverdict), and the settlement.Pieces
agent-os/crates/covenant-blockrun: the crate. 402 challenge parsing (BlockRun's realaccepts[]shape), x402 round-trip capture viacovenant_x402::Signer(never holds a key), theCallReceiptschema, and the verdict/routing logic. Guards a per-call spend cap and a bounded response read.covenantdwiring:blockrun.callandblockrun.verifyMCP tools, off by default behindCOVENANT_BLOCKRUN_ENABLED. On a paid call the daemon records aSettlementReceiptcarrying BlockRun's on-chain tx plus anExternalPaymentSettledaudit row, so the receipt reaches Solana through the existing settlement-batch machinery, alongside and never inside the payment.packages/blockrun-ts(@covenant-org/blockrun): awithCovenantReceipts(fetch)wrapper. Drop it under any BlockRun or OpenAI-compatible client, get a receipt per call.packages/blockrun-py(covenant-blockrun): the same as an httpxReceiptTransport, matching where BlockRun's Python SDK signs payments. Tees the response stream so it never consumes the caller's body.services/blockrun-verify: an x402-paid endpoint. Pay USDC to have Covenant verify a receipt and get a signed result back. Covenant dogfooding x402.Cross-language integrity
The receipt digest is RFC 8785 (JCS) SHA-256, byte-identical across Rust, TypeScript, and Python, so a receipt built by any SDK verifies in the daemon and the others. Two shared canary vectors (
cff938c0…and a whole-number-float case8328699d…) pin it with a test in all four places, including the ECMAScript number formatting and UTF-16 key sort where JCS implementations usually diverge.Proven on mainnet
Two real paid calls settled on Base mainnet (
0xb3faef41…and0x0cde5444…), receipt verified each time.Boundaries
Never touches payments. No new token, USDC and attestation only. Reuses existing crates (x402, settlement, audit). Off by default.
🤖 Generated with Claude Code