4

I am confused by the description of PoS algorithm here https://hackernoon.com/a-hitchhikers-guide-to-consensus-algorithms-d81aae3eb0e3

In PoS, the blocks aren’t created by miners doing work, but by minters staking their tokens to “bet” on which blocks are valid. In the case of a fork, minters spend their tokens voting on which fork to support. Assuming most people vote on the correct fork, validators who voted on the wrong fork would “lose their stake” in the correct one.

Is this how Ouroboros algorithm works?

srghma
  • 4,770
  • 2
  • 38
  • 54

2 Answers2

3

No.

A users stake is not directly affected by the staking process in any variant of the Ouroboros protocol. In practice, if a user extends the "wrong fork", they simply end up not getting any rewards for this block down the line.

Slashing algorithms are not necessary for Ouroboros, as it employs cryptography and probabalistic analysis to rule out the attacks it is designed to prevent.

Even if it were necessary, however, typically it comes in the form of punishing provably bad behaviour, and not honest "mistakes" (of which extending a shorter chain is one). Specifically, the variants I've seen will punish users if they create two blocks at the same point, i.e. they actively fork the chain.

1

In the Ouroboros Proof of Stake protocol, there is no penalty for betting on the wrong arm of a fork. And this does not only apply to deliberate, malicious fork attempts.

In Ouroboros it happens constantly and "by design" that two block producers each produce a block for the same slot. This happens because the allocation of a slot happens based on mathematical probabilities and the weight of the stake delegations. You can think of it as rolling dice. For example, a small pool must roll a 1 to become a slot leader. A larger pool is empowered to fill a slot if it rolls a 1 or 2. (the probabilities are of course much lower than described here on the basis of a 1-6 dice).

Each pool constantly rolls its own secret VRF key, and thus independently determines when it is slot leader. (in the Cardano mainnet which uses Ouroboros PoS it is a 2 second cycle) All other pools can check if this is a legitimate block when they receive the new block using the public VRF key.

Now, in some cases (about 5% of all blocks), chance may make two or even more stake pools legitimate slot leaders. So here several legitimate blocks are created without any bad intention at all.

However, Cardano's Ouroboros implementation has implemented a relatively fair solution for this, which allows a quick resolution of this fork. The winner is the block whose creator rolled the lowest number. This is a slight advantage for small pools, because they basically have to roll low to become the leader at all. But on average a pool loses about half (2.5%) of all generated blocks in these so-called slot battles because of the random collisions.

However, it is important that every node in the network can immediately determine the correct valid block without further data and time loss and that there is consensus on this. So these (by design) forks can be solved without much impact, and there is no need at all to punish anyone for this, especially not by slashing the participating tokens.

Markus G
  • 321
  • 2
  • 5