You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specs/schemes/deferred/scheme_deferred_evm.md
+16-17Lines changed: 16 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,8 @@
3
3
## Summary
4
4
5
5
The `deferred` scheme on EVM chains uses `EIP-712` signed vouchers to represent payment commitments from a buyer to a seller. Before issuing vouchers, the buyer deposits funds—denominated in a specific `ERC-20` token—into an on-chain escrow earmarked for the seller. Each voucher authorizes a payment against that escrow balance, and explicitly specifies the asset being used.
6
-
Sellers can collect and aggregate these signed messages over time, choosing when to redeem them on-chain and settling the total amount in a single transaction.
6
+
Sellers can collect and aggregate these signed messages over time, choosing when to redeem them on-chain and settling the total amount in a single transaction. The funds in the escrow contract are subject to a thawing period when withdrawing, this gives sellers guarantee they will be able to redeem in time.
7
+
Interactions with the escrow contract for the buyer (depositing, thawing and withdrawing funds) are all performed via signed authorizations to remove the need for gas and blockchain access. These authorizations are executed and translated into on-chain actions by the facilitator.
7
8
This design enables efficient, asset-flexible micropayments without incurring prohibitive gas costs for every interaction.
8
9
9
10
## `X-Payment` header payload
@@ -25,7 +26,6 @@ The `payload` field of the `X-PAYMENT` header must contain the following fields:
25
26
-`nonce`: Incremented with each aggregation (uint256)
26
27
-`escrow`: Address of the escrow contract (address)
27
28
-`chainId`: Network chain ID (uint256)
28
-
-`expiry`: Expiration timestamp after which voucher cannot be collected (uint64)
The `depositAuthorization` object enables gasless escrow deposits by allowing the facilitator to execute deposits on behalf of the buyer. This is particularly useful for first-time buyers or when escrow balance needs to be topped up. The structure consists of two parts:
75
+
The `depositAuthorization` object enables gasless escrow deposits by allowing the facilitator to execute deposits on behalf of the buyer. This is particularly useful for first-time buyers or when escrow balance needs to be topped up. Note that only assets implementing ERC-2612 permit extension are supported for gasless deposits.
76
+
77
+
The structure consists of two parts:
78
78
79
79
**Required:**
80
80
-`depositAuthorization`: EIP-712 signed authorization for the escrow contract
@@ -87,7 +87,7 @@ The `depositAuthorization` object enables gasless escrow deposits by allowing th
87
87
-`signature`: EIP-712 signature of the deposit authorization (bytes)
88
88
89
89
**Optional:**
90
-
-`permit`: EIP-2612 permit for the ERC-20 token (if token supports permits)
90
+
-`permit`: EIP-2612 permit for the ERC-20 token
91
91
-`owner`: Token owner address (address)
92
92
-`spender`: Escrow contract address (address)
93
93
-`value`: Token amount to approve (uint256)
@@ -116,8 +116,7 @@ Example `X-PAYMENT` header with deposit authorization:
@@ -233,10 +235,7 @@ The following steps are required to verify a deferred payment:
233
235
5.**Escrow balance check**:
234
236
- Verify the `buyer` has enough of the `asset` (ERC20 token) in the escrow to cover the valueAggregate in the `payload.voucher`
235
237
- Verify `id` has not been already collected in the escrow, or if it has, that the new balance is greater than what was already paid (in which case the difference will be paid)
236
-
6.**Expiry validation**:
237
-
- Verify the voucher has not expired by checking that the current timestamp is less than or equal to `expiry`
238
-
- Verify `paymentPayload.voucher.expiry` and `paymentPayload.voucher.timestamp` dates make sense
Copy file name to clipboardExpand all lines: specs/schemes/deferred/scheme_deferred_evm_escrow_contract.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ The contract manages deposits, withdrawals, and voucher redemption:
15
15
-**Vouchers**: Off-chain signed promises to pay that aggregate over time
16
16
-**Collection**: Sellers redeem vouchers against escrow balances
17
17
-**Withdrawal**: Buyers can withdraw unused funds after a thawing period
18
-
-**Authorization**: EIP-712 signed operations for gasless interactions (designed for x402 Facilitators to be able to abstract escrow management actions from buyers)
18
+
-**Authorizations**: EIP-712 signed operations for gasless interactions (designed for x402 Facilitators to be able to abstract escrow management actions from buyers)
19
19
20
20
## Data Structures
21
21
@@ -42,7 +42,6 @@ struct Voucher {
42
42
uint256 nonce; // Incremented with each aggregation
Copy file name to clipboardExpand all lines: specs/schemes/deferred/scheme_deferred_evm_voucher_store.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Summary
4
4
5
-
The Voucher Store is a critical component of the X402`deferred` payment scheme that manages the persistence and retrieval of signed payment vouchers and their settlement records. It serves as the data layer for sellers and facilitators to track off-chain payment obligations and their eventual on-chain settlements.
5
+
The Voucher Store is a critical component of the x402`deferred` payment scheme that manages the persistence and retrieval of signed payment vouchers and their settlement records. It serves as the data layer for sellers and facilitators to track off-chain payment obligations and their eventual on-chain settlements.
6
6
7
7
This specification defines the interface and requirements for implementing a voucher store in the deferred EVM payment system, ensuring consistent behavior across different implementations (in-memory, database-backed, etc.).
8
8
@@ -31,7 +31,6 @@ A voucher contains the following fields:
31
31
|`nonce`| uint256 | Incremented with each aggregation |
32
32
|`escrow`| address | Address of the escrow contract |
33
33
|`chainId`| uint256 | Network chain ID |
34
-
|`expiry`| uint64 | Expiration timestamp |
35
34
|`signature`| bytes | EIP-712 signature of the voucher |
0 commit comments