Randomness In Decred

Discussion in 'Governance' started by demo, May 23, 2017.

  1. 2017/12/15 - Decred v1.1.2 released! → Release Notes  → Downloads
  1. demo

    demo New Member

    Jan 8, 2017
    24
    2
    earth
    How this randomness occurs?
    Is this randomness a network randomness or a local one?
    If it is a local one, can I hack my local random generator (/dev/random) and cheat the system?

    Can someone show me the code chunk?

    https://github.com/decred

    thanks for your answer
     
  2. davecgh

    davecgh Hero Member
    Developer Organizer

    Dec 31, 2015
    642
    788
    Male
    United States
    It uses a deterministic PRNG with a seed of the header of the block that is being voted on. This ensures every node is able to independently verify consensus while still providing a selection process that is random.

    What is probably the most readable code regarding this process can be found in the chaingen package which is used to actually test the consensus rules.

    https://github.com/decred/dcrd/blob/master/blockchain/chaingen/generator.go#L996-L1118
     
    demo likes this.

Share This Page