Skip to content

Add ERC: x402 Payment Receipt Binding for ERC-8004 Agents#1717

Closed
hilarl wants to merge 1 commit into
ethereum:masterfrom
hilarl:tenzro/erc-x402-erc8004-binding
Closed

Add ERC: x402 Payment Receipt Binding for ERC-8004 Agents#1717
hilarl wants to merge 1 commit into
ethereum:masterfrom
hilarl:tenzro/erc-x402-erc8004-binding

Conversation

@hilarl
Copy link
Copy Markdown

@hilarl hilarl commented May 2, 2026

feat(ERCs): add ERC-XXXX x402 payment receipt binding

Summary

Adds a new ERC standardizing the binding between an x402 HTTP 402 Payment Required receipt and an ERC-8004 agent identity entry.
The on-chain interface maps keccak256(JCS(receipt)) → keccak256(utf8(did))
with deterministic selectors and an optional EIP-712 off-chain envelope.

Motivation

x402 is silent on agent identity — receipts prove a payment happened
but bind to ephemeral wallet addresses. ERC-8004 is silent on
payments — agent records carry no notion of "this agent paid for that
resource." Without a standard binding, every implementer wires the two
together with an ad-hoc off-chain database, defeating ERC-8004's goal
of cross-vendor agent portability for use cases like Sybil-resistant
reputation, paid-interaction validation, and audit trails for
autonomous agentic commerce.

This ERC is intentionally minimal and additive: it does not modify
x402, does not modify ERC-8004, and does not constrain the underlying
payment scheme, ledger, or DID method.

What's in the ERC

  • IPaymentReceiptBinding interface — a new sub-registry contract
    with three core methods (bindReceipt, getAgentByReceipt,
    getReceiptsByAgent), one event (ReceiptBound), and selector-
    stability matching ERC-8004's invariant.
  • Canonical hash constructionreceipt_hash = keccak256(JCS(x402_receipt))
    with RFC 8785 JCS canonicalization REQUIRED.
  • Agent identifieragent_id = keccak256(utf8(payer_did)) per
    ERC-8004, DID-method-agnostic.
  • Authorization model — dual: either the payer wallet that signed
    the x402 payment OR the ERC-8004 agentAddress MAY create a binding.
  • Off-chain attestation envelope — optional EIP-712 JSON document
    carrying the verbatim receipt for portable audit; JCS-canonicalized
    and signed by the agent's agentAddress.
  • Six-step verification procedure chaining trust into ERC-8004's
    IdentityRegistry.
  • Storage layout — three mappings sufficient for O(1) lookup in
    both directions, paginated enumeration by agent.

Sections (strict EIP-1 ordering): Abstract, Motivation, Specification,
Rationale, Backwards Compatibility, Reference Implementation, Security
Considerations, Copyright (CC0).

Reference Implementation

Two reference implementations are cited, neither presented as the
canonical or owning implementation:

  1. tenzro/tenzro-network — native multi-VM ERC-8004 implementation
    at precompile addresses 0x101a / 0x101b / 0x101c with
    byte-identical calldata to a Solidity deployment. Source:
    https://github.com/tenzro/tenzro-network/tree/main/crates/tenzro-identity/src/erc8004.rs.
  2. Companion x402 scheme PRdocs(specs): add exact scheme for Tenzro chain (EVM/SVM/Canton façades) coinbase/x402#135
    exact scheme variant emitting receipts in the canonical JSON form
    this ERC hashes.

A canonical Solidity reference will accompany the final draft.

Magicians discussion link

https://ethereum-magicians.org/t/erc-x402-payment-receipt-binding-for-erc-8004-agents/PLACEHOLDER

(Discussion thread will be opened ≥7 days before this PR is opened, per
EIP-1 process. Replace PLACEHOLDER with the assigned thread ID once
the Magicians post is live.)

AI assistance disclosure

Per the project's AI disclosure norms: parts of this ERC text and PR
description were prepared with AI assistance from Claude Code. All
technical decisions — interface shape, hash construction, authorization
model, verification procedure, storage layout — were reviewed and
authored by the human author (Hilal Agil, hilal@tenzro.com). The
reference implementation in tenzro/tenzro-network was developed
independently over preceding months as part of the Tenzro Ledger
codebase.

Checklist

  • Single new file under ERCS/ (ERCS/erc-XXXX.md); ERC editors
    will assign the final number.
  • Frontmatter follows EIP-1: lowercase keys, exact field order
    (eip, title, description, author, discussions-to,
    status, type, category, created, requires); ISO date
    2026-05-02; status Draft; type Standards Track; category
    ERC; requires: 8004.
  • Author entry: Hilal Agil (@hilarl) <hilal@tenzro.com>.
  • Sections in strict EIP-1 order: Abstract, Motivation,
    Specification, Rationale, Backwards Compatibility, Reference
    Implementation, Security Considerations, Copyright.
  • Copyright section is CC0 with the standard waiver line.
  • DCO sign-off on every commit:
    Signed-off-by: Hilal Agil <hilal@tenzro.com>.
  • Conventional Commit subject:
    feat(ERCs): add ERC-XXXX x402 payment receipt binding.
  • No prescriptive references to any specific ledger, VM, or DID
    method in the normative Specification section.
  • All examples use placeholder hex (0x<...>) or generic
    identifiers; no mainnet contract addresses cited as canonical.
  • Magicians thread linked above (will be ≥7 days old at PR open
    time).

Informational ERC defining a one-way binding between an x402 PaymentReceipt (EIP-712 typed) and an ERC-8004 agent identity, via a new IPaymentReceiptBinding sub-registry.

Signed-off-by: Hilal Agil <hilaal@gmail.com>

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Signed-off-by: Hilal Agil <hilaal@gmail.com>
@eip-review-bot
Copy link
Copy Markdown
Collaborator

eip-review-bot commented May 2, 2026

File ERCS/erc-draft_x402_erc8004_binding.md

Requires 1 more reviewers from @g11tech, @jochem-brouwer, @samwilsn, @xinbenlv

@eip-review-bot eip-review-bot changed the title Add ERC: x402 ↔ ERC-8004 Receipt Binding Profile Add ERC: x402 Payment Receipt Binding for ERC-8004 Agents May 2, 2026
@github-actions github-actions Bot added the w-ci label May 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

The commit 3f32470 (as a parent of f264479) contains errors.
Please inspect the Run Summary for details.

@hilarl hilarl closed this May 2, 2026
@hilarl hilarl deleted the tenzro/erc-x402-erc8004-binding branch May 2, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants