Bitcoin Forum
May 03, 2024, 04:46:25 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: custom mnemonic wordlist to generate deterministic keys and compare to addresses  (Read 80 times)
citb0in (OP)
Hero Member
*****
Offline Offline

Activity: 658
Merit: 656


Bitcoin g33k


View Profile
January 22, 2024, 07:43:51 PM
Last edit: January 22, 2024, 08:11:36 PM by citb0in
 #1

Hi all

do any of you know of an open source project preferably on github for free use that I could use as a basis for the following?

a custom mnemonic wordlist should be used, let's call it <klingon_mnemonic_word.lst> Smiley this klingon wordlist contains 2048 lines in total, a line can contain special characters like hyphens or an equal sign or other special characters. Spaces are also considered special characters. One word (or words) per line, so in summary the word list <klingon_mnemonic_word.lst> has 2048 lines.

Then there is another file called <btc_addresses.lst>. The tool should mass-gen n deterministic keys by using x words of the given mnemonic word list. The user should also be able to input how many derivation paths should be used for the generation. Then the seed should be generated and used to generate priv keys and their addresses. It should instantly check against the given list of Bitcoin addresses <btc_addresses.lst> and if a hit occurs it should output the result also to a log file <winner.txt>

Which freely available program (preferably Python or C++) can already handle this and I could use it as the basis for a test project so that I don't have to reinvent the wheel?

I look forward to helpful answers and thank you in advance.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
1714711585
Hero Member
*
Offline Offline

Posts: 1714711585

View Profile Personal Message (Offline)

Ignore
1714711585
Reply with quote  #2

1714711585
Report to moderator
1714711585
Hero Member
*
Offline Offline

Posts: 1714711585

View Profile Personal Message (Offline)

Ignore
1714711585
Reply with quote  #2

1714711585
Report to moderator
1714711585
Hero Member
*
Offline Offline

Posts: 1714711585

View Profile Personal Message (Offline)

Ignore
1714711585
Reply with quote  #2

1714711585
Report to moderator
It is a common myth that Bitcoin is ruled by a majority of miners. This is not true. Bitcoin miners "vote" on the ordering of transactions, but that's all they do. They can't vote to change the network rules.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
n0nce
Hero Member
*****
Offline Offline

Activity: 882
Merit: 5818


not your keys, not your coins!


View Profile WWW
January 22, 2024, 10:33:06 PM
Merited by pooya87 (2)
 #2

I don't know of any ready-made tool for this, but it sounds rather simple.

You could start with the Python reference implementation, from the BIP39 itself, for instance.

Wordlists are already in the format you describe, as shown here: https://github.com/bitcoin/bips/blob/master/bip-0039/bip-0039-wordlists.md
You just add yours in this directory: python-mnemonic/src/mnemonic/wordlist/

So let's assume you have a new wordlist at python-mnemonic/src/mnemonic/wordlist/klingon.txt and a list of addresses (one per line) in your working directory, called addresslist.txt.
Then your code would look something like this:
Code:
from mnemonic import Mnemonic
import bip32utils

# Import list of known addresses
addresslist = open("./addresslist.txt", "r").readlines()

mnemo = Mnemonic("klingon")
while True:
  # Create new random seed
  words = mnemo.generate(strength=256)
  seed = mnemo.to_seed(words)

  # Calculate root key, first child key and corresponding address
  root_key = bip32utils.BIP32Key.fromEntropy(seed)
  child_key = root_key.ChildKey(0).ChildKey(0) #adjust for custom derivation paths or add another loop
  child_address = child_key.Address()

  # Check if address is in given list of addresses
  if child_address in addresslist:
    print(f"Seed: {words} produces address: {child_address}")

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10530



View Profile
January 23, 2024, 04:31:12 AM
 #3

other special characters.
Electrum (https://github.com/spesmilo/electrum/blob/master/electrum/mnemonic.py) allows you enter your own custom word list and uses that when generating your BIP32 seed without a problem and in case by "special characters" you mean stuff that are outside of UTF8 range, Electrum handles that well too since it treats all inputs as Unicode (eg. it covers emojis). It is also not strict about the word count in that list.

The rest of the stuff like generating keys at certain derivation paths, storing to disk, etc. is something you should handle yourself by writing some script on top of mnemonic.py.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
citb0in (OP)
Hero Member
*****
Offline Offline

Activity: 658
Merit: 656


Bitcoin g33k


View Profile
January 23, 2024, 05:40:58 AM
 #4

good ideas! Thank you. I will dig into it soon and hopefully will find a suitable solution. Of course I need to adapt it to my needs but with some Python code this shouldn't be too difficult. The only bad thing on Python over C++ is the speed, so I guess I'll stick with secp256k1 from ice and multiprocessing or concurrent features for a fast key generation.

Thanks guys!

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10530



View Profile
January 23, 2024, 06:27:06 AM
 #5

What exactly are you trying to do that requires high speed? Is it some sort of brute forcing? Because in that case optimization is more complex than just using a certain programming language and a library.

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