Blockchain Technology
and FinTech
2 – Basic principles of
blockchain technology
Dr. Stefan Obernberger
Today
• How can we verify (ownership of) digital content?
• How can we create a secure, decentral platform to
exchange electronic cash?
Stefan Obernberger - ESE
2
Goals of this lecture
1. Understand the challenges of designing a digital,
decentralized, temper-proof recording device, which can be
used to create and exchange electronic cash.
2. Highlight the technical innovations brought together in the
blockchain technology (of Bitcoin).
3. Learn how each of the technical innovations helps to build a
secure platform to create and exchange digital cash.
Stefan Obernberger - ESE
3
Digital content and ownership
• Say you write a scientific paper with a novel idea
and post it on your website, you include your name
and date of publication.
• Some time later, somebody else copies your paper,
changes the author name and date of publication
– The copy claims to be dated earlier than your own
publication
– The copy’s author claims ownership of the digital content
• How can you prove that you are the owner?
Stefan Obernberger - ESE
4
Verification of digital content
• How can you prove that you have created digital
content at a certain point in time?
– You could register your data with something like a patent
office: You bring your data, they store it and issue a
receipt, record the storing time in a ledger, post it online
(like SSRN).
• Can you propose a solution that does not require a
trusted third party?
Stefan Obernberger - ESE
5
Solution w/o a trusted third party
• Print the digital content out and put it in a ledger
• Distribute the ledger so that everybody can verify the data for
themselves
– the stamp on the envelope can serve as time-stamp
– Wide distribution of the ledger is important because otherwise
somebody can establish an alternative ledger by distributing the ledger
more widely.
• Problems?
– Creating and sending out ledgers extremely costly
– People would have to be incentivized to keep and store
the ledger
Stefan Obernberger - ESE
6
Haber/Stornetta: Hash digital content
and post it in newspaper
Basic idea: Compress the digital content into a unique
code that is short enough to publish in a newspaper
1.
An algorithm called the hash-function is applied to any digital
document that needs to be time-stamped
– The outcome is a short, unique code
– Information about time and date is added
2. A stack of hashes of digital documents is hashed again and
the resulting code is posted in the NYT for everybody to see.
-> Distributed ledger
Stefan Obernberger - ESE
7
What does a hash function do?
• Input is converted to a hexadecimal string (“hash”)
by scrambling it in a way that is impractical to invert
• Example of hash-algorithm: “Take every third digit in
the file, multiply that number by 7, add the digits
together and divide the total by every fourth number
in the file. Append every number not used in the
previous calculation to the number you have, etc. . .”
Encrypting data with hash functions
Input
Output (SHA3-256)
“Erasmus University Rotterdam”
acc64a1e36abcd8b74e401b80866
e1551f276b6379c6043012f8eff7f4
006d7e
“Erasmus University Rotterham”
fd486a39e1a0ecd2d86ea51c5269
9b0aebf8a8f54e76a88947d918901
54f41ad
“Initial coin offerings (ICOs) are
sales of blockchain-based digital
tokens associated with specific
platforms or assets. Since 2014
ICOs have emerged as a new
financing instrument, with some
parallels to IPOs, venture capital,
and pre-sale crowdfunding.”
67274e00f61f726691c6c488568f8
822e22fdefb6f334807d71c3c7dfd4
b2b0f
Stefan Obernberger - ESE
9
What type of data can be hashed?
• Anything that can be stored in digital form
– Text
– Data
– Video, music, photographs
– Fingerprints, irises
– Etc.
• Limit: 2.09 exabytes
– So large it would take 220 years just to read in
– (Quantum computing might change this)
• Test it yourself:
https://emn178.github.io/online-tools/sha256.html
Output from a hash function
• Fixed length, generally 64 or 128 characters
– Tells you nothing about the length of the input
• 16 possible characters in each space
– Digits 0 through 9, letters a through f
– Number of possible outputs = 1664 or approximately 1.16 x 1077
• Small changes in input will drastically change the output
– Cannot use patterns of characters in the output as a roadmap for
recovering the input, even if you know the hash function that
generated the output
– Only trial-and-error decryption will work
Summary of how to time-stamp a
digital document
Digital document
Unique hash
Time & date
Unique hash of
time-stamped content
Distribute ledger or publish in
newspaper
Stefan Obernberger - ESE
12
Surety posts in the New York Times
Stuart Haber
Stefan Obernberger - ESE
13
Concept check: What did Haber and
Stornetta accomplish?
• What’s the purpose of the hash-code?
– It maps out digital content of any length into a unique, short string.
– Registering this short string is equivalent to registering the whole digital
content.
→ Allows you to compress large amounts of data in small pieces of text
• What’s the purpose of distributing the codes via NYT?
– It is widely distributed and nearly impossible to tamper with.
– Cost-efficient way of a distributed ledger.
→ Time and date need not be established by a trusted third party.
(Nevertheless, a third party is involved in the process, thus it’s not a fully
decentralized solution)
Stefan Obernberger - ESE
14
Questions
8254c329a92850f6d539dd376f4816ee2764517da5e0
235514af433164480d7a is the SHA256-hash of which
letter of the alphabet (a, b, c, d, .., z)?
Do you know of examples of where you use hashfunctions in daily life?
Stefan Obernberger - ESE
15
A peer-to-peer electronic cash system:
Blockchain Technology in Bitcoin
Stefan Obernberger - ESE
16
What is electronic cash?
• Basically, a digital version of cash
• Fungibility of cash
– One unit of digital cash is indistinguishable from any other unit of
the same digital cash.
– Owner is whoever is in possession
– Even if units of cash have a serial number, you do not have a
claim to a specific unit of cash.
→ You cannot reclaim stolen cash from its current holder (but you
are entitled to take legal action against whoever took it away
from you)
• Is money on your bank account electronic cash?
Stefan Obernberger - ESE
17
Why do we need electronic cash?
• Real world versus online transactions:
– Real-world marketplace: transactions are regularly done peer-to-peer using cash.
– Online marketplace: transactions via an intermediary using (credit) accounts.
• Cash is superior to credit cards in several ways:
– Cash transactions are non-reversible
– No trusted third party needs to provide (costly) verification
– Transfer of cash is immediate
• Problems with electronic cash:
– Database solutions require a trusted third party administrator
– Decentralized peer-to-peer solutions need to address three questions:
• How can you own something digitally that is fungible?
• How can you verify that somebody is the owner of fungible electronic cash?
• How can you store and validate data in a decentral fashion?
Stefan Obernberger - ESE
18
Moving beyond a read-only distributed
ledger
Say you want to use the distributed ledger discussed
earlier to record and verify whether somebody really owns
electronic cash and is thus entitled to transfer electronic
cash to you.
What can you credibly establish with the distributed ledger
solution? What problems still remain?
Stefan Obernberger - ESE
19
Moving beyond a read-only distributed
ledger
• What can you credibly establish using the ledger??
o The person owning electronic cash
o The amount of electronic cash owned by that person
o A record date at which that person owned electronic cash
• The ledger cannot provide
o A mechanism that allows us to verify the identity of the other
person
o A cryptographic way of fully digitally recording data that ensures
the integrity of the data
o A check whether that person has spent the electronic cash since
the record date (double-spending problem)
Stefan Obernberger - ESE
20
Technologies assembled by
Nakamoto (2008) in Bitcoin
• Digital signatures: Using double-key cryptography to make secure
transfers of assets from one wallet to another (British intelligence,
1970s)
• The Blockchain: Recording new data sequentially in a write-only,
indelible ledger (IBM, 1976)
• Proof-of-work: Validating new data by cryptographic “consensus”
proof, in recurring 10-minute open competitions, instead of relying
on a trusted third party (Nakamoto, 2008)
Stefan Obernberger - ESE
21
Digital cryptographic signatures
Private Key
Public Key
verify
Generates two values
r and s, which form
the signature
create
Function of private
key and hash of
transaction
Elliptic curve
cryptography
Function of public key,
hash of transaction,
and signature (r,s)
Returns true or false
Signature
Stefan Obernberger - ESE
22
Digital (cryptographic) signatures
• It is impossible to derive the private key from the
public key
– Only the private key can generate a correct signature
– However, the public key is linked to the private key in a
way such that you can check whether the corresponding
private key was used to generate the signature
• Learn more? -> look up “ECDSA Math”
Stefan Obernberger - ESE
23
The Blockchain (simplified)
Block N-1
Hash of block
N-2
Hash of
information
contained in
block N-1
Block N
Hash of block
N-1
Hash of
information
contained in
block N
Hash of block
N
If you make the slightest changes to information
contained in block N-1 (or earlier blocks), the hash of
block N will be completely different!
Stefan Obernberger - ESE
24
Who updates the blockchain?
Has to solve double-spending problem
• Haber and Stornetta (1991)
– A trusted third party codes blocks
– The chain is public, becoming a distributed ledger that can be
verified by anyone
• Nakamoto’s (2008) crowd-sourcing solution
– Network members compete to create new blocks
•
•
•
•
The competition is called proof-of-work
Proof of work: Solve a puzzle that solely requires computing power
Node which solves the puzzle first creates the block
Node earns a reward IF block is accepted as correct by the network
– Anyone can join the network and take part
Stefan Obernberger - ESE
25
Propagation of a transaction through
peer-to-peer network
Transacting nodes
Nodes which hear about the transaction
Stefan Obernberger - ESE
26
Mining nodes record all new
transactions in a transaction pool
Transaction cd3…
Transaction 67d…
Transaction a41…
Transaction b4f…
Transaction cd3…
Transaction a41…
Transaction b4f…
Transaction e66…
Transaction a41…
Transaction b4f…
Transaction cd3…
Transaction 67d…
Transaction d9e…
Transaction b4f…
Transaction cd3…
Transaction 67d…
Mining nodes
Stefan Obernberger - ESE
27
When a new block can be mined all
transactions in pool are aggregated
Merkle root
block N
Hash
(n-2)(n-1)n
Hash 123
Hash 12
Hash (n-1)n
Hash 23
Hash 1
Hash 2
Hash 3
Hash n
Transaction 1
Transaction 2
Transaction 3
Transaction n
Stefan Obernberger - ESE
28
Proof-of-work
Block N
Hash of Block
N-1
Timestamp
Merkle root
Block N
Nonce
Proof-of-work competition:
• Create a hash of the above four components that satisfies a predefined condition
• For example: “The first four digits of the hash need to be zeros”
• Challenge: Find a “nonce” (number) that creates such a hash.
Stefan Obernberger - ESE
29
Proof-of-work
Block N
Hash of Block
N-1
Timestamp
Merkle root
Block N
Nonce ???
System requires Hash output: 12345{…}
Stefan Obernberger - ESE
30
Proof-of-work
• A block is only added to the blockchain if 51% of the participating
nodes confirm that the transactions in the block are correct.
o If a coin is spend more than once, the block will not be accepted
by the network
o If accepted, the reward is newly created (“minted” or “mined”)
Bitcoin and transaction fees
• Incentive mechanism: The expected return from mining is higher for
creating correct blocks than for creating manipulated blocks.
• To play the game, you have to commit expensive resources to
the network. To win the game, you have to be honest.
• When does this mechanism fail?
• One party holds onto more than 51% of the nodes and can thus
validate an incorrect block.
Stefan Obernberger - ESE
31
The Blockchain of Bitcoin
Stefan Obernberger - ESE
32
Nakamoto integrated four innovations
to create Bitcoin
•
Digital signatures -> Ensures bitcoin can only be transacted by the person
who owns the bitcoin (gives controlled access to your wallet)
•
Distributed ledger -> Replaces a trusted third party to guarantee that the
data are correct
•
The blockchain -> makes changing the ledger impossible because changing
one entry of the ledger would require to change the entire blockchain, one
would have to rewrite the entire blockchain
•
Proof of work -> validates transactions, prevents double spending
Stefan Obernberger - ESE
33
What makes the blockchain brilliant?
• It is impossible to change one entry in the
blockchain w/o having to change the entire chain.
• The blockchain essentially is an easy-to-handle and
fool-proof transaction recording technology.
• It naturally offers a feature that is essential for the
functioning of markets: trust.
Stefan Obernberger - ESE
34
Next week
• Tomorrow: We take a close look at the mechanics and
economics of Bitcoin.
• Required readings and questions are posted online.
• Who is Satoshi Nakamoto?
Stefan Obernberger - ESE
35
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )