Bitcoin Forum
November 08, 2024, 09:46:20 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 »
  Print  
Author Topic: Pywallet 2.2: manage your wallet [Update required]  (Read 208211 times)
jackjack (OP)
Legendary
*
Offline Offline

Activity: 1176
Merit: 1280


May Bitcoin be touched by his Noodly Appendage


View Profile
August 03, 2011, 04:41:56 PM
Last edit: September 09, 2014, 03:59:12 PM by jackjack
Merited by ABCbits (76), LoyceV (42), EFS (20), malevolent (20), vapourminer (5), redsn0w (5), mprep (2), o_e_l_e_o (2), DireWolfM14 (1), furyo87 (1)
 #1

News: August 2014
My boring professional life made me stay away from bitcoin for far too long but I'm now back in business
Pywallet won't be fixed anymore except for critical bugs
Instead I'll finish its successor (that still has no name)


News: September 2013
I'm rebuilding pywallet from scratch:


This thread
First of all, I'd like to thank Joric for the first version of pywallet he made, this thread is about my fork.
Pywallet is a python script that deals with wallet.dat. It allows you to do plenty of things inside it.
You can post here whatever you want about pywallet: critics, asking for improvements/changes, telling me it helped you, pointing out errors/bugs, etc.


Pywallet 2: 22nd March 2013
Pywallet has been discontinued for around a year but is now actively developed again.
Look at the end of the 7th page for updates: encrypted wallet support, exporting/importing to/from files, merging wallets, etc.


Instructions (see also here)
Currently you can:
  • Dump your wallet, see your pubkeys, privkeys, their labels, etc
    • Under "Dump your wallet:"
    • Fill version with 0 for bitcoin, 52 for namecoin, 111 for testnets

  • Dump your transactions to a json file
    • Under "Dump your transactions to a file:"
    • Fill Output file with the full path to the file where you want the transactions to be written, this file must not exist

  • Import a key/address into your wallet, with a label, or as a reserve key
    • Under "Import a key into your wallet:"
    • Key is the private key to import, in base58 or in hexadecimal chars
    • Label is the name you want to see in the Address Book of the client
    • Check Reserve if you want your address NOT to show in the Address Book
    • Version = 0 for bitcoin, 52 for namecoin, 111 for testnets
    • Format of the private key: Hexadecimal if you see only digits, a, b, c, d, e and f, otherwise chose Regular

  • Import a transaction into your wallet
    • Under "Import a transaction into your wallet:"
    • Txk is the tx_k value you see in the wallet dump
    • Txv is the tx_v value you see in the wallet dump

  • Import transactions from a json file
    • Under "Import a transaction into your wallet:"
    • Txk = "file" (without quotes)
    • Txv = full path to the transactions dump file

  • Delete addresses from your wallet
    • Under "Delete a key from your wallet:"
    • Key is a Bitcoin address, not a priv key
    • Type: Bitcoin Address

  • Delete transactions from your wallet
    • Under "Delete a key from your wallet:"
    • Key is the hash of the transaction you want to delete (type "all" to delete them all)
    • Type: Transaction

  • Get info about a privkey, i.e. see address, base58 privkey, hexprivkey, pubkey and hash160, using the network you want
    • Under "Get some info about one key[and sign/verify messages]:"
    • Key is a private key
    • Leave Msg, Sig and Pubkey empty
    • Version = 0 for bitcoin, 52 for namecoin, 111 for testnets
    • Format of the private key: Hexadecimal if you see only digits, a, b, c, d, e and f, otherwise chose Regular

  • Sign and verify string, files, and binary string
    • Under "Get some info about one key and sign/verify messages:"
    • Key is the private key you want to sign the message/file with (only for signing)
    • Message is the message you want to sign/verify
      • If it is a string, just type it
      • If it is a binary string, type "Hex:" just before its hexadecimal representation
      • If it is a file, type "File:" just before its full path

    • Signature is the signature of your message (only for verifying)
    • Pubkey is the pubkey used to sign the message (only for verifying)

  • Read a device to find deleted keys (CLI only)
    • Assuming that:
      • The device you want to read is /dev/sda3
      • The size of /dev/sda3 is 30.1Gio
      • You want pywallet to write the new wallet containing the found keys in /home/jackjack/recovered_wallets
    • Run "sudo ./pywallet.py --recover --recov_device /dev/sda3 --recov_size 30.1Gio --recov_outputdir /home/jackjack/recovered_wallets"
    • Then replace your wallet (back it up before) with the recovered wallet and run "bitcoin -rescan"

  • Print the balance of a bitcoin address, read from blockexplorer


Installation:

How to run it:
 Download it there: https://github.com/jackjack-jj/pywallet
 Run './pywallet.py --web' then open 'http://localhost:8989' in your brower

Requirements:
 Python 2.5-2.7, with bsddb package
 ÃƒÆ’ƒÆ’Æ’Æ’Æ’ÃÆ’¢â‚¬Å¡ twisted package is necessary if you want to use the web interface
 ÃƒÆ’ƒÆ’Æ’Æ’Æ’ÃÆ’¢â‚¬Å¡ ecdsa package is necessary if you want to sign and verify messages

Confirmed to work on:
 Ubuntu 32bit(me)
 Windows 32bit(me), 64bit(ctoon6)
 OSX(defxor)

Pywallet can be used to:
 Import Vanitygen keys
 Delete 0/unconfirmed transactions
 Recover Namecoins (and testnetcoins) sent to Bitcoin addresses
 Create a deterministic wallet (using a passphrase)
 Create a deterministic wallet (using a file)
 Broadcast offline transactions
 Create a Bitcoin/*coin address from scratch
 Recover a wallet/deleted keys

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
samr7
Full Member
***
Offline Offline

Activity: 140
Merit: 430

Firstbits: 1samr7


View Profile
August 03, 2011, 05:15:30 PM
 #2

+1

That's awesome jackjack!

The web interface is a really cool feature, pushing in the direction of a lightweight bitcoin client.

It might be nice if it auto-filled the default wallet location.

Also, when I use it to access a bitcoin wallet, and bitcoin is running, bitcoin crashes with a database exception:

Code:
************************
EXCEPTION: 22DbRunRecoveryException       
DbEnv::txn_checkpoint: DB_RUNRECOVERY: Fatal error, run database recovery       
bitcoin in ThreadMessageHandler()       

Do you have some trick to avoid this, or at least warn about it?
jackjack (OP)
Legendary
*
Offline Offline

Activity: 1176
Merit: 1280


May Bitcoin be touched by his Noodly Appendage


View Profile
August 03, 2011, 05:25:07 PM
Last edit: August 03, 2011, 05:47:30 PM by jackjack
 #3

I just added the warning, thanks for pointing that out
I'll search if I can see when bitcoin is running

Auto-filling with default wallet location ok

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
oOoOo
Full Member
***
Offline Offline

Activity: 238
Merit: 100


View Profile
August 05, 2011, 12:27:52 AM
 #4

Doesn't work, I'm getting this

Code:
Traceback (most recent call last):
  File "pywallet.py", line 7, in <module>
    from bsddb.db import *
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/bsddb/__init__.py", line 64, in <module>
ImportError: No module named _bsddb

Do I need a new version of python? And if so, where do I get it??
jackjack (OP)
Legendary
*
Offline Offline

Activity: 1176
Merit: 1280


May Bitcoin be touched by his Noodly Appendage


View Profile
August 05, 2011, 12:34:19 AM
 #5

It seems you don't have the bsddb python package

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
defxor
Hero Member
*****
Offline Offline

Activity: 530
Merit: 500


View Profile
August 05, 2011, 07:11:16 AM
 #6

Doesn't work, I'm getting this

Code:
Traceback (most recent call last):
  File "pywallet.py", line 7, in <module>
    from bsddb.db import *
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/bsddb/__init__.py", line 64, in <module>
ImportError: No module named _bsddb

Do I need a new version of python? And if so, where do I get it??

Looks like you're on a Mac. bsddb is broken in Apple's default installation, the solution is to install another Python version via Macports.

oOoOo
Full Member
***
Offline Offline

Activity: 238
Merit: 100


View Profile
August 05, 2011, 08:42:13 PM
 #7

Doesn't work in the slightest.

Code:
localhost:bin $ python3.2 ./pywallet.py
  File "pywallet.py", line 54
    _p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2FL
                                                                           ^
SyntaxError: invalid syntax

hmmm....
coblee
Donator
Legendary
*
Offline Offline

Activity: 1654
Merit: 1351


Creator of Litecoin. Cryptocurrency enthusiast.


View Profile
August 05, 2011, 08:43:38 PM
 #8

Doesn't work in the slightest.

Code:
localhost:bin $ python3.2 ./pywallet.py
  File "pywallet.py", line 54
    _p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2FL
                                                                           ^
SyntaxError: invalid syntax

hmmm....

I think this only works with python 2.

whirlpool
Member
**
Offline Offline

Activity: 106
Merit: 10


View Profile
August 05, 2011, 08:45:14 PM
 #9

This works great! I can finally import private keys in Windows Smiley

jackjack (OP)
Legendary
*
Offline Offline

Activity: 1176
Merit: 1280


May Bitcoin be touched by his Noodly Appendage


View Profile
August 05, 2011, 11:11:44 PM
 #10

This works great! I can finally import private keys in Windows Smiley
Thanks for confirming it works in Windows!


Doesn't work in the slightest.

Code:
localhost:bin $ python3.2 ./pywallet.py
  File "pywallet.py", line 54
    _p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2FL
                                                                           ^
SyntaxError: invalid syntax

hmmm....

I think this only works with python 2.
Yes, it works in Python 2.x. Python 3 was untested, until now, thanks for the feedback

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
jackjack (OP)
Legendary
*
Offline Offline

Activity: 1176
Merit: 1280


May Bitcoin be touched by his Noodly Appendage


View Profile
August 07, 2011, 05:07:31 PM
 #11

New awesome feature: you can now delete addresses and tx's from your wallet!

So:
 no more headaches because of 0/unconfirmed transactions: find it, delete it
 easier wallet management: YOU chose exactly which addresses you want in which wallet

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
defxor
Hero Member
*****
Offline Offline

Activity: 530
Merit: 500


View Profile
August 07, 2011, 06:25:39 PM
 #12

As I just made a web interface I think it can now be much more useful, mainly for not-too-savvy people, that's why I post here
Here it is: https://github.com/jackjack-jj/pywallet
Download it, run './pywallet.py --web' then open 'http://localhost:8989' in your brower

If you want to reach not-too-savvy people I think a guide needs to be written how to get it up and running on Mac since bsddb is broken in (at least) Snow Leopard (I believe Leopard as well, haven't tried Lion).

Dumping related commands from my bash history, but I had Macports installed since before. The following should be tested by someone who hasn't installed Macports or pywallet, on a clean install. It's just from memory/history.

Mac pywallet installation guide:


Code:
sudo port install python27 python_select
sudo python_select python27
sudo port select --set python python27
sudo port install py-bsddb
sudo port install py27-twisted

./pywallet.py



(yeah python_select might be overkill if the user is never going to install other python versions)

jackjack (OP)
Legendary
*
Offline Offline

Activity: 1176
Merit: 1280


May Bitcoin be touched by his Noodly Appendage


View Profile
August 07, 2011, 07:10:08 PM
 #13

As I just made a web interface I think it can now be much more useful, mainly for not-too-savvy people, that's why I post here
Here it is: https://github.com/jackjack-jj/pywallet
Download it, run './pywallet.py --web' then open 'http://localhost:8989' in your brower

If you want to reach not-too-savvy people I think a guide needs to be written how to get it up and running on Mac since bsddb is broken in (at least) Snow Leopard (I believe Leopard as well, haven't tried Lion).

Dumping related commands from my bash history, but I had Macports installed since before. The following should be tested by someone who hasn't installed Macports or pywallet, on a clean install. It's just from memory/history.

Mac pywallet installation guide:


Code:
sudo port install python27 python_select
sudo python_select python27
sudo port select --set python python27
sudo port install py-bsddb
sudo port install py27-twisted

./pywallet.py



(yeah python_select might be overkill if the user is never going to install other python versions)
Thanks!
I forgot I have a Snow Leopard VM...... I'll test that there

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
jackjack (OP)
Legendary
*
Offline Offline

Activity: 1176
Merit: 1280


May Bitcoin be touched by his Noodly Appendage


View Profile
August 08, 2011, 02:59:12 AM
 #14

Another new feature: importing transactions
Now, offline transactions are far more simple than before (no more command lines or unofficial client)

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
RaTTuS
Hero Member
*****
Offline Offline

Activity: 792
Merit: 1000


Bite me


View Profile
August 09, 2011, 08:04:27 AM
 #15

jackjack,
what happens if I import a key into the address book of 2 clients ? [not that I want to - I just want to know what would happen]

In the Beginning there was CPU , then GPU , then FPGA then ASIC, what next I hear to ask ....

1RaTTuSEN7jJUDiW1EGogHwtek7g9BiEn
ffuentes
Member
**
Offline Offline

Activity: 70
Merit: 10


Only a curious passer-by / FirstBits: 13zsc1


View Profile WWW
August 09, 2011, 08:10:09 AM
 #16

Can I generate some private key (not only import it but the opposite) ?

A sort of bitcoins offline.

Listen Radio Libre (Electronica) Donate. (click for details).

Chilean peso VS BTC ahora: http://irage.ca/2btc.php?a=1&c=CLP&r=1

My bitcoin address
RaTTuS
Hero Member
*****
Offline Offline

Activity: 792
Merit: 1000


Bite me


View Profile
August 09, 2011, 09:23:53 AM
 #17

Can I generate some private key (not only import it but the opposite) ?

A sort of bitcoins offline.
see  https://bitcointalk.org/index.php?topic=25804.0

In the Beginning there was CPU , then GPU , then FPGA then ASIC, what next I hear to ask ....

1RaTTuSEN7jJUDiW1EGogHwtek7g9BiEn
jackjack (OP)
Legendary
*
Offline Offline

Activity: 1176
Merit: 1280


May Bitcoin be touched by his Noodly Appendage


View Profile
August 09, 2011, 11:27:51 AM
Last edit: August 10, 2011, 03:24:01 AM by jackjack
 #18

jackjack,
what happens if I import a key into the address book of 2 clients ? [not that I want to - I just want to know what would happen]
You will see its balance/tx's in these wallets just like you expect it
Only the first wallet to use the coins can spend them, obviously

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
jackjack (OP)
Legendary
*
Offline Offline

Activity: 1176
Merit: 1280


May Bitcoin be touched by his Noodly Appendage


View Profile
August 10, 2011, 03:29:19 AM
 #19

I would need a few testers to test new features, anybody?  Smiley

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
ffuentes
Member
**
Offline Offline

Activity: 70
Merit: 10


Only a curious passer-by / FirstBits: 13zsc1


View Profile WWW
August 10, 2011, 04:30:59 AM
Last edit: August 10, 2011, 05:56:36 AM by ffuentes
 #20

I would need a few testers to test new features, anybody?  Smiley

For a donation I would do it.

Listen Radio Libre (Electronica) Donate. (click for details).

Chilean peso VS BTC ahora: http://irage.ca/2btc.php?a=1&c=CLP&r=1

My bitcoin address
Pages: [1] 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 »
  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!