# Blockchain Fundamentals ## 1. What Is Blockchain? A blockchain is a distributed, immutable ledger that records transactions in a chain of blocks, where each block is linked to the previous one using cryptographic hashes. ## 2. Decentralization Blockchain networks distribute control across multiple nodes (computers). Benefits: - No single point of failure - Greater resilience and trust - Users don’t need to trust a central authority ## 3. Blocks & Chains - Block: Contains a batch of transactions, timestamp, nonce, and the hash of the previous block. - Chain: Links all blocks together using cryptographic hashes. This structure makes tampering nearly impossible. Changing one block requires changing every subsequent block across all nodes. ## 4. Cryptography Blockchain relies heavily on cryptographic techniques like: Hashing: Converts data to a fixed-length string (e.g., SHA-256). Public-key cryptography: Every user has a public/private key pair for signing transactions securely. This ensures: - Data integrity (hashing) - User identity & ownership (digital signatures) ## 5. Consensus Mechanisms How do thousands of nodes agree on the current state of the blockchain? Through consensus algorithms, such as: #### Proof of Work (PoW) - Miners solve complex puzzles to validate transactions - Energy-intensive but highly secure #### Proof of Stake (PoS) Used by Ethereum (after the Merge) - Validators stake tokens instead of mining - More energy-efficient and scalable ## 6. Transactions Every interaction on a blockchain (e.g., transfer, mint, swap) is a transaction: - Signed by a user's private key - Broadcast to the network - Verified and added to a block Once confirmed, it's immutable. ## 7. Gas Fees Blockchains like Ethereum charge gas fees for every transaction :::success High demand = high gas fees ::: ## 8. Scalability Trilemma A blockchain must balance: - Decentralization - Security - Scalability :::success Most systems can only optimize 2 out of 3. But new innovations (e.g., sharding, L2s) aim to solve this. ::: ## 9. Wallets A wallet holds your private key and lets you send/receive crypto.