Skip to content

Commit e65c6f1

Browse files
Update index.md
Added that the storage root of an ethereum account is empty Reference : https://ethereum.org/en/developers/docs/accounts/ ` This trie encodes the hash of the storage contents of this account, and is empty by default.`
1 parent d02ed0b commit e65c6f1

File tree

1 file changed

+5
-1
lines changed
  • src/content/developers/docs/data-structures-and-encoding/patricia-merkle-trie

1 file changed

+5
-1
lines changed

src/content/developers/docs/data-structures-and-encoding/patricia-merkle-trie/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,11 @@ From a block header there are 3 roots from 3 of these tries.
199199

200200
There is one global state trie, and it is updated every time a client processes a block. In it, a `path` is always: `keccak256(ethereumAddress)` and a `value` is always: `rlp(ethereumAccount)`. More specifically an ethereum `account` is a 4 item array of `[nonce,balance,storageRoot,codeHash]`. At this point, it's worth noting that this `storageRoot` is the root of another patricia trie:
201201

202+
203+
202204
### Storage Trie {#storage-trie}
203205

204-
Storage trie is where _all_ contract data lives. There is a separate storage trie for each account. To retrieve values at specific storage positions at a given address the storage address, integer position of the stored data in the storage, and the block ID are required. These can then be passed as arguments to the `eth_getStorageAt` defined in the JSON-RPC API, e.g. to retrieve the data in storage slot 0 for address `0x295a70b2de5e3953354a6a8344e616ed314d7251`:
206+
Storage trie is where _all_ contract data lives. There is a separate storage trie for each account. To retrieve values at specific storage positions at a given address the storage address, the integer position of the stored data in the storage, and the block ID are required. These can then be passed as arguments to the `eth_getStorageAt` defined in the JSON-RPC API, e.g. to retrieve the data in storage slot 0 for address `0x295a70b2de5e3953354a6a8344e616ed314d7251`:
205207

206208
```
207209
curl -X POST --data '{"jsonrpc":"2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' localhost:8545
@@ -233,6 +235,8 @@ curl -X POST --data '{"jsonrpc":"2.0", "method": "eth_getStorageAt", "params": [
233235
{"jsonrpc":"2.0","id":1,"result":"0x000000000000000000000000000000000000000000000000000000000000162e"}
234236
```
235237

238+
Note: The `storageRoot` for an Ethereum account is empty by default if it's not a contract account.
239+
236240
### Transactions Trie {#transaction-trie}
237241

238242
There is a separate transactions trie for every block, again storing `(key, value)` pairs. A path here is: `rlp(transactionIndex)` which represents the key that corresponds to a value determined by:

0 commit comments

Comments
 (0)