Bitcoin Forum
May 01, 2024, 09:06:35 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: Math problem regarding recovery seed  (Read 832 times)
birr
Hero Member
*****
Offline Offline

Activity: 867
Merit: 584


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.
1714554395
Hero Member
*
Offline Offline

Posts: 1714554395

View Profile Personal Message (Offline)

Ignore
1714554395
Reply with quote  #2

1714554395
Report to moderator
1714554395
Hero Member
*
Offline Offline

Posts: 1714554395

View Profile Personal Message (Offline)

Ignore
1714554395
Reply with quote  #2

1714554395
Report to moderator
"Governments are good at cutting off the heads of a centrally controlled networks like Napster, but pure P2P networks like Gnutella and Tor seem to be holding their own." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714554395
Hero Member
*
Offline Offline

Posts: 1714554395

View Profile Personal Message (Offline)

Ignore
1714554395
Reply with quote  #2

1714554395
Report to moderator
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<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: 867
Merit: 584


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: 3430
Merit: 10519



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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
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!