demystifying bitcoin - École polytechnique fédérale de ...lpd · demystifying bitcoin prof r....
TRANSCRIPT
![Page 1: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/1.jpg)
Demystifying Bitcoin
Prof R. GuerraouiEPFL & Collège de France & UM6P
![Page 2: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/2.jpg)
Have you heard about?
Blockchain Bitcoin
Ethereum
Turing Completeness NP vs PConsensus
Proof of workSignatures
Smart contracts
Snapshot
![Page 3: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/3.jpg)
Perspectives(1) The journalist
(2) The user
(3) The participant
(4) The engineer
(5) The scientist
![Page 4: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/4.jpg)
(1) The Journalist
2008: Financial crisis – Nakamoto (1/21m) From 1c to 8000$ through 20000$
2014: Ethereum (CH) - Now 800 $
From trading hardware to general trading
2020: Libra - FacebookCoin
![Page 5: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/5.jpg)
![Page 6: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/6.jpg)
Perspectives(1) The journalist
(2) The user
(3) The participant
(4) The engineer
(5) The scientist
![Page 7: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/7.jpg)
(2) The User
![Page 8: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/8.jpg)
(2) The User
The wallet: 1 private key + several public keys
Transaction validation signing + gossiping + mining + chaining
Transaction commitment After time t: thousands of users have seen it
![Page 9: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/9.jpg)
(3) The Participant
![Page 10: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/10.jpg)
(3) The Participant
![Page 11: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/11.jpg)
(3) The ParticipantTo validate a transaction, a miner has to solve a puzzle including it
Fairness and cooperation
Total: 21 millions bitcoins Now: 17 millions
Incentive: 12 bitcoins / puzzle50 bitcoins 3 years ago
![Page 12: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/12.jpg)
(4) The EngineerJoinning (a P2P network)
Gossiping (the transaction)
Mining (proof of work - nonce)Chaining (hash)
Committing/Aborting
Gathering (a block)
Signing (a transaction)
Gossiping (the block)
![Page 13: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/13.jpg)
![Page 14: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/14.jpg)
![Page 15: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/15.jpg)
![Page 16: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/16.jpg)
![Page 17: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/17.jpg)
The Big Picture
Special Reward TXTX-2 (signed)
TX-2452 (signed)
•••
Prev# nonce This
#
Bitcoinblock
Special Reward TX2 (signed)
2478 (signed)
•••
nonce This #
Special Reward TXTX-2 (signed)
TX-2325 (signed)
•••
Prev# nonce
Mining:findsuchthat<dnonce This #
How?Bytryingdifferentnonces (bruteforce)
![Page 18: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/18.jpg)
![Page 19: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/19.jpg)
![Page 20: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/20.jpg)
![Page 21: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/21.jpg)
Perspectives(1) The journalist
(2) The user
(3) The participant
(4) The engineer
(5) The scientist
![Page 22: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/22.jpg)
(5) The Scientist
Conjecture 1: Turing Universality
Conjecture 2: P is not NP
Theorem 1: Lamport (Consensus) Universality
Theorem 2: Consensus Impossibility
![Page 23: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/23.jpg)
Turing Universality (36)
![Page 24: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/24.jpg)
P vs NP (Nash/GV 50 – Ford 70)
? * ? = 91
7 * 13 = ?
![Page 25: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/25.jpg)
Lamport Universality (78)
![Page 26: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/26.jpg)
Every service can be implemented in a highly available manner using Consensus
Safety: No two nodes must choose different values.The chosen value must have been proposed by a node.
Liveness: Each node must eventually choose a value.
Consensus Universality (78)
![Page 27: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/27.jpg)
Consensus is impossible in an asynchronous system
Consensus Impossibility (84)
![Page 28: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/28.jpg)
Perspectives(1) The journalist
(2) The user
(3) The participant
(4) The engineer
(5) The scientist
![Page 29: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/29.jpg)
Payment System
Can we implement a payment system asynchronously?
![Page 30: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/30.jpg)
The infinitely big
The infinitely small
![Page 31: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/31.jpg)
Message Passing
p1
p2
p3
Send
Receive
![Page 32: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/32.jpg)
Shared Memory
p1
p2
Write()
Read()
1
1
ó Message Passing
Registers
![Page 33: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/33.jpg)
Atomic Shared Memory
p1
p2
p3
write(1) - ok
read() - 1
read() - 1
![Page 34: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/34.jpg)
Atomic Shared Memory
p1
p2
p3
write(1) - ok
read() - 1
read() - 0
![Page 35: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/35.jpg)
Non-Atomic Shared Memory
p1
p2
p3
write(1) - ok
read() - 0
read() - 1
![Page 36: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/36.jpg)
Non-Atomic Shared Memory
p1
p2
p3
write(1) - ok
read() - 0
read() - 1
![Page 37: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/37.jpg)
Message Passing ó Shared Memory
p1
p2
p3
Write(1) Ok
Read() 1
Quorums (asynchrony)
![Page 38: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/38.jpg)
Message Passing ó Shared Memory
p1
p2
p3
Write(1) Ok
Read() 1
Quorums (asynchrony)
![Page 39: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/39.jpg)
Message Passing ó Shared Memory
p1
p2
p3
Write(1) Ok
Read() 1
Quorums (asynchrony)
![Page 40: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/40.jpg)
« Optimization is the source of all evil » D. Knuth
« To understand a distributed computing problem: bring it to shared memory » T. Lannister
ó
![Page 41: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/41.jpg)
P vs NP
Asynchronous vs Synchronous
? * ? = 917 * 13 = ?
p1
p2
Write(P1)
Write(P2)
![Page 42: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/42.jpg)
Atomicity
Wait-freedom
Payment System
Can we implement a payment system asynchronously?
![Page 43: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/43.jpg)
Counter: Specification
A counter has two operations inc() and read(); it maintains an integer x init to 0
read():return(x)
inc():x := x + 1;return(ok)
![Page 44: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/44.jpg)
Counter: AlgorithmThe processes share an array of registers Reg[1,..,N]inc():
Reg[i].write(Reg[i].read() +1);return(ok)
read():sum := 0;for j = 1 to N do
sum := sum + Reg[j].read();return(sum)
![Page 45: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/45.jpg)
Counter*: Specification
Counter* has, in addition, operation dec()
dec():if x > 0 then x := x - 1; return(ok)else return(no)
Can we implement Counter* asynchronously?
![Page 46: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/46.jpg)
2-Consensus with Counter*
§ Registers R0 and R1 and Counter* C - initialized to 1
§ Process pI:§ propose(vI)§ RI.write(vI)§ res := C.dec()§ if(res = ok) then
ü return(vI)ü else return(R{1-I}.read())
![Page 47: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/47.jpg)
Impossibility [FLP85,LA87]
§ Corollary: no asynchronous algorithm implements Counter* among two processes using registers
§ Theorem: no asynchronous algorithm implements consensus among two processes using registers
![Page 48: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/48.jpg)
Sperner’s Lemma
§ Theorem: no asynchronous algorithm implements set-agreement using registers
![Page 49: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/49.jpg)
§ The consensus number of an object is the maximum number of processes than can solve consensus with it
![Page 50: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/50.jpg)
Payment Object (PO): Specification
Pay(a,b,x): transfer amount x from a to b if a > x (return ok; else return no)NB. Only the owner of a invokes Pay(a,*,*)
§ Questions: can PO be implemented asynchronously? what is the consensus number of PO?
![Page 51: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/51.jpg)
Payment Object (PO): Specification
Pay(a,b,x): transfer amount x from a to b if a > x (return ok; else return no)NB. Only the owner of a invokes Pay(a,*,*)
§ Questions: can PO be implemented asynchronously? what is the consensus number of PO?
![Page 52: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/52.jpg)
Snapshot: Specification
A snapshot has operations update() and scan(); it maintains an array x of size N
scan():return(x)
update(i,v):x[i] := v;return(ok)
![Page 53: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/53.jpg)
Algorithm?
The processes share one array of N registers Reg[1,..,N]scan():
for j = 1 to N do x[j] := Reg[j].read();
return(x) update(i,v):
Reg[i].write(v); return(ok)
![Page 54: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/54.jpg)
Atomicity?
p1
p2
p3
update(1,1) - ok
scan() - [1,0,2]
update(3,2) - ok
![Page 55: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/55.jpg)
Atomicity?
p1
p2
p3
update(1,1) - ok
scan() - [1,0,2]
update(3,2) - ok
![Page 56: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/56.jpg)
Atomicity?
p1
p2
p3
scan() - [0,0,10]
update(2,1) - ok
update(3,10) - ok
![Page 57: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/57.jpg)
Key idea for atomicity To scan, a process keeps reading the entire snapshot (i.e., collecting), until two arrays are the same
To update, scan then write the value and the scan
Key idea for wait-freedom
To scan, a process keeps collecting and returns a collect if it did not change, or some collect returned by a concurrent scan
![Page 58: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/58.jpg)
The Payment Object: Algorithm
Every process stores the sequence of its outgoing payments in its snapshot location
To pay, the process scans, computes its current balance: if bigger than the transfer, updates and returns ok, otherwise returns noTo read, scan and return the current balance
![Page 59: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/59.jpg)
PO can be implementedAsynchronously
Consensus number of PO is 1
Consensus number of PO(k) is k
![Page 60: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/60.jpg)
(5) The Scientist
Conjecture 1: Turing Universality
Conjecture 2: P is not NP
Theorem 1: Lamport (Consensus) Universality
Theorem 2: Consensus Impossibility
Theorem 3: PO < Consensus
![Page 61: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/61.jpg)
Payment System (AT2)
AT2_SAT2_D
AT2_R
Number of lines of code: one order of magnitude less
Latency: seconds (at most)
![Page 62: Demystifying Bitcoin - École Polytechnique Fédérale de ...lpd · Demystifying Bitcoin Prof R. Guerraoui EPFL & Collège de France & UM6P . Have you heard about? Blockchain Bitcoin](https://reader033.vdocuments.mx/reader033/viewer/2022060407/5f0fa3227e708231d4452653/html5/thumbnails/62.jpg)
References