Slide 1

Slide 1 text

Globalcode – Open4education Blockchain – Algoritmos de Consenso Consensus Algorithms Leonardo Piedade

Slide 2

Slide 2 text

Globalcode – Open4education Speaker Leonardo Piedade - 15+ years programming - 12+ years developing using Java - BS Degree in Computer Science - Web, Integration Systems, Backend, Distributed Systems and Blockchain Platforms. [email protected]

Slide 3

Slide 3 text

Globalcode – Open4education The Trust Machine “It is the first, full consensus distributed ledger mankind has ever seen” – Mastering Blockchain about Bitcoin https://www.economist.com/leaders/2015/10/31/the-trust-machine

Slide 4

Slide 4 text

Globalcode – Open4education https://www.technologyreview.com/s/610781/in-blockchain-we-trust/

Slide 5

Slide 5 text

Globalcode – Open4education Blockchain Principles Distributed Ledger Technology Data, assets, records, etc... Immutable transactions Everybody has a copy P2P Network Partial or Fully Distributed Consensus Untrusted Nodes Economic Model

Slide 6

Slide 6 text

Globalcode – Open4education Network Models Central Intermediary Competing Intermediaries No Intermediary (aka P2P)

Slide 7

Slide 7 text

Globalcode – Open4education “More precisely it is a decentralized distributed system” – Bitcoin In The Crypto World…

Slide 8

Slide 8 text

Globalcode – Open4education

Slide 9

Slide 9 text

Globalcode – Open4education CAP Theorem “Consistency is sacrificed in favor of availability and partition tolerance. But consistency is achieved over time” – Mastering Blockchain https://towardsdatascience.com/cap-theorem-and-distributed-database-management-systems-5c2be977950e ONLY PICK 2 OF THE 3!

Slide 10

Slide 10 text

Globalcode – Open4education Double Spending

Slide 11

Slide 11 text

Globalcode – Open4education “consensus algorithms exist to prevent double spending.” In The Crypto World…

Slide 12

Slide 12 text

Globalcode – Open4education “general agreement; harmony.” consensus /kənˈsen.səs/

Slide 13

Slide 13 text

Globalcode – Open4education “It is a process of agreement between distrusting nodes on a final state of data.” Consensus

Slide 14

Slide 14 text

Globalcode – Open4education The Two Generals Problem - 1975 https://www.youtube.com/watch?v=s8Wbt0b8bwY “Proved to be unsolved” https://mwhittaker.github.io/blog/two_generals_and_time_machines/

Slide 15

Slide 15 text

Globalcode – Open4education The Byzantine Generals Problem - 1982 https://people.eecs.berkeley.edu/~luca/cs174/byzantine.pdf “It can reach consensus as long as 2/3 are honest” - Lamport https://www.youtube.com/watch?v=dfsRQyYXOsQ

Slide 16

Slide 16 text

Globalcode – Open4education Fault Tolerance “The consensus algorithm should be able to run in the presence of faulty or malicious nodes.”

Slide 17

Slide 17 text

Globalcode – Open4education Classical Consensus “Every participant gets one vote” Examples: Paxos, Practical Byzantine Fault Tolerance (PBFT)

Slide 18

Slide 18 text

Globalcode – Open4education Classical Consensus “Problem: Who is a Participant?” Possible Solution: One IP address = One Vote?

Slide 19

Slide 19 text

Globalcode – Open4education Sybil Attack https://www.microsoft.com/en-us/research/wp-content/uploads/2002/01/IPTPS2002.pdf

Slide 20

Slide 20 text

Globalcode – Open4education

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Globalcode – Open4education Classical Consensus Requires a Closed Network https://www.imdb.com/title/tt3531824

Slide 23

Slide 23 text

Globalcode – Open4education Classical Consensus Requires a Closed Network

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

Globalcode – Open4education Proof of Work (PoW) - 2009 “Proof-of-work is essentially one-CPU-one-vote” - Bitcoin whitepaper Examples: Bitcoin(*), Ethereum, Dogecoin, Litecoin, Zcash, Monero, Dash, Primecoin, Verge, Tether

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

Globalcode – Open4education Proof of Work (PoW)

Slide 30

Slide 30 text

Globalcode – Open4education Proof of Work (PoW)

Slide 31

Slide 31 text

Globalcode – Open4education Proof of Work (PoW)

Slide 32

Slide 32 text

Globalcode – Open4education

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

Globalcode – Open4education

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

Globalcode – Open4education Attacks “As long as a majority of CPU power is controlled by nodes that are not cooperating to attack the network, they'll generate the longest chain and outpace attackers.” – Bitcoin whitepaper https://bitcoin.org/bitcoin.pdf

Slide 37

Slide 37 text

Globalcode – Open4education 51% Attack or Double-Spend Attack https://medium.com/coinmonks/what-is-a-51-attack-or-double-spend-attack-aa108db63474

Slide 38

Slide 38 text

Globalcode – Open4education 51% Attack or Double-Spend Attack https://medium.com/coinmonks/what-is-a-51-attack-or-double-spend-attack-aa108db63474

Slide 39

Slide 39 text

Globalcode – Open4education 51% Attack

Slide 40

Slide 40 text

Globalcode – Open4education 51% Attack Myths https://www.binance.vision/pt/security/what-is-a-51-percent-attack

Slide 41

Slide 41 text

Globalcode – Open4education https://www.crypto51.app/

Slide 42

Slide 42 text

Globalcode – Open4education “Houston we have a problem.”

Slide 43

Slide 43 text

Globalcode – Open4education Mining Pools https://www.blockchain.com/pools 07/15/2019

Slide 44

Slide 44 text

Globalcode – Open4education Proof of Stake (PoS) Examples: Cardano (Ouroboros), Nxt, Blackcoin, Peercoin “Everyone gets to vote proportional to their wealth” https://www.youtube.com/watch?v=psKDXvXdr7k Randomized Block Selection Coin Age Selection

Slide 45

Slide 45 text

Globalcode – Open4education Delegated Proof of Stake (DPoS) – 2014 Examples: EOS, BitShares, Steem, Lisk, Ark Digital Democracy Votes are proportional to the currencies Faster alternative Delegates vs Network Speed https://www.youtube.com/watch?v=OVKAOwzAwHI

Slide 46

Slide 46 text

Globalcode – Open4education “Don't do it, if you can avoid it.” Public Networks?

Slide 47

Slide 47 text

Globalcode – Open4education Practical Byzantine Fault Tolerance (PBFT) - 1999 http://pmg.csail.mit.edu/papers/osdi99.pdf Examples: Corda*, Hyperledger*, Neo*, Quorum* Closed networks Leader-based Full peering

Slide 48

Slide 48 text

Globalcode – Open4education The Byzantine Fault Tolerance http://www.csl.sri.com/papers/emsoft01/emsoft01.pdf

Slide 49

Slide 49 text

Globalcode – Open4education The Byzantine Fault Tolerance https://lwn.net/Articles/540368/

Slide 50

Slide 50 text

https://developers.libra.org/docs/assets/papers/the-libra-blockchain.pdf

Slide 51

Slide 51 text

Globalcode – Open4education Facebook LibraBFT Libra HotStuff https://developers.libra.org/docs/assets/papers/libra-consensus-state-machine-replication-in-the-libra-blockchain.pdf https://www.cs.unc.edu/~reiter/papers/2019/PODC.pdf

Slide 52

Slide 52 text

Globalcode – Open4education Some “Mastering” books…

Slide 53

Slide 53 text

Globalcode – Open4education …and whitepapers https://arxiv.org/pdf/1711.03936.pdf https://arxiv.org/pdf/1904.03487.pdf https://www.bitcoil.co.il/Doublespend.pdf

Slide 54

Slide 54 text

https://blog.acolyer.org/2018/02/12/sok-consensus-in-the-age-of-blockchains/

Slide 55

Slide 55 text

Globalcode – Open4education Go further Proof of Activity Proof of Authority Proof of Burn Proof of Capacity/Space Proof of Deposit Proof of Elapsed Time Proof of Importance Proof of Storage Delayed Proof of Work PAXOS RAFT Tangle FBA Casper FFG Casper CBC Hashgraph

Slide 56

Slide 56 text

Globalcode – Open4education … download this! bit.ly/tdcsp-2019 Leonardo Piedade

Slide 57

Slide 57 text

linkedin.com/in/leoap github.com/lpiedade [email protected]