Bitcoin Forum
November 14, 2024, 07:12:31 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: Math problem regarding recovery seed  (Read 873 times)
birr
Hero Member
*****
Offline Offline

Activity: 870
Merit: 585


View Profile
September 29, 2020, 05:43:45 PM
 #21

there isn't just one command for creating the hash

Maybe OP has the chops to roll his own bip39 in c or python or whatever, but why bother.  He should just use the bash command.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4361

<insert witty quote here>


View Profile
September 30, 2020, 12:27:25 AM
 #22

That's kinda my point, you don't need to "roll your own" anything... there are already libraries in most of the popular languages that do it all for you and they're all linked in the BIP39 spec: https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki#other-implementations

And what if the OP doesn't use Linux? Wink

All joking aside, the BIP39 spec isn't really there to provide implementation specific commands etc, but more of a high level description of the process involved. It's left up to the user to decide how they actually want to go about implementing the spec.

It's all specific use-case dependent.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
birr
Hero Member
*****
Offline Offline

Activity: 870
Merit: 585


View Profile
October 10, 2020, 07:18:02 PM
 #23

The use case is to test a 24 word mnemonic for checksum validity

refer to the bip 39 wordlist, which can be found here
https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt
but it is numbered 1 through 2048, which is wrong, and will give wrong results if you use it.
Change the numbering to 0 through 2047.  That's 11 bits.
Then look up each of your 24 words in that list, and record each word as an 11 bit binary number (include leading zeros) and concatenate them in a 264 bit string.
Divide the string into a 256 bit string and an 8 bit string.  The 256 bit string is ENT.  The 8 bits is the checksum, which might be right or wrong.
Do a sha256 hash of ENT, using the specified syntax.  Compare the first 8 bits of the hash to the 8 bits you took from the end of the 264 bit mnemonic binary.
pooya87
Legendary
*
Offline Offline

Activity: 3640
Merit: 11033


Crypto Swap Exchange


View Profile
October 11, 2020, 02:50:05 AM
 #24

but it is numbered 1 through 2048, which is wrong, and will give wrong results if you use it.
it is not numbered (https://raw.githubusercontent.com/bitcoin/bips/master/bip-0039/english.txt). and you shouldn't be using the list by hand anyways.
the numbers you see is the default line numbers that GitHub adds to all the files and they start from 1. here is some random "code" file where you can see the line numbers: https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp

Maybe OP has the chops to roll his own bip39 in c or python or whatever, but why bother.  He should just use the bash command.
using bash would be super slow for OP's case (ignoring the fact that the topic is more than a year old). additionally just finding the correct checksum is not enough, you'll still be left with tens of thousands of mnemonics that you'd have to use to derive key(s) from and check those too.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: « 1 [2]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!