-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Update EIP-1186: Fix broken link Merkle Tree Patricia #9889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| --- | ||
| eip: 1186 | ||
| title: RPC-Method to get Merkle Proofs - eth_getProof | ||
| author: Simon Jentzsch <[email protected]>, Christoph Jentzsch <[email protected]> | ||
|
Check warning on line 4 in EIPS/eip-1186.md
|
||
| discussions-to: https://github.com/ethereum/EIPs/issues/1186 | ||
| status: Stagnant | ||
| type: Standards Track | ||
|
|
@@ -9,22 +9,22 @@ | |
| created: 2018-06-24 | ||
| requires: 1474 | ||
| --- | ||
|
|
||
|
Check warning on line 12 in EIPS/eip-1186.md
|
||
| ## Simple Summary | ||
|
Check warning on line 13 in EIPS/eip-1186.md
|
||
|
|
||
| One of the great features of Ethereum is the fact, that you can verify all data of the state. But in order to allow verification of accounts outside the client, we need an additional function delivering us the required proof. These proofs are important to secure Layer2-Technologies. | ||
|
|
||
| ## Abstract | ||
|
|
||
| Ethereum uses a [Merkle Tree](https://github.com/ethereum/wiki/wiki/Patricia-Tree) to store the state of accounts and their storage. This allows verification of each value by simply creating a Merkle Proof. But currently, the standard RPC-Interface does not give you access to these proofs. This EIP suggests an additional RPC-Method, which creates Merkle Proofs for Accounts and Storage Values. | ||
| Ethereum uses a [Merkle Tree](https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/) to store the state of accounts and their storage. This allows verification of each value by simply creating a Merkle Proof. But currently, the standard RPC-Interface does not give you access to these proofs. This EIP suggests an additional RPC-Method, which creates Merkle Proofs for Accounts and Storage Values. | ||
|
Check warning on line 19 in EIPS/eip-1186.md
|
||
|
|
||
| Combined with a stateRoot (from the blockheader) it enables offline verification of any account or storage-value. This allows especially IOT-Devices or even mobile apps which are not able to run a light client to verify responses from an untrusted source only given a trusted blockhash. | ||
|
|
||
| ## Motivation | ||
|
|
||
| In order to create a MerkleProof access to the full state db is required. The current RPC-Methods allow an application to access single values (`eth_getBalance`,`eth_getTransactionCount`,`eth_getStorageAt`,`eth_getCode`), but it is impossible to read the data needed for a MerkleProof through the standard RPC-Interface. (There are implementations using leveldb and accessing the data via filesystems, but this can not be used for production systems since it requires the client to be stopped first - See https://github.com/zmitton/eth-proof) | ||
|
Check warning on line 25 in EIPS/eip-1186.md
|
||
|
|
||
| Today MerkleProofs are already used internally. For example, the [Light Client Protocol](https://github.com/zsfelfoldi/go-ethereum/wiki/Light-Ethereum-Subprotocol-%28LES%29#on-demand-data-retrieval) supports a function creating MerkleProof, which is used in order to verify the requested account or storage-data. | ||
|
Check warning on line 27 in EIPS/eip-1186.md
|
||
|
|
||
| Offering these already existing function through the RPC-Interface as well would enable Applications to store and send these proofs to devices which are not directly connected to the p2p-network and still are able to verify the data. This could be used to verify data in mobile applications or IOT-devices, which are currently only using a remote client. | ||
|
|
||
|
|
@@ -33,23 +33,23 @@ | |
|
|
||
| As Part of the eth-Module, an additional Method called `eth_getProof` should be defined as follows: | ||
|
|
||
| #### eth_getProof | ||
|
Check failure on line 36 in EIPS/eip-1186.md
|
||
|
|
||
| Returns the account- and storage-values of the specified account including the Merkle-proof. | ||
|
|
||
| ##### Parameters | ||
|
|
||
| 1. `DATA`, 20 Bytes - address of the account. | ||
| 2. `ARRAY`, 32 Bytes - array of storage-keys which should be proofed and included. See [`eth_getStorageAt`](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getstorageat) | ||
|
Check warning on line 43 in EIPS/eip-1186.md
|
||
| 3. `QUANTITY|TAG` - integer block number, or the string `"latest"` or `"earliest"`, see the [default block parameter](https://github.com/ethereum/wiki/wiki/JSON-RPC#the-default-block-parameter) | ||
|
Check warning on line 44 in EIPS/eip-1186.md
|
||
|
|
||
| ##### Returns | ||
|
|
||
| `Object` - A account object: | ||
|
|
||
| - `balance`: `QUANTITY` - the balance of the account. See [`eth_getBalance`](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getbalance) | ||
|
Check warning on line 50 in EIPS/eip-1186.md
|
||
| - `codeHash`: `DATA`, 32 Bytes - hash of the code of the account. For a simple Account without code it will return `"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"` | ||
| - `nonce`: `QUANTITY`, - nonce of the account. See [`eth_getTransactionCount`](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactioncount) | ||
|
Check warning on line 52 in EIPS/eip-1186.md
|
||
| - `storageHash`: `DATA`, 32 Bytes - SHA3 of the StorageRoot. All storage will deliver a MerkleProof starting with this rootHash. | ||
| - `accountProof`: `ARRAY` - Array of rlp-serialized MerkleTree-Nodes, starting with the stateRoot-Node, following the path of the SHA3 (address) as key. | ||
| - `storageProof`: `ARRAY` - Array of storage-entries as requested. Each entry is an object with these properties: | ||
|
|
@@ -134,5 +134,5 @@ | |
|
|
||
| TODO: Tests still need to be implemented, but the core function creating the proof already exists inside the clients and are well tested. | ||
|
|
||
| ## Copyright | ||
|
Check failure on line 137 in EIPS/eip-1186.md
|
||
| Copyright and related rights waived via [CC0](../LICENSE.md). | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Give access to me