From 20300e8a318bc45e09dabdf2384f05d19a0be059 Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Tue, 13 Aug 2024 14:29:40 +0200 Subject: [PATCH 01/27] Initial commit --- ERCS/erc-xxxx.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 ERCS/erc-xxxx.md diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md new file mode 100644 index 0000000000..862e91b284 --- /dev/null +++ b/ERCS/erc-xxxx.md @@ -0,0 +1,26 @@ +--- +eip: xxxx +title: +description: +author: +discussions-to: +status: Draft +type: Standards Track +category: ERC +created: +requires: +--- + +## Abstract + +## Motivation + +## Specification + +## Rationale + +## Security Considerations + +## Copyright + +Copyright and related rights waived via [CC0](../LICENSE.md). From e63c1f912991faa6d0f99319f216a54ce76623fc Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Wed, 14 Aug 2024 00:11:42 +0200 Subject: [PATCH 02/27] Initial addition of RIP-7560 specific JSON-RPC API methods --- ERCS/erc-xxxx.md | 170 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 862e91b284..b27557dd4c 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -17,6 +17,176 @@ requires: ## Specification +#### `eth_sendRawTransaction` + +Parameters + +1. DATA - The signed RLP-encoded RIP-7560 transaction data. + +Returns + +1. DATA, 32 Bytes - the transaction hash, or the zero hash if the transaction is not yet available. + +#### `eth_sendRip7560Transaction` + +Parameters: + +1. Object - The RIP-7560 transaction object + +| Name | Type | Description | +|---------------------------------|----------------|----------------------------------------------------------------| +| **sender** | DATA, 20 Bytes | Address of the Smart Contract Account making the transaction | +| **deployer** | DATA, 20 Bytes | Address of the Deployer - account factory contract | +| **deployerData** | DATA | Data that is provided to the Deployer contract | +| **paymaster** | DATA, 20 Bytes | Address of the Pyaymaster contract | +| **paymasterData** | DATA | Data that is provided to the Paymaster contract | +| callData | DATA | Data that is provided to the Account contract for execution | +| nonce | QUANTITY | A 256 bit nonce. Use of `nonce > 2^64` is defined in RIP-7712) | +| **builderFee** | QUANTITY | Value passed from sender or paymaster to the `coinbase` | +| maxPriorityFeePerGas | QUANTITY | The maximum gas price to be included as a tip to the validator | +| maxFeePerGas | QUANTITY | The maximum fee per unit of gas | +| **validationGasLimit** | QUANTITY | Gas provided for the transaction account validation frame | +| **paymasterValidationGasLimit** | QUANTITY | Gas provided for the transaction paymaster validation frame | +| **paymasterPostOpGasLimit** | QUANTITY | Gas provided for the transaction paymaster `postOp` frame | +| callGasLimit | QUANTITY | Gas provided for the transaction execution frame | +| accessList | OBJECT | An EIP-2930 compatible Access List structure | +| EIP-7702 authorizations (WIP) | ARRAY | An EIP-7702 compatible list of contracts injected into EOAs | +| **signature** | DATA | A signature of any kind used by Account to verify transaction | + +\* fields marked as **bold** are unique for the RIP-7560 transaction type + +Returns: + +1. DATA, 32 Bytes - the transaction hash, or the zero hash if the transaction is not yet available. + +Error: + +DATA - The revert data of the first reverted frame. +CODE - The error code indicating the type of error, which may include the entity that caused the revert on-chain. +MESSAGE - The human-readable error that may include a decoding of the `DATA` field if possible. + +#### `eth_getTransactionByHash` + +Parameters + +1. DATA, 32 Bytes - hash of a transaction + +Returns + +1. Object - A transaction object, or null when no transaction was found: + +| Name | Type | Description | +|------------------|----------------|-----------------------------------------------------------------------| +| blockHash | DATA, 32 Bytes | Hash of the block where this transaction was in, or null when pending | +| blockNumber | QUANTITY | Block number where this transaction was in, or null when pending | +| transactionIndex | QUANTITY | The transaction's index position in the block, or null when pending | +| type | QUANTITY | The transaction type | + +\* followed by the entire RIP-7560 transaction object as described in `eth_sendRip7560Transaction` + +#### `eth_getTransactionReceipt` + +For an `AA_TX_TYPE` transaction is included in a block, returns the following values in addition to the existing fields: + +Returns + +1. Object - A transaction receipt object, or null when no receipt was found: + +Fields specific to an RIP-7560 transaction receipt: + +| Name | Type | Description | +|----------------------------|-----------------|--------------------------------------------------------------------------------| +| sender | DATA, 20 Bytes | Address of the sender of this transaction | +| paymaster | DATA, 20 Bytes | Address of the Paymaster if it is paying for the transaction, null otherwise | +| deployer | DATA, 20 Bytes | Address of the Deployer if it is included in the transaction, null otherwise | +| senderCreationGasUsed | QUANTITY | The amount of gas actually used by the sender deployment frame | +| senderValidationGasUsed | QUANTITY | The amount of gas actually used by the sender validation frame | +| paymasterValidationGasUsed | QUANTITY | The amount of gas actually used by the paymaster validation frame | +| executionGasUsed | QUANTITY | The amount of gas actually used by the execution frame | +| postOpStatus | QUANTITY | 1 (success), 0 (failure), or `null` (did not run) status of the `postOp` frame | +| postOpGasUsed | QUANTITY | The amount of gas actually used by the paymaster `postOp` frame | +| validationLogs | ARRAY | Array of log objects, which this transaction'S VALIDATION FRAME generated. | +| validationLogsBloom | DATA, 256 Bytes | Array of log objects, which this transaction'S VALIDATION FRAME generated. | + +Continued, these fields are shared by all transaction types: + +| Name | Type | Value | +|-------------------|-----------------|------------------------------------------------------------------------------------------| +| transactionHash | DATA, 32 Bytes | Hash of the transaction. | +| transactionIndex | QUANTITY | Integer of the transactions index position in the block. | +| blockHash | DATA, 32 Bytes | Hash of the block where this transaction was in. | +| blockNumber | QUANTITY | Block number where this transaction was in. | +| cumulativeGasUsed | QUANTITY | The total amount of gas used when this transaction was executed in the block. | +| effectiveGasPrice | QUANTITY | The sum of the base fee and tip paid per unit of gas. | +| gasUsed | QUANTITY | The amount of gas used by this specific transaction alone. | +| contractAddress | DATA, 20 Bytes | The contract address created, if the transaction was a contract creation, otherwise null | +| logs | ARRAY | Array of log objects, which this transaction'S EXECUTION FRAME generated. | +| logsBloom | DATA, 256 Bytes | Bloom filter for light clients to quickly retrieve related logs. | +| type | QUANTITY | Integer of the transaction type | +| status | QUANTITY | Either 1 (success) or 0 (failure) status of the execution frame | + +#### `eth_executeRip7560Transaction` + +Parameters: + +1. Object - The RIP-7560 transaction object (as defined in `eth_sendRip7560Transaction`). + The `signature` field is optional. + +Returns: + +DATA - The return value of the `sender` execution frame. + +Error: + +DATA - The revert data of the first reverted frame. +CODE - The error code indicating the type of error, which may include the entity that caused the revert on-chain. +MESSAGE - The human-readable error that may include a decoding of the `DATA` field if possible. + +#### `eth_estimateRip7560TransactionGas` + +Parameters: + +1. Object - The RIP-7560 transaction object (as defined in `eth_sendRip7560Transaction`). + The `validationGasLimit`, `paymasterGasLimit`, `callGasLimit` fields are optional. +2. QUANTITY|TAG - integer block number, or the string "latest", "earliest", "pending", "safe" or "finalized" +3. Object - State override set + The State Override Set option allows you to change the state of a contract before executing the call. This means you + can modify the values of variables stored in the contract, such as balances and approvals for that call without + actually modifying the contract on the blockchain. + This behavior is equivalent to the one defined for the `eth_call` RPC method. + +Returns: + +1. Object + +| Name | Type | +|--------------------|----------| +| validationGasLimit | QUANTITY | +| paymasterGasLimit | QUANTITY | +| callGasLimit | QUANTITY | +| builderFee | QUANTITY | + +Error: + +DATA - The revert data of the first reverted frame. +CODE - The error code indicating the type of error, which may include the entity that caused the revert on-chain. +MESSAGE - The human-readable error that may include a decoding of the `DATA` field if possible. + +##### Notes on implementation details + +As mentioned earlier, the `sender` and `paymaster` contracts should not revert on the validation failure +and should make calls to `sigFailAccount` and `sigFailPaymaster` accordingly +in order to support `eth_estimateRip7560TransactionGas`. + +The recommended way to achieve this behavior for Smart Contract Accounts and Paymasters is to compare the `signature` +parameter to a predetermined "dummy signature" and to call a `sigFail` callback in case the values match. + +#### `eth_traceRip7560Validation` + +TODO + +### Error Codes + ## Rationale ## Security Considerations From fae2ef6d0243b07d7b52f26e750fe1a5b886272b Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Wed, 14 Aug 2024 21:14:54 +0200 Subject: [PATCH 03/27] Add some definitions --- ERCS/erc-xxxx.md | 291 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 235 insertions(+), 56 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index b27557dd4c..4386da059f 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -1,44 +1,78 @@ --- eip: xxxx -title: -description: +title: JSON-RPC API for RIP-7560 Native Account Abstraction +description: A set of JSON-RPC API methods that are required for a fully functional Native Account Abstraction protocol author: discussions-to: status: Draft type: Standards Track category: ERC created: -requires: +requires: RIP-7560, ERC-7562, EIP-7702 --- ## Abstract +The [RIP-7560](https://github.com/ethereum/RIPs/blob/master/RIPS/rip-7560.md) defines the new transaction type +and the modifications to the EVM needed for the Native Account Abstraction support. + +However, there are a number of modifications to the Ethereum JSON-RPC API that is needed as well. +This proposal contains the full description of the new or modified APIs, and it would be highly beneficial +for the Native Account Abstraction ecosystem to implement these APIs in a standardised and compatible way. + ## Motivation +Native Account Abstraction is expected to supersede the [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) +by making all the benefits of Account Abstraction a core part of the protocol, bringing down the cost for the users, +enabling easy migration to post-quantum cryptography and eventually deprecation of Externally Owned Accounts altogether. + +A number of current Ethereum JSON-RPC API methods are defined for transactions of existing types, such as legacy, +[EIP-2930](https://eips.ethereum.org/EIPS/eip-2930), +[EIP-1559](https://eips.ethereum.org/EIPS/eip-1559), +[EIP-4844](https://eips.ethereum.org/EIPS/eip-4844), +and the upcoming [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702). +They are not properly defined for RIP-7560 transaction type. + +There are also some actions that are only applicable in the context of Native Account Abstraction, +which requires a creation of new JSON-RPC API methods. + ## Specification -#### `eth_sendRawTransaction` +We define the following changes to the Ethereum JSON-RPC API: + +#### Add RIP-7560 support for `eth_sendRawTransaction` -Parameters +Parameters: 1. DATA - The signed RLP-encoded RIP-7560 transaction data. -Returns +Returns: 1. DATA, 32 Bytes - the transaction hash, or the zero hash if the transaction is not yet available. -#### `eth_sendRip7560Transaction` +#### Add RIP-7560 support for `eth_sendTransaction` + +Allows clients to send a new transaction to the mempool. +Can operate in two modes: +as a wallet request to sign and send the transaction +or simply a way to send a pre-signed one. + +If fhe `signature` parameter is not `null` acts similar to `eth_sendRawTransaction`, +simply allowing the use of a JSON transaction format instead of its RLP encoding. + +If fhe `signature` parameter is `null`, fills in a `signature` field similar to the `eth_signRip7560Transaction` method. +In case the node is not able to create such a `signature` returns an error describing the failure reason. Parameters: -1. Object - The RIP-7560 transaction object +1. OBJECT - The RIP-7560 transaction object | Name | Type | Description | |---------------------------------|----------------|----------------------------------------------------------------| | **sender** | DATA, 20 Bytes | Address of the Smart Contract Account making the transaction | | **deployer** | DATA, 20 Bytes | Address of the Deployer - account factory contract | | **deployerData** | DATA | Data that is provided to the Deployer contract | -| **paymaster** | DATA, 20 Bytes | Address of the Pyaymaster contract | +| **paymaster** | DATA, 20 Bytes | Address of the Paymaster contract | | **paymasterData** | DATA | Data that is provided to the Paymaster contract | | callData | DATA | Data that is provided to the Account contract for execution | | nonce | QUANTITY | A 256 bit nonce. Use of `nonce > 2^64` is defined in RIP-7712) | @@ -65,40 +99,77 @@ DATA - The revert data of the first reverted frame. CODE - The error code indicating the type of error, which may include the entity that caused the revert on-chain. MESSAGE - The human-readable error that may include a decoding of the `DATA` field if possible. -#### `eth_getTransactionByHash` +#### Create a new JSON-RPC API method `eth_signRip7560Transaction` + +This method is used by an RIP-7560 wallet application that operates the credentials for the Smart Contract Account +specified as a `sender` of the provided RIP-7560 transaction. -Parameters +Parameters: + +1. OBJECT - The RIP-7560 transaction object. The `signature` parameter must be `null`. + +Returns: + +1. DATA - a value to be used as a `signature` parameter that makes the provided RIP-7560 transaction valid. + +#### Add RIP-7560 support for `eth_getTransaction` APIs + +This includes the following APIs: `eth_getTransactionByHash`, `eth_getTransactionByBlockHashAndIndex`, +`eth_getTransactionByBlockNumberAndIndex`. + +These methods have a very similar purpose and should support returning the new transaction type object. + +Parameters: +`eth_getTransactionByHash`: 1. DATA, 32 Bytes - hash of a transaction -Returns +`eth_getTransactionByBlockHashAndIndex`: + +1. DATA, 32 Bytes - hash of a block. +2. QUANTITY - the transaction index position. + +`eth_getTransactionByBlockNumberAndIndex`: + +1. QUANTITY | TAG - a block number, or the string "earliest", "latest", "pending", "safe" or "finalized", as in the + default block parameter. +2. QUANTITY - the transaction index position. -1. Object - A transaction object, or null when no transaction was found: +Note that the "transaction index position" is determined by the position of the transaction's **validation frame**. -| Name | Type | Description | -|------------------|----------------|-----------------------------------------------------------------------| -| blockHash | DATA, 32 Bytes | Hash of the block where this transaction was in, or null when pending | -| blockNumber | QUANTITY | Block number where this transaction was in, or null when pending | -| transactionIndex | QUANTITY | The transaction's index position in the block, or null when pending | -| type | QUANTITY | The transaction type | +Returns: + +1. OBJECT - A transaction object, or `null` when no transaction was found: + +| Name | Type | Description | +|------------------|----------------|-------------------------------------------------------------------------| +| blockHash | DATA, 32 Bytes | Hash of the block where this transaction was in, or `null` when pending | +| blockNumber | QUANTITY | Block number where this transaction was in, or `null` when pending | +| transactionIndex | QUANTITY | The transaction's index position in the block, or `null` when pending | +| type | QUANTITY | The transaction type | \* followed by the entire RIP-7560 transaction object as described in `eth_sendRip7560Transaction` -#### `eth_getTransactionReceipt` +#### Add RIP-7560 support for `eth_getTransactionReceipt` -For an `AA_TX_TYPE` transaction is included in a block, returns the following values in addition to the existing fields: +For an RIP-7560 transaction included in a block, return also the values specific to this transaction type +in addition to all the existing fields. -Returns +Parameters: -1. Object - A transaction receipt object, or null when no receipt was found: +1. DATA, 32 Bytes - hash of a transaction + +Returns: + +1. OBJECT - A transaction receipt object, or `null` when no receipt was found: Fields specific to an RIP-7560 transaction receipt: | Name | Type | Description | |----------------------------|-----------------|--------------------------------------------------------------------------------| | sender | DATA, 20 Bytes | Address of the sender of this transaction | -| paymaster | DATA, 20 Bytes | Address of the Paymaster if it is paying for the transaction, null otherwise | -| deployer | DATA, 20 Bytes | Address of the Deployer if it is included in the transaction, null otherwise | +| paymaster | DATA, 20 Bytes | Address of the Paymaster if it is paying for the transaction, `null` otherwise | +| deployer | DATA, 20 Bytes | Address of the Deployer if it is included in the transaction, `null` otherwise | | senderCreationGasUsed | QUANTITY | The amount of gas actually used by the sender deployment frame | | senderValidationGasUsed | QUANTITY | The amount of gas actually used by the sender validation frame | | paymasterValidationGasUsed | QUANTITY | The amount of gas actually used by the paymaster validation frame | @@ -110,27 +181,36 @@ Fields specific to an RIP-7560 transaction receipt: Continued, these fields are shared by all transaction types: -| Name | Type | Value | -|-------------------|-----------------|------------------------------------------------------------------------------------------| -| transactionHash | DATA, 32 Bytes | Hash of the transaction. | -| transactionIndex | QUANTITY | Integer of the transactions index position in the block. | -| blockHash | DATA, 32 Bytes | Hash of the block where this transaction was in. | -| blockNumber | QUANTITY | Block number where this transaction was in. | -| cumulativeGasUsed | QUANTITY | The total amount of gas used when this transaction was executed in the block. | -| effectiveGasPrice | QUANTITY | The sum of the base fee and tip paid per unit of gas. | -| gasUsed | QUANTITY | The amount of gas used by this specific transaction alone. | -| contractAddress | DATA, 20 Bytes | The contract address created, if the transaction was a contract creation, otherwise null | -| logs | ARRAY | Array of log objects, which this transaction'S EXECUTION FRAME generated. | -| logsBloom | DATA, 256 Bytes | Bloom filter for light clients to quickly retrieve related logs. | -| type | QUANTITY | Integer of the transaction type | -| status | QUANTITY | Either 1 (success) or 0 (failure) status of the execution frame | - -#### `eth_executeRip7560Transaction` +| Name | Type | Value | +|-------------------|-----------------|--------------------------------------------------------------------------------------------| +| transactionHash | DATA, 32 Bytes | Hash of the transaction. | +| transactionIndex | QUANTITY | Integer of the transactions index position in the block. | +| blockHash | DATA, 32 Bytes | Hash of the block where this transaction was in. | +| blockNumber | QUANTITY | Block number where this transaction was in. | +| cumulativeGasUsed | QUANTITY | The total amount of gas used when this transaction was executed in the block. | +| effectiveGasPrice | QUANTITY | The sum of the base fee and tip paid per unit of gas. | +| gasUsed | QUANTITY | The amount of gas used by this specific transaction alone. | +| contractAddress | DATA, 20 Bytes | The contract address created, if the transaction was a contract creation, otherwise `null` | +| logs | ARRAY | Array of log objects, which this transaction'S EXECUTION FRAME generated. | +| logsBloom | DATA, 256 Bytes | Bloom filter for light clients to quickly retrieve related logs. | +| type | QUANTITY | Integer of the transaction type | +| status | QUANTITY | Either 1 (success) or 0 (failure) status of the execution frame | + +#### Create a new JSON-RPC API method `eth_executeRip7560Transaction` + +Executes the entire RIP-7560 transaction in memory without broadcasting it or including it in a block. +Does not require the transaction to be properly signed, meaning it continues execution after either an account +or a paymaster contract make a `sigFailAccount` or `sigFailPaymaster` call. +If all frames execute successfully, simply returns the data returned by the top level frame of the execution phase. +If any of the validation or execution frames revers, returns an error object containing the revert message. +If the transaction validation fails for any reason other than the failed signature check, +returns an error object containing the details of the validation failure. Parameters: -1. Object - The RIP-7560 transaction object (as defined in `eth_sendRip7560Transaction`). +1. OBJECT - The RIP-7560 transaction object (as defined in `eth_sendRip7560Transaction`). The `signature` field is optional. +2. QUANTITY | TAG - integer block number, or the string "latest", "earliest", "pending", "safe" or "finalized" Returns: @@ -142,14 +222,21 @@ DATA - The revert data of the first reverted frame. CODE - The error code indicating the type of error, which may include the entity that caused the revert on-chain. MESSAGE - The human-readable error that may include a decoding of the `DATA` field if possible. -#### `eth_estimateRip7560TransactionGas` +#### Create a new JSON-RPC API method `eth_estimateRip7560TransactionGas` + +Performs a search for gas limit values required to make each of the frames of the RIP-7560 transaction execute +successfully and without running out of gas. +Note that for validation frames, only valid calls to an appropriate `AA_ENTRY_POINT` callback, +such as `acceptAccount`, `acceptPaymaster`, `sigFailAccount` and `sigFailPaymaster`, is considered a success. + +If it fails to find such a value, returns an error message with the detailed description of the failure reason. Parameters: -1. Object - The RIP-7560 transaction object (as defined in `eth_sendRip7560Transaction`). +1. OBJECT - The RIP-7560 transaction object (as defined in `eth_sendRip7560Transaction`). The `validationGasLimit`, `paymasterGasLimit`, `callGasLimit` fields are optional. -2. QUANTITY|TAG - integer block number, or the string "latest", "earliest", "pending", "safe" or "finalized" -3. Object - State override set +2. QUANTITY | TAG - integer block number, or the string "latest", "earliest", "pending", "safe" or "finalized" +3. OBJECT - State override set The State Override Set option allows you to change the state of a contract before executing the call. This means you can modify the values of variables stored in the contract, such as balances and approvals for that call without actually modifying the contract on the blockchain. @@ -159,12 +246,12 @@ Returns: 1. Object -| Name | Type | -|--------------------|----------| -| validationGasLimit | QUANTITY | -| paymasterGasLimit | QUANTITY | -| callGasLimit | QUANTITY | -| builderFee | QUANTITY | +| Name | Type | +|-----------------------------|----------| +| validationGasLimit | QUANTITY | +| paymasterValidationGasLimit | QUANTITY | +| paymasterPostOpGasLimit | QUANTITY | +| callGasLimit | QUANTITY | Error: @@ -174,23 +261,115 @@ MESSAGE - The human-readable error that may include a decoding of the `DATA` fie ##### Notes on implementation details -As mentioned earlier, the `sender` and `paymaster` contracts should not revert on the validation failure -and should make calls to `sigFailAccount` and `sigFailPaymaster` accordingly +As mentioned in the RIP-7560, the `sender` and `paymaster` contracts should not revert on the validation failure +and should make calls to `sigFailAccount` and `sigFailPaymaster` respectively in order to support `eth_estimateRip7560TransactionGas`. The recommended way to achieve this behavior for Smart Contract Accounts and Paymasters is to compare the `signature` parameter to a predetermined "dummy signature" and to call a `sigFail` callback in case the values match. -#### `eth_traceRip7560Validation` +#### Create a new JSON-RPC API method `eth_traceRip7560Validation` + +Only executes the validation phase of the RIP-7560 transaction and returns the tracing results of this execution. +This is done in order to allow other clients to determine +whether all contracts used within the validation phase of this transaction are compliant with the rules +defined in the [ERC-7562](https://eips.ethereum.org/EIPS/eip-7562). + +Parameters: -TODO +1. OBJECT - The RIP-7560 transaction object (as defined in `eth_sendRip7560Transaction`). +2. QUANTITY | TAG - a block number, or the string "earliest", "latest", "pending", "safe" or "finalized", as in the + default block parameter. + +Returns: + +1. OBJECT - the tracing result of executing the entire validation phase of the RIP-7560 transaction. + +Example of the tracing result JSON response: + +```json +{ + "callsFromEntryPoint": [ + { + "topLevelTargetAddress": "
", + "access": { + "
": { + "reads": { + "slot": "value" + }, + "writes": { + "slot": "value" + }, + "transientReads": {}, + "transientWrites": {} + } + }, + "opcodes": { + "": "" + }, + "contractSize": { + "
": { + "contractSize": 0, + "opcode": "CALL" + } + }, + "calls": [ + { + "type": "CALL", + "from": "
", + "to": "
", + "method": "0x", + "value": "0x0", + "gas": 2000000, + "gasUsed": 0, + "data": "" + } + ], + "logs": [ + { + "data": "", + "topic": [ + "" + ] + } + ] + } + ] +} + +``` ### Error Codes +* code: -32500 - transaction validation failed by `sender`. + The message field SHOULD be set to the revert message from the `sender`. + +* code: -32501 - transaction validation failed by `paymaster`. + The message field SHOULD be set to the revert message from the `paymaster`. + +* code: -32502 - transaction validation failed by `deployer` + The message field SHOULD be set to the revert message from the `deployer`. + +* code: -32503 - Transaction out of time range. + The message field SHOULD include the requested time range and the current block timestamp. + ## Rationale +### Creating `eth_executeRip7560Transaction` instead of modifying `eth_call` + +The semantics of the `eth_call` are currently very simple for all existing transaction types, and would become +significantly more complex with the addition of the RIP-7560 transaction type support. + +It seems like the difference between these transaction types warrants a separate standalone RPC API method. + ## Security Considerations +The RPC API methods standard described in this document does not have any consequences for the security of the +Native Account Abstraction ecosystem. + +The implementations of these APIs, especially the ones related to generating a `signature` for a transaction, +must be extremely careful when handling the Smart Contract Accounts' credentials. + ## Copyright Copyright and related rights waived via [CC0](../LICENSE.md). From 75f568710c02912341bde776dc4636714944ad49 Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Thu, 15 Aug 2024 11:48:42 +0200 Subject: [PATCH 04/27] Update erc-xxxx.md --- ERCS/erc-xxxx.md | 44 ++++---------------------------------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 4386da059f..bf82e31ed7 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -40,32 +40,16 @@ which requires a creation of new JSON-RPC API methods. We define the following changes to the Ethereum JSON-RPC API: -#### Add RIP-7560 support for `eth_sendRawTransaction` - -Parameters: - -1. DATA - The signed RLP-encoded RIP-7560 transaction data. - -Returns: - -1. DATA, 32 Bytes - the transaction hash, or the zero hash if the transaction is not yet available. - -#### Add RIP-7560 support for `eth_sendTransaction` - -Allows clients to send a new transaction to the mempool. -Can operate in two modes: -as a wallet request to sign and send the transaction -or simply a way to send a pre-signed one. +#### Create a new JSON-RPC API method `eth_signRip7560Transaction` -If fhe `signature` parameter is not `null` acts similar to `eth_sendRawTransaction`, -simply allowing the use of a JSON transaction format instead of its RLP encoding. +This method is used by an RIP-7560 wallet application that operates the credentials for the Smart Contract Account +specified as a `sender` of the provided RIP-7560 transaction. -If fhe `signature` parameter is `null`, fills in a `signature` field similar to the `eth_signRip7560Transaction` method. In case the node is not able to create such a `signature` returns an error describing the failure reason. Parameters: -1. OBJECT - The RIP-7560 transaction object +1. OBJECT - The RIP-7560 transaction object. The `signature` parameter must be `null`. | Name | Type | Description | |---------------------------------|----------------|----------------------------------------------------------------| @@ -85,31 +69,11 @@ Parameters: | callGasLimit | QUANTITY | Gas provided for the transaction execution frame | | accessList | OBJECT | An EIP-2930 compatible Access List structure | | EIP-7702 authorizations (WIP) | ARRAY | An EIP-7702 compatible list of contracts injected into EOAs | -| **signature** | DATA | A signature of any kind used by Account to verify transaction | \* fields marked as **bold** are unique for the RIP-7560 transaction type Returns: -1. DATA, 32 Bytes - the transaction hash, or the zero hash if the transaction is not yet available. - -Error: - -DATA - The revert data of the first reverted frame. -CODE - The error code indicating the type of error, which may include the entity that caused the revert on-chain. -MESSAGE - The human-readable error that may include a decoding of the `DATA` field if possible. - -#### Create a new JSON-RPC API method `eth_signRip7560Transaction` - -This method is used by an RIP-7560 wallet application that operates the credentials for the Smart Contract Account -specified as a `sender` of the provided RIP-7560 transaction. - -Parameters: - -1. OBJECT - The RIP-7560 transaction object. The `signature` parameter must be `null`. - -Returns: - 1. DATA - a value to be used as a `signature` parameter that makes the provided RIP-7560 transaction valid. #### Add RIP-7560 support for `eth_getTransaction` APIs From 595eb7ab1863a3a5680c0bef2663fb00f945b7d7 Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Thu, 15 Aug 2024 12:00:14 +0200 Subject: [PATCH 05/27] Update ERCS/erc-xxxx.md Co-authored-by: shahafn --- ERCS/erc-xxxx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index bf82e31ed7..becbf4801d 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -198,7 +198,7 @@ If it fails to find such a value, returns an error message with the detailed des Parameters: 1. OBJECT - The RIP-7560 transaction object (as defined in `eth_sendRip7560Transaction`). - The `validationGasLimit`, `paymasterGasLimit`, `callGasLimit` fields are optional. + The `validationGasLimit`, paymasterValidationGasLimit, `paymasterGasLimit` and `callGasLimit` fields are optional. 2. QUANTITY | TAG - integer block number, or the string "latest", "earliest", "pending", "safe" or "finalized" 3. OBJECT - State override set The State Override Set option allows you to change the state of a contract before executing the call. This means you From be81528b8d38a01265a12be5a7048a812d5f6226 Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Thu, 15 Aug 2024 12:00:26 +0200 Subject: [PATCH 06/27] Update ERCS/erc-xxxx.md Co-authored-by: shahafn --- ERCS/erc-xxxx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index becbf4801d..827aa19305 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -13,7 +13,7 @@ requires: RIP-7560, ERC-7562, EIP-7702 ## Abstract -The [RIP-7560](https://github.com/ethereum/RIPs/blob/master/RIPS/rip-7560.md) defines the new transaction type +[RIP-7560](https://github.com/ethereum/RIPs/blob/master/RIPS/rip-7560.md) defines the new transaction type and the modifications to the EVM needed for the Native Account Abstraction support. However, there are a number of modifications to the Ethereum JSON-RPC API that is needed as well. From 7aee678f7b2cb6a09a074d8e79fb32103ca022e0 Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Thu, 15 Aug 2024 12:00:40 +0200 Subject: [PATCH 07/27] Update ERCS/erc-xxxx.md Co-authored-by: shahafn --- ERCS/erc-xxxx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 827aa19305..3bdc275d28 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -22,7 +22,7 @@ for the Native Account Abstraction ecosystem to implement these APIs in a standa ## Motivation -Native Account Abstraction is expected to supersede the [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) +Native Account Abstraction is expected to supersede [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) by making all the benefits of Account Abstraction a core part of the protocol, bringing down the cost for the users, enabling easy migration to post-quantum cryptography and eventually deprecation of Externally Owned Accounts altogether. From 8a469f77b322fb9085b44b1dbd88a7255f2d1474 Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Thu, 15 Aug 2024 12:12:06 +0200 Subject: [PATCH 08/27] Update erc-xxxx.md --- ERCS/erc-xxxx.md | 47 +++++++++-------------------------------------- 1 file changed, 9 insertions(+), 38 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 3bdc275d28..b17b098677 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -76,44 +76,6 @@ Returns: 1. DATA - a value to be used as a `signature` parameter that makes the provided RIP-7560 transaction valid. -#### Add RIP-7560 support for `eth_getTransaction` APIs - -This includes the following APIs: `eth_getTransactionByHash`, `eth_getTransactionByBlockHashAndIndex`, -`eth_getTransactionByBlockNumberAndIndex`. - -These methods have a very similar purpose and should support returning the new transaction type object. - -Parameters: -`eth_getTransactionByHash`: - -1. DATA, 32 Bytes - hash of a transaction - -`eth_getTransactionByBlockHashAndIndex`: - -1. DATA, 32 Bytes - hash of a block. -2. QUANTITY - the transaction index position. - -`eth_getTransactionByBlockNumberAndIndex`: - -1. QUANTITY | TAG - a block number, or the string "earliest", "latest", "pending", "safe" or "finalized", as in the - default block parameter. -2. QUANTITY - the transaction index position. - -Note that the "transaction index position" is determined by the position of the transaction's **validation frame**. - -Returns: - -1. OBJECT - A transaction object, or `null` when no transaction was found: - -| Name | Type | Description | -|------------------|----------------|-------------------------------------------------------------------------| -| blockHash | DATA, 32 Bytes | Hash of the block where this transaction was in, or `null` when pending | -| blockNumber | QUANTITY | Block number where this transaction was in, or `null` when pending | -| transactionIndex | QUANTITY | The transaction's index position in the block, or `null` when pending | -| type | QUANTITY | The transaction type | - -\* followed by the entire RIP-7560 transaction object as described in `eth_sendRip7560Transaction` - #### Add RIP-7560 support for `eth_getTransactionReceipt` For an RIP-7560 transaction included in a block, return also the values specific to this transaction type @@ -186,6 +148,15 @@ DATA - The revert data of the first reverted frame. CODE - The error code indicating the type of error, which may include the entity that caused the revert on-chain. MESSAGE - The human-readable error that may include a decoding of the `DATA` field if possible. +#### Add RIP-7560 support for all remaining transaction-level RPC APIs + +This includes the following APIs: `eth_sendTransaction`, `eth_sendRawTransaction`, `eth_getTransactionByHash`, `eth_getTransactionByBlockHashAndIndex`, +`eth_getTransactionByBlockNumberAndIndex`. + +These methods have a very similar purpose and should support returning the new transaction type object. + +Note that the "transaction index position" is determined by the position of the transaction's **validation frame**. + #### Create a new JSON-RPC API method `eth_estimateRip7560TransactionGas` Performs a search for gas limit values required to make each of the frames of the RIP-7560 transaction execute From 7907ef9ca810c81699e2fa8115607a0aabb91a74 Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Thu, 15 Aug 2024 13:57:08 +0200 Subject: [PATCH 09/27] Remove unnecessary list of existing transaction types --- ERCS/erc-xxxx.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index b17b098677..9105375534 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -26,13 +26,6 @@ Native Account Abstraction is expected to supersede [ERC-4337](https://eips.ethe by making all the benefits of Account Abstraction a core part of the protocol, bringing down the cost for the users, enabling easy migration to post-quantum cryptography and eventually deprecation of Externally Owned Accounts altogether. -A number of current Ethereum JSON-RPC API methods are defined for transactions of existing types, such as legacy, -[EIP-2930](https://eips.ethereum.org/EIPS/eip-2930), -[EIP-1559](https://eips.ethereum.org/EIPS/eip-1559), -[EIP-4844](https://eips.ethereum.org/EIPS/eip-4844), -and the upcoming [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702). -They are not properly defined for RIP-7560 transaction type. - There are also some actions that are only applicable in the context of Native Account Abstraction, which requires a creation of new JSON-RPC API methods. From aa361b31e128d6942b1a8c7b0d276c7ccecb17ab Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Thu, 15 Aug 2024 14:02:29 +0200 Subject: [PATCH 10/27] Fix reference to a removed method --- ERCS/erc-xxxx.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 9105375534..3ce4e6d139 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -127,7 +127,7 @@ returns an error object containing the details of the validation failure. Parameters: -1. OBJECT - The RIP-7560 transaction object (as defined in `eth_sendRip7560Transaction`). +1. OBJECT - The RIP-7560 transaction object (as defined in `eth_signRip7560Transaction`). The `signature` field is optional. 2. QUANTITY | TAG - integer block number, or the string "latest", "earliest", "pending", "safe" or "finalized" @@ -161,7 +161,7 @@ If it fails to find such a value, returns an error message with the detailed des Parameters: -1. OBJECT - The RIP-7560 transaction object (as defined in `eth_sendRip7560Transaction`). +1. OBJECT - The RIP-7560 transaction object (as defined in `eth_signRip7560Transaction`). The `validationGasLimit`, paymasterValidationGasLimit, `paymasterGasLimit` and `callGasLimit` fields are optional. 2. QUANTITY | TAG - integer block number, or the string "latest", "earliest", "pending", "safe" or "finalized" 3. OBJECT - State override set @@ -205,7 +205,7 @@ defined in the [ERC-7562](https://eips.ethereum.org/EIPS/eip-7562). Parameters: -1. OBJECT - The RIP-7560 transaction object (as defined in `eth_sendRip7560Transaction`). +1. OBJECT - The RIP-7560 transaction object (as defined in `eth_signRip7560Transaction`). 2. QUANTITY | TAG - a block number, or the string "earliest", "latest", "pending", "safe" or "finalized", as in the default block parameter. From b48ec44639a23841480ed51899a24b1b97d3c26b Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Thu, 15 Aug 2024 14:39:39 +0200 Subject: [PATCH 11/27] Remove 'eth_signRip7560Transaction'; remove 'eth_traceRip7560Validation' result schema --- ERCS/erc-xxxx.md | 129 +++++++++++++---------------------------------- 1 file changed, 35 insertions(+), 94 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 3ce4e6d139..9e245e220d 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -31,43 +31,35 @@ which requires a creation of new JSON-RPC API methods. ## Specification +This document defines the API that the RIP-7560 compatible Ethereum nodes provide to either Smart Contract +Wallet applications or advanced dapps. We define the following changes to the Ethereum JSON-RPC API: -#### Create a new JSON-RPC API method `eth_signRip7560Transaction` - -This method is used by an RIP-7560 wallet application that operates the credentials for the Smart Contract Account -specified as a `sender` of the provided RIP-7560 transaction. - -In case the node is not able to create such a `signature` returns an error describing the failure reason. - -Parameters: - -1. OBJECT - The RIP-7560 transaction object. The `signature` parameter must be `null`. - -| Name | Type | Description | -|---------------------------------|----------------|----------------------------------------------------------------| -| **sender** | DATA, 20 Bytes | Address of the Smart Contract Account making the transaction | -| **deployer** | DATA, 20 Bytes | Address of the Deployer - account factory contract | -| **deployerData** | DATA | Data that is provided to the Deployer contract | -| **paymaster** | DATA, 20 Bytes | Address of the Paymaster contract | -| **paymasterData** | DATA | Data that is provided to the Paymaster contract | -| callData | DATA | Data that is provided to the Account contract for execution | -| nonce | QUANTITY | A 256 bit nonce. Use of `nonce > 2^64` is defined in RIP-7712) | -| **builderFee** | QUANTITY | Value passed from sender or paymaster to the `coinbase` | -| maxPriorityFeePerGas | QUANTITY | The maximum gas price to be included as a tip to the validator | -| maxFeePerGas | QUANTITY | The maximum fee per unit of gas | -| **validationGasLimit** | QUANTITY | Gas provided for the transaction account validation frame | -| **paymasterValidationGasLimit** | QUANTITY | Gas provided for the transaction paymaster validation frame | -| **paymasterPostOpGasLimit** | QUANTITY | Gas provided for the transaction paymaster `postOp` frame | -| callGasLimit | QUANTITY | Gas provided for the transaction execution frame | -| accessList | OBJECT | An EIP-2930 compatible Access List structure | -| EIP-7702 authorizations (WIP) | ARRAY | An EIP-7702 compatible list of contracts injected into EOAs | - -\* fields marked as **bold** are unique for the RIP-7560 transaction type - -Returns: - -1. DATA - a value to be used as a `signature` parameter that makes the provided RIP-7560 transaction valid. +### Definition of the RIP-7560 transaction type: + +The following table represents a full list of fields of an RIP-7560 transaction: + +| Name | Type | Description | +|-------------------------------|----------------|----------------------------------------------------------------| +| sender | DATA, 20 Bytes | Address of the Smart Contract Account making the transaction | +| deployer | DATA, 20 Bytes | Address of the Deployer - account factory contract | +| deployerData | DATA | Data that is provided to the Deployer contract | +| paymaster | DATA, 20 Bytes | Address of the Paymaster contract | +| paymasterData | DATA | Data that is provided to the Paymaster contract | +| callData | DATA | Data that is provided to the Account contract for execution | +| nonce | QUANTITY | A 256 bit nonce. Use of `nonce > 2^64` is defined in RIP-7712 | +| builderFee | QUANTITY | Value passed from sender or paymaster to the `coinbase` | +| maxPriorityFeePerGas | QUANTITY | The maximum gas price to be included as a tip to the validator | +| maxFeePerGas | QUANTITY | The maximum fee per unit of gas | +| validationGasLimit | QUANTITY | Gas provided for the transaction account validation frame | +| paymasterValidationGasLimit | QUANTITY | Gas provided for the transaction paymaster validation frame | +| paymasterPostOpGasLimit | QUANTITY | Gas provided for the transaction paymaster `postOp` frame | +| callGasLimit | QUANTITY | Gas provided for the transaction execution frame | +| accessList | OBJECT | An EIP-2930 compatible Access List structure | +| EIP-7702 authorizations (WIP) | ARRAY | An EIP-7702 compatible list of contracts injected into EOAs | +| signature | DATA | A signature of any kind used by Account to verify transaction | + +### Changes to the JSON-RPC API #### Add RIP-7560 support for `eth_getTransactionReceipt` @@ -127,7 +119,7 @@ returns an error object containing the details of the validation failure. Parameters: -1. OBJECT - The RIP-7560 transaction object (as defined in `eth_signRip7560Transaction`). +1. OBJECT - The RIP-7560 transaction object. The `signature` field is optional. 2. QUANTITY | TAG - integer block number, or the string "latest", "earliest", "pending", "safe" or "finalized" @@ -143,7 +135,8 @@ MESSAGE - The human-readable error that may include a decoding of the `DATA` fie #### Add RIP-7560 support for all remaining transaction-level RPC APIs -This includes the following APIs: `eth_sendTransaction`, `eth_sendRawTransaction`, `eth_getTransactionByHash`, `eth_getTransactionByBlockHashAndIndex`, +This includes the following APIs: `eth_sendTransaction`, `eth_sendRawTransaction`, `eth_getTransactionByHash`, +`eth_getTransactionByBlockHashAndIndex`, `eth_getTransactionByBlockNumberAndIndex`. These methods have a very similar purpose and should support returning the new transaction type object. @@ -161,7 +154,7 @@ If it fails to find such a value, returns an error message with the detailed des Parameters: -1. OBJECT - The RIP-7560 transaction object (as defined in `eth_signRip7560Transaction`). +1. OBJECT - The RIP-7560 transaction object. The `validationGasLimit`, paymasterValidationGasLimit, `paymasterGasLimit` and `callGasLimit` fields are optional. 2. QUANTITY | TAG - integer block number, or the string "latest", "earliest", "pending", "safe" or "finalized" 3. OBJECT - State override set @@ -205,67 +198,15 @@ defined in the [ERC-7562](https://eips.ethereum.org/EIPS/eip-7562). Parameters: -1. OBJECT - The RIP-7560 transaction object (as defined in `eth_signRip7560Transaction`). +1. OBJECT - The RIP-7560 transaction object. 2. QUANTITY | TAG - a block number, or the string "earliest", "latest", "pending", "safe" or "finalized", as in the default block parameter. Returns: -1. OBJECT - the tracing result of executing the entire validation phase of the RIP-7560 transaction. - -Example of the tracing result JSON response: - -```json -{ - "callsFromEntryPoint": [ - { - "topLevelTargetAddress": "
", - "access": { - "
": { - "reads": { - "slot": "value" - }, - "writes": { - "slot": "value" - }, - "transientReads": {}, - "transientWrites": {} - } - }, - "opcodes": { - "": "" - }, - "contractSize": { - "
": { - "contractSize": 0, - "opcode": "CALL" - } - }, - "calls": [ - { - "type": "CALL", - "from": "
", - "to": "
", - "method": "0x", - "value": "0x0", - "gas": 2000000, - "gasUsed": 0, - "data": "" - } - ], - "logs": [ - { - "data": "", - "topic": [ - "" - ] - } - ] - } - ] -} - -``` +1. OBJECT - the tracing result of executing the entire validation phase of the RIP-7560 transaction.\ +The exact shape of the returned object is not strictly defined by this standard and can be decided +by different implementation. ### Error Codes From 7430b1e1d2624b0b6fb2074136c0b5fa64ba91a7 Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Thu, 15 Aug 2024 14:55:29 +0200 Subject: [PATCH 12/27] Remove 'validationLogsBloom' field --- ERCS/erc-xxxx.md | 1 - 1 file changed, 1 deletion(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 9e245e220d..9084861a5b 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -88,7 +88,6 @@ Fields specific to an RIP-7560 transaction receipt: | postOpStatus | QUANTITY | 1 (success), 0 (failure), or `null` (did not run) status of the `postOp` frame | | postOpGasUsed | QUANTITY | The amount of gas actually used by the paymaster `postOp` frame | | validationLogs | ARRAY | Array of log objects, which this transaction'S VALIDATION FRAME generated. | -| validationLogsBloom | DATA, 256 Bytes | Array of log objects, which this transaction'S VALIDATION FRAME generated. | Continued, these fields are shared by all transaction types: From ad1327fad86796e46862571219756c1bc8a97164 Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Thu, 15 Aug 2024 15:14:19 +0200 Subject: [PATCH 13/27] Update ERCS/erc-xxxx.md Co-authored-by: Dror Tirosh --- ERCS/erc-xxxx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 9084861a5b..99d92ce793 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -61,7 +61,7 @@ The following table represents a full list of fields of an RIP-7560 transaction: ### Changes to the JSON-RPC API -#### Add RIP-7560 support for `eth_getTransactionReceipt` +#### Changes to `eth_getTransactionReceipt` For an RIP-7560 transaction included in a block, return also the values specific to this transaction type in addition to all the existing fields. From 060e251ef1ca59dae07c54c1cbc7e9d4df85062e Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Thu, 15 Aug 2024 15:25:10 +0200 Subject: [PATCH 14/27] Remove title & nesting levels --- ERCS/erc-xxxx.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 99d92ce793..dca5d0b4cc 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -59,9 +59,7 @@ The following table represents a full list of fields of an RIP-7560 transaction: | EIP-7702 authorizations (WIP) | ARRAY | An EIP-7702 compatible list of contracts injected into EOAs | | signature | DATA | A signature of any kind used by Account to verify transaction | -### Changes to the JSON-RPC API - -#### Changes to `eth_getTransactionReceipt` +### Add RIP-7560 support for `eth_getTransactionReceipt` For an RIP-7560 transaction included in a block, return also the values specific to this transaction type in addition to all the existing fields. @@ -106,7 +104,7 @@ Continued, these fields are shared by all transaction types: | type | QUANTITY | Integer of the transaction type | | status | QUANTITY | Either 1 (success) or 0 (failure) status of the execution frame | -#### Create a new JSON-RPC API method `eth_executeRip7560Transaction` +### Create a new JSON-RPC API method `eth_executeRip7560Transaction` Executes the entire RIP-7560 transaction in memory without broadcasting it or including it in a block. Does not require the transaction to be properly signed, meaning it continues execution after either an account @@ -132,7 +130,7 @@ DATA - The revert data of the first reverted frame. CODE - The error code indicating the type of error, which may include the entity that caused the revert on-chain. MESSAGE - The human-readable error that may include a decoding of the `DATA` field if possible. -#### Add RIP-7560 support for all remaining transaction-level RPC APIs +### Add RIP-7560 support for all remaining transaction-level RPC APIs This includes the following APIs: `eth_sendTransaction`, `eth_sendRawTransaction`, `eth_getTransactionByHash`, `eth_getTransactionByBlockHashAndIndex`, @@ -142,7 +140,7 @@ These methods have a very similar purpose and should support returning the new t Note that the "transaction index position" is determined by the position of the transaction's **validation frame**. -#### Create a new JSON-RPC API method `eth_estimateRip7560TransactionGas` +### Create a new JSON-RPC API method `eth_estimateRip7560TransactionGas` Performs a search for gas limit values required to make each of the frames of the RIP-7560 transaction execute successfully and without running out of gas. @@ -179,7 +177,7 @@ DATA - The revert data of the first reverted frame. CODE - The error code indicating the type of error, which may include the entity that caused the revert on-chain. MESSAGE - The human-readable error that may include a decoding of the `DATA` field if possible. -##### Notes on implementation details +#### Notes on implementation details As mentioned in the RIP-7560, the `sender` and `paymaster` contracts should not revert on the validation failure and should make calls to `sigFailAccount` and `sigFailPaymaster` respectively @@ -188,7 +186,7 @@ in order to support `eth_estimateRip7560TransactionGas`. The recommended way to achieve this behavior for Smart Contract Accounts and Paymasters is to compare the `signature` parameter to a predetermined "dummy signature" and to call a `sigFail` callback in case the values match. -#### Create a new JSON-RPC API method `eth_traceRip7560Validation` +### Create a new JSON-RPC API method `eth_traceRip7560Validation` Only executes the validation phase of the RIP-7560 transaction and returns the tracing results of this execution. This is done in order to allow other clients to determine From d3b30f2928827867743e343630285b7d783bca0c Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Thu, 15 Aug 2024 15:30:07 +0200 Subject: [PATCH 15/27] Address PR comments --- ERCS/erc-xxxx.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index dca5d0b4cc..4acfb0fa73 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -111,6 +111,8 @@ Does not require the transaction to be properly signed, meaning it continues exe or a paymaster contract make a `sigFailAccount` or `sigFailPaymaster` call. If all frames execute successfully, simply returns the data returned by the top level frame of the execution phase. If any of the validation or execution frames revers, returns an error object containing the revert message. +Note that unlike `eth_call`, RIP-7560 transaction depends on its deployment and validation, +so it can't be called in isolation from its deployment and validation If the transaction validation fails for any reason other than the failed signature check, returns an error object containing the details of the validation failure. @@ -208,13 +210,13 @@ by different implementation. ### Error Codes * code: -32500 - transaction validation failed by `sender`. - The message field SHOULD be set to the revert message from the `sender`. + The message field SHOULD be set to the revert message and data from the `sender`. * code: -32501 - transaction validation failed by `paymaster`. - The message field SHOULD be set to the revert message from the `paymaster`. + The message field SHOULD be set to the revert message and data from the `paymaster`. * code: -32502 - transaction validation failed by `deployer` - The message field SHOULD be set to the revert message from the `deployer`. + The message field SHOULD be set to the revert message and data from the `deployer`. * code: -32503 - Transaction out of time range. The message field SHOULD include the requested time range and the current block timestamp. From 508a43a63fa09dd808e647195e5301d6a8343043 Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Mon, 19 Aug 2024 13:17:55 +0200 Subject: [PATCH 16/27] Update ERCS/erc-xxxx.md Co-authored-by: Yoav Weiss --- ERCS/erc-xxxx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 4acfb0fa73..73e8c8c26a 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -110,7 +110,7 @@ Executes the entire RIP-7560 transaction in memory without broadcasting it or in Does not require the transaction to be properly signed, meaning it continues execution after either an account or a paymaster contract make a `sigFailAccount` or `sigFailPaymaster` call. If all frames execute successfully, simply returns the data returned by the top level frame of the execution phase. -If any of the validation or execution frames revers, returns an error object containing the revert message. +If any of the validation or execution frames reverts, returns an error object containing the revert message. Note that unlike `eth_call`, RIP-7560 transaction depends on its deployment and validation, so it can't be called in isolation from its deployment and validation If the transaction validation fails for any reason other than the failed signature check, From 8c1858736f642d9914979269582ec76b272fbad9 Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Mon, 19 Aug 2024 17:49:14 +0200 Subject: [PATCH 17/27] AA-419: Rename parameters --- ERCS/erc-xxxx.md | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 73e8c8c26a..7d1c152fb7 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -22,7 +22,7 @@ for the Native Account Abstraction ecosystem to implement these APIs in a standa ## Motivation -Native Account Abstraction is expected to supersede [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) +Native Account Abstraction is expected to improve upon [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) by making all the benefits of Account Abstraction a core part of the protocol, bringing down the cost for the users, enabling easy migration to post-quantum cryptography and eventually deprecation of Externally Owned Accounts altogether. @@ -46,7 +46,7 @@ The following table represents a full list of fields of an RIP-7560 transaction: | deployerData | DATA | Data that is provided to the Deployer contract | | paymaster | DATA, 20 Bytes | Address of the Paymaster contract | | paymasterData | DATA | Data that is provided to the Paymaster contract | -| callData | DATA | Data that is provided to the Account contract for execution | +| executionData | DATA | Data that is provided to the Account contract for execution | | nonce | QUANTITY | A 256 bit nonce. Use of `nonce > 2^64` is defined in RIP-7712 | | builderFee | QUANTITY | Value passed from sender or paymaster to the `coinbase` | | maxPriorityFeePerGas | QUANTITY | The maximum gas price to be included as a tip to the validator | @@ -57,7 +57,7 @@ The following table represents a full list of fields of an RIP-7560 transaction: | callGasLimit | QUANTITY | Gas provided for the transaction execution frame | | accessList | OBJECT | An EIP-2930 compatible Access List structure | | EIP-7702 authorizations (WIP) | ARRAY | An EIP-7702 compatible list of contracts injected into EOAs | -| signature | DATA | A signature of any kind used by Account to verify transaction | +| authorizationData | DATA | Data that will be used by the Account to verify transaction | ### Add RIP-7560 support for `eth_getTransactionReceipt` @@ -74,18 +74,18 @@ Returns: Fields specific to an RIP-7560 transaction receipt: -| Name | Type | Description | -|----------------------------|-----------------|--------------------------------------------------------------------------------| -| sender | DATA, 20 Bytes | Address of the sender of this transaction | -| paymaster | DATA, 20 Bytes | Address of the Paymaster if it is paying for the transaction, `null` otherwise | -| deployer | DATA, 20 Bytes | Address of the Deployer if it is included in the transaction, `null` otherwise | -| senderCreationGasUsed | QUANTITY | The amount of gas actually used by the sender deployment frame | -| senderValidationGasUsed | QUANTITY | The amount of gas actually used by the sender validation frame | -| paymasterValidationGasUsed | QUANTITY | The amount of gas actually used by the paymaster validation frame | -| executionGasUsed | QUANTITY | The amount of gas actually used by the execution frame | -| postOpStatus | QUANTITY | 1 (success), 0 (failure), or `null` (did not run) status of the `postOp` frame | -| postOpGasUsed | QUANTITY | The amount of gas actually used by the paymaster `postOp` frame | -| validationLogs | ARRAY | Array of log objects, which this transaction'S VALIDATION FRAME generated. | +| Name | Type | Description | +|----------------------------|----------------|--------------------------------------------------------------------------------| +| sender | DATA, 20 Bytes | Address of the sender of this transaction | +| paymaster | DATA, 20 Bytes | Address of the Paymaster if it is paying for the transaction, `null` otherwise | +| deployer | DATA, 20 Bytes | Address of the Deployer if it is included in the transaction, `null` otherwise | +| senderCreationGasUsed | QUANTITY | The amount of gas actually used by the sender deployment frame | +| senderValidationGasUsed | QUANTITY | The amount of gas actually used by the sender validation frame | +| paymasterValidationGasUsed | QUANTITY | The amount of gas actually used by the paymaster validation frame | +| executionGasUsed | QUANTITY | The amount of gas actually used by the execution frame | +| postOpStatus | QUANTITY | 1 (success), 0 (failure), or `null` (did not run) status of the `postOp` frame | +| postOpGasUsed | QUANTITY | The amount of gas actually used by the paymaster `postOp` frame | +| validationLogs | ARRAY | Array of log objects, which this transaction'S VALIDATION FRAME generated. | Continued, these fields are shared by all transaction types: @@ -113,13 +113,13 @@ If all frames execute successfully, simply returns the data returned by the top If any of the validation or execution frames reverts, returns an error object containing the revert message. Note that unlike `eth_call`, RIP-7560 transaction depends on its deployment and validation, so it can't be called in isolation from its deployment and validation -If the transaction validation fails for any reason other than the failed signature check, +If the transaction validation fails for any reason other than the failed `authorizationData` check, returns an error object containing the details of the validation failure. Parameters: 1. OBJECT - The RIP-7560 transaction object. - The `signature` field is optional. + The `authorizationData` field is optional. 2. QUANTITY | TAG - integer block number, or the string "latest", "earliest", "pending", "safe" or "finalized" Returns: @@ -185,8 +185,9 @@ As mentioned in the RIP-7560, the `sender` and `paymaster` contracts should not and should make calls to `sigFailAccount` and `sigFailPaymaster` respectively in order to support `eth_estimateRip7560TransactionGas`. -The recommended way to achieve this behavior for Smart Contract Accounts and Paymasters is to compare the `signature` -parameter to a predetermined "dummy signature" and to call a `sigFail` callback in case the values match. +The recommended way to achieve this behavior for Smart Contract Accounts and Paymasters is to compare the +`authorizationData` +parameter to a predetermined "dummy" and to call a `sigFail` callback in case the values match. ### Create a new JSON-RPC API method `eth_traceRip7560Validation` @@ -204,8 +205,8 @@ Parameters: Returns: 1. OBJECT - the tracing result of executing the entire validation phase of the RIP-7560 transaction.\ -The exact shape of the returned object is not strictly defined by this standard and can be decided -by different implementation. + The exact shape of the returned object is not strictly defined by this standard and can be decided + by different implementation. ### Error Codes @@ -235,7 +236,7 @@ It seems like the difference between these transaction types warrants a separate The RPC API methods standard described in this document does not have any consequences for the security of the Native Account Abstraction ecosystem. -The implementations of these APIs, especially the ones related to generating a `signature` for a transaction, +The implementations of these APIs, especially the ones related to generating an `authorizationData` for a transaction, must be extremely careful when handling the Smart Contract Accounts' credentials. ## Copyright From e4726c2929adb554b555382836de76f616265b01 Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Sun, 8 Sep 2024 12:46:00 +0200 Subject: [PATCH 18/27] Remove unnecessary 'contractAddress' field --- ERCS/erc-xxxx.md | 1 - 1 file changed, 1 deletion(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 7d1c152fb7..93ba1d5628 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -98,7 +98,6 @@ Continued, these fields are shared by all transaction types: | cumulativeGasUsed | QUANTITY | The total amount of gas used when this transaction was executed in the block. | | effectiveGasPrice | QUANTITY | The sum of the base fee and tip paid per unit of gas. | | gasUsed | QUANTITY | The amount of gas used by this specific transaction alone. | -| contractAddress | DATA, 20 Bytes | The contract address created, if the transaction was a contract creation, otherwise `null` | | logs | ARRAY | Array of log objects, which this transaction'S EXECUTION FRAME generated. | | logsBloom | DATA, 256 Bytes | Bloom filter for light clients to quickly retrieve related logs. | | type | QUANTITY | Integer of the transaction type | From 8cf51dd98cd7645088e6d93bfc08edbab69190d0 Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Tue, 10 Sep 2024 15:08:22 +0200 Subject: [PATCH 19/27] Explain fields optionality --- ERCS/erc-xxxx.md | 74 ++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 93ba1d5628..60023b3fb4 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -39,25 +39,25 @@ We define the following changes to the Ethereum JSON-RPC API: The following table represents a full list of fields of an RIP-7560 transaction: -| Name | Type | Description | -|-------------------------------|----------------|----------------------------------------------------------------| -| sender | DATA, 20 Bytes | Address of the Smart Contract Account making the transaction | -| deployer | DATA, 20 Bytes | Address of the Deployer - account factory contract | -| deployerData | DATA | Data that is provided to the Deployer contract | -| paymaster | DATA, 20 Bytes | Address of the Paymaster contract | -| paymasterData | DATA | Data that is provided to the Paymaster contract | -| executionData | DATA | Data that is provided to the Account contract for execution | -| nonce | QUANTITY | A 256 bit nonce. Use of `nonce > 2^64` is defined in RIP-7712 | -| builderFee | QUANTITY | Value passed from sender or paymaster to the `coinbase` | -| maxPriorityFeePerGas | QUANTITY | The maximum gas price to be included as a tip to the validator | -| maxFeePerGas | QUANTITY | The maximum fee per unit of gas | -| validationGasLimit | QUANTITY | Gas provided for the transaction account validation frame | -| paymasterValidationGasLimit | QUANTITY | Gas provided for the transaction paymaster validation frame | -| paymasterPostOpGasLimit | QUANTITY | Gas provided for the transaction paymaster `postOp` frame | -| callGasLimit | QUANTITY | Gas provided for the transaction execution frame | -| accessList | OBJECT | An EIP-2930 compatible Access List structure | -| EIP-7702 authorizations (WIP) | ARRAY | An EIP-7702 compatible list of contracts injected into EOAs | -| authorizationData | DATA | Data that will be used by the Account to verify transaction | +| Name | Type | Description | +|-------------------------------|----------------|-------------------------------------------------------------------------------------| +| sender | DATA, 20 Bytes | Address of the Smart Contract Account making the transaction | +| deployer | DATA, 20 Bytes | Address of the Deployer - account factory contract (optional) | +| deployerData | DATA | Data that is provided to the Deployer contract (if `deployer` is set) | +| paymaster | DATA, 20 Bytes | Address of the Paymaster contract (optional) | +| paymasterData | DATA | Data that is provided to the Paymaster contract (if `paymaster` is set) | +| executionData | DATA | Data that is provided to the Account contract for execution | +| nonce | QUANTITY | A 256 bit nonce. Use of `nonce > 2^64` is defined in RIP-7712 | +| builderFee | QUANTITY | Value passed from sender or paymaster to the `coinbase` | +| maxPriorityFeePerGas | QUANTITY | The maximum gas price to be included as a tip to the validator | +| maxFeePerGas | QUANTITY | The maximum fee per unit of gas | +| validationGasLimit | QUANTITY | Gas provided for the transaction account validation frame | +| paymasterValidationGasLimit | QUANTITY | Gas provided for the transaction paymaster validation frame (if `paymaster` is set) | +| paymasterPostOpGasLimit | QUANTITY | Gas provided for the transaction paymaster `postOp` frame (if `paymaster` is set) | +| callGasLimit | QUANTITY | Gas provided for the transaction execution frame | +| accessList | OBJECT | An EIP-2930 compatible Access List structure | +| EIP-7702 authorizations (WIP) | ARRAY | An EIP-7702 compatible list of contracts injected into EOAs | +| authorizationData | DATA | Data that will be used by the Account to verify transaction | ### Add RIP-7560 support for `eth_getTransactionReceipt` @@ -74,18 +74,18 @@ Returns: Fields specific to an RIP-7560 transaction receipt: -| Name | Type | Description | -|----------------------------|----------------|--------------------------------------------------------------------------------| -| sender | DATA, 20 Bytes | Address of the sender of this transaction | -| paymaster | DATA, 20 Bytes | Address of the Paymaster if it is paying for the transaction, `null` otherwise | -| deployer | DATA, 20 Bytes | Address of the Deployer if it is included in the transaction, `null` otherwise | -| senderCreationGasUsed | QUANTITY | The amount of gas actually used by the sender deployment frame | -| senderValidationGasUsed | QUANTITY | The amount of gas actually used by the sender validation frame | -| paymasterValidationGasUsed | QUANTITY | The amount of gas actually used by the paymaster validation frame | -| executionGasUsed | QUANTITY | The amount of gas actually used by the execution frame | -| postOpStatus | QUANTITY | 1 (success), 0 (failure), or `null` (did not run) status of the `postOp` frame | -| postOpGasUsed | QUANTITY | The amount of gas actually used by the paymaster `postOp` frame | -| validationLogs | ARRAY | Array of log objects, which this transaction'S VALIDATION FRAME generated. | +| Name | Type | Description | +|----------------------------|----------------|--------------------------------------------------------------------------------------------------| +| sender | DATA, 20 Bytes | Address of the sender of this transaction | +| paymaster | DATA, 20 Bytes | Address of the Paymaster if it is paying for the transaction, `null` otherwise | +| deployer | DATA, 20 Bytes | Address of the Deployer if it is included in the transaction, `null` otherwise | +| senderCreationGasUsed | QUANTITY | The amount of gas actually used by the sender deployment frame, or zero if frame not executed | +| senderValidationGasUsed | QUANTITY | The amount of gas actually used by the sender validation frame | +| paymasterValidationGasUsed | QUANTITY | The amount of gas actually used by the paymaster validation frame, or zero if frame not executed | +| executionGasUsed | QUANTITY | The amount of gas actually used by the execution frame | +| postOpGasUsed | QUANTITY | The amount of gas actually used by the paymaster `postOp` frame, or zero if frame not executed | +| postOpStatus | QUANTITY | 1 (success), 0 (failure), or `null` (did not run) status of the `postOp` frame | +| validationLogs | ARRAY | Array of log objects, which this transaction'S VALIDATION FRAME generated. | Continued, these fields are shared by all transaction types: @@ -165,12 +165,12 @@ Returns: 1. Object -| Name | Type | -|-----------------------------|----------| -| validationGasLimit | QUANTITY | -| paymasterValidationGasLimit | QUANTITY | -| paymasterPostOpGasLimit | QUANTITY | -| callGasLimit | QUANTITY | +| Name | Type | Comment | +|-----------------------------|----------|-----------------------------------------| +| validationGasLimit | QUANTITY | | +| paymasterValidationGasLimit | QUANTITY | if `paymaster` is set, `null` otherwise | +| paymasterPostOpGasLimit | QUANTITY | if `paymaster` is set, `null` otherwise | +| callGasLimit | QUANTITY | | Error: From fff8372236f7317cedda12f300c0d6ed70d325d5 Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Tue, 10 Sep 2024 15:33:10 +0200 Subject: [PATCH 20/27] Remove 'status', add 'executionStatus' --- ERCS/erc-xxxx.md | 49 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 60023b3fb4..1a1a550f0c 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -74,34 +74,33 @@ Returns: Fields specific to an RIP-7560 transaction receipt: -| Name | Type | Description | -|----------------------------|----------------|--------------------------------------------------------------------------------------------------| -| sender | DATA, 20 Bytes | Address of the sender of this transaction | -| paymaster | DATA, 20 Bytes | Address of the Paymaster if it is paying for the transaction, `null` otherwise | -| deployer | DATA, 20 Bytes | Address of the Deployer if it is included in the transaction, `null` otherwise | -| senderCreationGasUsed | QUANTITY | The amount of gas actually used by the sender deployment frame, or zero if frame not executed | -| senderValidationGasUsed | QUANTITY | The amount of gas actually used by the sender validation frame | -| paymasterValidationGasUsed | QUANTITY | The amount of gas actually used by the paymaster validation frame, or zero if frame not executed | -| executionGasUsed | QUANTITY | The amount of gas actually used by the execution frame | -| postOpGasUsed | QUANTITY | The amount of gas actually used by the paymaster `postOp` frame, or zero if frame not executed | -| postOpStatus | QUANTITY | 1 (success), 0 (failure), or `null` (did not run) status of the `postOp` frame | -| validationLogs | ARRAY | Array of log objects, which this transaction'S VALIDATION FRAME generated. | +| Name | Type | Description | +|----------------------------|----------------|------------------------------------------------------------------------------------------------------------------------------------| +| sender | DATA, 20 Bytes | Address of the sender of this transaction | +| paymaster | DATA, 20 Bytes | Address of the Paymaster if it is paying for the transaction, `null` otherwise | +| deployer | DATA, 20 Bytes | Address of the Deployer if it is included in the transaction, `null` otherwise | +| senderCreationGasUsed | QUANTITY | The amount of gas actually used by the sender deployment frame, or zero if frame not executed | +| senderValidationGasUsed | QUANTITY | The amount of gas actually used by the sender validation frame | +| paymasterValidationGasUsed | QUANTITY | The amount of gas actually used by the paymaster validation frame, or zero if frame not executed | +| executionGasUsed | QUANTITY | The amount of gas actually used by the execution frame | +| postOpGasUsed | QUANTITY | The amount of gas actually used by the paymaster `postOp` frame, or zero if frame not executed | +| executionStatus | QUANTITY | 0 (success), 1 (execution reverted), 2 (`postOp` reverted), 3 (both execution and `postOp` reverted) status of the execution frame | +| validationLogs | ARRAY | Array of log objects, which this transaction'S VALIDATION FRAME generated. | Continued, these fields are shared by all transaction types: -| Name | Type | Value | -|-------------------|-----------------|--------------------------------------------------------------------------------------------| -| transactionHash | DATA, 32 Bytes | Hash of the transaction. | -| transactionIndex | QUANTITY | Integer of the transactions index position in the block. | -| blockHash | DATA, 32 Bytes | Hash of the block where this transaction was in. | -| blockNumber | QUANTITY | Block number where this transaction was in. | -| cumulativeGasUsed | QUANTITY | The total amount of gas used when this transaction was executed in the block. | -| effectiveGasPrice | QUANTITY | The sum of the base fee and tip paid per unit of gas. | -| gasUsed | QUANTITY | The amount of gas used by this specific transaction alone. | -| logs | ARRAY | Array of log objects, which this transaction'S EXECUTION FRAME generated. | -| logsBloom | DATA, 256 Bytes | Bloom filter for light clients to quickly retrieve related logs. | -| type | QUANTITY | Integer of the transaction type | -| status | QUANTITY | Either 1 (success) or 0 (failure) status of the execution frame | +| Name | Type | Value | +|-------------------|-----------------|-------------------------------------------------------------------------------| +| transactionHash | DATA, 32 Bytes | Hash of the transaction. | +| transactionIndex | QUANTITY | Integer of the transactions index position in the block. | +| blockHash | DATA, 32 Bytes | Hash of the block where this transaction was in. | +| blockNumber | QUANTITY | Block number where this transaction was in. | +| cumulativeGasUsed | QUANTITY | The total amount of gas used when this transaction was executed in the block. | +| effectiveGasPrice | QUANTITY | The sum of the base fee and tip paid per unit of gas. | +| gasUsed | QUANTITY | The amount of gas used by this specific transaction alone. | +| logs | ARRAY | Array of log objects, which this transaction'S EXECUTION FRAME generated. | +| logsBloom | DATA, 256 Bytes | Bloom filter for light clients to quickly retrieve related logs. | +| type | QUANTITY | Integer of the transaction type | ### Create a new JSON-RPC API method `eth_executeRip7560Transaction` From 6d6ff4317565b9b4d030e268df0251945875c228 Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Tue, 10 Sep 2024 15:37:58 +0200 Subject: [PATCH 21/27] Mmove the `eth_getTransactionReceipt` description to core RIP-7560 --- ERCS/erc-xxxx.md | 49 +++++------------------------------------------- 1 file changed, 5 insertions(+), 44 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 1a1a550f0c..8b6cdfdb09 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -59,49 +59,6 @@ The following table represents a full list of fields of an RIP-7560 transaction: | EIP-7702 authorizations (WIP) | ARRAY | An EIP-7702 compatible list of contracts injected into EOAs | | authorizationData | DATA | Data that will be used by the Account to verify transaction | -### Add RIP-7560 support for `eth_getTransactionReceipt` - -For an RIP-7560 transaction included in a block, return also the values specific to this transaction type -in addition to all the existing fields. - -Parameters: - -1. DATA, 32 Bytes - hash of a transaction - -Returns: - -1. OBJECT - A transaction receipt object, or `null` when no receipt was found: - -Fields specific to an RIP-7560 transaction receipt: - -| Name | Type | Description | -|----------------------------|----------------|------------------------------------------------------------------------------------------------------------------------------------| -| sender | DATA, 20 Bytes | Address of the sender of this transaction | -| paymaster | DATA, 20 Bytes | Address of the Paymaster if it is paying for the transaction, `null` otherwise | -| deployer | DATA, 20 Bytes | Address of the Deployer if it is included in the transaction, `null` otherwise | -| senderCreationGasUsed | QUANTITY | The amount of gas actually used by the sender deployment frame, or zero if frame not executed | -| senderValidationGasUsed | QUANTITY | The amount of gas actually used by the sender validation frame | -| paymasterValidationGasUsed | QUANTITY | The amount of gas actually used by the paymaster validation frame, or zero if frame not executed | -| executionGasUsed | QUANTITY | The amount of gas actually used by the execution frame | -| postOpGasUsed | QUANTITY | The amount of gas actually used by the paymaster `postOp` frame, or zero if frame not executed | -| executionStatus | QUANTITY | 0 (success), 1 (execution reverted), 2 (`postOp` reverted), 3 (both execution and `postOp` reverted) status of the execution frame | -| validationLogs | ARRAY | Array of log objects, which this transaction'S VALIDATION FRAME generated. | - -Continued, these fields are shared by all transaction types: - -| Name | Type | Value | -|-------------------|-----------------|-------------------------------------------------------------------------------| -| transactionHash | DATA, 32 Bytes | Hash of the transaction. | -| transactionIndex | QUANTITY | Integer of the transactions index position in the block. | -| blockHash | DATA, 32 Bytes | Hash of the block where this transaction was in. | -| blockNumber | QUANTITY | Block number where this transaction was in. | -| cumulativeGasUsed | QUANTITY | The total amount of gas used when this transaction was executed in the block. | -| effectiveGasPrice | QUANTITY | The sum of the base fee and tip paid per unit of gas. | -| gasUsed | QUANTITY | The amount of gas used by this specific transaction alone. | -| logs | ARRAY | Array of log objects, which this transaction'S EXECUTION FRAME generated. | -| logsBloom | DATA, 256 Bytes | Bloom filter for light clients to quickly retrieve related logs. | -| type | QUANTITY | Integer of the transaction type | - ### Create a new JSON-RPC API method `eth_executeRip7560Transaction` Executes the entire RIP-7560 transaction in memory without broadcasting it or including it in a block. @@ -132,7 +89,11 @@ MESSAGE - The human-readable error that may include a decoding of the `DATA` fie ### Add RIP-7560 support for all remaining transaction-level RPC APIs -This includes the following APIs: `eth_sendTransaction`, `eth_sendRawTransaction`, `eth_getTransactionByHash`, +This includes the following APIs: +`eth_sendTransaction`, +`eth_sendRawTransaction`, +`eth_getTransactionByHash`, +`eth_getTransactionReceipt`, `eth_getTransactionByBlockHashAndIndex`, `eth_getTransactionByBlockNumberAndIndex`. From 1e71ff2d81c07ae5e2690d704986187bd269f6f0 Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Tue, 10 Sep 2024 15:55:38 +0200 Subject: [PATCH 22/27] Remove transaction description table --- ERCS/erc-xxxx.md | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 8b6cdfdb09..1872d60c45 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -35,30 +35,6 @@ This document defines the API that the RIP-7560 compatible Ethereum nodes provid Wallet applications or advanced dapps. We define the following changes to the Ethereum JSON-RPC API: -### Definition of the RIP-7560 transaction type: - -The following table represents a full list of fields of an RIP-7560 transaction: - -| Name | Type | Description | -|-------------------------------|----------------|-------------------------------------------------------------------------------------| -| sender | DATA, 20 Bytes | Address of the Smart Contract Account making the transaction | -| deployer | DATA, 20 Bytes | Address of the Deployer - account factory contract (optional) | -| deployerData | DATA | Data that is provided to the Deployer contract (if `deployer` is set) | -| paymaster | DATA, 20 Bytes | Address of the Paymaster contract (optional) | -| paymasterData | DATA | Data that is provided to the Paymaster contract (if `paymaster` is set) | -| executionData | DATA | Data that is provided to the Account contract for execution | -| nonce | QUANTITY | A 256 bit nonce. Use of `nonce > 2^64` is defined in RIP-7712 | -| builderFee | QUANTITY | Value passed from sender or paymaster to the `coinbase` | -| maxPriorityFeePerGas | QUANTITY | The maximum gas price to be included as a tip to the validator | -| maxFeePerGas | QUANTITY | The maximum fee per unit of gas | -| validationGasLimit | QUANTITY | Gas provided for the transaction account validation frame | -| paymasterValidationGasLimit | QUANTITY | Gas provided for the transaction paymaster validation frame (if `paymaster` is set) | -| paymasterPostOpGasLimit | QUANTITY | Gas provided for the transaction paymaster `postOp` frame (if `paymaster` is set) | -| callGasLimit | QUANTITY | Gas provided for the transaction execution frame | -| accessList | OBJECT | An EIP-2930 compatible Access List structure | -| EIP-7702 authorizations (WIP) | ARRAY | An EIP-7702 compatible list of contracts injected into EOAs | -| authorizationData | DATA | Data that will be used by the Account to verify transaction | - ### Create a new JSON-RPC API method `eth_executeRip7560Transaction` Executes the entire RIP-7560 transaction in memory without broadcasting it or including it in a block. From 8b0a2a7fc1c9ac03d6d4d2ca23285fc145f9adc7 Mon Sep 17 00:00:00 2001 From: Dror Tirosh Date: Tue, 10 Sep 2024 16:57:16 +0300 Subject: [PATCH 23/27] update title Co-authored-by: shahafn --- ERCS/erc-xxxx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 1872d60c45..4d367efcc8 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -1,6 +1,6 @@ --- eip: xxxx -title: JSON-RPC API for RIP-7560 Native Account Abstraction +title: JSON-RPC Ethereum Client API for RIP-7560 Native Account Abstraction description: A set of JSON-RPC API methods that are required for a fully functional Native Account Abstraction protocol author: discussions-to: From 23855addfe652d50d6e1429351bc75a9c47e2e90 Mon Sep 17 00:00:00 2001 From: shahafn Date: Tue, 10 Sep 2024 17:00:56 +0300 Subject: [PATCH 24/27] Grammar --- ERCS/erc-xxxx.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 4d367efcc8..972b457f1b 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -16,7 +16,7 @@ requires: RIP-7560, ERC-7562, EIP-7702 [RIP-7560](https://github.com/ethereum/RIPs/blob/master/RIPS/rip-7560.md) defines the new transaction type and the modifications to the EVM needed for the Native Account Abstraction support. -However, there are a number of modifications to the Ethereum JSON-RPC API that is needed as well. +However, there are a number of modifications to the Ethereum JSON-RPC API that are needed as well. This proposal contains the full description of the new or modified APIs, and it would be highly beneficial for the Native Account Abstraction ecosystem to implement these APIs in a standardised and compatible way. @@ -27,7 +27,7 @@ by making all the benefits of Account Abstraction a core part of the protocol, b enabling easy migration to post-quantum cryptography and eventually deprecation of Externally Owned Accounts altogether. There are also some actions that are only applicable in the context of Native Account Abstraction, -which requires a creation of new JSON-RPC API methods. +which require a creation of new JSON-RPC API methods. ## Specification From 4eaf77af2f2c6bb1de8bcef0543a6b3c120815bc Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Tue, 10 Sep 2024 16:01:55 +0200 Subject: [PATCH 25/27] Rename to `eth_executeRip7560Transaction` to `eth_callRip7560Transaction` --- ERCS/erc-xxxx.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 972b457f1b..4ff0000462 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -35,9 +35,9 @@ This document defines the API that the RIP-7560 compatible Ethereum nodes provid Wallet applications or advanced dapps. We define the following changes to the Ethereum JSON-RPC API: -### Create a new JSON-RPC API method `eth_executeRip7560Transaction` +### Create a new JSON-RPC API method `eth_callRip7560Transaction` -Executes the entire RIP-7560 transaction in memory without broadcasting it or including it in a block. +Executes the entire RIP-7560 transaction **in memory** without broadcasting it or including it in a block. Does not require the transaction to be properly signed, meaning it continues execution after either an account or a paymaster contract make a `sigFailAccount` or `sigFailPaymaster` call. If all frames execute successfully, simply returns the data returned by the top level frame of the execution phase. From 8013ecfdcbec5026c93e1296fc25ec90c82666c6 Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Tue, 10 Sep 2024 16:03:10 +0200 Subject: [PATCH 26/27] Fix --- ERCS/erc-xxxx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 4ff0000462..c373f2eecc 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -159,7 +159,7 @@ Returns: ## Rationale -### Creating `eth_executeRip7560Transaction` instead of modifying `eth_call` +### Creating `eth_callRip7560Transaction` instead of modifying `eth_call` The semantics of the `eth_call` are currently very simple for all existing transaction types, and would become significantly more complex with the addition of the RIP-7560 transaction type support. From 237cd9ae287fb69aec9f122c06c92af795c0180d Mon Sep 17 00:00:00 2001 From: Dror Tirosh Date: Tue, 10 Sep 2024 17:12:18 +0300 Subject: [PATCH 27/27] update call return value --- ERCS/erc-xxxx.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index c373f2eecc..d4656d4ed8 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -55,7 +55,10 @@ Parameters: Returns: -DATA - The return value of the `sender` execution frame. +OBJECT: + data - the return value of the `sender` execution frame. + sigFail [optional] - account called "sigFailAccount" + sigFailPaymaster [optional] - paymaster called "sigFailPaymaster" Error: