Bitcoin Forum
May 04, 2024, 11:57:32 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: blockstack_recover: Extract private keys from blockstack-client wallets  (Read 172 times)
NotATether (OP)
Legendary
*
Offline Offline

Activity: 1596
Merit: 6728


bitcoincleanup.com / bitmixlist.org


View Profile WWW
February 17, 2021, 05:43:03 AM
Last edit: March 03, 2021, 12:39:10 PM by NotATether
Merited by Mitchell (5), LoyceV (4), ABCbits (4), HCP (2), Heisenberg_Hunter (2), DaveF (1), Pmalek (1)
 #1

As promised here is my tool for recovering bitcoins from blockstack-client (an abandoned Python2 wallet software that's difficult to install and extract keys from anymore) wallets called blockstack_recover (PyPI) (Github). It takes a blockstack-client wallet.json file, and decides it into the private keys that it uses to receive payments. Then you can import them into another wallet software to access your bitcoins.

While blockstack-client was a Python 2-only wallet, whose source code is no longer on Github, this tool works only on Python 3+, and has minimum dependencies to reduce the risk of malicious Python libraries being pulled.

Installation:

pip install blockstack_recover

Running:

Find the path to your unencrypted wallet.json (the tool does not work with encrypted wallet.json), and run:

blockstack_recover extract wallet.json

If you only have an encrypted wallet.json, decrypt it first using:

blockstack_recover decrypt wallet.json decrypted-wallet.json

And supply your password to it. The program can't help you if you don't remember your password.

The unencrypted wallet.json is a JSON File that only has the keys "master_private_key" with a long hexadecimal number and "wallet_password", the wallet password in plain-text.

If you have any bitcoins inside a blockstack-client wallet, please move them off now.

Never give anybody your wallet.json, even if it's encrypted. I have discovered that passwords can be brute-forced using the AES256 encryption code in the blockstack-client. This can be devastating if used with hardware acceleration like PyCUDA.


If there is enough support I will make a tool that decrypts an encrypted wallet.json file, that'll be useful as well. Done!

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Bitcoin addresses contain a checksum, so it is very unlikely that mistyping an address will cause you to lose money.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714867052
Hero Member
*
Offline Offline

Posts: 1714867052

View Profile Personal Message (Offline)

Ignore
1714867052
Reply with quote  #2

1714867052
Report to moderator
1714867052
Hero Member
*
Offline Offline

Posts: 1714867052

View Profile Personal Message (Offline)

Ignore
1714867052
Reply with quote  #2

1714867052
Report to moderator
1714867052
Hero Member
*
Offline Offline

Posts: 1714867052

View Profile Personal Message (Offline)

Ignore
1714867052
Reply with quote  #2

1714867052
Report to moderator
DaveF
Legendary
*
Offline Offline

Activity: 3472
Merit: 6263


Crypto Swap Exchange


View Profile WWW
February 17, 2021, 12:44:17 PM
 #2

Good job on doing this. There are probably a few people out there with BTC sitting in wallets they could not get to.

...
While blockstack-client was a Python 2-only wallet, whose source code is no longer on Github,...

There are some links out there to the client, since I cannot verify their authenticity I will not post them, but a bit of searching and you can find them and they do look like the correct ones.

-Dave

█▀▀▀











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











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

Activity: 2870
Merit: 7464


Crypto Swap Exchange


View Profile
February 18, 2021, 12:17:21 PM
Merited by NotATether (1)
 #3

This setup.py is a bit worrying since future update could introduce breaking change and might break your code. Mentioning working version of Python and dependency might be helpful.

Code:
install_requires=[
    'ecdsa',
    'utilitybelt',
    'pycrypto',
    'bitcoin',
    'cachetools',
    'base58',
],

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
NotATether (OP)
Legendary
*
Offline Offline

Activity: 1596
Merit: 6728


bitcoincleanup.com / bitmixlist.org


View Profile WWW
February 18, 2021, 05:54:35 PM
 #4

There are some links out there to the client, since I cannot verify their authenticity I will not post them, but a bit of searching and you can find them and they do look like the correct ones.

-Dave

If you are talking about the source bundles which can be downloaded from PyPI, I have verified that those are authentic (21XO used one of them to recover his private key).

What seemed to have happened is that the blockstack developers "nuked" the blockstack-client source code from Github and replaced it with some bizarre incompatible Node.js wallet.

This setup.py is a bit worrying since future update could introduce breaking change and might break your code. Mentioning working version of Python and dependency might be helpful.

Code:
install_requires=[
    'ecdsa',
    'utilitybelt',
    'pycrypto',
    'bitcoin',
    'cachetools',
    'base58',
],

D'oh, I forgot to pip freeze the dependencies and put those in the setup.py instead Embarrassed. Will fix ASAP.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
NotATether (OP)
Legendary
*
Offline Offline

Activity: 1596
Merit: 6728


bitcoincleanup.com / bitmixlist.org


View Profile WWW
March 03, 2021, 12:45:16 PM
 #5

Bump with decrypting functionality added! Please update to version 1.1.1.

The program has been split into two subcommands. From here on, to extract private keys from an unencrypted wallet.json as normal, use the extract subcommand: blockstack_recover extract ARGUMENTS.... As for decrypting an encrypted wallet for which you have its password, use the decrypt subcommand: blockstack_recover decrypt ARGUMENTS...

Internally I also fixed the encryption and decryption AES functions which apparently were broken from not padding the input along 32 bytes. Took quite a while to figure out that I was missing padding! And the PyPI page had a broken github link -.-

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
NotATether (OP)
Legendary
*
Offline Offline

Activity: 1596
Merit: 6728


bitcoincleanup.com / bitmixlist.org


View Profile WWW
July 27, 2021, 03:52:30 PM
Last edit: July 27, 2021, 05:02:30 PM by NotATether
 #6

Bumping this as a notice that the latest version of the package incorrectly links the project homepage as https:// [link intentionally broken] github.com/ZenulAbidin/blockstack-recover (hyphen instead of underscore) which causes a 404 when you try to go there. Pushing a newer version ASAP that fixes this.

Update: Fixed in 1.1.2 (and technically 1.1.1 but that release was never pushed to PyPI for some reason).

.
.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!