Skip to content

POPS-VRF implementation #172

@moshababo

Description

@moshababo

Proof of Work Protected Setup-Verifiable Random Function (POPS-VRF)

Replacing #146, #168, spacemeshos/go-spacemesh#3507

Motivation

Prevent miners from choosing any arbitrary VRF identity that they wish to use in the consensus protocol.

More info can be found here.

Solution

  1. Impose cost on VRF identity generation (while keeping it amortised for honest users), so that a bounded adversary won't be able to "try" too many identities.

    This would help to prevent grinding on VRF identities to perform concentration attacks in Hare and ballots production. But it isn't sufficient for the beacon, where identity-grinding can be expended over a long period of time. And so:

  2. Require VRF identities to be “positioned in time” by using a positioning element, providing an efficient way to be sorted according to the time it was generated after.

    This would allow to implement a mitigation of a DoS attack against the beacon, where in case of getting too many proposals (considering the total weight of ATXs), they can be sorted according to their identity's time positioning, so that oldest identities' proposals could be ignored.

    More info about the attack and the mitigation can be found here.

VRF identity workflow

  1. Pick an arbitrary VRF key pair
  2. Commit the VRF pub key + a positioning element to PoST initialisation
  3. During PoST initialisation, check for every nonce whether it satisfies H( nonce ++ VRFpk ++ positioning ) < d
  4. A successful nonce should be used in every VRF invocation

Implementation

Support increase of number of units

Extracted this feature into its own epic: #209

This feature is currently not supported in the ATX level. If/when it will, it should impact the VRF generation difficulty so that the probability of finding one nonce during the (now longer) PoST initialisation will remain. In the case, the previously found nonce might turn invalid, and a new nonce will need to be advertised in a non-initial ATX, which contains the updated number of units.

An implementation implication of a potential higher difficulty (and so a lower threshold) is that finding a successful nonce won't be enough, because a better/lower one might be skipped as a result of that and so:

The good news

Having the VRF identity to have an on-mesh positioning element makes the requirement to commit genesis ID to PoST initialisation (in order to prevent its re-use across different networks) redundant because the positioning element already includes the genesis ID in a path of collision-resistant hashes.

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions