Introduction to Bitcoin and Blockchain Part 1
Introduction to Bitcoin and Blockchain Part 1
Ravi Mittal
Acknowledgements
⚫ The contents for this lecture have been taken from following sources.
Thanks are due to authors who have prepared original contents and
presentations:
⚫ CS795: Blockchain Technologies, Class notes and slides, George Mason University, Prof
Foteini Baldimtsi, http://www.baldimtsi.com/teaching/cs795_sp17
⚫ Talk: Introduction to Cryptocurrencies, by Prof Stephen Dziembowski, Univ of Warsaw,
https://www.crypto.edu.pl/dziembowski-talks
⚫ CS419 Computer Security, Lecture Blockchain and Bitcoin, Prof Paul Krzyzanowski,
Rutgers University
⚫ Course CS251. Fall 2022, Stanford University, Prof Dan Boneh
⚫ Presentations: Blockchain at Berkeley, https://blockchain.berkeley.edu/courses/spring-
2020-fundamentals-decal/
⚫ https://learnmeabitcoin.com/beginners/getting-started
⚫ Bina Ramamurthy, Talk: Blockchain to Empower All, University of Buffalo, NY
⚫ ECE/CS 598AM: Cryptocurrency Security, Fall 2016, Class presentation, Prof Andrew
Miller, http://soc1024.ece.illinois.edu/teaching/ece598am/fall2016/
⚫ http://blockchain.mit.edu/blockchain
2
In this class we will study
⚫ Brief Introduction: Blockchain
⚫ Crypto Building blocks: Hash, Hash pointer, Digital Signature
⚫ Bitcoin: An Introduction
⚫ Transition: Our currency to Bitcoin
⚫ Popularity of Bitcoin
⚫ Thanks to Satoshi Nakamoto
⚫ Merkle Tree – An efficient data structure
⚫ Bitcoin Design Principles
⚫ Bitcoin - Identity Management
⚫ Key design Challenges of Bitcoin / Cryptocurrencies
⚫ Transactions and Transaction Table – Blockchain
⚫ Achieving Consensus
⚫ Proof of Work
⚫ Process Steps
⚫ Bitcoin: Problems and shortcomings
⚫ More information on Bitcoin (Self reading)
3
Reading
4
5
Earlier
6
Now…
7
Brief Introduction – Blockchain
What is a blockchain?
2009 2015
Bitcoin Ethereum
Several innovations:
⚫ Blockchain computer: a fully programmable environment
$9.9B
$3.4B
$2.7B
# Active developers since launch (as of 12/31/2022)
17
Lots of Innovations are happening!
32 bytes
256
megabytes hash value 𝑇 = 0,1
Hash Function: Definition (Self Reading)
⚫ Hash function: H(M)
⚫ Input: Arbitrary length message M
⚫ Output: Fixed length, n-bit hash
⚫ Sometimes written as {0, 1}* → {0, 1}n
⚫ Properties
⚫ Correctness: Deterministic
⚫ Hashing the same input always produces the same output
⚫ Efficiency: Efficient to compute
⚫ Security: One-way-ness (“preimage resistance”)
⚫ Security: Second preimage resistance
⚫ Security: Collision-resistance
⚫ Unpredictability: No predictable patterns for how changing the input
affects the output
⚫ Changing 1 bit in the input causes the output to be completely different
22
Ref: CS161C Univ of California Berkeley
Cryptographic Hash Functions (repeat)
23
Application: committing to data on a blockchain
Alice has a large file 𝑚. She posts ℎ = 𝐻(𝑚) (32 bytes)
⚫ Cryptographic Hash
⚫ To check integrity of message
⚫ Pointer
⚫ A data structure to allow one element to refer to another
⚫ It’s an address – memory location
⚫ Hash Pointer
⚫ A tuple
⚫ Traditional pointer, Hash of data-element that is being pointed to
25
Hash Pointers
⚫ Hash pointer = { pointer to data, hash(data) }
Hash of data being pointed and Pointer to data
27
Hash Pointers: Linked Lists = Blockchain data structure
Genesis block
Null
Latest block
First block
29
Ref: CS419, Prof Paul Krzyzanowski, Rutgers University
Tamper Detection
30
Ref: CS419, Prof Paul Krzyzanowski, Rutgers University
Tamper Detection
• The adversary will have to change all hash pointers back to the
head
• If we can keep the head of the list safe so an adversary cannot
modify it, then we can always detect tampering
input: output:
Correctness:
for every (sk,pk) := Gen() and every M we have
Vrfy(pk,M,Sign(sk,M)) = yes
Security:
“without knowing sk it is infeasible to compute σ such that
Vrfy(pk,M,σ) = yes”
Ref: Presentation by Stefan Dziembowski, Univ of Warsaw
Digital signatures
Solution: make signature depend on document
Signer
Verifier
‘accept’
Bob agrees to pay Alice 1$
verifier or
‘reject’
signature
signing
algorithm
secret signing public verification
key (sk) key (pk)
How to use the digital signatures?
publish pk
message M
(Bitcoin, Ethereum)
Money?
Legal?
39
Crypto?
Unit recently: Now also:
Crypto =
Crypto = a short name for cryptocurrencies
cryptography (e.g.: Bitcoin) and
blockchain
Also: the name of the main
annual conference in
cryptography.
https://yle.fi/uutiset/
osasto/news/finance_
⚫ Blockchain: data structure behind ministry_crackdown_o
cryptocurrency. Method of storing n_cryptocurrency_trad
e/10040789
data amongst multiple parties that
ensures data integrity without
requiring trust.
41
What is Cryptocurrency?
42
Our Currency to Bitcoin
Our Currency
⚫ Physical cash
⚫ Non-traceable (well, mostly!)
⚫ Secure (mostly)
⚫ Low inflation
⚫ Can’t be used online directly
⚫ Credit and Debit cards
⚫ Partly secure
⚫ Digital Transactions – possible
⚫ Tracked by banks
⚫ Electronic credit or debit transactions
◆ Bank sees all transactions
◆ Merchants can track/profile customers
44
Traditional ways of paying digitally
Alice’s credit
Alice’s credit card number
card number
Alice Bob
transfer money
to Bob’s transfer
account confirmation
Alice Bob
PROBLEMS
1. Trusted server for each transaction is needed
→ Trust on Financial Institutions
2. High transaction fees
3. No anonymity.
Ref: Presentation by Stefan Dziembowski, Univ of Warsaw
Common types of payments
.
.
.
46
Ref: Lecture 1 CS795/ISA Spring 2017, Prof. Foteini Baldimtsi
And then in 2008
Blockchain
Bitcoin
e4ac7dec3e2c
Now, addition of Bitcoin, Cryptocurrencies
.
.
48
49
What is Bitcoin?
bfa1406343bb49
ga63w234349aa
bfa144534555d9
output: Y Y
where: Y = A ∧ B
With a “trusted third party” – it’s easy
ideal world:
A B
Y Y
real world:
bfa1406343bb49
ga63w234349aa
bfa144534555d9
In other words: can we “emulate” the ideal world in the real world?
No Trusted Server – what does it mean?
output:
no 3 yes
2 no
yes
yes security requirements:
• votes are secret
• the votes are
correctly counted
• in particular: there
no yes is a consensus about
the outcome
No Trusted Server
(open source)
59
Thank you!
Popularity of the Bitcoin (self reading)
Bitcoin market value
64
http://coinmarketcap.com/
Why Bitcoin became so popular ?
65
Adapted from: Lecture 1 CS795/ISA Spring 2017, Prof. Foteini Baldimtsi
Cyber Currency Uses
66
Adapted from: Lecture 1 CS795/ISA Spring 2017, Prof. Foteini Baldimtsi
Accepted in thousands of Businesses
Financial Institutions involved in Crypto
68
Bitcoin – Thanks to Satoshi Nakamoto
(self reading)
Satoshi Nakamoto
71
Slide courtesy of Ittay Eyal
Bitcoin value comes from the fact that:
“people expect that other people will accept it in the future.”
sceptics:
It’s a Ponzi scheme
74
Merkle Tree – Why?
75
Merkle Tree – Why?