Pages:
Author

Topic: .05BTC (~$1,700) to whoever helps me successfully extract my BTC from CLI wallet (Read 1802 times)

newbie
Activity: 18
Merit: 1
Incredible story! Congratulations! Both to OP and to people who helped!

Please forgive me if I was sceptical, but in the past I had bad experience with user who needed help and at the end it was find out he was just a Russian fake wallet seller...
https://bitcointalksearch.org/topic/050-btc-reward-for-a-valid-password-5245680

Yes, I always think it's someone trying to scam someone. But this is the first thread I saw where people helped other people and got their fair share. Guess I'm browsing wrong kinda forums till now... 😂
member
Activity: 170
Merit: 58
Incredible story! Congratulations! Both to OP and to people who helped!

Please forgive me if I was sceptical, but in the past I had bad experience with user who needed help and at the end it was find out he was just a Russian fake wallet seller...
https://bitcointalksearch.org/topic/050-btc-reward-for-a-valid-password-5245680
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
P.S. I'm also planning to fork the blockstack client legacy code and add those two commands to import a wallet and extract the private keys for anyone else trying to get their coins out of blockstack.

Unfortunately this is going to take a wee bit longer than I planned because I have to port escobol's code to Python 3. If I run it on Python 2, the registrar Python module introduces dependency hell which prevents it from being installed from a setup.py.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
@NotATether, @escobol @PawGo: I want to Merit the right posts, but I don't really want to analyze all posts in details. Can you tell me which of your posts lead to the solution, so I can easily lazily Merit them?

I can but it's going to be in the form of quotes and not direct links, I think that'll be more useful. Long post warning


Any update?
Did OP open the wallet and forgot about his promise?


I was able to download Blockstack .18 on Ubuntu thanks to the instructions PawGo gave my via DM (thanks PawGo).

The wallet has 3 keys (data, payment, owner). But I only have a "master key". So I'm not sure if I need to download an even earlier version of Blockstack or if I need to extract the payment key from the master key somehow in version .18.

I emailed Blockstack support but they still haven't responded.


If I install an earlier version of Blockstack, I need to delete Blockstack .18 first right?

So, it looks like Blockstack has it's own private key format that is 64 to 66 characters long. Apparently, even the address types in Blockstack are different from bitcoin addresses but can be converted to and from them.

You should try using blockstack-client (it is a python binding of blockstack https://pypi.org/project/blockstack-client/, it's the one that makes a json file like the one you showed, when a wallet is created and pesters the user to export it to a file). It needs Python 2 to work.

1. Install Python 2
Code:
sudo apt install -y python2

2. Install pip for python 2 (yes we run this as root user)
Code:
sudo curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
sudo python2 get-pip.py

2. Install blockstsck-client
Code:
pip2 install blockstack-client virtualchain==0.14.0

3. Save this wallet JSON you posted to a file, like wallet.json for example.
Code:
{
"master_private_key": "ef242kfjj24ekf3223jesdkhefsfhk324wuefhw38fhrypofhtr34d342132d34jsd49",
"wallet_password": “kljsef9832nkfssf”
}

4. Run
Code:
blockstack set_advanced_mode
and type "on" to access the inport_wallet command.

5. Run
Code:
blockstack import_wallet wallet.json
, it will import your wallet from wallet.json and display your addresses.

6. To get the private keys run
Code:
blockstack wallet

It will show you output like this:

Code:
Enter wallet password: PUT THE wallet_password HERE, IT IS NOT ENCRYPTED
------------------------------------------------------------
Payment address:        1HxJ767HSYyvPzHKBVP1JUHfefNzg53Hp6
Owner address:          1PcCxR81Y5BrrD4FnwoWuJ8tH7kURTe1nv
Data public key:        035d999986a0de6e61a20dfa2b92b22daf451303e7b34a4b34103c33d712cfc1fd
------------------------------------------------------------
Balance:
1HxJ767HSYyvPzHKBVP1JUHfefNzg53Hp6: 0.0
------------------------------------------------------------
Names Owned:
1PcCxR81Y5BrrD4FnwoWuJ8tH7kURTe1nv: []
------------------------------------------------------------
------------------------------------------------------------
Payment private key info: 5K2qrQ36ZiJRdViu8BJpnizVxkFEr2ZFzxycW6VL1NAbTD3GLXy
Owner private key info:   5JybVGERkbVCPNXSRnBBxkch68o2D39hrrYw4h8VXX8QEUsKjcQ
Data private key info:    L4Z7X5s1v5Tpt6CZZBfLzRVsZpEkJoRuxwRGpe4xD8C28hwjeXun
{
    "data_privkey": "dad7d349dff5637d20192396c6fa31f957c22e261c333aeb5ed5101751031afa01",
    "data_pubkey": "035d999986a0de6e61a20dfa2b92b22daf451303e7b34a4b34103c33d712cfc1fd",
    "owner_address": "1PcCxR81Y5BrrD4FnwoWuJ8tH7kURTe1nv",
    "owner_privkey": "5JybVGERkbVCPNXSRnBBxkch68o2D39hrrYw4h8VXX8QEUsKjcQ",
    "payment_address": "1HxJ767HSYyvPzHKBVP1JUHfefNzg53Hp6",
    "payment_privkey": "5K2qrQ36ZiJRdViu8BJpnizVxkFEr2ZFzxycW6VL1NAbTD3GLXy"
}

Note: this is data for a sample wallet I created using blockstack. Do not send any bitcoins to these addresses; you will lose your money.



Quote
2. Install blockstsck-client
Code:
pip2 install blockstack-client virtualchain==0.14.0


I'm getting lots of errors when I run this command: https://ibb.co/rfVqcbn

show us the bottom of error

https://ibb.co/ySLHP2y

Code:
apt-get install python-dev



name code as dirty.py

wallet.json with master private_key and wallet_password

dirty.py with wallet.json in one place

in Terminal:
Code:
python2 dirty.py wallet.json wallet2.json
Will print all info in terminal (wallet address, priv key, wif)

If you see 194zW3CDXCuhx24quQcDaJBKwmonxxkK7N, copy WIF - import to Electrum and have fun Smiley



dirty.py
Code:
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
    Blockstack Legacy wallet crack

"""
from registrar.wallet import HDWallet
from registrar.crypto.utils import aes_encrypt, aes_decrypt
from registrar.crypto.utils import get_address_from_privkey, get_pubkey_from_privkey
from binascii import hexlify
from pybitcoin import BitcoinPrivateKey
import json
import sys
import os.path
import os
import base64


if __name__ == "__main__":
  
    result = {}
    print "Blockstack Legacy wallet crack"
    print "-----"
    print ""
    if len(sys.argv) != 3:
         print "Usage: python2 %s /path/to/wallet.json /path/to/destination/wallet.json" % sys.argv[0]
         sys.exit(1)

    src = sys.argv[1]
    dest = sys.argv[2]

    print "Opening wallet file %s..." % src
    f_src = open(src)
    jwallet = json.load(f_src)
    print "Deriving master private key..."
    hex_privkey = jwallet["master_private_key"]
    password = jwallet["wallet_password"]
    hex_password = hexlify(password)

    wallet = HDWallet(hex_privkey)
    child = wallet.get_child_keypairs(count=3, include_privkey=False)
  

    hex_privkey_1 = wallet.get_child_privkey(1)
    btc_1 = get_address_from_privkey(hex_privkey_1)
    btc_privkey_1 = BitcoinPrivateKey(hex_privkey_1)
    wif_1 = btc_privkey_1.to_wif()
  
    hex_privkey_2 = wallet.get_child_privkey(0)
    btc_2 = get_address_from_privkey(hex_privkey_2)
    btc_privkey_2 = BitcoinPrivateKey(hex_privkey_2)
    wif_2 = btc_privkey_2.to_wif()

    hex_privkey_3 = wallet.get_child_privkey(2)
    btc_3 = get_address_from_privkey(hex_privkey_3)
    btc_privkey_3 = BitcoinPrivateKey(hex_privkey_3)
    wif_3 = btc_privkey_3.to_wif()

  
    master = wallet.get_master_privkey()
    btc_privkey = BitcoinPrivateKey(hex_privkey)
    priv_hex = btc_privkey.to_hex()
    priv_wif = btc_privkey.to_wif()

    btc = get_address_from_privkey(hex_privkey)
    btc_pub = get_pubkey_from_privkey(hex_privkey)

    data = {}
    encrypted_key = aes_encrypt(hex_privkey, hex_password)
    data['encrypted_master_private_key'] = encrypted_key
    data['payment_addresses'] = [child[0]]
    data['owner_addresses'] = [child[1]]

    file = open(dest, 'w')
    file.write(json.dumps(data))
    file.close()
    print ""
    print "Wallet created. Make sure to backup the following:"
    print ""
    print "-----"
    print "master_private_key:", hex_privkey
    print "wallet_password:", password
    print "-----"
    print ""
    print "-----"
    print "encrypted_master_private_key:", encrypted_key
    print "-----"
    print "owner_addresses:", [child[1]]
    print "owner_addresses:", btc_1
    print "owner_key_hex:", hex_privkey_1
    print "WIF owner:", wif_1
    print "-----"
    print "payment_addresses:", [child[0]]
    print "payment_addresses:", btc_2
    print "payment_key_hex", hex_privkey_2
    print "WIF payment:", wif_2
    print "-----"
    print "payment_addresses:", [child[2]]
    print "payment_addresses:", btc_3
    print "payment_key_hex", hex_privkey_3
    print "WIF payment:", wif_3
    print "-----"
    print ""
    print "FROM MASTER"
    print "Address:", btc
    print "Priv HEX:", priv_hex
    print "WIF Master:", priv_wif





check

Code:
pip2 install registrar==0.0.3.4

------
Checked on new/clean Ubuntu 18.04 LTS

In terminal:

sudo apt-get update
sudo apt-get upgrade
sudo apt install python-minimal
sudo apt install python-pip
sudo apt-get install libssl-dev libffi-dev
pip2 install registrar==0.0.3.4

then (navigate in terminal to the place where is dirty.py (code) and wallet.json)
python2 dirty.py wallet.json wallet_tesporesset.json

Got all pubs/privs



Thnx NotATether, Ive tested it with few mpk/passwords generated with 3 old blockstack versions  (0.10.x) and with that simple code I got the same public/privkey (also added WIF for easy import to electrum).

I am having difficulty installing the required dependencies of your script (module registrar and all its dependencies) alongside blockstack, and as I predicted it is very difficult to find a virtualenv for python2 in the ubuntu apt repositories  Sad

Can we not make this script use python3? Yours doesn't depend on blockstack-client so it's possible as long as registrar has a Python 3 module.



escobol has sent me an updated script that works. The previous version malfunctions and terminates with a Python error, nothing malicious or anything, so don't use that one.

Use this updated one instead:

Code:
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
    Blockstack Legacy wallet crack

"""
from registrar.wallet import HDWallet
from registrar.crypto.utils import aes_encrypt, aes_decrypt
from registrar.crypto.utils import get_address_from_privkey, get_pubkey_from_privkey
from binascii import hexlify
from pybitcoin import BitcoinPrivateKey
import json
import sys
import os.path
import os
import base64


if __name__ == "__main__":
  
    result = {}
    print "Blockstack Legacy wallet crack"
    print "-----"
    print ""
    if len(sys.argv) != 3:
         print "Usage: python2 %s /path/to/wallet.json /path/to/destination/wallet.json" % sys.argv[0]
         sys.exit(1)

    src = sys.argv[1]
    dest = sys.argv[2]

    print "Opening wallet file %s..." % src
    f_src = open(src)
    jwallet = json.load(f_src)
    print "Deriving master private key..."
    hex_privkey = jwallet["master_private_key"]
    password = jwallet["wallet_password"]
    hex_password = hexlify(password)

    wallet = HDWallet(hex_privkey)
    child = wallet.get_child_keypairs(count=3, include_privkey=False)
  

    hex_privkey_1 = wallet.get_child_privkey(1)
    btc_privkey_1 = BitcoinPrivateKey(hex_privkey_1)
    wif_1 = btc_privkey_1.to_wif()
  
    hex_privkey_2 = wallet.get_child_privkey(0)
    btc_privkey_2 = BitcoinPrivateKey(hex_privkey_2)
    wif_2 = btc_privkey_2.to_wif()

    hex_privkey_3 = wallet.get_child_privkey(2)
    btc_privkey_3 = BitcoinPrivateKey(hex_privkey_3)
    wif_3 = btc_privkey_3.to_wif()

  
    master = wallet.get_master_privkey()
    btc_privkey = BitcoinPrivateKey(hex_privkey)
    priv_hex = btc_privkey.to_hex()
    priv_wif = btc_privkey.to_wif()

    btc = get_address_from_privkey(hex_privkey)
    btc_pub = get_pubkey_from_privkey(hex_privkey)

    data = {}
    encrypted_key = aes_encrypt(hex_privkey, hex_password)
    data['encrypted_master_private_key'] = encrypted_key
    data['payment_addresses'] = [child[0]]
    data['owner_addresses'] = [child[1]]

    file = open(dest, 'w')
    file.write(json.dumps(data))
    file.close()
    print ""
    print "Wallet created. Make sure to backup the following:"
    print ""
    print "-----"
    print "master_private_key:", hex_privkey
    print "wallet_password:", password
    print "-----"
    print ""
    print "-----"
    print "encrypted_master_private_key:", encrypted_key
    print "-----"
    print "owner_addresses:", [child[1]]
    print "owner_key_hex:", hex_privkey_1
    print "WIF owner:", wif_1
    print "-----"
    print "payment_addresses:", [child[0]]
    print "payment_key_hex", hex_privkey_2
    print "WIF payment:", wif_2
    print "-----"
    print "payment_addresses:", [child[2]]
    print "payment_key_hex", hex_privkey_3
    print "WIF payment:", wif_3
    print "-----"
    print ""
    print "FROM MASTER"
    print "Address:", btc
    print "Priv HEX:", priv_hex
    print "WIF Master:", priv_wif

I confirm that it outputs the private keys for a sample wallet I created.



payment_addresses: ['194zW3CDXCuhx24quQcDaJBKwmonxxkK7N']
payment_key_hex xxx
WIF payment: xxx

Omg I think it worked...

Code:
parallels@parallels-Parallels-Virtual-Platform:~/Desktop$ python2 dirty.py wallet.json wallet2.json
Blockstack Legacy wallet crack
-----

Opening wallet file wallet.json...
Deriving master private key...

Wallet created. Make sure to backup the following:

-----
master_private_key: xxx
wallet_password: xxx
-----

-----
encrypted_master_private_key: xxx
-----
owner_addresses: ['146qagi4RScaREcgvxyzXuc8JBJ6T48e5J']
owner_key_hex: xxx
WIF owner: xxx
-----
payment_addresses: ['194zW3CDXCuhx24quQcDaJBKwmonxxkK7N']
payment_key_hex xxx
WIF payment: xxx
-----
payment_addresses: ['179s8CGfRVwjoLtNbd9a4HMoTYon4vsoyv']
payment_key_hex xxx
WIF payment: xxx
-----

FROM MASTER
Address: 1MCU3cw8bSnaoaCTywx5HgHkL8Vn3dzkd6
Priv HEX: xxx
WIF Master: xxx
parallels@parallels-Parallels-Virtual-Platform:~/Desktop$


What do I need to import into Electrum? The WIF master?

I tried not be biased, and only picked the posts that directly lead OP to the solution in sequential order. But none of this should be necessary once I finish modding blockstack-client. Obviously keep a maximum cap of merit for each user Roll Eyes Embarrassed
legendary
Activity: 952
Merit: 1367
I was able to download Blockstack .18 on Ubuntu thanks to the instructions PawGo gave my via DM (thanks PawGo).
@PawGo: can you post your instructions here for future reference?

I used cygwin on Windows (https://www.cygwin.com/) but if you have Ubuntu, the actions should be this same. For me it was easier to emulate linux using cygwin, that's why I tried.
So, download the installation package and launch. It will connect to server and try to download needed packaged. You may select packages you want - or first install empty cygwin and then launch installation again just to add missing packages.
I send you the list of all packages I have - as I wrote before you will need python2-devel and libssl-devel packages. And python2.7 of course. The rest normally comes with the installation. Maybe I am missing something - I had this environment configured before - but I think it will be easy to find which package is required.
https://ibb.co/dPJ3sQz
https://ibb.co/b3mF0Ww
https://ibb.co/xjqxrQ7

then you receive access to console.
I have launched
Code:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
Code:
python2.7 get-pip.py
Code:
python2.7 -m pip install --upgrade pip
Code:
python2.7 -m pip install onedrivesdk==1.1.8
Code:
python2.7 -m pip install blockstack==0.18.0.10

and now blockstack is installed

Code:
$ blockstack --version
/usr/lib/python2.7/site-packages/virtualchain/lib/ecdsalib.py:26: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
  from cryptography.hazmat.backends import default_backend
0.18.0.10

--------

@NotATether: you may mark this post, and maybe also one of (already merited by ETFbitcoin):
https://bitcointalksearch.org/topic/m.56010431
https://bitcointalksearch.org/topic/m.56011477
https://bitcointalksearch.org/topic/m.56017358
My other posts you merited already Wink

member
Activity: 154
Merit: 39
@NotATether
[child[0]]

Sorry PawGo, didn't mean to leave you out.

Okay I will send .033 to NotATether, .033 to escobol, and .033 to PawGo. I will keep .9 Smiley


Please PM me your addresses!

One last thing, which of the three private keys were your bitcoins in? Owner, payment, or that master key?

Payment
member
Activity: 154
Merit: 39
Started with #80
LAter #102 and #103

Nice to see this resolved! I've added this topic to my [overview] Recover Bitcoin from any old storage format.

I was able to download Blockstack .18 on Ubuntu thanks to the instructions PawGo gave my via DM (thanks PawGo).
@PawGo: can you post your instructions here for future reference?

Okay I will send .033 to NotATether, .033 to escobol, and .033 to PawGo. I will keep .9 Smiley
It's great to see you keep your promise!

@NotATether, @escobol @PawGo: I want to Merit the right posts, but I don't really want to analyze all posts in details. Can you tell me which of your posts lead to the solution, so I can easily lazily Merit them?

Remember that now you have a lot of forks... You may check here: http://www.findmycoins.ninja/
Only BCH has some sensible value, but if you want to play, now you may collect many of them. Just be careful with software you install (maybe do it on virtual machine) and do it after you empty BTC.
If there was 1 Bitcoin in the address, you're looking at appromately these amounts:
BCH: $400
BSV: $165
BCH-A: $15
BTG: $8
BCD: $5
Some of the others have some value too, but I haven't figured out yet how to claim them.
Don't forget there's no replay protection between the first 3. If you want, I can send you some BCH dust so you can move it without moving your BSV/BCH-A.

legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Nice to see this resolved! I've added this topic to my [overview] Recover Bitcoin from any old storage format.

I was able to download Blockstack .18 on Ubuntu thanks to the instructions PawGo gave my via DM (thanks PawGo).
@PawGo: can you post your instructions here for future reference?

Okay I will send .033 to NotATether, .033 to escobol, and .033 to PawGo. I will keep .9 Smiley
It's great to see you keep your promise!

@NotATether, @escobol @PawGo: I want to Merit the right posts, but I don't really want to analyze all posts in details. Can you tell me which of your posts lead to the solution, so I can easily lazily Merit them?

Remember that now you have a lot of forks... You may check here: http://www.findmycoins.ninja/
Only BCH has some sensible value, but if you want to play, now you may collect many of them. Just be careful with software you install (maybe do it on virtual machine) and do it after you empty BTC.
If there was 1 Bitcoin in the address, you're looking at appromately these amounts:
BCH: $400
BSV: $165
BCH-A: $15
BTG: $8
BCD: $5
Some of the others have some value too, but I haven't figured out yet how to claim them.
Don't forget there's no replay protection between the first 3. If you want, I can send you some BCH dust so you can move it without moving your BSV/BCH-A.
legendary
Activity: 952
Merit: 1367

One last thing: all the forks (e.g. bitcoin cash) is also connected with my BTC...so when I send out BTC to anther wallet, will it also send out BCH?


Congratulations!

Remember that now you have a lot of forks... You may check here: http://www.findmycoins.ninja/
Only BCH has some sensible value, but if you want to play, now you may collect many of them. Just be careful with software you install (maybe do it on virtual machine) and do it after you empty BTC.

jr. member
Activity: 57
Merit: 29
Sorry PawGo, didn't mean to leave you out.

Okay I will send .033 to NotATether, .033 to escobol, and .033 to PawGo. I will keep .9 Smiley


Please PM me your addresses!

One last thing, which of the three private keys were your bitcoins in? Owner, payment, or that master key?

Payment
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
Sorry PawGo, didn't mean to leave you out.

Okay I will send .033 to NotATether, .033 to escobol, and .033 to PawGo. I will keep .9 Smiley


Please PM me your addresses!

One last thing, which of the three private keys were your bitcoins in? Owner, payment, or that master key?
jr. member
Activity: 57
Merit: 29
Sorry PawGo, didn't mean to leave you out.

Okay I will send .033 to NotATether, .033 to escobol, and .033 to PawGo. I will keep .9 Smiley


Please PM me your addresses!
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
VICTORY!!!!!!!!! Thank you all so much!!!

Awesome, glad that it worked out for you. We almost got stumped at the part to extract the private keys but escobol gave us the final push!

One last thing: all the forks (e.g. bitcoin cash) is also connected with my BTC...so when I send out BTC to anther wallet, will it also send out BCH?

Sending the BTC to some other address will only send that BTC by itself and no forks. You should follow LoyceV's fork claiming guide to claim your BCH and BSV.

And I will split the bounty with escobol and NotATether but let me know if anyone feels I should also send them some extra BTC for their help.

I personally feel that you should also share it with PawGo, he has corrected several steps in my process without which you wouldn't have blockstack installed in the first place. Just my two sats.

P.S. I'm also planning to fork the blockstack client legacy code and add those two commands to import a wallet and extract the private keys for anyone else trying to get their coins out of blockstack.
jr. member
Activity: 57
Merit: 29
VICTORY!!!!!!!!! Thank you all so much!!!


One last thing: all the forks (e.g. bitcoin cash) is also connected with my BTC...so when I send out BTC to anther wallet, will it also send out BCH?



And I will split the bounty with escobol and NotATether but let me know if anyone feels I should also send them some extra BTC for their help.






So grateful to all you guys.
member
Activity: 154
Merit: 39
payment_addresses: ['194zW3CDXCuhx24quQcDaJBKwmonxxkK7N']
payment_key_hex xxx
WIF payment: xxx

Omg I think it worked...

Code:
parallels@parallels-Parallels-Virtual-Platform:~/Desktop$ python2 dirty.py wallet.json wallet2.json
Blockstack Legacy wallet crack
-----

Opening wallet file wallet.json...
Deriving master private key...

Wallet created. Make sure to backup the following:

-----
master_private_key: xxx
wallet_password: xxx
-----

-----
encrypted_master_private_key: xxx
-----
owner_addresses: ['146qagi4RScaREcgvxyzXuc8JBJ6T48e5J']
owner_key_hex: xxx
WIF owner: xxx
-----
payment_addresses: ['194zW3CDXCuhx24quQcDaJBKwmonxxkK7N']
payment_key_hex xxx
WIF payment: xxx
-----
payment_addresses: ['179s8CGfRVwjoLtNbd9a4HMoTYon4vsoyv']
payment_key_hex xxx
WIF payment: xxx
-----

FROM MASTER
Address: 1MCU3cw8bSnaoaCTywx5HgHkL8Vn3dzkd6
Priv HEX: xxx
WIF Master: xxx
parallels@parallels-Parallels-Virtual-Platform:~/Desktop$


What do I need to import into Electrum? The WIF master?
jr. member
Activity: 57
Merit: 29
Omg I think it worked...

Code:
parallels@parallels-Parallels-Virtual-Platform:~/Desktop$ python2 dirty.py wallet.json wallet2.json
Blockstack Legacy wallet crack
-----

Opening wallet file wallet.json...
Deriving master private key...

Wallet created. Make sure to backup the following:

-----
master_private_key: xxx
wallet_password: xxx
-----

-----
encrypted_master_private_key: xxx
-----
owner_addresses: ['146qagi4RScaREcgvxyzXuc8JBJ6T48e5J']
owner_key_hex: xxx
WIF owner: xxx
-----
payment_addresses: ['194zW3CDXCuhx24quQcDaJBKwmonxxkK7N']
payment_key_hex xxx
WIF payment: xxx
-----
payment_addresses: ['179s8CGfRVwjoLtNbd9a4HMoTYon4vsoyv']
payment_key_hex xxx
WIF payment: xxx
-----

FROM MASTER
Address: 1MCU3cw8bSnaoaCTywx5HgHkL8Vn3dzkd6
Priv HEX: xxx
WIF Master: xxx
parallels@parallels-Parallels-Virtual-Platform:~/Desktop$


What do I need to import into Electrum? The WIF master?
HCP
legendary
Activity: 2086
Merit: 4314
Did you do all of the steps that escobol mentioned in their earlier post:
check

Code:
pip2 install registrar==0.0.3.4

------
Checked on new/clean Ubuntu 18.04 LTS

In terminal:

sudo apt-get update
sudo apt-get upgrade
sudo apt install python-minimal
sudo apt install python-pip
sudo apt-get install libssl-dev libffi-dev
pip2 install registrar==0.0.3.4

The important one is:
Code:
pip2 install registrar==0.0.3.4
jr. member
Activity: 57
Merit: 29
Okay I pasted the updated code in text editor and saved it as 'dirty.py' on my desktop (where my wallet.json) file is. Here is what I got from Terminal:

Code:
parallels@parallels-Parallels-Virtual-Platform:~/Desktop$ python2 dirty.py wallet.json wallet2.json
Traceback (most recent call last):
  File "dirty.py", line 7, in
    from registrar.wallet import HDWallet
ImportError: No module named registrar.wallet
parallels@parallels-Parallels-Virtual-Platform:~/Desktop$





escobol has sent me an updated script that works. The previous version malfunctions and terminates with a Python error, nothing malicious or anything, so don't use that one.

Use this updated one instead:

Code:
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
    Blockstack Legacy wallet crack

"""
from registrar.wallet import HDWallet
from registrar.crypto.utils import aes_encrypt, aes_decrypt
from registrar.crypto.utils import get_address_from_privkey, get_pubkey_from_privkey
from binascii import hexlify
from pybitcoin import BitcoinPrivateKey
import json
import sys
import os.path
import os
import base64


if __name__ == "__main__":
  
    result = {}
    print "Blockstack Legacy wallet crack"
    print "-----"
    print ""
    if len(sys.argv) != 3:
         print "Usage: python2 %s /path/to/wallet.json /path/to/destination/wallet.json" % sys.argv[0]
         sys.exit(1)

    src = sys.argv[1]
    dest = sys.argv[2]

    print "Opening wallet file %s..." % src
    f_src = open(src)
    jwallet = json.load(f_src)
    print "Deriving master private key..."
    hex_privkey = jwallet["master_private_key"]
    password = jwallet["wallet_password"]
    hex_password = hexlify(password)

    wallet = HDWallet(hex_privkey)
    child = wallet.get_child_keypairs(count=3, include_privkey=False)
  

    hex_privkey_1 = wallet.get_child_privkey(1)
    btc_privkey_1 = BitcoinPrivateKey(hex_privkey_1)
    wif_1 = btc_privkey_1.to_wif()
  
    hex_privkey_2 = wallet.get_child_privkey(0)
    btc_privkey_2 = BitcoinPrivateKey(hex_privkey_2)
    wif_2 = btc_privkey_2.to_wif()

    hex_privkey_3 = wallet.get_child_privkey(2)
    btc_privkey_3 = BitcoinPrivateKey(hex_privkey_3)
    wif_3 = btc_privkey_3.to_wif()

  
    master = wallet.get_master_privkey()
    btc_privkey = BitcoinPrivateKey(hex_privkey)
    priv_hex = btc_privkey.to_hex()
    priv_wif = btc_privkey.to_wif()

    btc = get_address_from_privkey(hex_privkey)
    btc_pub = get_pubkey_from_privkey(hex_privkey)

    data = {}
    encrypted_key = aes_encrypt(hex_privkey, hex_password)
    data['encrypted_master_private_key'] = encrypted_key
    data['payment_addresses'] = [child[0]]
    data['owner_addresses'] = [child[1]]

    file = open(dest, 'w')
    file.write(json.dumps(data))
    file.close()
    print ""
    print "Wallet created. Make sure to backup the following:"
    print ""
    print "-----"
    print "master_private_key:", hex_privkey
    print "wallet_password:", password
    print "-----"
    print ""
    print "-----"
    print "encrypted_master_private_key:", encrypted_key
    print "-----"
    print "owner_addresses:", [child[1]]
    print "owner_key_hex:", hex_privkey_1
    print "WIF owner:", wif_1
    print "-----"
    print "payment_addresses:", [child[0]]
    print "payment_key_hex", hex_privkey_2
    print "WIF payment:", wif_2
    print "-----"
    print "payment_addresses:", [child[2]]
    print "payment_key_hex", hex_privkey_3
    print "WIF payment:", wif_3
    print "-----"
    print ""
    print "FROM MASTER"
    print "Address:", btc
    print "Priv HEX:", priv_hex
    print "WIF Master:", priv_wif

I confirm that it outputs the private keys for a sample wallet I created.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
escobol has sent me an updated script that works. The previous version malfunctions and terminates with a Python error, nothing malicious or anything, so don't use that one.

Use this updated one instead:

Code:
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
    Blockstack Legacy wallet crack

"""
from registrar.wallet import HDWallet
from registrar.crypto.utils import aes_encrypt, aes_decrypt
from registrar.crypto.utils import get_address_from_privkey, get_pubkey_from_privkey
from binascii import hexlify
from pybitcoin import BitcoinPrivateKey
import json
import sys
import os.path
import os
import base64


if __name__ == "__main__":
  
    result = {}
    print "Blockstack Legacy wallet crack"
    print "-----"
    print ""
    if len(sys.argv) != 3:
         print "Usage: python2 %s /path/to/wallet.json /path/to/destination/wallet.json" % sys.argv[0]
         sys.exit(1)

    src = sys.argv[1]
    dest = sys.argv[2]

    print "Opening wallet file %s..." % src
    f_src = open(src)
    jwallet = json.load(f_src)
    print "Deriving master private key..."
    hex_privkey = jwallet["master_private_key"]
    password = jwallet["wallet_password"]
    hex_password = hexlify(password)

    wallet = HDWallet(hex_privkey)
    child = wallet.get_child_keypairs(count=3, include_privkey=False)
  

    hex_privkey_1 = wallet.get_child_privkey(1)
    btc_privkey_1 = BitcoinPrivateKey(hex_privkey_1)
    wif_1 = btc_privkey_1.to_wif()
  
    hex_privkey_2 = wallet.get_child_privkey(0)
    btc_privkey_2 = BitcoinPrivateKey(hex_privkey_2)
    wif_2 = btc_privkey_2.to_wif()

    hex_privkey_3 = wallet.get_child_privkey(2)
    btc_privkey_3 = BitcoinPrivateKey(hex_privkey_3)
    wif_3 = btc_privkey_3.to_wif()

  
    master = wallet.get_master_privkey()
    btc_privkey = BitcoinPrivateKey(hex_privkey)
    priv_hex = btc_privkey.to_hex()
    priv_wif = btc_privkey.to_wif()

    btc = get_address_from_privkey(hex_privkey)
    btc_pub = get_pubkey_from_privkey(hex_privkey)

    data = {}
    encrypted_key = aes_encrypt(hex_privkey, hex_password)
    data['encrypted_master_private_key'] = encrypted_key
    data['payment_addresses'] = [child[0]]
    data['owner_addresses'] = [child[1]]

    file = open(dest, 'w')
    file.write(json.dumps(data))
    file.close()
    print ""
    print "Wallet created. Make sure to backup the following:"
    print ""
    print "-----"
    print "master_private_key:", hex_privkey
    print "wallet_password:", password
    print "-----"
    print ""
    print "-----"
    print "encrypted_master_private_key:", encrypted_key
    print "-----"
    print "owner_addresses:", [child[1]]
    print "owner_key_hex:", hex_privkey_1
    print "WIF owner:", wif_1
    print "-----"
    print "payment_addresses:", [child[0]]
    print "payment_key_hex", hex_privkey_2
    print "WIF payment:", wif_2
    print "-----"
    print "payment_addresses:", [child[2]]
    print "payment_key_hex", hex_privkey_3
    print "WIF payment:", wif_3
    print "-----"
    print ""
    print "FROM MASTER"
    print "Address:", btc
    print "Priv HEX:", priv_hex
    print "WIF Master:", priv_wif

I confirm that it outputs the private keys for a sample wallet I created.
member
Activity: 154
Merit: 39
check

Code:
pip2 install registrar==0.0.3.4

------
Checked on new/clean Ubuntu 18.04 LTS

In terminal:

sudo apt-get update
sudo apt-get upgrade
sudo apt install python-minimal
sudo apt install python-pip
sudo apt-get install libssl-dev libffi-dev
pip2 install registrar==0.0.3.4

then (navigate in terminal to the place where is dirty.py (code) and wallet.json)
python2 dirty.py wallet.json wallet_tesporesset.json

Got all pubs/privs



Thnx NotATether, Ive tested it with few mpk/passwords generated with 3 old blockstack versions  (0.10.x) and with that simple code I got the same public/privkey (also added WIF for easy import to electrum).

I am having difficulty installing the required dependencies of your script (module registrar and all its dependencies) alongside blockstack, and as I predicted it is very difficult to find a virtualenv for python2 in the ubuntu apt repositories  Sad

Can we not make this script use python3? Yours doesn't depend on blockstack-client so it's possible as long as registrar has a Python 3 module.
Pages:
Jump to: