Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Adjust codeHash explanation
Was a little confused about the purpose and value of codeHash in contract accounts versus externally-owned account after reading this for the first time, so i took a peek at the yellowpaper. the yellowpaper description was almost identical to these docs, but as someone totally unfamiliar with these concepts, the minor grammatical differences in the yellowpaper actually clarified a few things for me.
  • Loading branch information
mariahpickett authored Dec 1, 2021
commit 162e90c0becc6687c19945eefbd4df910cb7176b
6 changes: 3 additions & 3 deletions src/content/developers/docs/accounts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ Both account types have the ability to:

Ethereum accounts have four fields:

- `nonce` – a counter that indicates the number of transactions sent from the account. This ensures transactions are only processed once. In a contract account, this number represents the number of contracts created by the account
- `balance` – the number of wei owned by this address. Wei is a denomination of ETH and there are 1e+18 wei per ETH.
- `codeHash` – this hash refers to the _code_ of an account on the Ethereum virtual machine (EVM). Contract accounts have code fragments programmed in that can perform different operations. This EVM code gets executed if the account gets a message call. It cannot be changed unlike the other account fields. All such code fragments are contained in the state database under their corresponding hashes for later retrieval. This hash value is known as a codeHash. For externally owned accounts, the codeHash field is the hash of an empty string.
- `nonce` – A counter that indicates the number of transactions sent from the account. This ensures transactions are only processed once. In a contract account, this number represents the number of contracts created by the account
- `balance` – The number of wei owned by this address. Wei is a denomination of ETH and there are 1e+18 wei per ETH.
- `codeHash` – For externally-owned accounts, this field is the hash of an empty string. For contract accounts, this field is the hash of the Ethereum virtual machine (EVM) _code_ that gets executed if the account receives a message call. These code fragments can perform various operations, and they are contained in the state database under their corresponding hashes for later retrieval. Unlike all other account fields, the codeHash is immutable, meaning it cannot be modified after its creation.
- `storageRoot` – Sometimes known as a storage hash. A 256-bit hash of the root node of a Merkle Patricia trie that encodes the storage contents of the account (a mapping between 256-bit integer values), encoded into the trie as a mapping from the Keccak 256-bit hash of the 256-bit integer keys to the RLP-encoded 256-bit integer values. This trie encodes the hash of the storage contents of this account, and is empty by default.

![A diagram showing the make up of an account](./accounts.png)
Expand Down