diff --git a/specs/schemes/exact/scheme_exact_evm.md b/specs/schemes/exact/scheme_exact_evm.md index 4393d92357..d7fd348d91 100644 --- a/specs/schemes/exact/scheme_exact_evm.md +++ b/specs/schemes/exact/scheme_exact_evm.md @@ -12,7 +12,7 @@ This is implemented via one of three asset transfer methods, depending on the to | **2. Permit2** | Tokens without EIP-3009. Uses a Proxy + Permit2. | **Universal Fallback** (Works for any ERC-20). | One-time use | | **3. ERC-7710** | Smart accounts with delegation support. | **Smart Account Option** (Paid from ERC-7710 compatible account). | One-time use and multi-use | -If no `assetTransferMethod` is specified in the payload, the implementation should prioritize `eip3009` (if compatible) and then `permit2`. +If no `assetTransferMethod` is specified in `PaymentRequired.extra`, clients should treat it as `"eip3009"` for backwards compatibility. Payment payloads that use a non-default transfer method should echo the selected `assetTransferMethod` in `accepted.extra`. In all cases, the Facilitator cannot modify the amount or destination. They serve only as the transaction broadcaster. @@ -68,7 +68,7 @@ The `payload` field must contain: **`extra` field definitions specific to `eip3009`:** -- `extra.assetTransferMethod` (required): MUST be `"eip3009"`. +- `extra.assetTransferMethod` (optional in `PaymentRequired`, default `"eip3009"`): if present, MUST be `"eip3009"`. - `extra.name` (required): The EIP-712 domain name of the token contract. Used for `transferWithAuthorization` signature construction. - `extra.version` (required): The EIP-712 domain version of the token contract. Used for `transferWithAuthorization` signature construction. diff --git a/specs/transports-v2/http.md b/specs/transports-v2/http.md index a735f80032..bbe8a268e7 100644 --- a/specs/transports-v2/http.md +++ b/specs/transports-v2/http.md @@ -49,6 +49,11 @@ The base64 header decodes to: } ``` +For the EVM `exact` scheme, omitting `extra.assetTransferMethod` in +`PaymentRequired` indicates the default `"eip3009"` method. Servers should set +`extra.assetTransferMethod` when advertising a non-default method such as +`"permit2"` or `"erc7710"`. + ## Payment Payload Transmission Clients send payment data using the `PAYMENT-SIGNATURE` HTTP header. diff --git a/typescript/.changeset/quiet-cycles-serve.md b/typescript/.changeset/quiet-cycles-serve.md new file mode 100644 index 0000000000..e6b26382fd --- /dev/null +++ b/typescript/.changeset/quiet-cycles-serve.md @@ -0,0 +1,5 @@ +--- +"@x402/evm": patch +--- + +Clarify exact EVM channel asset semantics and align voucher asset selection with the transfer method. diff --git a/typescript/packages/mechanisms/evm/src/batch-settlement/client/voucher.ts b/typescript/packages/mechanisms/evm/src/batch-settlement/client/voucher.ts index 9fb49e09d4..9e3bf08515 100644 --- a/typescript/packages/mechanisms/evm/src/batch-settlement/client/voucher.ts +++ b/typescript/packages/mechanisms/evm/src/batch-settlement/client/voucher.ts @@ -12,7 +12,9 @@ import { getBatchSettlementEip712Domain } from "../utils"; * under the batched domain. * * @param signer - Client wallet used to produce the EIP-712 signature. - * @param channelId - Identifier of the payment channel (`keccak256(abi.encode(ChannelConfig))`). + * @param channelId - Identifier of the payment channel. This is the EIP-712 + * hash of the `ChannelConfig` typed data for the batch settlement domain; see + * `computeChannelId`. * @param maxClaimableAmount - Cumulative ceiling the receiver may claim (decimal string in token units). * @param network - CAIP-2 network identifier (e.g. `eip155:84532`). * @returns Signed voucher fields ready to be included in a payment payload.