L03: Consensus Mechanisms Flashcards

1
Q

Objectives of consensus mechanisms (5)

A
  1. Achieve unified agreement about the state of the network. Nodes ensure that the network status is always updated to the latest consensus.
  2. Prevent double-spending by reviewing the transaction history and ensuring only valid transactions be included in the public ledger.
  3. Incentivise self-regulation of a trustless system by aligning the interests of all network participants. (e.g. through token rewards) and punish rogue actors (e.g. by making dubious acts financially and computationally prohibitive) to ensure that actors work for the system than against it.
  4. Ensure equality keeping low entry barriers. Enable everyone to review the underlying source code to directly evaluate a protocol’s fairness.
  5. Provide fault tolerance by ensuring immediate and uninterrupted replacement in the event of failure by resorting to backup components or other procedures through consensus mechanisms.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Consensus Mechanisms– CAP Theorem

Explain what C,A,P mean. Explain what the theorem means.

A
  • Consistency (C): Consistency means that no two nodes in a network provide a different state at any point in time and that no node returns a non-current state.
  • Availability (A): Availability means that every node in a system will always provide a (non-error) response, enabling users to read-and/or-write at any time.
  • Partition tolerance (P): Partition tolerance means that a network is able to continue operations in the event that two or more nodes of a network fail to communicate

Distributed database systems are unable to simultaneously achieve consistency, availability, and partition tolerance–> therefore, aim to optimize two of the three properties simultaneously.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What kind of system optimise for:
1. C & A but not P
2. P & A but not C
3. P & C but not A

A
  1. non-distributed centralised databases.
  2. distributed/decentralised
  3. distributed/decentralised
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
  • CAP theorem is about compromising in database design
  • Because any (distributed) system assumes some degree of partition tolerance, the question is …. Is it preferable to have a system return potentially outdated values, or no values at all?
  • Byzantine fault: components in distributed computer system can fail, and … — server inconsistently appears both failing and functioning, presenting …, making it difficult to reach consensus as to …
A

availability versus consistency

information regarding component failure is incomplete

different symptoms to different observers

which server really failed and should be disconnected

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Abstract version of BGP:

A

◦ How to reach consensus among parties (i.e., components in a distributed system)
◦ regarding which components have been compromised (i.e., have failed)
◦ with imperfect information on compromisation (i.e., whether a component has failed)?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
  • Q: How would you solve the Byzantine Generals’ Problem?
A
  • A: Design a consensus algorithm that ensures that:
    1. All loyal generals decide upon the same plan of action.
    2. A small number of traitors cannot cause the loyal generals to adopt a bad plan.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do PoW consensus mechanism solve the Byzantine Generals’ Problem? (e.g bitcoin) – 5 steps

In PoW, miners have to solve a computationally difficult puzzle to propose a new block to the blockchain.

A

◦ Puzzle Difficulty: The puzzle is hard to solve but easy to verify.
◦ Solving it requires significant computational effort (hashing power).
◦ Block Proposal: The first miner to solve the puzzle broadcasts the block to the network.
◦ Verification: Other nodes verify the solution and the validity of the transactions within the block.
◦ Longest Chain Rule: The chain with the most cumulative proof of work is considered the valid chain.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Differentiate between a soft fork and a hard fork. Give an example of each of those.

A

Soft fork: backward compatible upgrade to the blockchain protocol. Nodes running on old software will accept blocks produced under new rules as valid but nodes running on new software version will not accept blocks produced under old rules as valid. Used to implement new features or security enhancements without requiring all nodes to upgrade.

E.g. Segregated Witness (SegWit) in Bitcoin aimed to improve transaction malleability and increase block capacity

Hard fork: non-backward compatible upgrade to the blockchain protocol. Nodes that do not upgrade will not recognise new blocks as valid –> potentially leading to a permanent split. Use: Hard forks can result from fundamental changes in the protocol, or to reverse transactions after a security breach.

E.g. Ethereum’s hard fork after The DAO Hack resulted in the creation of Ethereum (ETH) and Ethereum Classic (ETC).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
  • Q: How do miners of two simultaneous blocks split the mining rewards?
  • A: They do not split in a …!
    1. Initial Fork:
    Miner A finds Block 101 and broadcasts it.
    Miner B, almost simultaneously, finds another Block 101 and broadcasts it.
  1. Temporary Fork:
    Some nodes and miners receive and build on Miner A’s Block 101, while others receive and build on Miner B’s Block 101.
  2. Chain Resolution:
    Miner C mines Block 102 on top of Miner A’s Block 101.
    Now, Miner A’s chain is longer (101 -¿ 102), and the network starts to adopt this chain.
  3. Outcome:
A

soft fork

Miner A gets the reward for Block 101, and Miner C gets the reward for Block 102. Miner B’s Block 101 is orphaned, and Miner B does not receive any rewards.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do PoW consensus mechanism solve the Byzantine Generals’ Problem?

  • PoW achieves Byzantine Fault Tolerance as follows:
    ◦ …: It is computationally infeasible for a single entity to control the majority of the network’s hashing power (51% attack).
    ◦ Sybil Resistance: …
    ◦ …
A

Security Through Energy Consumption

Miners must invest significant resources (electricity and hardware) to participate, making it expensive to act maliciously.

Chain Reorganization: Even if a few blocks are temporarily altered by a malicious entity, the honest chain will eventually become the longest due to cumulative work, rendering the attack futile.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do PoS consensus mechanism solve the Byzantine Generals’ Problem?
* Example: Ethereum 2.0 and Cardano
* In PoS, validators are chosen to propose and validate blocks based on the…
◦ Stake Weighting: The probability of …
◦ Validation: …
◦ Slashing: Validators are penalized (slashed) if they … or fail to perform their duties correctly.

A

amount of cryptocurrency they are willing to “stake.”

being chosen to propose a block is proportional to the amount of stake.

Validators check the proposed block. If the block is valid, they append it to the blockchain.

act maliciously

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

PoS achieves Byzantine Fault Tolerance as follows:
◦ Economic Incentives: Validators are incentivized to act honestly because…
◦ Finality Mechanisms: PoS systems often employ … (like Casper FFG in Ethereum 2.0) that ensure …
◦ Reduced Energy Consumption: PoS achieves consensus without the high energy costs of PoW, but with …

A

they have a financial stake in the network. Acting maliciously risks losing their staked funds.

finality gadgets; once a block is finalized, it cannot be reverted without significant cost.

strong economic disincentives against misbehavior.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

PoS: Validator selection; Consensus Process; Decentralisation

A
  1. Stake-based selection; randomised process
  2. Validation and rewards: When selected, a validator creates a new block and
    broadcasts it to the network. If the block is accepted by the network, the validator
    receives a reward, usually in the form of transaction fees and newly minted tokens. Slashing in case of malicious intents/ fail to validate transactions properly.
  3. Decentralisation level is high– any token holder can participate; the degree of decentralisation depends on the distribution of token holdings.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

DPoS: Validator selection; Consensus Process; Decentralisation

A
  1. i) In DPoS, token holders vote to elect a small, fixed number of delegates (also known as ”witnesses” or ”block producers”) who are responsible for validating transactions and creating new blocks. Token holders can delegate their voting power to others
    ii) Voting and Election: The voting process is continuous, allowing for the replacement of delegates based
    on their performance and the community’s preferences
  2. i)Rotation and Block Production: Elected delegates take turns producing blocks in a predetermined order. This rotation ensures that all selected delegates have the opportunity to produce blocks
    ii) Efficiency and Speed: DPoS is designed to be more efficient and faster than PoS, with block production
    times typically shorter due to the limited number of validators and the streamlined consensus process
  3. i) Representative Democracy: DPoS introduces a form of representative democracy, where token holders influence the network indirectly through their chosen delegates. This can lead to a lower level of
    decentralisation compared to PoS, as only a small number of delegates control block production
    ii) Accountability: Delegates are held accountable by the community and can be voted out if they do not
    perform their duties effectively or act against the network’s interests
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Key differences between DPoS and PoS:

Selection mechanism; Number of validators; Efficiency/Scalability; Governance/Flexibility; Security/Attack vectors

A

◦ Selection Mechanism
PoS: Validators are chosen based on their individual stake in the network DPoS: Validators are elected by token holders through a voting process

◦ Number of Validators
PoS: Potentially a large number of validators, depending on the number of stakers DPoS: A fixed, smaller number of delegates are responsible for block production

◦ Efficiency and Scalability
PoS: Generally slower due to the larger number of validators and more complex consensus process DPoS: More efficient and faster due to the streamlined process and limited number of block producers

◦ Governance and Flexibility
PoS: Governance can be slower as all stakeholders need to participate in decision-making processes
DPoS: More flexible and adaptable governance model, allowing for quick changes through delegate voting

◦ Security and Attack Vectors
PoS: Security relies on the economic stake; higher decentralization can increase resilience against
attacks
DPoS: Security depends on the elected delegates’ integrity and the community’s vigilance in holding them accountable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly