Pages:
Author

Topic: Pywallet 2.2: manage your wallet [Update required] - page 32. (Read 208288 times)

legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
Wow what the actual fuck?

Well, first things first
I'd be happy to be able to --dumpwallet into a file, edit that file and then --importdump or something like that.
You can: this then that

About your "reserve" finding: I think it was 1 before, then 0 after
If so, the 'delete' function deleted the address from the pool, hence the 1 key deleted

But I just found the problem!
Line 1782: change 'if type == "key":' to 'if type == "key" or type == "ckey":'
Must do the trick
legendary
Activity: 1974
Merit: 1030
I'm sorry but I can't reproduce your problem
Check that:
  • you have the last version of pywallet (should be 1.9.3 or 1.9.4)
  • pywallet returns "key:1Pc6N7aDoxxxxxxx has been successfully deleted from /home/xxx/.bitcoin/wallet.dat, resulting in 2 deleted items"
  • you're dumping the wallet that from which you deleted a key (already said I know)

I wasn't using the latest version, but 2.0b9 from march (commit 278c6e0). However, this is getting interesting:

Code:
$ pgrep -lf bitco
$ grep ^pywver pywallet.py
pywversion="1.9.3"
$ cp /home/btc/.bitcoin/wallet.dat /some/backup
$ read -s P
$ ./pywallet.py --passphrase="$P" --dumpwallet &>wallet-dump1
$ xxd /home/btc/.bitcoin/wallet.dat >wallet-hex1
$ grep 1BLre3Uv7Xxh5XgYa8NXbS7ZYTXBuyCfiK wallet-dump1
            "addr": "1BLre3Uv7Xxh5XgYa8NXbS7ZYTXBuyCfiK",

That is the address I want to delete. Now I run "./pywallet.py --web" and submit the "Delete a key from your wallet" form with this data (copy-pasted here):

Code:
Wallet Directory: /home/btc/.bitcoin
Wallet Filename: wallet.dat
Key: 1BLre3Uv7Xxh5XgYa8NXbS7ZYTXBuyCfiK
Type: Bitcoin address

key:1BLre3Uv7Xxh5XgYa8NXbS7ZYTXBuyCfiK has been successfully deleted from /home/btc/.bitcoin/wallet.dat, resulting in 0 deleted item

Python isn't my native tongue but after managing to tweak the code a bit:

Code:
$ git diff
diff --git a/pywallet.py b/pywallet.py
index 45370e0..c6bbdb2 100755
--- a/pywallet.py
+++ b/pywallet.py
@@ -1781,16 +1781,19 @@ def delete_from_wallet(db_env, walletfile, typedel, keydel):
                elif typedel == "key":
                        if type == "key":
                                if keydel == public_key_to_bc_address(kds.read_bytes(kds.read_compact_size())):
+                                       print "ok deleting key %s of type key" % key
                                        db.delete(key)
                                        deleted_items+=1
                        elif type == "pool":
                                vds.read_int32()
                                vds.read_int64()
                                if keydel == public_key_to_bc_address(vds.read_bytes(vds.read_compact_size())):
+                                       print "ok deleting key %s of type pool" % key
                                        db.delete(key)
                                        deleted_items+=1
                        elif type == "name":
                                if keydel == kds.read_string():
+                                       print "ok deleting key %s of type name" % key
                                        db.delete(key)
                                        deleted_items+=1

I don't get any of those lines in stdout:

Code:
$ ./pywallet.py --web
'ecdsa' package is not installed, pywallet won't be able to sign/verify messages
2013-04-11 11:11:57+0200 [-] Log opened.
2013-04-11 11:11:57+0200 [-] Starting server: 2013-04-11 11:11:57.506397
2013-04-11 11:11:57+0200 [-] twisted.web.server.Site starting on 8989
2013-04-11 11:11:57+0200 [-] Starting factory
2013-04-11 11:12:11+0200 [HTTPChannel,0,127.0.0.1] 127.0.0.1 - - [11/Apr/2013:09:12:10 +0000] "GET / HTTP/1.1" 200 29750 "http://localhost:8989/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0"
2013-04-11 11:12:18+0200 [HTTPChannel,0,127.0.0.1] 127.0.0.1 - - [11/Apr/2013:09:12:17 +0000] "GET /Delete?dir=/home/btc/.bitcoin&name=wallet.dat&keydel=1BLre3Uv7Xxh5XgYa8NXbS7ZYTXBuyCfiK&typedel=key HTTP/1.1" 200 132 "http://localhost:8989/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0"
^C2013-04-11 11:12:31+0200 [-] Received SIGINT, shutting down.
2013-04-11 11:12:31+0200 [twisted.web.server.Site] (Port 8989 Closed)
2013-04-11 11:12:31+0200 [twisted.web.server.Site] Stopping factory
2013-04-11 11:12:31+0200 [-] Main loop terminated.

In fact:

Code:
$ ./pywallet.py --passphrase="$P" --dumpwallet &>wallet-dump2
$ xxd /home/btc/.bitcoin/wallet.dat >wallet-hex2
$ md5sum wallet-*
fdffc13c2ee830e46b6b33ea8629ea10  wallet-dump1
fdffc13c2ee830e46b6b33ea8629ea10  wallet-dump2
db862daf9579568a9fcdfba2cd6378b4  wallet-hex1
db862daf9579568a9fcdfba2cd6378b4  wallet-hex2

Something I didn't say yesterday because I didn't think it would have something to do, is the contents of the "reserve" field in the wallet:

Code:
$ less wallet-dump1    ## trimmed output
{
    "keys": [
            "addr": "1BLre3Uv7Xxh5XgYa8NXbS7ZYTXBuyCfiK",
            "compressed": true,
            "encrypted_privkey": "2d4a14267d220fce36d7c48df789561797743c29cf750ef5a5234faa7ab178ed8ef4e113771bdb9fe3aa4b0c2a94e9e
9",                                                                                                                                          "pubkey": "02e34a2cc7ee8694cd943d58b222a82e181741002151378820216f6e330cee4c31",
            "reserve": 1,
            "sec": "KxKs8MzyCZ7ufjGsvZNUJtEF9dxuV12geRfM5KCMRofmFXWhbuVr",
            "secret": "2100db5080ec709e0e015d669808111de6f5e9c0e8425f126dce4dc1cd8f520601"
        },

I could swear that "reserve" was 0 before I tried to delete the key for the first time, and maybe turned into one when I got the "success, 1 key deleted" message. Can this be the reason that today pywallet isn't able to show at least the "1 deleted" message?

I'd be happy to be able to --dumpwallet into a file, edit that file and then --importdump or something like that.
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
I'm sorry but I can't reproduce your problem
Check that:
  • you have the last version of pywallet (should be 1.9.3 or 1.9.4)
  • pywallet returns "key:1Pc6N7aDoxxxxxxx has been successfully deleted from /home/xxx/.bitcoin/wallet.dat, resulting in 2 deleted items"
  • you're dumping the wallet that from which you deleted a key (already said I know)



Btw, it's slower than expected but the new version isn't forgotten, I'm working on it
legendary
Activity: 1974
Merit: 1030
Did you put the bitcoin address? (Not pub key nor priv key)

First I tried with the privkey but got a message "success, deleted 0 keys". It was when I tried the address that I got "success, deleted 1 key".


Are you sure you delete from, and dump the same wallet?

Yes. But let me do it for a third time and I'll report back (will take some hours though).
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
Did you put the bitcoin address? (Not pub key nor priv key)
Are you sure you delete from, and dump the same wallet?
legendary
Activity: 1974
Merit: 1030
I'm using "Delete a key from your wallet" in the web UI to delete a private key(*) and, although I get a message telling that the operation was successful and 1 key was deleted, it still appears in the output of --dumpwallet. I expected the key to be absent from the --dumpwallet output. Did I neglect any step?


(*) It's a throwaway one that I generated in bitaddress and imported just to test that bitcoind could import compressed private keys. I published it in the forum so I don't want to keep it in my wallet lest any funds end up there for any reason.
legendary
Activity: 1498
Merit: 1000
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
Oh I see, Google was actually helpful then
Well, not many people uses pywallet on mac and I don't have one

It's a valid suggestion though, it's put on the list
legendary
Activity: 1498
Merit: 1000
Has anyone created a brew formula for this?
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
What is a brew formula?
Even Google doesn't say much about that
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
Many thanks for reporting this!
It's edited and must be ok now

Also I think I made PWI use the github's install.bat so it should automatically work for future installs
member
Activity: 84
Merit: 10
I reserved the http://pywallet.tk domain name. It's the updated instructions

Great, thank you jackjack, your instructions-site is very helpful.

For Windows you offer the auto-installation-exe:
https://github.com/downloads/jackjack-jj/pywallet/PWI_0.0.3.exe

This exe contains the 'wget-1.11.4-1-setup.exe' for automatic downloading of needed software and the batch-script 'install.bat' using the wget-programm.

In line 10, 18 and 19 of your 'install.bat' you download and install the Twisted-Package:
http://buildbot.twistedmatrix.com/builds/twisted-packages/Twisted-11.0.0.winxp32-py2.7.exe

But version 'Twisted-11.0.0.winxp32-py2.7.exe' doesn't extist any longer, what results in a broken installation.

Checking the Twistedmatrix site I found there exists a version '...win32..' instead of '...winxp32...'

Thus I unpacked your PWI_0.0.3.exe with 7zip,
changed the three lines of 'install.bat' to '...Twisted-11.0.0.win32-py2.7.exe'
started 'install.bat' by hand
and everything worked wonderfull.

Maybe your Github-'install.bat' needs to be changed accordingly.

legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
Ah ah yeah it should be but I felt that there were more needs for the wui so I focused on it

Yes you can compile a python program, look at py2exe
I'm not sure about how it will deal with dependencies though...
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
Oh, okay. I'm willing to wait. I had this idea that command line stuff developed on Linux (or Python) would be "more powerful" than any gui or wui version. hehe.

Incidentally, can you "compile" a binary of this for Windows? I looked at some tools for this, but I may have to do a little more tinkering.
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
With the command line you can't do that yet.
I know it's ridiculous that WUI and command line don't have the same utilities... That will change soon (in v2.1, note that v2.0 will be released on Monday)

If you absolutely have to use the command line, you can dump then use grep (I'm sure there's a port of grep on windows)
Or wait for v2.1
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
Ok. Exactly how to get just the public key, and the private key. Nothing else.

What I've been doing is just dumping the whole thing, then output to text file, then remove everything else I don't like. I made bitcoin-qt create a new wallet with 500 keys, encrypt it, then pywallet the keys out of the new wallet.dat file.

Basically, I'm using pywallet and bitcoin-qt as my own version of offline bitaddress and vanitygen (no pattern) to generate compressed keys.

I tried using just "addr,privkey" or "sec" but maybe I'm typing the commands wrong or something. Using Windows, command line.
hero member
Activity: 525
Merit: 500
I'll test it out cause I cant get the upgrade to 8.1 done without the new wallet telling me 30% less coins.  Hence my approach, dump key, import keys.

Thanks.
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
Short question, can the tool work on an offline wallet?  Does it modify the wallet in any way, I only want to dump all addresses/privkeys and acount names, not more.

Offline: yes!
Modifying: it does what you ask it. If you just ask to dump, it will only dump and won't modify anything
Depending on whether you want to import the file later, use 'dump wallet' or 'dump keys'. Instructions here: http://pywallet.tk
You can still ask in this thread if something is unclear
hero member
Activity: 525
Merit: 500
Short question, can the tool work on an offline wallet?  Does it modify the wallet in any way, I only want to dump all addresses/privkeys and acount names, not more.
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
I fixed a bug that made the WUI only show uncompressed addresses of private keys. I don't use compressed keys so I didn't notice earlier.
I now suppose that pywallet is enough stable and removed the beta flag
You should upgrade because of the fixed bug and also because of the updater that will now work

I'll release the new big version this week-end I hope
Feel free to post suggestions for it or anything you have to say
Pages:
Jump to: