diff --git a/ERCS/erc-7677.md b/ERCS/erc-7677.md index 39c9f0a256..e6dce38f95 100644 --- a/ERCS/erc-7677.md +++ b/ERCS/erc-7677.md @@ -4,8 +4,7 @@ title: Paymaster Web Service Capability description: A way for apps to communicate with smart wallets about paymaster web services author: Lukas Rosario (@lukasrosario), Dror Tirosh (@drortirosh), Wilson Cusack (@wilsoncusack), Kristof Gazso (@kristofgazso), Hazim Jumali (@hazim-j) discussions-to: https://ethereum-magicians.org/t/erc-7677-paymaster-web-service-capability/19530 -status: Last Call -last-call-deadline: 2024-09-05 +status: Review type: Standards Track category: ERC created: 2024-04-03 @@ -30,7 +29,7 @@ We define two JSON-RPC methods to be implemented by paymaster web services. #### `pm_getPaymasterStubData` -Returns stub values to be used in paymaster-related fields of an unsigned user operation for gas estimation. Accepts an unsigned user operation, entrypoint address, chain id, and a context object. Paymaster service providers can define fields that app developers should use in the context object. +Returns stub values to be used in paymaster-related fields of an unsigned user operation for gas estimation. Accepts an unsigned user operation, entrypoint address, chain id, and a context object. Paymaster service providers can define fields that app developers should use in the context object. This method MAY return paymaster-specific gas values if applicable to the provided EntryPoint version. For example, if provided with EntryPoint v0.7, this method MAY return `paymasterVerificationGasLimit`. Furthermore, for EntryPoint v0.7, this method MUST return a value for `paymasterPostOpGasLimit`. This is because it is the paymaster that pays the postOpGasLimit, so it cannot trust the wallet to estimate this amount. @@ -67,14 +66,14 @@ type GetPaymasterStubDataParams = [ ]; type GetPaymasterStubDataResult = { - sponsor?: { name: string; icon?: string } // Sponsor info - paymaster?: string // Paymaster address (entrypoint v0.7) + sponsor?: { name: string; icon?: string }; // Sponsor info + paymaster?: string; // Paymaster address (entrypoint v0.7) paymasterData?: string; // Paymaster data (entrypoint v0.7) paymasterVerificationGasLimit?: `0x${string}`; // Paymaster validation gas (entrypoint v0.7) paymasterPostOpGasLimit?: `0x${string}`; // Paymaster post-op gas (entrypoint v0.7) paymasterAndData?: string; // Paymaster and data (entrypoint v0.6) isFinal?: boolean; // Indicates that the caller does not need to call pm_getPaymasterData -} +}; ``` ###### `pm_getPaymasterStubData` Example Parameters @@ -90,7 +89,7 @@ type GetPaymasterStubDataResult = { "verificationGasLimit": "0x...", "preVerificationGas": "0x...", "maxFeePerGas": "0x...", - "maxPriorityFeePerGas": "0x...", + "maxPriorityFeePerGas": "0x..." }, "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", "0x2105", @@ -188,10 +187,10 @@ type GetPaymasterDataParams = [ ]; type GetPaymasterDataResult = { - paymaster?: string // Paymaster address (entrypoint v0.7) + paymaster?: string; // Paymaster address (entrypoint v0.7) paymasterData?: string; // Paymaster data (entrypoint v0.7) paymasterAndData?: string; // Paymaster and data (entrypoint v0.6) -} +}; ``` ###### `pm_getPaymasterData` Example Parameters @@ -207,7 +206,7 @@ type GetPaymasterDataResult = { "verificationGasLimit": "0x...", "preVerificationGas": "0x...", "maxFeePerGas": "0x...", - "maxPriorityFeePerGas": "0x...", + "maxPriorityFeePerGas": "0x..." }, "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", "0x2105", @@ -305,6 +304,7 @@ The wallet will then make the above paymaster RPC calls to the URLs specified in #### Wallet Implementation To conform to this specification, smart wallets that wish to leverage app-sponsored transactions: + 1. MUST indicate to apps that they can communicate with paymaster web services via their response to an [EIP-5792](./eip-5792.md) `wallet_getCapabilities` call. 2. SHOULD make calls to and use the values returned by the paymaster service specified in the capabilities field of an [EIP-5792](./eip-5792.md) `wallet_sendCalls` call. An example of an exception is a wallet that allows users to select a paymaster provided by the wallet. Since there might be cases in which the provided paymaster is ultimately not used—either due to service failure or due to a user selecting a different, wallet-provided paymaster—applications MUST NOT assume that the paymaster it provides to a wallet is the entity that pays for transaction fees. @@ -313,7 +313,7 @@ To conform to this specification, smart wallets that wish to leverage app-sponso ```typescript type PaymasterServiceCapability = { supported: boolean; -} +}; ``` ###### `wallet_getCapabilities` Example Response @@ -323,7 +323,7 @@ type PaymasterServiceCapability = { "0x2105": { "paymasterService": { "supported": true - }, + } }, "0x14A34": { "paymasterService": { @@ -385,4 +385,4 @@ This flow would allow developers to keep their paymaster service API keys secret ## Copyright -Copyright and related rights waived via [CC0](../LICENSE.md). \ No newline at end of file +Copyright and related rights waived via [CC0](../LICENSE.md).