BLOCKCHAINS
March 25, 2019
Introduction to
slides available at https://slides.com/chenevert
Gabriel Chênevert
Math teacher at ISEN Lille
Computer Science department
Information theory:
- compression
- error correction
- cryptography
What is a blockchain?
...and why should you care?
Some history
Birth of Bitcoin
Term "blockchain"
S. Nakamoto
oct. 2008
So... what is a blockchain?
A blockchain is an authenticated, immutable and distributed ledger
Data structures
Information can be stored in many ways inside computers, depending on how it is meant to be used and accessed
Example: Array
Johnny | 06 12 34 56 78 |
Dee Dee | 06 43 04 46 24 |
Joey | 06 78 23 84 92 |
Tommy | 06 02 83 64 40 |
For efficient access: sort keys
Dee Dee | 06 43 04 46 24 |
Joey | 06 78 23 84 92 |
Johnny | 06 12 34 56 78 |
Tommy | 06 02 83 64 40 |
But: insertion involves a lot of copying
Dee Dee | 06 43 04 46 24 |
Joey | 06 78 23 84 92 |
Johnny | 06 12 34 56 78 |
Tommy | 06 02 83 64 40 |
Gabriel | 06 87 93 03 45 |
But: insertion involves a lot of copying
Dee Dee | 06 43 04 46 24 |
Joey | 06 78 23 84 92 |
Johnny | 06 12 34 56 78 |
Tommy | 06 02 83 64 40 |
Gabriel | 06 87 93 03 45 |
But: insertion involves a lot of copying
Dee Dee | 06 43 04 46 24 |
Joey | 06 78 23 84 92 |
Johnny | 06 12 34 56 78 |
Tommy | 06 02 83 64 40 |
Gabriel | 06 87 93 03 45 |
But: insertion involves a lot of copying
Dee Dee | 06 43 04 46 24 |
Joey | 06 78 23 84 92 |
Johnny | 06 12 34 56 78 |
Tommy | 06 02 83 64 40 |
Gabriel | 06 87 93 03 45 |
But: insertion involves a lot of copying
Dee Dee | 06 43 04 46 24 |
Joey | 06 78 23 84 92 |
Johnny | 06 12 34 56 78 |
Tommy | 06 02 83 64 40 |
Gabriel | 06 87 93 03 45 |
But: insertion involves a lot of copying
Dee Dee | 06 43 04 46 24 |
Gabriel | 06 87 93 03 45 |
Joey |
06 78 23 84 92 |
Johnny | 06 12 34 56 78 |
Tommy | 06 02 83 64 40 |
indeed!
Solution: use a chained list
Dee Dee | 06 43 04 46 24 |
Joey | 06 78 23 84 92 |
Johnny | 06 12 34 56 78 |
Tommy | 06 02 83 64 40 |
Each entry includes a pointer to the next
Inserting is now easy
Dee Dee | 06 43 04 46 24 |
Joey | 06 78 23 84 92 |
Johnny | 06 12 34 56 78 |
Tommy | 06 02 83 64 40 |
Gabriel | 06 87 93 03 45 |
Inserting is now easy
Dee Dee | 06 43 04 46 24 |
Joey | 06 78 23 84 92 |
Johnny | 06 12 34 56 78 |
Tommy | 06 02 83 64 40 |
Gabriel | 06 87 93 03 45 |
Ledgers
Chained lists used to keep track of financial transactions
Personal ledger
Income | +200,00 € |
Sandwich | - 6,50 € |
Book | - 12,98 € |
Found on the floor | + 5,00 € |
Flowers for mom | - 15,00 € |
Given the initial amount, one can go through the ledger to find out the current amount at any time
Income | +200,00 € |
Sandwich | - 6,50 € |
Book | - 12,98 € |
Found on the floor | + 5,00 € |
Flowers for mom | - 15,00 € |
25,00 € |
225,00 € |
218,50 € |
205,52 € |
210,52 € |
190,52 € |
Multi-user ledger
me | boss | resto | library | floor | florist |
+200 € | -200 € | ||||
-6,50 € | +6,50 € | ||||
-12,98 € | +12,98 € | ||||
+5,00 € | -5,00 € | ||||
-15,00 € | +15,00 € |
Now imagine a gigantic ledger keeping track of all the transactions made with a given currency since its introduction...
...so that is it possible to know precisely what amount is owned by any user at any time...
...and we have just reinvented Bitcoin!
Blocks
May contain one or more transactions + associated data
From: Yncréa
To: Gabriel
Amount: 200,00 €
From: Gabriel
To: restaurant
Amount: 6,50 €
From: Gabriel
To: bookstore
Amount: 12,98 €
From: floor
To: Gabriel
Amount: 5 €
From: Gabriel
To: florist
Amount: 15 €
So now we have a chain of blocks
Recall
A blockchain is an authenticated, immutable and distributed ledger
Distributed: no central authority controls the ledger
Can be stored and accessed across a network of independent (untrustworthy) nodes
So anyone in the network can add a new block to the chain
Authentication: every block is digitally signed by its issuer
To authenticate the order of the blocks:
Each block contains a digest (hash) of the previous block, thus authenticating the pointer as well
Digest: 0af4ec6
Transactions:
From: Alice
To: Bob
Amount: 200 €
...
Digest: 56f34a9
Transactions:
From: Carol
To: David
Amount: 30 €
...
Digest: 38ba3e2
Transactions:
From: Elliott
To: Felix
Amount: 15 €
...
Every node stores a complete copy of the blockchain and can verify its integrity at any time
But who decides which blocks are legit and can be added to the chain?
Private blockchain: managed by a central authority
(others might have read access)
Public blockchain: no one / anyone / everyone!
Adding a block
Digest: 0af4ec6
Transactions:
From: Alice
To: Bob
Amount: 200 €
...
In order to validate / sign a block, the node has to solve a computational challenge ensuring that adding a block to the chain is a non-trivial operation
proof of work
(other mechanisms are possible, e.g. proof of stake)
Extending the chain
Whenever two different versions of the chain are encountered, the longest one is selected
To change a block once committed, one would need to control > 50% of the computing resources of the network
Applications
- together with peer-to-peer file distribution protocols (BitTorrent): InterPlanetary File System
... rise of the World Computer?
- Anchoring documents (patents, diplomas, notarial acts, ...)
- Smart contracts and distributed programming (see: Ethereum, CryptoKitties, ...)
- Cryptocurrencies (Bitcoin, Zcash, Monero, ...)
- Digital payment systems (Ripple, ...)
- Royalties distribution system (eMusic, ...)
Further reading
- Bruce Schneier last week: There's no good reason to trust blockchain technology
- JP Delahaye, Pour la science
- ...
these slides available at https://slides.com/chenevert
Introduction to blockchains
By Gabriel Chênevert
Introduction to blockchains
Introduction to blockchain technology for 4th year ISA students on February 11 / March 25, 2019
- 2,443