Blockchain
Introduction
Bitcoin
Through The
Blockchain
Economics
Technical
Communities
- history, real life characters and events -
Money
Stones, salt, shells, gold
Medium of exchange, unit of account, store of value
Not the first Blockchain
Not the first digital currency
1995
Surety
Cryptographic hash functions
The New York Times
DigiCash (1989)
Mondex (1993)
CyberCash (1994)
E-gold (1996)
Hashcash (1997)
B-Money (1998)
Bit Gold (1998)
Lucre (1999)
Paypal (1993), Alipay (2003), M-Pesa (2007)
Rely on some form of central authority
Peer-to-peer
Double-spending
- Ledger -
Records:
- Economic Activity
- Financial Relationships
(Transactions)
(Debt)
Keeps:
- Transaction Records
- Balance Records
(Ethereum)
(Bitcoin)
(UTXO)
- Cryptography -
- Communication that needs to be protected (encryption)
- Computations that need to be verified (digital fingerprint)
Fundamental to blockchain technology.
Makes blockchains immutable and easily verifiable.
Resolves the double spend problem.
- Merkle Trees
- Digital Signatures
- Asymmetric Cryptography (Public Key Cryptography)
(+ Addresses)
- Cryptographic Hash Functions
- Prove knowledge of a secret (digital signature)
- Consensus -
The state of what we all agree to.
Rules without rulers.
Network-based rules.
Determines the validity of transactions and blocks.
Protocol rules
- Max 21 000 000 BTC
- Issuance rate. Halving every 210,000 blocks (~4 years)
6,25 BTC
2009:
50
2012:
25
2016:
12,5
2020:
~2137
...
BTC
BTC
BTC
E.g.:
Block Size
Block Header
Previous Block Hash
...
Transaction Counter
Transactions
Block Size
Block Header
Previous Block Hash
...
Transaction Counter
Transactions
Block Size
Block Header
Previous Block Hash
...
Transaction Counter
Transactions
#630,000
...
Previous Block Hash
Previous Block Hash
Previous Block Hash
Block Size
Block Header
Previous Block Hash
...
Transaction Counter
Transactions
Previous Block Hash
Fork
...
- Bitcoin Core
(the reference implementation)
- bcoin
- Bitcore
- BitcoinJS
...
(3rd Halving, May 2020)
Full /
Light-
weight
Mining
Network Routing
Wallet
Cryptographic Hash Functions
Input
Hash
Cryptographic Hash Function
- Deterministic
- One-way
- Changing only one bit from the Input, changes the Hash completely
- Avoid Hash Collisions
- Speed. Fast, but not too fast
Intro to BTC!
SHA-256
11d8ec7d723a09c61e64de2e0f8ad92e2ed4e0f9742aece5cf15e237d3577674
Intro to ETH!
SHA-256
7adc629fe69b898aa5a4d3f094e26efb45ab092b500d712bd37de7a3647df515
Proof of Work
Mining
Mempool
Unconfirmed
Transactions
Transactions
Block Size
Transaction Counter
Block Header
Nonce
#630,000
(3rd Halving, May 2020)
Block Header Hash < Target
Nonce
Number Once
: 0, 1, 2, 3 ... 2³² (4,294,967,295)
Target: 0x17117a39
000000000000000000024bead8df69990852c202db0e0097c1a12ea637d7e96d
000000000000000000117A390000000000000000000000000000000000000000
Nonce: 2,302,182,970
Timestamp
Target
Merkle Root
Previous Block Hash
Version
=
Target: 0x17117a39
0x117a39 * 2^(0x08 * (0x17 - 0x03)) =
1,674,005,436,900,453,533,413,418,811,078,063,286,996,924,790,657,253,376 =
000000000000000000117A390000000000000000000000000000000000000000
Minimum Difficulty (the one in the Genesis Block):
Target: 0x1d00ffff
0x00ffff * 2^(0x8 * (0x1d - 0x03)) =
0x00000000FFFF0000000000000000000000000000000000000000000000000000
Difficulty Retargeting (every 2016 Blocks):
New Target = Old Target * (Time of Last 2016 Blocks / 20160 minutes)
...
Block Header
...
Immutable
~ 100 000 000 TH / s
Transactions
Merkle Root
...
Previous Block Hash
...
...
...
Transactions
Merkle Root
Block Header
Block Header
...
Transactions
Merkle Root
...
Previous Block Hash
...
...
Block Header
...
Transactions
Merkle Root
...
Previous Block Hash
...
...
Previous Block Hash
Block Header
Previous Block Hash
Block Header
There is more to gain by being part of the network
~ 100-200 000 000 kWh per day
> 10 000 Nodes
Has to re-validate Blocks
Attacker
Bitcoin Network
Modified Blockchain
51% attack
Issuance Rate
~10 min
Halving each 210,000 Blocks, or ~4 years
Stock / Flow
Appreciate when there is demand,
while production is constrained from inflating the supply
(existing production)
(annual production)
Gold:
- ~1.5% annual production
- high Stock to Flow ratio
Transparent and predictable
Copper
demand
price
production
price
imagination
exercise
Blockchain
Network
Proof of Work Mining
- Ledger
- Consensus
- Hash Functions (Cryptography)
- Issuance Rate
- Immutability
- Open Source Software
Next:
Receive, Send & Hold Funds
Private
Key
Public
Key
Bitcoin
Address
Elliptic Curve Multiplication
Hashing Function
Asymmetric Cryptography
(Public Key Cryptography)
Addresses
Keys
Wallets
,
- manage Keys and Addresses
- keep track of funds
- create and sign transactions
Private Key: 1 ... 1.158*1077-1 (~2256)
- Contain Keys,
not Coins
Open to all. Anybody can start participating
Android, iOS, Linux, Windows, Mac -
Hardware -
Deterministic, Nondeterministic -
could be generated randomly
(secp256k1)
(SHA256 & RIPEMD160)
A = RIPEMD160(SHA256(K))
K = k * G
Transactions
1778qNWeJRtrqHAiYhM5gPMUbTXrV7X2bp
bc1qqqfhzxtu67fv70ftnhnqqd3ud4jfgkv0rj05ea
0.07783548
Flooding.
Confirmations:
0
(mempool)
1
(the last Block added to the Blockchain contains our Transaction)
2
(one Block added after the Block that contains our Transaction)
6
...
...
(irreversible)
3K9WWZEdBAbLgfeuNLeKW8XWGhTBoyfTn3
bc1qqqfhzxtu67fv70ftnhnqqd3ud4jfgkv0rj05ea
0.08331267
bc1quzkljdpv8y7jdj4sanqga3sh2tzlc4pdkhscsw
bc1qqqfhzxtu67fv70ftnhnqqd3ud4jfgkv0rj05ea
0.07131278
23,246,093
satoshis
0.14101432
33Qj37FtdPMEeL99vCHv35rKdtCMezEVUt
bc1qqqfhzxtu67fv70ftnhnqqd3ud4jfgkv0rj05ea
0.14101432
0.14914826
0.07783548
0.07131278
0.00807598
bc1qgaghyv0n993vvlcusec8tv9w92hl73a5lgxdg7
0.1490903
0.00005796
–
=
(Fees)
UTXOs - Unspent Transaction Outputs
Valid structurally -
Valid Digital Signature -
Input amounts ≥ Output amounts -
Inputs can be spent only once -
BRD, Electrum, Mycelium, Eclair, ...
, Pen, Paper
Phone
BRD Wallet
+ Android & iOS
+ graphical interface
+ connects directly to a Node
12, 24 words Mnemonic Phrase
BIP39
(BIP - Bitcoin Improvement Proposals)
Wallets generate deterministic keys
Wallets
2048 English words
204812 = 2132 , 204824 = 2264
– control over fees
+ Open source
+ Non-custodial
Addresses, Keys
Transactions
Setting up a Wallet
- Open
- Confirmations
- Pros and cons
Block explorers
- Read Blockchain data
- Anyone can participate
- Seed
- UTXOs
- Fees
- Public key cryptography
Blockchain-v2
By vladmilinovici
Blockchain-v2
- 375