Author

Topic: how to convert xprv to wif or (hex) 1,2,3 address index (python) (Read 188 times)

legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
I did through bash as advised odolvlobo
but it turned out the speed is very low 23 xprv per second and I have a dictionary for 1 million xprv

anyway thank you for checking

If you need better performance, you might want to check different Python library which should have better performance[1-3]. You also could check Python multi-core programming feature[4].

[1] https://github.com/ofek/bit
[2] https://github.com/1200wd/bitcoinlib
[3] https://github.com/richardkiss/pycoin
[4] https://docs.python.org/3/library/multiprocessing.html
newbie
Activity: 54
Merit: 0
You can make a wrapper script around bip32gen, in a single file using `os.spawnl` to create a bip32gen subprocess and wait for it to exit. The wrapper will just read the list of keys from a file and loop through them.
Note: Make sure you make the script wrapper executable.
Code:
#!/usr/bin/python3
import os

keys = []
file = open('keys.txt' 'r')
for l in file:
    keys.append(l.strip('\n'))
for k in keys:
    os.spawnl(os.P_WAIT, '/path/to/bip32gen', ['cmd', 'options', 'as', 'list'])



I did through bash as advised odolvlobo
but it turned out the speed is very low 23 xprv per second and I have a dictionary for 1 million xprv

anyway thank you for checking
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
You can make a wrapper script around bip32gen, in a single file using `os.spawnl` to create a bip32gen subprocess and wait for it to exit. The wrapper will just read the list of keys from a file and loop through them.
Note: Make sure you make the script wrapper executable.
Code:
#!/usr/bin/python3
import os

keys = []
file = open('keys.txt' 'r')
for l in file:
    keys.append(l.strip('\n'))
for k in keys:
    os.spawnl(os.P_WAIT, '/path/to/bip32gen', ['cmd', 'options', 'as', 'list'])
legendary
Activity: 3374
Merit: 3095
Playbet.io - Crypto Casino and Sportsbook
I tried to search and it seems there is no direct guide to making a python script to bulk convert xprv to wif key or hex.

Why not try to play with this python that I found on Github.

- https://github.com/ELHARAKA/MassPrivatekeysToWIF

Just take note only run this offline I do not know if this one is safe I just found it on Google when I search for a guide. Or you can get some idea there and build your own python script,.
legendary
Activity: 4466
Merit: 3391
But it only works if there are only 1 xprv in the dictionary  / please help me how to make it possible to convert many

https://codefather.tech/blog/bash-loop-through-lines-file/
newbie
Activity: 54
Merit: 0
how to convert xprv to wif or (hex) 1,2,3 address index (python)

i try this script?

https://github.com/lyndsysimon/bip32utils

k.txt :
Code:
xprv9u4S6TaiPQdMnT6uRJXQCxW69c3dRK7QEWJzq8iTFGXi1RcfjomN1H13dvci2wLBhQYkYEk4GngfpL1F9fbBqcWWu6qWRPQbuR5wmHLgRm4
xprv9wRuwjCQVQgMUaDTMhNS819LTEHUV7zfZ219Cr5tfziUKW7ucDVrVsM1camgGbWV6waQGZCNZwRyfJD8h7XYUVHoyNS5JmFxAdDfLnstxN2
...

I want to use this command to select xprv  one by one and convert to wif or privkey(hex)

cat k.txt |  bip32gen  -i xprv -f - -o wif -F -  0 1

Code:
L23QxT1kkPrXVagUPaFgr3RxAv46QJamgkgfu724bkT8TLCfVwda
KxzGwpbbisCcuNK5dJt33jPJVrpDpe1st6qES2PSF2TWu8LCofyQ


But it only works if there are only 1 xprv in the dictionary  / please help me how to make it possible to convert many

maybe some other similar script or this one like that?
Jump to: