I verified the words and the structure of the recoverySeed variable, but I'm still getting "ERROR: Invalid recovery seed".
What’s going on with my code?
issue with bip39.validateMnemonic()
6 replies 236 views
coin_sigmaLegendary
Posts: 1275 · Reputation: 5553
#2May 14, 2019, 05:08 AM
What software exactly you are using to generate seed?
Are you developing something?
I can't figure it out where did you get that error "invalid recovery seed". It looks like you are developing something that generates a seed phrase?
stack_2017Senior Member
Posts: 201 · Reputation: 1389
#3May 14, 2019, 05:53 AM
The words might be part of the wordlist, but this does not automatically make it a valid seedphrase.
Just by looking "seed seek shine"... "suit summer strong" etc.. it feels as if you scrolled down the wordlist, and then selected the words randomly.
You can use the same library you're using now to generate a valid seedphrase as written here: https://github.com/bitcoinjs/bip39
It is very wrong to let people know your seed phrase for the people not to be able to compromise your wallet. But it is fine if you know this already. Your seed phrase is your money. If stolen, your coins on the addresses the keys of the seed phrase generated will all be stolen.
You are right. I inputted both on iancoleman and they are both invalid. Also I join both together to make it 24 words seed phrase and still invalid. Roskapostit should let us know how he generated the seed phrase just as BitMaxz posted.
Thanks. This indeed was the problem. The last word is a checksum so this is why it didn't work.
FTFY
Sorry for being pedantic.
You didn't check closely the format actually, if you haven't calculated and added the checksum to the seed. It's a bit harder than randomly generating 24 words belonging to the 2048 words list in reality.
You have to generate randomly a binary value with a length between 128 and 256 bits, multiple of 32. Then to hash it with SHA256 and take the first length/32 bits of this hash as the checksum you put at the end of your binary string. After that, you need to convert each 11 bits packets of this string into words from the indexed wordlist to get your final mnemonic seed.
You can find the precise requirements here https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki
Related topics
- Bitcoin Core displaying coins (UTXOs) in a new tab 13
- Are you in favor of BIP-110? Let's get a Bitcoin poll going. 0
- Erlay seems to have some issues here’s a better proposal for a bitcoin protocol without invites 3
- New Optional Hourglass Implementation is Live 3
- Ways to earn some sats by contributing to bitcoin core development 5
- Exploring the Potential and Challenges of a Kardashev-Scale Bitcoin Network 3