際際滷

際際滷Share a Scribd company logo
Consensus Models
Barry OConnor
9th April 2018
When?
1. Permissionless Blockchains
2. Permissioned Blockchains
1. A dynamic way of reaching agreement in a group
2. Not voting  majority rule
3. Consensus  for the good of the group
What?
1. Agreement Seeking: As much agreement from the group as possible.
2. Collaborative: Aim to work together to achieve a result that puts the
best interest of the group first.
3. Cooperative: Should not put their own interests first and work as a team
more than individuals.
4. Egalitarian: A group trying to achieve consensus should be as egalitarian
as possible.
5. Inclusive: As many people as possible should be involved in the
consensus process.
6. Participatory: It should be such that everyone should actively participate
in the the overall process.
Byzantine Generals Problem(BGP)
1. A General
2. His lieutenants
3. Traitors
 The generals are collectively known as processes.
 The general who initiates the order is the source process, and the orders sent to the other processes are messages.
 Traitorous generals and lieutenants are faulty processes, and loyal generals and lieutenants are correct processes.
 The order to retreat or attack is a message with a 1 or 0.
 In general, a solution to agreement problems must pass three tests: termination, agreement, and validity. As applied to the
Byzantine General's problem, these three tests are:
1. A solution has to guarantee that all correct processes eventually reach a decision regarding the value of the order they have
been given.
2. All correct processes have to decide on the same value of the order they have been given.
3. If the source process is a correct process, all processes have to decide on the value that was originally given by the source
process.
https://people.eecs.berkeley.edu/~luca/cs174/byzantine.pdf
How do you solve it?
1.Proof for work
2.Proof of stake
3.Delegated proof of stake
4.Delegated Byzantine fault tolerance
1. Proof of work
BGP
1. Attack tonight
2. Add a NONCE to the text  a random hex
3. They hash the text with the nonce and see the result. They only
decide to share messages that start with 00000.
4. If the hash is met, they send the messages. If not, they will
randomly change the nonce until the hash works.
5. If it is intercepted and changed, a general can look for the 00000.
This is BTC Mining using cryptographic puzzles.
2. Proof of stake
1. The validators lock up some of their coins as stake.
2. After that, they will start validating the blocks.
 Meaning, when they discover a block which they think can be added to the
chain, they will validate it by placing a bet on it.
3. Validators take turns proposing and voting on the next block.
4. If the block gets appended to the chain, then the validators will get
a reward proportionate to their bets.
Ethereum is moving to this model with Casper.
3. Delegated proof of stake
1. At the start of every round, 21 block producers(Witnesses) are chosen.
 Top 20 are automatically chosen while the 21st one is chosen proportional to the
number of their votes relative to the other producers.
2. The producers are then shuffled around using a pseudorandom number
derived from the block time.
 This is done to ensure that a balance connectivity to all other producers is
maintained.
3. To ensure that regular block production is maintained and that block
time is kept to 3 seconds, producers are punished for not participating by
being removed from consideration.
4. A producer has to produce at least one block every 24 hours to be in
consideration.
EOS is using this to scale up to millions of TPS
4. Delegated Byzantine fault tolerance
1. One of the delegates is randomly chosen as a speaker.
1. The Speaker then look at all the demands of the citizens and creates a law.
2. They then calculate a Happiness Factor of these laws to see if the number is enough to
satisfy the citizens needs or not.
3. They then pass that down to the delegates.
2. The delegates then individually check the Speakers calculations.
1. If the the speakers number matches the Delegates then they give their approval, if not
then they give their disapproval.
2. 66% of the delegates need to give their approval for the law to pass.
3. If the majority is not sealed, then a new leader is chosen and the process starts
again.
4. The citizens are whoever owns tokens aka ordinary nodes.
5. Delegates are the bookkeeping nodes.
The NEO network uses this model
Thank you.

More Related Content

Consensus models April 2018

  • 2. When? 1. Permissionless Blockchains 2. Permissioned Blockchains 1. A dynamic way of reaching agreement in a group 2. Not voting majority rule 3. Consensus for the good of the group
  • 3. What? 1. Agreement Seeking: As much agreement from the group as possible. 2. Collaborative: Aim to work together to achieve a result that puts the best interest of the group first. 3. Cooperative: Should not put their own interests first and work as a team more than individuals. 4. Egalitarian: A group trying to achieve consensus should be as egalitarian as possible. 5. Inclusive: As many people as possible should be involved in the consensus process. 6. Participatory: It should be such that everyone should actively participate in the the overall process.
  • 4. Byzantine Generals Problem(BGP) 1. A General 2. His lieutenants 3. Traitors The generals are collectively known as processes. The general who initiates the order is the source process, and the orders sent to the other processes are messages. Traitorous generals and lieutenants are faulty processes, and loyal generals and lieutenants are correct processes. The order to retreat or attack is a message with a 1 or 0. In general, a solution to agreement problems must pass three tests: termination, agreement, and validity. As applied to the Byzantine General's problem, these three tests are: 1. A solution has to guarantee that all correct processes eventually reach a decision regarding the value of the order they have been given. 2. All correct processes have to decide on the same value of the order they have been given. 3. If the source process is a correct process, all processes have to decide on the value that was originally given by the source process. https://people.eecs.berkeley.edu/~luca/cs174/byzantine.pdf
  • 5. How do you solve it? 1.Proof for work 2.Proof of stake 3.Delegated proof of stake 4.Delegated Byzantine fault tolerance
  • 6. 1. Proof of work BGP 1. Attack tonight 2. Add a NONCE to the text a random hex 3. They hash the text with the nonce and see the result. They only decide to share messages that start with 00000. 4. If the hash is met, they send the messages. If not, they will randomly change the nonce until the hash works. 5. If it is intercepted and changed, a general can look for the 00000. This is BTC Mining using cryptographic puzzles.
  • 7. 2. Proof of stake 1. The validators lock up some of their coins as stake. 2. After that, they will start validating the blocks. Meaning, when they discover a block which they think can be added to the chain, they will validate it by placing a bet on it. 3. Validators take turns proposing and voting on the next block. 4. If the block gets appended to the chain, then the validators will get a reward proportionate to their bets. Ethereum is moving to this model with Casper.
  • 8. 3. Delegated proof of stake 1. At the start of every round, 21 block producers(Witnesses) are chosen. Top 20 are automatically chosen while the 21st one is chosen proportional to the number of their votes relative to the other producers. 2. The producers are then shuffled around using a pseudorandom number derived from the block time. This is done to ensure that a balance connectivity to all other producers is maintained. 3. To ensure that regular block production is maintained and that block time is kept to 3 seconds, producers are punished for not participating by being removed from consideration. 4. A producer has to produce at least one block every 24 hours to be in consideration. EOS is using this to scale up to millions of TPS
  • 9. 4. Delegated Byzantine fault tolerance 1. One of the delegates is randomly chosen as a speaker. 1. The Speaker then look at all the demands of the citizens and creates a law. 2. They then calculate a Happiness Factor of these laws to see if the number is enough to satisfy the citizens needs or not. 3. They then pass that down to the delegates. 2. The delegates then individually check the Speakers calculations. 1. If the the speakers number matches the Delegates then they give their approval, if not then they give their disapproval. 2. 66% of the delegates need to give their approval for the law to pass. 3. If the majority is not sealed, then a new leader is chosen and the process starts again. 4. The citizens are whoever owns tokens aka ordinary nodes. 5. Delegates are the bookkeeping nodes. The NEO network uses this model