From b8f106c0777949cb2c9cc400ad959234c88824d3 Mon Sep 17 00:00:00 2001 From: Jet Hughes Date: Mon, 19 Dec 2022 14:24:11 +1300 Subject: [PATCH] vault backup: 2022-12-19 14:24:11 --- content/notes/ethereum.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/content/notes/ethereum.md b/content/notes/ethereum.md index 998423668..857bf6e76 100644 --- a/content/notes/ethereum.md +++ b/content/notes/ethereum.md @@ -52,4 +52,18 @@ Ethereum is a transaction based state machine. Activities such as transactions, contracts, and minig all change the state of the ethereum blockchain. -e.g., an accout balance (stored in the state trie) which changes every time a transac +Data like account balances are not stored in the blocks of the chain. only the root node hashes of the transaction trie, staet trie ad receipts trie are stoed directly in the chain. + +![](https://i.imgur.com/fIgNeUR.png) + +There are two **types of data** stored in Ethereum. _Permanent_ (e.g., a transaction recorded in the transaction trie) and _Ephemeral_ (e.g., an account balance stored in the state trie) data. + +## State Trie +contains a key and value pair for every account which exists on the eth network. The key is a 160 bit id. The value is the encoded details of an etherum account (nonce, balance, storageRoot, codeHash). + +The root node (a hash of the entire tree) is dependent on all internal state trie data. + +## Storage Trie +This is where the contract data lives. Each eth account has its own storage trie. this is stored as a hash of the storage trie's root node "storageRoot" in the global state trie + +## Transaction Trie