Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions specs/methods/evm/draft-evm-charge-00.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ This specification defines four credential types:
- The server naturally sponsors gas (fee payer)
- Split payments are atomic via batch transfers
- No nonce management burden on the client
- `externalId` is cryptographically bound via witness data
- `externalId` is cryptographically bound via the challenge hash

- **`type="authorization"`**: The client signs an
off-chain EIP-3009 {{EIP-3009}} `transferWithAuthorization`
Expand Down Expand Up @@ -450,18 +450,19 @@ in array order.

The Permit2 witness mechanism provides cryptographic
binding between the payment authorization and the
challenge. When `externalId` is present in the challenge
request, the client MUST include it in the EIP-712
witness struct. When `externalId` is absent from the challenge request,
`PaymentWitness.externalId` is the empty string (`""`). The server MUST
challenge. The witness commits to `challengeHash`, which
is derived from `challenge.id` and `challenge.realm`.
Because `challenge.id` is an HMAC over the serialized
challenge request (see {{I-D.httpauth-payment}}), every
request field, including `externalId` when present, is
already bound through `challengeHash`. The server MUST
verify the witness matches before submitting the transaction.

The witness type is defined as:

~~~solidity
struct PaymentWitness {
bytes32 challengeHash;
string externalId;
}
~~~

Expand All @@ -480,7 +481,7 @@ against a different challenge, even if the payment
parameters are identical.

The witness type string for EIP-712 is:
`"PaymentWitness witness)PaymentWitness(bytes32 challengeHash, string externalId)TokenPermissions(address token,uint256 amount)"`
`"PaymentWitness witness)PaymentWitness(bytes32 challengeHash)TokenPermissions(address token,uint256 amount)"`

This specification defines that witness schema directly for
challenge binding. Implementations MUST use the exact type
Expand Down