Post

DIY crypto wallet out of rain drops β˜”οΈ

DIY crypto wallet out of rain drops β˜”οΈ

When rain starts - where do you look? πŸ‘€

I’ve always been drawn to look down at the street and see how raindrops spread across pavement - marking first watter drop hits on the ground before they cover it all.

Today was no different. When first rain drops hit my head, as usual, I started looking down - but this time, rain had not much concrete to cover apart from lawn and trees, sinse I was walking outside my family’s countryside residence.

Im my world πŸ—ΊοΈ

The only concrete in rains posession was a little alley near our house made of perfectly square cement blocks. They obserb rain drops flawelessly, creating a perfectly visible pattern.

The idea of using this natural random generation instantly came to me.
As a square makes a perfect shape to extract data from.

Let’s extract some DATA πŸ“Š

A square cement block can be seen as a grid: number by number.
So all we need to do is define the number (grid size) and extract coordinates to work with.

Coordinate map representation What needs to be done

Instant idea πŸ’‘

Was to create a naturally-generated crypto wallet. And the best ratio for this job is 256x256.

  1. To generate a wallet mnemonic, 128 bits of entropy are needed (BIP-39).
  2. Every coordinate X or Y on a 256Γ—256 grid ranges from 0 to 255 β€” representing 1 byte = 8 bits.
  3. So a pair of (x, y) = 2 bytes = 16 bits of entropy.
  4. 128 / 16 = 8 pairs of (x, y) are needed to generate a 12-word seed phrase in BIP-39 standard.

Execution πŸ‘¨πŸ»β€πŸ’»

I took a picture of a cement square and mapped the rain hits coordinates onto a 256x256 grid using GIMP.

1
2
3
4
5
6
7
8
9
10
11
// Coordinates of 8 raindrops on a 256 by 256 square grid
const raindrops = [
  { x: 23, y: 112 },
  { x: 65,  y: 34 },
  { x: 136,  y: 188 },
  { x: 110,   y: 120 },
  { x: 101,  y: 140 },
  { x: 227, y: 180 },
  { x: 144,  y: 38 },
  { x: 228, y: 56 },
];

All that’s left is to use BIP-39 to finish the job;

1
2
3
4
5
6
7
import { entropyToMnemonic } from 'bip39';

const entropyBytes = Uint8Array.from(raindrops.flatMap(({ x, y }) => [x, y]));
const mnemonic = entropyToMnemonic(Buffer.from(entropyBytes));

console.log("🧠 Mnemonic:", mnemonic); 
// 🧠 Mnemonic: blast link emerge badge shoulder destroy normal organ region license ribbon immense

Feel free to create your own unique wallet using the guide and code above β€” it’s also available on my GitHub.

NO NEED TO WAIT FOR RAIN: Grab a coloring brush and splash some color onto white paper β€” random splashes guaranteed 🀝🏼

This post is licensed under CC BY 4.0 by the author.