1200wd / bitcoinlib

Bitcoin and other Cryptocurrencies Library for Python. Includes a fully functional wallet, Mnemonic key generation and management and connection with various service providers to receive and send blockchain and transaction information.
http://bitcoinlib.readthedocs.io/
GNU General Public License v3.0
598 stars 200 forks source link

How to import wallets from DB ? #184

Closed jun3d4y closed 2 years ago

jun3d4y commented 3 years ago

Hello, I've messing around with your library for a couple of hours now and it is awesome !

The only issue I have is that I can't find a way to import an existing wallet. I noticed that there is a DB under ~/.bicoinlib/database/, so I thought that there is a way to import existing wallets ? If not I could also import it using the mnemonic passphrase, but again I did not find how to do it in the documentation.

Could you help me ?

mccwdev commented 3 years ago

Thank you!

To import a walllet you can import a private or public master key and then rebuild it and scan for transactions:

w = Wallet.create("MyWallet", keys=passphrase)
w.scan()