Blockchain

About the Classes!

  • Instructor: Sabin Nepal
  • Duration: 4 Weeks, 1 Session per Week, 3hrs/day
  • Goal: Understand blockchain's origins, fundamentals, and real-world applications
  • Prerequisites: Curiosity about blockchain, basic programming knowledge
  • Expectation From Students: Find a good blockchain related idea, write 2 page essay about it

@neymarsabin

Outline

  • W1(24, Aug): Origins and Basics of Blockchain: Why Blockchain Exists?
  • W2(30, Aug): Blockchain and Cryptography: Under the Hood?
  • W3(31, Aug): Advanced Blockchain Concepts: Beyond Basics?
  • W4(7, Sept): Real-World Apps and Future Trends: Beyond Bitcoin?

@neymarsabin

Sabin Nepal

AI | Blockchain | System and Operations

  • Software Engineer with 7+ years of Experience
  • Passionate about Blockchain, AI & Programming
  • Masters in AI at Kathmandu University
  • Ruby, Python, JavaScript, Go, Solidity
@neymarsabin

Week 1 — Origins & Basics of Blockchain

"Why Blockchain Exists?"

@neymarsabin

Session Flow

  1. Blockchain Warm-up
  2. History of Digital Money & Bitcoin
  3. What is Blockchain?
  4. Fundamental Technologies
  5. Try Out!!

@neymarsabin

What comes to your mind when you hear...

"Blockchain?" or "Bitcoin?"

@neymarsabin

The Google Doc Analogy

  • Everyone sees the same version
  • Changes visible to all
  • No one can secretly change it

But blockchain ≠ Google Docs — it adds security + decentralization and many more...
@neymarsabin

@neymarsabin

The Problem Before Blockchain

Why did we even need blockchain?

  • Digital info can be copied infinitely -> problem for money and ownership
  • We relied on banks and intermediaries to verify transactions and prevent fraud
  • Issues: Single point of failure, fees, censorship, trust etc.

@neymarsabin

Double Spending Problem

When the same digital money can be copied and spent more than once.

@neymarsabin

The Trust Problem

  • Online transactions rely on middlemen (banks, companies)
  • Central points can be hacked, corrupted, censored
  • "What happens if your bank decides to freeze your account?"
  • "Can you send money to someone in another country without a bank?"

@neymarsabin

Earlier Attempts at Digital Cash

  • eCash (David Chaum, 1980s) -> Privacy-focused digital money, but still required a central bank-like authority to issue and verify coins.
  • Hashcash (Adam Back, 1997) -> Proof-of-work to combat email spam, Not money, but the PoW idea later became Bitcoin’s backbone.
  • b-money (Wei Dai, 1998) -> Had many of Bitcoin’s ideas (contracts, PoW, consensus) but never implemented.
  • Bit Gold (Nick Szabo, 1998) -> Proof-of-work and linked chains of ownership. Very close to Bitcoin, but still lacked a working consensus mechanism.

@neymarsabin

Then Came Bitcoin, 2008...

We don't need middlemen if we can trust the math.
@neymarsabin

10,000 BTC for 2 Pizzas, 2010

@neymarsabin

Setback: Mt. Gox Hack, 2014

  • Hackers accessed and stole around 800,000 bitcoin.
  • The price of Bitcoin dropped from 1100 USD to 400 USD.

@neymarsabin

Vitalik Buterin and Ethereum, 2013

Bitcoin is a cool currency. But what if blockchain could run anything like apps, contracts, games, organizations - without a central authority?
  • Launched Ethereum in 2015
  • Turning the blockchain into a global World Computer
  • Major flood of Smart Contracts, DeFi, NFTs, DAOs, MetaVerse etc.

@neymarsabin

Top Layer 1 Blockchains, 2025

@neymarsabin

Why Blockchain?

  • Decentralization: No single point of control or failure
  • Transparency: All transactions are visible to everyone
  • Security: Cryptographic techniques ensure data integrity
  • Immutability: Once data is added, it cannot be changed or deleted
  • Trustless: No need to trust a third party; trust the code and math
  • Permissionless: Anyone can join and participate in the network

@neymarsabin

Next Step... Technology

Then, What is Blockchain?

A magic notebook everyone shares and no one can erase.
A digital database or ledger that is distributed among the nodes of a peer-to-peer network.
An append only state machine replicated across a network of computers.
Fault-tolerant, incentive-driven consensus protocol for decentralized systems.

@neymarsabin

Terminologies...

  • Client Server Architecture
  • Peer-to-Peer (P2P)/Decentralized Networks
  • Nodes
  • Consensus Mechanisms
  • Blocks
  • Transactions
  • Chain

@neymarsabin

Client-Server Networks

@neymarsabin

Peer-to-Peer (P2P) Networks

  • Each computer/node/peer acts as both a client and server
  • No central server controls the network
  • Torrents, IPFS, Minecraft, Bitcoin etc.

@neymarsabin

@neymarsabin

P2P Visualizer
Source: DSN KIT

@neymarsabin

What are Nodes?

  • Nodes are individual computers that participate in the blockchain network.
  • They store, validate, and relay transactions and blocks.
  • Each node has a copy of the entire blockchain or part of it.
  • Nodes communicate with each other to maintain the network's integrity and security.
  • Nodes can be full nodes (store entire blockchain) or light nodes (store only part of the blockchain).

@neymarsabin

Nodes in Blockchain

  • Full Nodes: Store the entire blockchain, validate transactions, and maintain network integrity.
  • Light Nodes: Store only a part of the blockchain, rely on full nodes for validation, and are more resource-efficient.
  • Mining Nodes: Participate in the mining process, solving complex mathematical problems to add new blocks to the blockchain.
  • Validator Nodes: Responsible for validating transactions in PoS systems
  • Archive Nodes, Relay Nodes

@neymarsabin

Consensus Mechanisms

  • Consensus Mechanisms are protocols that ensure all nodes in a blockchain network agree on the current state of the blockchain.
  • They prevent double spending and ensure the integrity of the blockchain.
  • Different blockchains use different consensus mechanisms, such as Proof of Work (PoW), Proof of Stake (PoS), and others.

@neymarsabin

Blocks

  • Blocks are containers that hold a list of transactions.
  • Each block contains a header (metadata) and a body (transactions).
  • Blocks are linked together in a chain, forming the blockchain.
  • Each block has a unique identifier called a hash.
  • Blocks are added to the blockchain through a process called mining or validation.

@neymarsabin

Bitcoin Blocks

source: blockchain.com/explorer

@neymarsabin

Transactions

  • Transactions are the individual records of value transfer on the blockchain.
  • Each transaction has a sender, receiver, amount, and timestamp.
  • Transactions are grouped into blocks and added to the blockchain.
  • Considered immutable once confirmed in a block.

@neymarsabin

A simple Bitcoin Transaction

@neymarsabin

Chain

  • The chain is the sequence of blocks linked together.

@neymarsabin

Recap

  • Blockchain is a decentralized, distributed ledger technology.
  • It solves the double spending problem and eliminates the need for intermediaries.
  • It consists of nodes, consensus mechanisms, blocks, transactions, and a chain.
  • Key concepts include P2P networks, full nodes, light nodes, and mining.

@neymarsabin

Try Out?...

@neymarsabin

Resources

@neymarsabin