feat(action-providers): add ActionRefVerify provider — recomputable, third-party-checkable reference for any declared action - #1459
Open
giskard09 wants to merge 1 commit into
Conversation
Read-only, no wallet, no transactions. Derives action_ref (action-ref-v1: SHA-256 of RFC 8785 JCS over agent_id/action_type/scope/timestamp) for a declared action, and independently checks the public chain for a matching Anchored event against the permissionless AnchorRegistry contract. Modeled on X402ActionProvider.retryWithX402's real request/response shape. Full worked example (incl. a real on-chain anchor) at github.com/giskard09/coinbase-x402-action-ref-anchor. Tests: 6/6 passing. Lint, prettier, tsc --noEmit all clean.
🟡 Heimdall Review Status
|
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.
What this adds
A new, read-only action provider,
ActionRefVerifyActionProvider— no wallet required, no transactions. Two actions:compute_action_ref— derivesaction_ref, a deterministic content-addressed identifier (SHA-256 of RFC 8785 JCS canonicalization,action-ref-v1spec) for a declared{agent_id, action_type, scope, timestamp}.verify_action_ref_anchor— queries a public chain's RPC directly (Base, Arbitrum One, or Ink — sameAnchorRegistryCREATE2 address on all three) for anAnchored(bytes32,address,uint256)event matching a givenaction_ref. Trusts nothing off-chain.Why
X402ActionProvider.retryWithX402dispatches a real x402 payment and, on success, reports{status: "success", details: {paymentUsed, paymentProof}}—paymentProofdecoded straight from thepayment-response/x-payment-responseheader the facilitator sent back. That's the provider's own account of settlement. This provider does not close that boundary — it answers an adjacent, narrower question: given a declared request and result, can any third party — not just the facilitator — recompute a content-addressed identifier for that exact pair and confirm an independent, operator-external anchor timestamp, regardless of whether the underlying payment was accurately reported?The same construction applies to any other action provider's declared input/output, not just x402 — this provider is intentionally generic, not specific to any single provider or protocol.
What it does NOT do
Worked example
A full, independently-reproducible instance (derivation + a real on-chain anchor on Base mainnet, modeled on
X402ActionProvider.retryWithX402) is published atgiskard09/coinbase-x402-action-ref-anchor. It is explicitly a synthetic worked example — see that repo'sPROVENANCE.md— no real wallet, no real x402 payment. Read it before using this provider against a real action.Testing
6/6 tests passing (
actionRefVerifyActionProvider.test.ts), including a byte-exact check against the published worked example'saction_ref.pnpm lint,pnpm format:check, andtsc --noEmitall clean.