1/9
basic concepts
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
Ethereum account
entity with an ether (ETH) balance that can send messages on Ethereum. Two types; Externally-owned account(EOA) conrolled by private keys, Contract account, a smart contract deployed, controlled by code.
Account 4 fields
nonce, balance, codeHash,storageRoot
nonce
A counter that indicates the number of transactions sent from an externally-owned account or the number of contracts created by a contract account. Only one transaction with a given nonce can be executed for each account, protecting against replay attacks where signed transactions are repeatedly broadcast and re-executed.
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. immutable. All such code fragments are contained in the state database under their corresponding hashes for later retrieval.
if EOA , codeHash= ““;
storageRoot/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.
The public key is generated from …
the private key using the Elliptic Curve Digital Signature Algorithm. Last 20bytes of Keccak-256 hash of the public key and adding 0x to the beginning. so EOA has 42characcter address. Hexadecimal string
wallets
wallet is an interface or application that lets you interact with your Ethereum account. An account is not a wallet
hash function
A hash function is like a deterministic fingerprint of a piece of arbitrary data(that you put in in that transaction). It is also single-directional; It is very easy to compute and very hard to reverse.