Bitcoin is only a decentralized currency that’s it
When Eth came most of the minors not went to Eth thus not making it decentralize enough (this is called cold start problem) thus then Eth told come on to Eth such that i become decentralize and as I’m not only an decentralize currency, people can also build on me thus make me decentralize enough such that the coming generation cryptos can build on me
Eth uses ECC (elliptical curve cryptography) to generate public and private key pair and then it will again hash it with keccak-256 algorithm and bring it to 32 bytes and again in that it will only consider last 20 bytes and convert it into hexadecimal in shape of 0x{hexa decimal conversion of last 20 bytes}
1 dollar 100 cents in the same way 1 eth 10^18 wei and some times while in context of talking about gas in eth we use gwei which is 1 eth 10^9 gwei
In case of Solana it is 1 sol 10^9 lamports

If you’re a minor

If you mining Bitcoins then the power of your machine decides if you’re transaction block will pickup or not
In case of Ethereum the amount of Ethereum you can stake will decide if you’re transaction block will pickup or not

World State

World State in Ethereum is like a giant list that keeps track of the current situation for every account on the network. They are of two types

  1. Externally Owned Accounts (EOAs): These are the accounts that people control with their private keys—like personal wallets. It’s like a bank account send money, receive money and check balance that’s it. And the pin of the account is your private key
  2. Contract Accounts: These are accounts controlled by smart contracts instead of a private key.- Contract Accounts can’t start transactions on their own. They can only respond to incoming transactions from EOAs or other contracts. So, an EOA needs to interact with the Contract Account first to “wake it up”. Once they receive a transaction, they can execute functions, update internal data, or even interact with other contracts if programmed to do so.

The World State maps each account’s address (the unique identifier for each account) to its current state. Each account’s state includes details like:

  • Balance: How much ETH the account holds.
  • Storage: Any data stored in the account (especially for contract accounts).
  • Code: For contract accounts, this includes the actual code that the smart contract runs.
    Think of the World State as a spreadsheet where each row represents an account, and each column holds the current details about that account. Whenever a transaction happens, this spreadsheet updates with the new balances, data, and any other changes.
    So, the World State is the complete picture of what every account on Ethereum currently “looks like” at any given moment.
    Q where do the master “Ethereum World State Trie” is stored ?
    A Every full node in the Ethereum network holds a copy of the Ethereum state. It’s physically located in the storage (SSD or NVMe commonly) of any full node in the Ethereum network.

Eth as a State Machine

Ethereum is a state machine whose state changes as more blocks are added to the blockchain.
This means that Ethereum constantly updates its World State (the current situation of all accounts) whenever a new block of transactions is added.

  1. Nounce
AspectExternally Owned Account (EOA)Contract Account (Smart Contract)
Definition of NonceNumber of transactions sent by the EOANumber of contracts created by the account
PurposeEnsures unique transaction orderingEnsures unique contract addresses
IncrementingIncreases after each transactionIncreases after each contract creation
Used For- Preventing double-spending- Determining the address of newly created contracts
- Preventing replay attacks
- Ensuring transaction order
  1. Balance
  • EOAs: Your personal account where you directly manage your money, send and receive Ether, and pay fees from your balance.
  • Contract Accounts: A programmed account that holds Ether based on rules in the code. It can send and receive Ether according to those rules, but it doesn’t pay fees; the person using it does.
  1. Storage hash
    • Firstly storage, like a filing cabinet where each smart contract keeps its important information organized in drawers (key-value pairs)
    • next the Storage Hash, This is a summary page that gives a quick overview of all the contents in the filing cabinet, helping you know what’s stored without looking through each drawer. It also provides security, ensuring that any changes are detectable.
  2. Code hash
  • Smart contracts in Ethereum are written in high-level languages (like Solidity), but they are compiled into EVM bytecode for execution on the Ethereum Virtual Machine (EVM).
  • The code hash is a cryptographic hash (usually SHA3) of the contract’s bytecode. It uniquely identifies the code of the contract.
  • Once a smart contract is deployed on Ethereum, its code hash is permanently fixed unless the contract is destroyed

EVM

Solidity Code ---(compiled to)- Byte Code ---(will be run by)- EVM
Each part of the bytecode represents an opcode, which stands for “operation code.” Opcodes are the individual instructions that tell the EVM what to do. Examples of opcodes include basic operations like:

  • Arithmetic (e.g., addition or subtraction),
  • Data manipulation (e.g., storing and retrieving data),
  • Control flow (e.g., jump to different parts of the code based on conditions). Execution in the EVM: When a smart contract is deployed or executed, the EVM reads the bytecode one opcode at a time, following each instruction to carry out the actions coded in the smart contract. In simple terms, opcodes are like commands in a recipe for the EVM, telling it exactly what steps to take, one at a time, to carry out the smart contract’s functions. ABI(Application Binary Interface): Think of it as a translator between humans and smart contracts. It’s a JSON file that defines how to interact with a smart contract
// Basic structure of ABI's
[
  {
    "name": "transfer",
    "type": "function",
    "inputs": [
      {"name": "recipient", "type": "address"},
      {"name": "amount", "type": "uint256"}
    ],
    "outputs": [{"type": "bool"}]
  }
]
  • Smart contracts are deployed as bytecode (machine code)
  • Humans can’t read bytecode directly
  • ABIs tell applications how to format data correctly to interact with the contract

Ethereum Transaction Architecture

  • Transaction has many fields and each field is stored in the form of a Merkle tree
  • Merkle tree is a tree data structure, where the leaf nodes contain the hash of a block of data and the non-leaf nodes contain the hash of its children nodes.
  • In a Merkle tree, any change to the underlying data causes the hash of the node referring to the data to change. Since each parent node hash depends on the data of its children, any change to the data of a child node causes the parent hash to change. This happens to each parent node up to the root node. Therefore, any change to the data at the leaf nodes causes the root node hash to change. From this, we can derive two important properties:
  1. We don’t need to compare all the data across the leaf nodes to know if they have the same data. We can just compare the root node hash.
  2. If we want to prove that specific data is part of the tree, we can use a technique called Merkle proofs. We won’t dive into details here but it is an easy and effective way to prove that a piece of data is in the Merkle tree.

The first property is important because it makes it possible to store only a hash of the root node to represent the data at that point in time. This means we only need to store the root hash of the tree representing the block on the blockchain (as opposed to storing all the data in the blockchain) and still keep the data immutable.