# Some Basic Ethereum Foundational Topics I learnt this Week @Blockfuse Labs
## **1. Accounts in Ethereum**
In Ethereum accounts are like digital wallets that can hold ETH (Ethereum's currency) and interact with smart contracts
*There are two types of accounts in Ethereum:*
***1. Externally Owned Accounts (EOAs***)
Controlled by humans (like me and you)
access with private keys
Used to send ETH, deploy contracts
Example: You create a wallet with MetaMask that’s an EOA
- [ ] Think of it like your bank account you control it with your password (private key).
***2. Contract Accounts***
Controlled by smart contract code (not humans)
Has its own rules written in code
Can only act when triggered by an EOA or another contract
Example: A smart contract for an NFT or DeFi app
- [ ] Think of this like an automatic machine
## **2. Transaction in Ethereum**
A transaction in Ethereum is like sending a message or doing something on the blockchain
Just like sending airtime or cash with your phone in Ethereum, you send ETH or trigger actions with a transaction.
**What Can a Transaction Do?**
* Send ETH from one account to another
* Call a smart contract (e.g., buy an NFT, swap tokens)
* Deploy a new smart contract
* Trigger code execution in the Ethereum Virtual Machine (EVM)
#### Small highlight !!
1. Only Externally Owned Accounts (EOAs) can start a transaction.
2. Smart contracts (Contract Accounts) cannot start a transaction, but they can react to one.
## 3. Blocks in Ethereum
A block is like a container that holds a group of transactions
Imagine a receipt with many transactions listed that’s a block in Ethereum
***Why Are Blocks Important***
* They group transactions together
* They help keep the network in order
* They are linked together to form the blockchain (chain of blocks)
***How Blocks Are Created***
* People send transactions
* Transactions go into a pool (mempool)
* A validator picks some and puts them into a block
* The block is added to the blockchain
* Everyone updates their copy of Ethereum.
***Blocks Summary***
* Blocks hold transactions
* They are created by validators
* Each block links to the previous one forming the blockchain
* If a block changes the chain breaks that’s how Ethereum stays secure and trustworthy
## 4. Ethereum Virtual Machine (EVM)
The EVM is like the brain or engine of Ethereum
It runs all the smart contracts and transactions on the network,
It makes sure everything runs the same way on every system worldwide
***What Does the EVM Do?***
* Executes smart contract code
* Handles transactions
* Makes sure everyone sees the same result
* Keeps Ethereum secure and decentralized
***How EVM Works (Simple Flow)***
* You send a transaction to a smart contract
* The EVM reads the bytecode of that contract
* It uses opcodes (small instructions) to run the code
* It updates the state (balances, variables, etc.)
* Result is saved on the blockchain
## 5. Opcodes for the EVM
They are the tiny instructions the EVM understands and uses to run smart contracts
***What Are Opcodes Used For?***
* To tell the EVM what to do
* To execute smart contract logic
* To manage storage, memory, and math operations
* Every smart contract becomes opcodes after being compiled
***Some common opcodes***
| **Opcodes** | **What it doees** |
| -------- | -------- |
| PUSH | Push a value to the stack |
| POP | Removethe top Value |
| ADD | Add top 2 numbers |
| MUL | Multiply top 2 numbers |
| SSTORE | Save Value to contract |
| SLOAD | Load value from storage |
| JUMP | Go to a specific location in code |
| CALL | Call another contract |
***Come importance of opcodes***
* They are the real language of the EVM
* They make smart contracts run correctly
* Help developers optimize gas usage
* Used by tools like Etherscan to show contract internals
## **6.Gas and Fees**
In Ethereum Gas is like the fuel needed to run a transaction or smart contract
**And**
Fees are what you pay in ETH to use that gas.
Just like a car needs fuel to move Ethereum needs gas to process transactions.
#### Why Gas?
Every action on Ethereum (sending ETH, using a dApp, calling a smart contract) needs computing power
That power is not free you pay for it with gas.
#### How It Works
Each operation in the EVM (like ADD, SSTORE, CALL, etc.) has a fixed gas cost
The more complex the action, the more gas it uses.
***Example:***
You send a transaction:
Gas Used = 21,000
Gas Price = 50 gwei
Fee = 21,000 × 50 gwei = 1,050,000 gwei = 0.00105 ETH
Base Fee and Priority Fee (EIP-1559)
* ***Base Fee:*** Automatically set by the network based on demand
* ***Priority Fee (tip):*** Optional – helps your transaction get picked faster
***Summary***
* Gas is the fuel for running Ethereum transactions and smart contracts
* You pay fees in ETH based on how much gas your action uses
* Gas helps protect the network from spam and abuse
* More complex = more gas = more fees
## 7. Nodes and Clients
In Ethereum nodes are like computers that help keep the network running.
And clients are the software that these nodes use to talk to the Ethereum network.
***Think of Ethereum as a big team.***
- [ ] Nodes = team members
- [ ] Clients = the tools they use to work together
### 1. What Is a Node?
A node is any computer connected to the Ethereum network
It helps by:
* Keeping a copy of the blockchain
* Verifying transactions and blocks
* Sharing information with other nodes
* Running the EVM to process code
***There are different types of nodes:***
* Full Node
* Light Node
* Archive Node
* Validator Node
### 2. What Is a Client?
A client is the software that runs the Ethereum protocol (rules)
***Some importance of Node and client***
* Keep Ethereum decentralized
* Help process and verify every transaction
* Store the full history of Ethereum
* Let developers and dApps interact with the blockchain