Another way to do this, for "perfect" entropy calculation is to roll six-sided dice and write down bits. Then convert those directly to a private key...
Bleah, I coded some python to turn any-sided dice into a full-strength private key, no hashes. The answer is it takes a LOT of dice rolling, less than 100 d6's is not a full-strength key.
I quit at an unencoded 64 byte hex key, you can convert it to an importable key/address with
http://bitaddress.org or such.
**Dice to Bitcoin private key generator**
>How many sides on your dice?:6
Need 100 rolls of 6-sided dice. (258.496250072 bits)
Number of dice rolls so far: 0, need 100 more.
input dice rolling results, no space between rolls:)
>22222222222222333333333333333
Number of dice rolls so far: 29, need 71 more.
input dice rolling results, no space between rolls:)
>2222222222244444444444
Number of dice rolls so far: 51, need 49 more.
input dice rolling results, no space between rolls:)
>2222222222333333333
Number of dice rolls so far: 70, need 30 more.
input dice rolling results, no space between rolls:)
>1
Number of dice rolls so far: 71, need 29 more.
input dice rolling results, no space between rolls:)
>55555555555
Number of dice rolls so far: 82, need 18 more.
input dice rolling results, no space between rolls:)
>333333
Number of dice rolls so far: 88, need 12 more.
input dice rolling results, no space between rolls:)
>55555555
Number of dice rolls so far: 96, need 4 more.
input dice rolling results, no space between rolls:)
>222222222
raw private key: 218c3c240686849676c9828fc5fd8749860365a0ed82ebe3e601a2b9a039f333
Or if you want to see what it looks like with bits or coin flips:
**Dice to Bitcoin private key generator**
>How many sides on your dice?:2
Need 256 rolls of 2-sided dice. (256.0 bits)
Number of dice rolls so far: 0, need 256 more.
input dice rolling results, no space between rolls:)
>1111111111111111111111111111111122222222222222222222222222222222111111111111111 1111111111111111122222222222222222222222222222222
Number of dice rolls so far: 128, need 128 more.
input dice rolling results, no space between rolls:)
>1111111111111111111111111111111122222222222222222222222222222222111111111111111 1111111111111111122222222222222222222222222222222
raw private key: ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000
import math
keyval = 0
sides = ''
roll_list = []
maxkey = int('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141', base=16)
while not sides.isdigit() or int(sides) < 2:
sides = raw_input('**Dice to Bitcoin private key generator**\n>How many sides on your dice?:')
sides = int(sides)
rolls = int(math.ceil(math.log(maxkey, sides)))
print "Need %s rolls of %s-sided dice. (%s bits)" % (rolls, sides, math.log(math.pow(sides, rolls), 2))
while len(roll_list) < rolls:
print "Number of dice rolls so far: %s, need %s more." % (len(roll_list), rolls-len(roll_list))
if sides < 10:
rollinput = raw_input('input dice rolling results, no space between rolls:)\n>')
rollinput = list(rollinput)
else:
rollinput = raw_input('input dice rolling results,separated by spaces:)\n>')
rollinput = rollinput.split()
add_rolls = []
for inputitem in rollinput:
if not inputitem.isdigit() or int(inputitem) < 1 or int(inputitem) > sides:
print "**invalid dice roll detected: '%s', discarding all input " % inputitem
break
add_rolls.append(int(inputitem))
roll_list.extend(add_rolls)
for i in range(rolls):
keyval += (roll_list[i]-1) * sides ** i
hexkey = "{0:064x}".format(keyval)[-64:] # truncate to 64 bytes hex
if int(hexkey, base=16) > maxkey or int(hexkey, base=16) < 1:
raise Exception('Wow, invalid key, try again!')
print "raw private key: ", hexkey
Not a problem to roll that many dice if you've got a
dice-o-matic, though.