Blockchain Complete Notes
1. Solidity Programming Language
Solidity is a high-level programming language used to write smart contracts on Ethereum.
Importance: Enables decentralized applications, automation without intermediaries, and secure
transactions.
Example:
pragma solidity ^0.8.0;
contract Hello {
string public message = "Hello Blockchain";
}
2. Consensus Mechanisms
Proof of Work (PoW)
Miners solve complex puzzles to validate transactions.
Diagram:
User -> Miner -> Solve Puzzle -> Block Added
Proof of Stake (PoS)
Validators are chosen based on stake (coins held).
Proof of Burn (PoB)
Coins are burned to gain mining rights.
Proof of Elapsed Time (PoET)
Random wait time decides validator (used in Hyperledger).
3. Blockchain Applications
Supply Chain
Tracks goods transparently from origin to delivery.
Smart Cities
Used in energy, transport, and governance.
DApps
Apps that run on blockchain without central authority.
4. Cryptographic Hash Functions & SHA
Hash functions convert input into fixed-length output.
SHA (Secure Hash Algorithm) ensures data integrity.
Example:
Input -> SHA-256 -> Fixed Hash
5. Smart Contracts & DApps
Smart contracts are self-executing programs.
DApps use smart contracts as backend.
6. Bitcoin System
Mining
Cloud: renting mining power. Own: using personal hardware.
Double Spending
Blockchain prevents spending same coin twice.
P2P Network
Nodes communicate directly without central authority.
7. Merkle Tree
Used to verify data efficiently in blockchain.
Root
/ \
Hash Hash
/ \ / \
Tx1 Tx2 Tx3 Tx4
8. Public Ledger & Decentralization
Public ledger records all transactions openly.
Decentralization removes central authority, increasing trust.