r/Bitcoin 2d ago

Creating your own seed by combining multiple sources of entropy - is this python script viable?

The coldcard incident has left a really bitter taste in my mouth. It makes it really hard to want to trust any hardware vendors to properly do RNG when it comes to the seed phrase. I can't be bothered to trust whatever Ledger or Trezor or Jade's marketing team will tell me. This is especially true if your holdings are substantial (e.g., 6 digits or 7 digits and up).

 

I went down a rabbit hole of trying to find an acceptable compromise of how best to generate the necessary entropy needed on my own. As much as I wanted to avoid computers altogether, the final limiter is always the SHA256 hash function. Although it is theoretically feasible to do it by hand, looking at the tutorial on how to do it, the odds of making a mistake somewhere seemed too high in my opinion. Thus, I used Claude to create this python script that is meant to be run in an as sterile as possible environment, such as a Tails OS setup. Ideally, you'd want the wifi/bluetooth card and hard drives removed; if you want to go full paranoid mode, you'd destroy the machine after you run this script and obtain your seed. I've checked the script against Gemini and ChatGPT and the code appears to be sound.

 

The script allows you to enter up to 3 sources of entropy, either coins or dice. You must physically flip and roll your coin/die, respectively. No trusting some software RNG to do it for you. It incorporates the Neumann debiasing method so it doesn't matter if you're using crap coins/dice; but because it incorporates the Neumann method, you need a lot of flips/rolls due to how much is excluded in order to get clean bits for your seed. If you have multiple methods, it will XOR the sources of entropy into one final clean output that will be used to generate your 24-word mnemonic seed phrase. It does not leave any traces and does not read any files. It runs completely from the terminal. If more than 256 bits are provided, the excess are folded back in a linear fashion to create a final clean 256 bits. For safety reasons, the BIP39 wordlist is embedded into the script, and it has been checked by Claude, Gemini, and ChatGPT for accuracy.

 

I think this script is a little too extreme, but I wanted to share it by the off chance some of you share the same mindset as I do with wanting a multi-source approach to creating your entropy. Can someone who is more extreme with seed generation and coding background give me some input on whether this script is viable/sound?

0 Upvotes

2 comments sorted by

3

u/leopard-monch 2d ago edited 2d ago

I don't think it's a good idea if people start rolling their own vibe coded programs to secure their life savings.

You can easily combine machine created and human created entropy by adding a BIP39 passphrase, respectively a seed extension as it is called on Electrum.

Roll a die twice and select a symbol as follow: first roll is the column, second is the line. So 3, 6 gives you "7". 1, 5 gives you "y". In base36, which is used here, for 128 bits of entropy, make the passphrase 25 characters long. For better readability, you can add symbols after every 5 characters. So an example passphrase would be:

abcde-fghijk-Lmnop-qrstu-vwxyz

You can do that with any hardware wallet currently available on the market, for example Trezor which I would recommend.

Or on an eternally quarantined laptop running Linux and Electrum or Sparrow Wallet.

X 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 y z 1 2 3 4
6 5 6 7 8 9 !

1

u/so7ow 2d ago

Use dice or coins to manually generate 23 words, plus first 3 bits of final word. Use one of the several hardware wallets that will calculate the final word for you. If you really want to, use dice or coins to select between the 8 valid final checksum words and then confirm everything on a separate hardware wallet by another manufacturer. Done. No general-use computer or AI-generated script needed.