Skip to content

Conversation

@danfinlay
Copy link

Description

Adds a new payment scheme utilizing ERC-7710 account permissions. Allows payment in any token from accounts that expose this simple and flexible interface. Also allows payments to be made by permitted agents, including AI agents.

Tests

Just a specification for now, but tests can be added in the implementation phase.

Checklist

  • I have formatted and linted my code
  • All new and existing tests pass
  • My commits are signed (required for merge) -- you may need to rebase if you initially pushed unsigned commits

@cb-heimdall
Copy link

cb-heimdall commented Dec 8, 2025

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@vercel
Copy link

vercel bot commented Dec 8, 2025

@danfinlay is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@danfinlay
Copy link
Author

What’s “from codeflow.yml” mean as a Heimdall requirement?

IMG_1992

@phdargen
Copy link
Contributor

phdargen commented Dec 15, 2025

Hi @danfinlay, thanks for putting this proposal together! Could you please update this to v2 (https://docs.cdp.coinbase.com/x402/migration-guide)?

As an initial comment, I think this needs a better separation between the schema defining a logical way of moving money (eg exact or upto) and the mechanism via which this is implemented. Imo, ERC-7710 is not a schema but an alternative mechanism.

Please have a look at a recent similar PR (#769) suggesting Permit2 as an additional settlement mechanism for the exact scheme.

@danfinlay
Copy link
Author

I just updated per x402v2 per your private message, but now I see you also suggest the proposal be in the form of an extension to the exact scheme.

If this is the preferred format for alternate authorization formats, I would probably recommend updating the exact scheme to not so heavily declare its dependence on ERC-3009. The scheme's evm definition reads like an ERC-3009 payment format, not as a general purpose envelope for expressing multiple payment schemes. If it is merely an envelope, maybe ERC-3009 support should itself be an extension of the exact scheme.

If you insist on this format, I'll oblige, but the current organization makes it very easy for potential contributors to choose this same approach.

@danfinlay danfinlay mentioned this pull request Dec 16, 2025
3 tasks
@danfinlay
Copy link
Author

Opened an alternate PR that formats this proposal as an extension to the exact scheme: #807

@phdargen
Copy link
Contributor

Thanks a lot for the prompt update @danfinlay!

Agreed that the exact evm scheme needs to be refined to remove the ERC-3009 bias, this is started in #769, see https://github.com/coinbase/x402/blob/1f1dc9f1651244513929dc1237a679f00ffa3dbd/specs/schemes/exact/scheme_exact_evm.md.

V2 just launched and with that we are beginning to explore additional schemes and mechanisms, any feedback is much appreciated 🙏

Looping in @fabrice-cheng (author of #769) for further guidance and review

@danfinlay
Copy link
Author

danfinlay commented Jan 6, 2026

Nice to meet you, @fabrice-cheng! Happy new year! Let's make x402 even better!

@phdargen
Copy link
Contributor

phdargen commented Jan 7, 2026

Hi @danfinlay, thanks for considering my comment in #807.

However, I believe there was a misunderstanding. I did not recommend to implement ERC-7710 as an extension to the exact scheme but as an additional mechanism for the exact scheme similar to the Permit2 mechanism in #769.

#769 introduces Permit2 as a new AssetTransferMethod besides EIP-3009 which is specified in the payload:

{
  "x402Version": 2,
  "accepted": {
    "scheme": "exact",
    "network": "eip155:84532",
    "amount": "10000",
    "payTo": "0x209693Bc6afc0C5328bA36FaF03C514EF312287C",
    "maxTimeoutSeconds": 60,
    "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
    "extra": {
      "assetTransferMethod": "permit2",
      "name": "USDC",
      "version": "2"
    }
  }
  "payload": {
    "signature": "0x2d6a7588d6acca505cbf0d9a4a227e0c52c6c34008c8e8986a1283259764173608a2ce6496642e377d6da8dbbf5836e9bd15092f9ecab05ded3d6293af148b571c",
    "permit2Authorization": {
      "permitted": {
        "token": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
        "amount": "10000"
      },
      "from": "0x857b06519E91e3A54538791bDbb0E22373e36b66",
      "spender": "0xx402Permit2ProxyAddress",
      "nonce": "0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f13480",
      "deadline": "1740672154",
      "witness": {
        "to": "0x209693Bc6afc0C5328bA36FaF03C514EF312287C",
        "validAfter": "1740672089",
        "extra": {}
      }
    }
  },
}

#769 then also introduces 2 extensions, erc20ApprovalGasSponsoring and eip2612GasSponsoring but these are optional for the Permit2 mechanism to sponsor the approval transaction on the user's behalf.

My recommendation for your proposal would be to closely follow #769 and modify scheme_exact_evm.md with ERC-7710 as new AssetTransferMethod, see https://github.com/coinbase/x402/blob/4698b6f88e09ccdb6695fa69660baf1f121e8964/specs/schemes/exact/scheme_exact_evm.md

I am thus closing #807, please refrain from opening new PRs so we can consolidate the discussion around this proposal in a single place


```http
HTTP/1.1 402 Payment Required
X-PAYMENT-REQUIRED: <base64-encoded-json>
Copy link
Contributor

Choose a reason for hiding this comment

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


Note over Client: 3. Client creates delegation<br/>via signer (EOA, smart wallet, etc.)

Client->>Server: 4. GET /resource + X-PAYMENT<br/>(7710 payload)
Copy link
Contributor

Choose a reason for hiding this comment

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

X-PAYMENT -> PAYMENT-SIGNATURE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants