Skip to content

feat(demo): decision receipts in the explorer, and a market sale as an example - #28

Merged
M0nsxx merged 1 commit into
mainfrom
feat/decision-receipts
Nov 27, 2026
Merged

M0nsxx merged 1 commit into
mainfrom
feat/decision-receipts

Conversation

@Eras256

@Eras256 Eras256 commented Nov 27, 2026

Copy link
Copy Markdown
Member

Two small receipt types the explorer did not show yet.

Decision receipts. The library already writes nirium-decision-v1: what the payer's pre-sign policy decided about an x402 payment, including DENY and WAIT, which sign nothing and leave nothing on the chain. The explorer now recognizes one (pasted, dropped or by CID) and checks it in the browser with verifyDecision: format, hash and payer signature. It shows the decision, the reason, the policy, what it would have paid, to whom, for what and the reference, and says there is no transfer to compare against the chain.

  • avalanche/sdk/examples/decision-selftest.mjs: a local seller charging $0.01 on Avalanche Fuji and a buyer whose policy refuses it twice (DENY: limit $0.005; WAIT: above $0.005 needs a person). Nothing settles; the payer signs a decision receipt for each. Both are in evidence/2026-11-27/, 10/10 checks.
  • Test: both receipts classify as decisions and verify; with the outcome changed they fail.

A market sale as an example: a C-Chain mainnet sale (Qmf2KvRL…) of the x402 market, anchored on Audit Trail today (pinned document = the evidence file, verifier VALID against the chain before anchoring).

The decision receipts get their own example cards once the node can anchor them (Eras256/nirium-core-private#281, then a node deploy); that is a small follow-up with the CIDs.

Checked locally in Edge: the four receipts VALID, an edited amount NO VÁLIDO, the market story VALID, no page errors. tsc and the tests pass.

🤖 Generated with Claude Code

…n example

The explorer recognizes a nirium-decision-v1 receipt (what the payer's pre-sign policy decided,
DENY and WAIT included) and checks it in the browser with verifyDecision: hash and payer
signature, since a refusal has nothing on the chain. It shows the decision, the reason, what it
would have paid, to whom and for what.

New self-test: sdk/examples/decision-selftest.mjs refuses a $0.01 payment on Avalanche Fuji as DENY and as
WAIT, signs nothing on-chain, and writes the two receipts now in evidence/2026-11-27.

New example: a C-Chain mainnet sale (Qmf2KvRL…) of the x402 market, anchored on Audit Trail on 27 Nov.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@M0nsxx M0nsxx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-assisted review (Claude)

Read the diff: the explorer recognizes a nirium-decision-v1 receipt and checks it in the browser with verifyDecision (hash and payer signature), showing the decision, the reason, the would-be amount and the payee. It adds decision-selftest.mjs and its two Fuji receipts (DENY, WAIT, nothing signed on-chain), plus a C-Chain mainnet market-sale story. tsc and 13/13 tests pass; checked in Edge, and an edited amount shows NO VÁLIDO. Approve.

@M0nsxx
M0nsxx merged commit 6976b10 into main Nov 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants