P08 Blockchain
P08 Blockchain
Blockchain: An Overview
Prepared by:
Sultan Almuhammadi
This lecture is based on:
Bashir: Mastering Blockchain (Ch 1. Blockchain 101)
Narayanan: Bitcoin and Cryptocurrency Technologies (Ch 1)
Outline
2
Blockchain General Structure
3
Background
In 1982, David Chaum proposed a structure “similar to
blockchain” with protocols to establish, maintain and trust a
system by mutually suspicious groups.
In 1991, cryptographically secured chain of blocks was
introduced to implement a system with timestamped documents
that cannot be tampered. Then Merkle tree was added to the
design to improve efficiency in 1992.
The term “blockchain” was first conceptualized with the
invention of Bitcoin in 2008.
Bitcoin:
A peer-to-peer electronic cash
Built using chain of blocks and Merkle tree.
4
Definitions
Blockchain:
A peer-to-peer distributed ledger that is cryptographically-secure,
append-only, immutable and updateable only via consensus or
agreement among peers.
Peer-to-peer:
No central controller in the network
Participant peers talk to each other directly
Distributed ledger:
The ledger is spread across the network among all peers.
Each peer holds a copy of the whole ledger (or the blockchain).
Cryptographically-secure:
The security of the ledger is provided using cryptography (like secure
haching, digital signature, encryption, …etc.)
5
Definitions (Continue)
Append-only:
Data can be only added to the blockchain sequentially in time-ordered.
Immutable:
Once the data is added, it cannot be changed.
Any change or modification can be detected (tamper-evident).
Updateable via consensus:
Any update is validated first then added to the blockchain only if a
consensus has been reached among all peers/nodes.
The consensus is achieved using various consensus facilitation
algorithms.
6
Tamper-evident vs Tamper-Proof
Tamper-evident:
If Eve modifies any block in the chain, it will result in the hash pointer
in the following block being incorrect, and hence the modification is
detectable. The next hash code is used as an evidence of modification.
Tamper-proof:
It is hard to modify (or tamper) with the data in the first place.
If Eve manages to modify the data, the modification may not
necessarily be detected.
7
Terminologies
Distributed Systems:
Two or more nodes work with each other in a coordinated
fashion to achieve a common outcome.
The end users see it as a single logical platform.
Eg. Google's search engine.
Nodes:
Individual players in a distributed system.
Capable of sending and receiving messages to and from
each other.
Have memory and a processor
Can be honest, faulty, or malicious
Byzantine node:
A node that exhibits irrational behavior
Named after the Byzantine Generals Problem.
8
Terminologies
9
Terminologies
10
Distributed System Design
Example:
N4 is a Byzantine node
L2 is broken or a slow link
11
Types of Blockchain
Public Blockchain:
Not owned by anyone
Open to the public
Any peer can participate in the decision-making process
All peers maintain a copy of the ledger locally
Examples: Bitcoin, Ethereum
12
Types of Blockchain
Private Blockchain:
Open only to a group of individuals or organizations
The group members share the ledger among themselves
Example: HydraChain (an extension of the Ethereum providing
Permissioned Distributed Ledgers)
13
Types of Blockchain
Semiprivate Blockchain:
Part of the blockchain is private and part of it is public
Can be used in scenarios where the private part remains
internal, while the public part is used by anyone.
14
Features of Blockchain
Distributed consensus
Transaction verification
Platform for smart contracts
Transferring value between peers
Generation of cryptocurrency
Smart property
Provider of security
Immutability
Uniqueness
15
Blockchain and Cryptocurrency
Bitcoin (BTC) is the first cryptocurrency built on the blockchain
technology. It was published in 2008, and first used in 2009.
Over 8000 cryptocurrencies/altcoins have been introduced since then:
Litecoin (LTC) and Namecoin (NMC) in 2011
Peercoin (PPC) in 2012
Ripple (XRP) in 2013
Dash (DASH) and Monero (XMR) in 2014
Ethereum or “Ether” (ETH) in 2015
Zcash (ZEC), Bitcoin Cash (BCH), EOS, and Cardano (ADA) in 2017
16
Blockchain and Cryptocurrency
Public Keys as Identities:
Cryptocurrencies use public-key as identity of the coin owner.
When the coin owner want to spend the coin, the transaction is signed
using the owner’s private key.
The signature can be verified publicly.
The transaction states the value of the spent coin and the new owner.
In order to understand how Bitcoin and other cryptocurrencies
work, we will consider a simple cryptocurrency that may not
have enough security. Then we the security features gradually.
A Simple cryptocurrency (Goofy-Coin)
An improved cryptocurrency (Scrooge-Coin)
Other altcoins
17
Blockchain and Cryptocurrency
A Simple Cryptocurrency (Goofy-Coin)
Rules of Goofy-Coin:
Goofy can create new coins by simply signing a statement that he’s making a new
coin with a unique coin ID.
Whoever owns a coin can pass it on to someone else by signing a statement that
saying, “Pass on this coin to X” (where X is specified as a public key)
Anyone can verify the validity of a coin by following the chain of hash pointers
back to its creation by Goofy, verifying all of the signatures along the way.
18
Blockchain and Cryptocurrency
Security issues of Goofy-Coin:
Goofy controls the system (centralized)
Double-Spending Problem
Double-Spending Attack:
One of the key challenge in digital cash
Alice can spend the same coin twice.
First she passes it to Bob, and sign the
transaction, then she passes it Charley and
sign the transaction.
Both Bob and Charley can verify the
validity of these transactions following
the hash pointers to the creation of the
coin signed by Goofy.
19
Blockchain and Cryptocurrency
An improved Cryptocurrency (Scrooge-Coin)
To solve the double‐spending problem.
Append‐only ledger containing all transactions.
It will be publicly visible if coins were previously sent to a
different owner.
Use a blockchain, were each block contains the transaction ID
and a hash code of the previous block.
Types of Transactions: CreateCoins or PayCoins.
20
Blockchain and Cryptocurrency
Coin creations in Scrooge-Coin:
21
Blockchain and Cryptocurrency
PayCoins Rules of Scrooge-Coin:
The consumed coins are valid (correctly
created in previous transactions)
The consumed coins were not already
consumed in some previous transaction.
(No double‐spend).
The total value of the coins that come out
of this transaction is equal to the total
value of the coins that went in.
The transaction is validly signed by the
owners of all of the consumed coins.
22
Blockchain and Cryptocurrency
Security issues of Scrooge-Coin:
Double-Spending problem is solve.
Scrooge controls the system (centralization)
Decentralization
Nobody controls the system.
Example: Bitcoin (and altcoins)
23
Cryptocurrency Market Cap.
As of Aug 2018:
As of Nov 2020:
Over 3900 cryptocurrencies
Market cap: $499 Billions
See https://coinmarketcap.com/ for updates
24