The random processes in the contract need a source of "entropy" to fuel that randomness. Anyone can contribute entropy to the election, both before the election starts (used for the randomness of group meeting assignment) as well as the final sortition round that selects the Head Chief.

To encourage the community to learn how this is done and own the process, we're offering a 10 EOS bounty to the person who successfully contributes the block header that ends up being used for the election.

▶️ Video Walkthrough of the process described below

Before the Election

Beginning 24 hours prior to the election's start_time, you can seed the randomizer! And this can be done again and again; seeds with higher entropy will trump previously-submitted seeds that have less entropy.

To do so, call (with any account) the electseed action on the contract with a Bitcoin serialized block header from the last hour or so. You should see success. (See Getting Bitcoin Block Header section below for more details.) If you're first, you will also see that the elect.curr state has updated to current_election_state_seeding.

  1. Get start_time from elect.curr with this link. Notice:
    1. "Contract" tab is selected
    2. contract name: genesis.eden
    3. "Tables" tab is selected
    4. elect.curr table is selected
    5. Scope: 0
  2. Get Bitcoin Block Header that was produced during the 24-hour window preceding start-time (see section just below)
  3. Submit bitcoin block header via electseed action here

The Final Sortition Round

The final sortition round needs randomness to be a truly random process. We take randomness from the Bitcoin blockchain.

  1. Query the elect.curr table, and note the start_time and end_time. (See instructions just above) because you'll need a block header that was produced in the time window defined by these 2 values, which constitutes a 2-hour period.
  2. Grab a serialized Bitcoin block header that's between the start_time and end_time (see Getting Bitcoin Block Header just below)
  3. Run electseed with the header as the value here. See the electseed function and its comments in our election technical doc for more details.

Getting Bitcoin Block Header

  1. Get latest block hash: https://blockstream.info/api/blocks/tip/hash

    Alternatively, get hashes (id) for the last 10 blocks: https://blockstream.info/api/blocks or https://blockstream.info/api/blocks/{$startHeight} for the 10 blocks starting at the startHeight.

  2. Get serialized header from hash: https://blockstream.info/api/block/${hash}/header(e.g., https://blockstream.info/api/block/000000000000000000025181bed97f038c9e0153129f1caed4f5d8959c413592/header)

🔗 Blockstream API Reference

Note: You can alternatively get a serialized block header from other sites like https://learnmeabitcoin.com/explorer/blockchain/ but you want an appropriately timed header, and on some sites, eg. leanmeabitcoin.com, the header info is often delayed. If it's up-to-date, just click on a later block and toggle to see the header "Serialized."