Announcing an updated drawing protocol for the EffectiveAltruism.org donor lotteries

By SamDeere @ 2019-01-24T22:22 (+7)

Update 28 Jan 2019: We've reverted to using the original NIST Beacon protocol for the draw.

It has come to our attention that the public source of randomness used to draw the EffectiveAltruism.org donor lottery — the NIST Randomness Beacon — is not currently operating due to the ongoing US government shutdown. This means our regular method of drawing winning numbers is unavailable.

Methodology

There have been several alternative methods suggested for a good public source of randomness. After careful deliberation, we have chosen to use the Incorporated Research Institutions for Seismology (IRIS) list of earthquakes as a randomness source. The data includes a range of numbers that will be impossible to predict in advance, including the latitude, longitude, magnitude, and depth of the earthquake.

We will choose the first earthquake appearing on this list of large earthquakes with a timestamp immediately after the lottery draw date.

Specifically, we will:

We will do the drawing at least 24 hours after the draw date to ensure that IRIS has had time to process incoming data.

There are two lotteries up for drawing ($100k and $500k), currently with draw times staggered by five minutes. In order to ensure there are two separate drawings, we will reset their draw timestamps to be identical, and then use the first two earthquake events appearing on the list after that timestamp as follows:

Worked Example

Let’s assume that the donor lotteries in question closed at midnight on January 23, 2019. The two earthquake events immediately after this timestamp are 10998501 and 10998539 respectively.

Reference implementation

The following bash script illustrates the process for generating the hashes:

#!/bin/bash  

#  Bash script for calculating the winning lottery number using earthquake  
#  data from IRIS (Incorporated Research Institutions for Seismology).  
#  
#  Usage:  
#         ./draw_lottery_iris.sh iris_id  
#   e.g.  ./draw_lottery_iris.sh 10998811  
#  
#  The script works as follows:  
#  - get the request from the IRIS server for the relevant event  
#  - trim newlines from the response  
#  - strip the response to just the numeric digits  
#  - get the SHA256 hash of the digit string in binary  
#  - cast the binary hash to a hexdump (only keeping the first line)  
#  - truncate the hash to its first 10 characters  

EVENT_ID=$1  

curl -s "http://service.iris.edu/fdsnws/event/1/query?eventid=$EVENT_ID&format=text" \  
 | tr -d '\n' \  
 | awk '{gsub(/[^0-9]/,"")}1' \  
 | openssl dgst -sha256 -binary \  
 | xxd -p | head -n 1 \  
 | cut -c -10

Further info

To avoid any more late-breaking changes, we'll commit to using this protocol even in the event that the NIST beacon comes back online before the lottery draw date.

EDIT 28 Jan 2019: The NIST beacon has come back online. Notwithstanding the statement that we would stick with the above protocol, we've decided that it would be best to revert to the NIST Beacon as our source of randomness. That is, the drawing procedure will be as it originally was (as described in the donor lottery's methodology section).

If you have any more questions, please comment below.

Crossposted from the Centre For Effective Altruism blog


SamDeere @ 2019-01-28T23:49 (+7)

The NIST Beacon is back online. After consulting a number of people (and notwithstanding that we previously committed to not changing back), we've decided that it would in fact be better to revert to using the NIST beacon. I've edited the post text to reflect this, and emailed all lottery participants.

vipulnaik @ 2019-01-28T05:32 (+2)

It looks like the NIST randomness beacon will be back in time for the draw date of the lottery. https://www.nist.gov/programs-projects/nist-randomness-beacon says "NIST will reopen at 6:00 AM on Monday, January 28, 2019."

Might it make sense to return to the NIST randomness beacon for the drawing?

rafa_fanboy @ 2019-01-25T13:49 (+1)

random.org ?

SamDeere @ 2019-01-25T18:07 (+3)

AFAIK random.org offers to run lotteries for you (for a fee), but all participants still need to trust them to generate the numbers fairly. It's obviously unlikely that there would in fact be any problem here, but we're erring on the side of having something that's easier for an external party to inspect.

Paul_Christiano @ 2019-01-25T18:20 (+4)

Trusting random.org doesn't seem so bad (probably a bit better than trusting IRIS, since IRIS isn't in the business of claiming to be non-manipulable). I don't know if they support arbitrary winning probabilities for draws, but probably there is some way to make it work.

(That does seem strictly worse than hashing powerball numbers though, which seem more trustworthy than random.org and easier to get.)