{{ message }}

Instantly share code, notes, and snippets.

# schierlm/IOTA-Dice.md

Created Aug 26, 2017
Generating a IOTA seed using a dice

# Generating a IOTA seed using a dice

If you do not trust seed generators and do not believe your random keyboard smashing is random enough, you can use a dice to generate a random, perfectly distributed IOTA seed.

Just follow the instructions below and write down the seed while you are throwing your dice.

Note that this can be tedious, as between 162 and 243 dice rolls are required to generate the whole seed.

## Instructions

• Roll your dice two times (remember the order of the results).
• If the first roll is a 6, or if the first roll is a 5 and the second roll is 4-6, roll a third time.
• Look up the character in the table below
• Repeat until your seed has 81 characters
First roll Second roll 1 2 3 4 5 6
1 A B C D E F
2 G H I J K L
3 M N O P Q R
4 S T U V W X
5 Third roll 1-2
Third roll 3-4
Third roll 5-6
Y Z 9 A
B
C
D
E
F
G
H
I
6 Third roll 1-2
Third roll 3-4
Third roll 5-6
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
9

### kachunga commented Dec 3, 2017

Thanks for the technique. I think it can be done more simply, with two rolls of the die. In a 6x6 grid assign the allowed characters (A-Z and 9) to 27 of the 36 possibilities from two rolls. Ignore rolls that come up with the other 9 possibilites in the grid, and just roll again. For each of the 81 seed positions, there is an equal probability of any of the 27 characters occupying that position. Would appreciate comments as I'm wondering if I've missed something.

### justinbass commented Dec 10, 2017 • edited

That method works equally well, but requires more dice rolls. Put simply, in the proposed method, no letter ever takes more than 3 rolls, but in your method, the maximum number of rolls to generate a number is technically infinite (what if you rolled 66, 66, 66, ...).

### justinbass commented Dec 10, 2017

Should be mentioned that both techniques are far from the optimally low ceil(log(27 ** 81, 6)) = 149 dice rolls.

For fun I created this repo to calculate a seed with the lowest number of rolls: https://github.com/justinbass/passthedice

### kachunga commented Dec 10, 2017

The method I describe above is fast, just takes a few minutes. Note that I meant roll two dice at once, not separate rolls of one die. Have used this method twice, and it requires about 100 rolls of two dice. To further avoid detectable patterns in the generation of the seed: (i) the nine grid squares to block out should be the pairs (1,1), (2,2), etc. plus (1,6), (2,5) and (3,4). This excludes all the dice numbers about equally (ii) fill in the remaining grid squares with A-Z and 9 in random order, and (iii) use different brands and sizes of 6-sided dice and mix and match them on the different rolls. For example I used 7 different pairs from 3 different dice brands, for a total of 14 dice to choose from on each roll. (i) and (iii) help avoid predictability from dice that might tend to land on certain numbers more than others due to being weighted imperfectly. In addition shake the dice a lot before each roll, and roll them on a surface/in an area where they can roll and bounce around a lot. I prefer rolling dice to relying on a computer-generated seed because with dice I can see for myself that it's random i.e. the mechanics of generating the seed are out in the open and simple. Also it is impossible for anyone to steal the seed electronically as a result of the generation method.

### kachunga commented Dec 11, 2017

Correction, (i) isn't about imperfectly weighted dice. What it does do is exclude all the numbers 1-6 about equally, helping avoid bias in the selection of characters forming the seed. (iii) does help minimize bias from dice that may be imperfectly weighted.

### mackleberry commented May 16, 2018

Guys I need to add a different way of generating an iota seed.

Its easier better simpler and 100% random

You need 9 different colores dice and a bag.

The dice has 6 faces. We only need 3 outcomes per dice. So if 1or2, 3or4, 5or6. 3 possibilities not 6.

3 possibilities times 9 equals 27.

100per cent random.

So 9 dice in a bag. Shake the bag. Pick 1 face of 1 dice in that bag. And you have the car 9 or A-Z