Repository navigation
Check signed receipts on x402 Doctor and presign-guard answers (0.9.0) - #17
Merged
Merged
Conversation
Both services now sign every paid answer (EIP-191 over canonical JSON, request
inside the signed body). The preflight, diagnose and presign actions verify it
before the agent uses a verdict: signed by the service's pinned signer and
bound to exactly the request sent. A valid answer ends with "Signed by ... ✓";
a changed, unsigned or foreign answer, or one for another request, is not used
("Do not pay on it" / "Do not sign until it can be checked").
- src/receipt.ts: canonical JSON, input hash, verifyReceipt (viem), SIGNERS.
- Services attach the signed route and input to each result.
- Settings: FIZZL_VERIFY_RECEIPTS (require|off), FIZZL_DOCTOR_SIGNERS,
FIZZL_PRESIGN_SIGNERS.
- Tests: fixtures sign like the live services; tampered, unsigned and foreign
answers are refused; the off switch; pinned signers; real production
receipts from both services verify.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
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.
x402 Doctor and presign-guard now sign every paid answer: EIP-191 over canonical JSON, with the request inside the signed body. The actions that decide "pay" or "sign" now check it, so an agent never acts on a verdict that isn't provably from the service, for exactly its request.
What
FIZZL_PREFLIGHT_X402,FIZZL_DIAGNOSE_X402andFIZZL_PRESIGN_CHECKverify the receipt:0xAaE6…277d, presign-guard0xf084…1EaE;input_sha256matches the request that was sent: the query for Doctor, the JSON body for presign-guard.src/receipt.ts: canonical JSON, input hash,verifyReceipt(viem, already a dependency) andSIGNERS.request(route and input) to each result.FIZZL_VERIFY_RECEIPTS(requireby default, oroff),FIZZL_DOCTOR_SIGNERSandFIZZL_PRESIGN_SIGNERS.Tests
npm test: 40/40.After merge
Publish 0.9.0 (the Publish to npm workflow).
🤖 Generated with Claude Code
https://claude.ai/code/session_01TsD5haPKxeWjYmErHzvU48
Generated by Claude Code