Blockchain and Web3 course Β· Module 1: Blockchain Fundamentals
Welcome to the Crypt - The Underground City of Blockchain!
In this lesson9
Welcome to the Crypt! I am Atlas, the Cartographer of the Depths and your guide through this underground world. I'm glad you've decided to descend into our city built on the foundations of blockchain!
What Awaits You in the Crypt?
On this journey through underground tunnels and chambers, you'll learn to build decentralized applications (dApps) and understand the technology that's revolutionizing the world of finance and beyond:
- Blockchain - a network of tunnels connecting our underground chambers
- Cryptography - cipher locks protecting our vaults
- Ethereum - the main tunnel network of our city
- Ethers.js - tools for navigating the underground
- Smart Contracts - automated mechanisms in our chambers
- Tokens and NFTs - underground coins and unique crystals
- DeFi - a decentralized marketplace in the catacombs
What is Blockchain?
Imagine that the Crypt is a vast underground city with thousands of tunnels and chambers. Each chamber (block) is connected to the previous one, forming an unbroken network (chain). This is exactly what blockchain is - a chain of blocks!
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BLOCKCHAIN = TUNNEL NETWORK β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β
β β Block 1 βββββΆβ Block 2 βββββΆβ Block 3 βββββΆβ Block 4 β β
β β(Chamber)β β(Chamber)β β(Chamber)β β(Chamber)β β
β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β
β β β β β β
β Transactions Transactions Transactions Transactions β
β stored stored stored stored β
β in block in block in block in block β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββKey characteristics of blockchain:
- Immutability - once carved in stone, a transaction cannot be changed
- Decentralization - there is no single ruler, all guardians (nodes) have a copy
- Transparency - anyone can see all tunnels and chambers
- Security - cryptographic locks protect every chamber
History of Blockchain - From Satoshi to Today
2008 - The Birth of an Idea
The mysterious Satoshi Nakamoto (the first Cartographer of the Depths) published a whitepaper describing Bitcoin - the first underground blockchain city.
2009 - Bitcoin Genesis Block
The first block (chamber) of Bitcoin was created - the Genesis Block. The era of cryptocurrencies began.
2015 - Ethereum
Vitalik Buterin created Ethereum - an expanded city with automated mechanisms (smart contracts).
2020+ - DeFi and NFT Explosion
Underground marketplaces (DeFi) and crystal galleries (NFTs) revolutionized the possibilities of blockchain.
Decentralization vs Centralization
In the traditional world (on the surface) we have banks - central vaults controlled by a single institution:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CENTRALIZATION (Bank) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββ β
β β BANK β β
β β (Center) β β
β βββββββββ¬ββββββββ β
β β β
β βββββββββββββββββΌββββββββββββββββ β
β β β β β
β βΌ βΌ βΌ β
β ββββββββββ ββββββββββ ββββββββββ β
β β Client β β Client β β Client β β
β ββββββββββ ββββββββββ ββββββββββ β
β β
β Single point of failure Censorship possible β
β Requires trust Intermediary fees β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββIn the Crypt (blockchain) every guardian (node) has a full copy of the entire city:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DECENTRALIZATION (Blockchain) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββ ββββββββββ β
β β Node 1 ββββββββββββΆβ Node 2 β β
β ββββββ¬ββββ βββββ¬βββββ β
β β β β
β β ββββββββββ β β
β βββββΆβ Node 3 ββββββ β
β ββββββ¬ββββ β
β β β
β βββββββββββ΄ββββββββββ β
β β β β
β βΌ βΌ β
β ββββββββββ ββββββββββ β
β β Node 4 βββββββββββΆβ Node 5 β β
β ββββββββββ ββββββββββ β
β β
β No single point of failure β
β Censorship resistant β
β Trustless (no trust required) β
β Peer-to-peer β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββBasic Concepts
Block (Chamber)
A container for transactions. Each block contains:
- Hash - a unique identifier (cipher lock)
- Previous Hash - connection to the previous block (tunnel)
- Transactions - list of operations
- Timestamp - time of creation
- Nonce - number used in mining
Hash (Cipher Lock)
A cryptographic function that converts data into a unique string of characters:
// Example: SHA-256 hash
"Hello" β "185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969"
"hello" β "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"
// Even a small change produces a completely different hash!Mining (Extraction)
The process of creating new blocks. Miners solve mathematical puzzles to add a new chamber to the tunnel network.
Node (Guardian)
A computer storing a copy of the entire blockchain. Guardians verify transactions and maintain the network.
Bitcoin vs Ethereum
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BITCOIN vs ETHEREUM β
βββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ€
β BITCOIN β ETHEREUM β
βββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββ€
β 2009 β 2015 β
β Satoshi Nakamoto β Vitalik Buterin β
β Digital gold β World computer β
β Store of value β Smart contracts, dApps β
β Proof of Work β Proof of Stake β
β ~7 tx/s β ~30 tx/s (more with L2) β
β Simple script β Turing-complete (Solidity) β
βββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββIn the Crypt, we'll mainly explore Ethereum - because it allows creating smart contracts and dApps!
Testnets vs Mainnet
In the Crypt, we have two types of tunnels:
Mainnet (The Main City)
- Real ETH, real value
- Transactions cost real money
- Production applications run here
Testnet (Abandoned Tunnels - training ground)
- Test ETH (no value)
- Free experimentation
- Perfect for learning!
Popular testnets:
- Sepolia - the main testnet for developers
- Hoodi - a testnet for validator and staking tests (replaced Holesky in 2025)
Goerli and Holesky are shut down, so do not use them in new projects.
Summary
In this lesson you learned:
- What blockchain is (a network of tunnels connecting chambers)
- History from Bitcoin to Ethereum
- The difference between centralization and decentralization
- Basic concepts: block, hash, mining, node
- Bitcoin vs Ethereum
- Mainnet vs Testnet
What's Next?
In the next lesson, Atlas will take you to the Hall of Ciphers, where you'll learn the secrets of cryptography - the foundation of security for the entire underground city!
Get ready to discover the secrets of public and private keys!
Code for this lesson: index.js
// Simulation of a simple block in blockchain
const block = {
index: 0,
timestamp: Date.now(),
data: "Genesis Block - First block in the chain",
previousHash: "0000000000000000000000000000000000000000",
hash: ""
};
// Simple hash function (in real blockchain we use SHA-256)
function simpleHash(data) {
let hash = 0;
const str = JSON.stringify(data);
for (let i = 0; i < str.length; i++) {
const char = str.charCodeAt(i);
hash = ((hash << 5) - hash) + char;
hash = hash & hash;
}
return Math.abs(hash).toString(16).padStart(8, '0');
}
block.hash = simpleHash(block);
console.log("=== GENESIS BLOCK ===");
console.log(JSON.stringify(block, null, 2));
Spotted a mistake in this lesson?
Check yourself
Answer the questions from this lesson. Pick an answer to see right away whether it is correct.
1. Blockchain is:
2. Who published the Bitcoin whitepaper in 2008?
3. The main advantage of decentralization is:
Hands-on tasks in the game
- Vertical ordering
Arrange the block elements from header to transactions:
- Code editor
Create a block object with fields: index, timestamp, data, previousHash, hash
- Horizontal ordering
Arrange the components that go into the block hashing function:
- Click in order
Click, in order, the features characteristic of a public blockchain:
- Code editor
Complete the addBlock function that adds a block to the chain array
- Vertical ordering
Arrange the events in chronological order:
Tasks after this lesson
- QuestionQuiz: What Is Blockchain?
- Put in orderArrange the Block Structure
- Coding taskCreate a Simple Block
- QuestionQuiz: Who Created Bitcoin?
- Put in orderBuilding a Block Hash
- QuestionQuiz: Decentralization
- Click in orderClick the Blockchain Features
- Coding taskBlockchain Simulation
- Put in orderSorting: Blockchain History