![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/4740756/pasted-from-clipboard.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/4740761/Yncrea_regions_hdf_ref_vertical_couleur_cmjn_300dpi.jpg)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/4740765/pasted-from-clipboard.png)
BLOCKCHAINS
March 25, 2019
Introduction to
slides available at https://slides.com/chenevert
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/4740789/avatar2.jpg)
Gabriel Chênevert
Math teacher at ISEN Lille
Computer Science department
Information theory:
- compression
- error correction
- cryptography
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/5767019/AdobeStock_173520164-1024x768.jpeg)
What is a blockchain?
...and why should you care?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/5766955/pasted-from-clipboard.png)
Some history
Birth of Bitcoin
Term "blockchain"
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/5767050/pasted-from-clipboard.png)
S. Nakamoto
oct. 2008
So... what is a blockchain?
A blockchain is an authenticated, immutable and distributed ledger
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/5766924/pasted-from-clipboard.png)
Data structures
Information can be stored in many ways inside computers, depending on how it is meant to be used and accessed
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/5767126/illus.png)
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 |
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/5767141/more_vertical_dots__383673.png)
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 |
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/5767141/more_vertical_dots__383673.png)
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
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/5767204/1200px-Ledger.png)
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 € |
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/5767141/more_vertical_dots__383673.png)
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 € |
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/5767141/more_vertical_dots__383673.png)
25,00 € |
225,00 € |
218,50 € |
205,52 € |
210,52 € |
190,52 € |
Multi-user ledger
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/5767141/more_vertical_dots__383673.png)
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!
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/5767217/Bitcoin.png)
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
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/5767247/pasted-from-clipboard.png)
So anyone in the network can add a new block to the chain
Authentication: every block is digitally signed by its issuer
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/5767258/1_lCkX_EApzHu8hgwxJDY1Nw.png)
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
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/4741252/1_bJQyDZtJikR7mBVuhVGpBw.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/4741260/1_t8C3VfeVf49bdfUZecBtbg.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/4741262/1_2yGwYXgCvLcZl3MoW044tg.png)
Whenever two different versions of the chain are encountered, the longest one is selected
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/5767303/1_xgpVRSJA707FH3m_x4nHWw.png)
To change a block once committed, one would need to control > 50% of the computing resources of the network
Applications
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/5767306/pasted-from-clipboard.png)
- 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
![](https://s3.amazonaws.com/media-p.slid.es/uploads/851701/images/5767356/51H0oIey7OL._SY498_BO1_204_203_200_.jpg)
- 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,492