Pages:
Author

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

sr. member
Activity: 350
Merit: 251
ill be sure to run dban from now on when i reformat...
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
New command-line option: Recover your deleted keys
Code:
sudo ./pywallet.py --recover --recov_size 30.1Gio --recov_device /dev/sda3 --recov_outputdir /home/jackjack/recovered_wallets
This will read the 30.1 first Gio of /dev/sda3 to find some deleted private keys (sudo can be needed to read devices)

recov_size accepts ko, kio, Mo, Mio, Go, Gio, To and Tio units (edit: I just think about that, some of you may usually use kB/MB/..., I'll fix that, later Wink ). No space allowed between the number and the unit
recov_device is obviously the device to read
recov_outputdir is the directory where pywallet will write the recovered wallet (named "recovered_wallet_TIMESTAMP.dat")

It's only a command-line option because if one deletes his wallet and tries to recover it, running a browser is not exactly is good idea...

It takes about 25 minutes to read 100 Go

Code:
File:   pywallet.py v1.1-27
Sig:    304402202553256cbeb2020f9f3b4a970bd34f2fa0588311525acf95c4eb56725c1c08730220374dd3658f8da7d2ec2f25a8216a561766f0f471304a7988bd300e8333bc9c50
Pubkey: 04307867a30e7b8673b92f9c62c664dbd821a3be44e8d41fc65261296f4d6e71fa430a0d7f54e3aca296357900fe096c2bc7333d60e57ffe73bc2f49b581c17750



I tried running it with Python 2.4.  It kinda works.  The biggest issue I ran into, the json module does not appear to exist in Python 2.4.  According to the docs on python.org, json would appear to have been introduced in 2.6.
I'll see if I can use something else instead of json, thanks for the feedback
full member
Activity: 140
Merit: 430
Firstbits: 1samr7
New release:
 web interface now use --datadir and --wallet flags to autofill forms
 no more "A if cond else B", so it should run with python 2.4 and maybe less, can someone test?

Very cool, the web interface auto-fill works beautifully.

I tried running it with Python 2.4.  It kinda works.  The biggest issue I ran into, the json module does not appear to exist in Python 2.4.  According to the docs on python.org, json would appear to have been introduced in 2.6.
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
New release:
 web interface now use --datadir and --wallet flags to autofill forms
 no more "A if cond else B", so it should run with python 2.4 and maybe less, can someone test?

I also modify the OP to add how to use each function, everything is written there


Code:
File:   pywallet.py
Sig:    3046022100a50f5c70fbdb001e1fc6e8d7154f7fcdd5247803d82dffa06bfffddba9d388ef022100f6c8ebfdc34022fd8ed0242e5766881756c69aa32bc582ff4d966300763f4002
Pubkey: 04307867a30e7b8673b92f9c62c664dbd821a3be44e8d41fc65261296f4d6e71fa430a0d7f54e3aca296357900fe096c2bc7333d60e57ffe73bc2f49b581c17750
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
Are you reading the wallet database in such a way that concurrent access would be possible if the client also supported it?
Yes I think so

For maximum usefulness, it would be nice to be able to use the running wallet instead of having to shut down your client or take a backup.
The client opens and locks the wallet until it is exited, so until the devs change that behaviour it's not possible

I have some other ideas for patching the client too. Like being able to set a flag on an address that tells the node not to return it in response to a getnewaddress request so that you can have some keys used only for signing.
If you create a new address in the client and set its label to "Signing address", it will never use it as a pool key because it's not and with the label you will know it's your signing address
It should be sufficient I think
kjj
legendary
Activity: 1302
Merit: 1026
Are you reading the wallet database in such a way that concurrent access would be possible if the client also supported it?  For maximum usefulness, it would be nice to be able to use the running wallet instead of having to shut down your client or take a backup.

I have some other ideas for patching the client too.  Like being able to set a flag on an address that tells the node not to return it in response to a getnewaddress request so that you can have some keys used only for signing.
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
http://dl.dropbox.com/u/9866930/pywallet_dependencies_x64v1.7z

this will get you started if you do not have everything setup already

just open the files in the order listed in README.txt

ill sign the SHA-512 in a sec  Cheesy

Code:
Message:   SHA-512: 5e74415fdabeba1936490bf5a462bbc4ab06502adf4c692e9a21af652a4821af99785b94d7779c444cab92f51966b1ebacdfa7bc5305a9b241beda466d5fc389
Signature: 304502203a422c58979a3cfae39c674f52c46eda7060d5088bf4772643ee9bbffb273265022100d8946e2248e7d94320b509539d20efee10e48ecd762faf0ae8d270729d301a6a
Pubkey:    0423321cff08cb3dbed8bcf20c5e552155bc10ed9495bd9407543245f2fc4ca91d359dae5a14458142cd5a7d4f181c2363a0447ac6b22948d7b4c73117b431ae04

from now on i guess ill use this key, or i might make another one with proper capitalization...

Code:
1CtooN6jNELYKXUmBFVRva8qwHfLNqRBao
I'll look at your file and make a link in the readme
I can't see your youtube video now because of a ridiculous bandwidth here... But thanks for making it


I added some little things: you can now sign/verify files and binary strings. Use this with "Hex:6294aa82be73" and "File:/home/jackjack/test.zip" (yes, ctoon6 gave me this idea with his dependencies file Wink )
In info you can now see the hash160 of a key
And when you dump a wallet you can chose the version. Before that, all addresses (e.g. namecoin and testnet) were changed in their bitcoin aliases which was not really practical
sr. member
Activity: 350
Merit: 251
http://www.youtube.com/watch?v=oF52V6xxCy8

Youtube video to show how to install.
sr. member
Activity: 350
Merit: 251
http://dl.dropbox.com/u/9866930/pywallet_dependencies_x64v1.7z

this will get you started if you do not have everything setup already

just open the files in the order listed in README.txt

ill sign the SHA-512 in a sec  Cheesy

Code:
Message:   SHA-512: 5e74415fdabeba1936490bf5a462bbc4ab06502adf4c692e9a21af652a4821af99785b94d7779c444cab92f51966b1ebacdfa7bc5305a9b241beda466d5fc389
Signature: 304502203a422c58979a3cfae39c674f52c46eda7060d5088bf4772643ee9bbffb273265022100d8946e2248e7d94320b509539d20efee10e48ecd762faf0ae8d270729d301a6a
Pubkey:    0423321cff08cb3dbed8bcf20c5e552155bc10ed9495bd9407543245f2fc4ca91d359dae5a14458142cd5a7d4f181c2363a0447ac6b22948d7b4c73117b431ae04

from now on i guess ill use this key, or i might make another one with proper capitalization...

Code:
1CtooN6jNELYKXUmBFVRva8qwHfLNqRBao
kjj
legendary
Activity: 1302
Merit: 1026
Signature of 'hello, i am ctoon6' by 1CtooN6jNELYKXUmBFVRva8qwHfLNqRBao: 3045022044ad2a6f17dbde17dc46cd110d7df2b224ca79f9ebfb28d03c9ba53a254455650221008 bb8ca927f5881bd700b89bca2b0235e6da8426df6a1a045fdf6790bef027a6b
Pubkey: 0423321cff08cb3dbed8bcf20c5e552155bc10ed9495bd9407543245f2fc4ca91d359dae5a14458 142cd5a7d4f181c2363a0447ac6b22948d7b4c73117b431ae04

Verified.

Code:
Signature of 'hello, i am ctoon6' by 1CtooN6jNELYKXUmBFVRva8qwHfLNqRBao is 3045022044ad2a6f17dbde17dc46cd110d7df2b224ca79f9ebfb28d03c9ba53a254455650221008bb8ca927f5881bd700b89bca2b0235e6da8426df6a1a045fdf6790bef027a6b

edit: i got it, they were long and were wrapping in the forum and made me confused

Yeah, the silly forum software munges lines by adding spaces or newlines to long strings.
sr. member
Activity: 350
Merit: 251
Signature of 'hello, i am ctoon6' by 1CtooN6jNELYKXUmBFVRva8qwHfLNqRBao: 3045022044ad2a6f17dbde17dc46cd110d7df2b224ca79f9ebfb28d03c9ba53a254455650221008 bb8ca927f5881bd700b89bca2b0235e6da8426df6a1a045fdf6790bef027a6b
Pubkey: 0423321cff08cb3dbed8bcf20c5e552155bc10ed9495bd9407543245f2fc4ca91d359dae5a14458 142cd5a7d4f181c2363a0447ac6b22948d7b4c73117b431ae04


so would i paste
Code:
0423321cff08cb3dbed8bcf20c5e552155bc10ed9495bd9407543245f2fc4ca91d359dae5a14458142cd5a7d4f181c2363a0447ac6b22948d7b4c73117b431ae04

into pubkey

and
Code:
3045022044ad2a6f17dbde17dc46cd110d7df2b224ca79f9ebfb28d03c9ba53a254455650221008bb8ca927f5881bd700b89bca2b0235e6da8426df6a1a045fdf6790bef027a6b

into signature if i wanted to verify a message

edit: i got it, they were long and were wrapping in the forum and made me confused
kjj
legendary
Activity: 1302
Merit: 1026
Works.

Code:
Signature of 'does it sign?' by 17LeVE2fjEK7ncqxCToU4McytDHLUhKpyx: 3045022059300e192acb208fd9075bfa237f36931fdec3802923af8d44a95e4b96fc90a8022100b6f41321afa1919529f4916035614d67eeb4b6f7c41cfb5049da614b988a5c8d
Pubkey: 04321a3c84e2e380215518fc952fbd782f20ca8940366f7575953c136dfb585b33a93e9969f546d13fd2afbf407dfd44a745b1421d027ee4f16de31a0d7a3b7edb


iv got the new version running 1.1-23

what does each field mean?

key=bitcoin private key?
message=duh
signature=?
public=bitcoin public key?
version=do i need to change that, or is that there for future reasons

key = bitcoin private key, can be found by dumping the wallet.
message = message to sign or verify
signature = signature of message to verify
publickey = public key of message to verify
Version = used to create the address format.  Should be 0 currently, but can be different in the future, or for testnet.

To get key info, you only need to fill in the Key: field.
To sign a message, you need to fill in Key: and Message:.
To verify a signature, you need to fill in Message:, Signature: and Publickey:.
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
iv got the new version running 1.1-23

what does each field mean?

key=bitcoin private key?
message=duh
signature=?
public=bitcoin public key?
version=do i need to change that, or is that there for future reasons
Yes sorry I should have said that before

Three cases:
1. You just want some info, then just fill Key as usual
2. You want to sign, then fill Key and Msg to sign Msg with Key
3. You want to verify, then fill Msg, Sig and Pubkey to verify that Sig is a signature of Msg by Pubkey
sr. member
Activity: 350
Merit: 251
iv got the new version running 1.1-23

what does each field mean?

key=bitcoin private key?
message=duh
signature=?
public=bitcoin public key?
version=do i need to change that, or is that there for future reasons
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
What a dumb!
I was signing my test string instead of the msg form
Try your signatures as if the message were "coucou", it will work...

New release pushed, it will surely work better
kjj
legendary
Activity: 1302
Merit: 1026
That one works.  The "Thank you guys!" one does not.
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
Still nothing.

I tried it with a different key.  By the way, if you use --web, it ignores --wallet= on the command line.  It'd be nice if that carried over.

I went used Dump Your Wallet and copied out one of the "sec" values, scroll down to the info/sign/verify section, paste in the key, Get Info.  Results:

Code:
Address (Bitcoin): 17LeVE2fjEK7ncqxCToU4McytDHLUhKpyx
Privkey (Bitcoin): [secret]
Hexprivkey: [secret]
Pubkey: 04321a3c84e2e380215518fc952fbd782f20ca8940366f7575953c136dfb585b33a93e9969f546d13fd2afbf407dfd44a745b1421d027ee4f16de31a0d7a3b7edb

Type "maybe different words?" into the message box, Get Info.  Result:

Code:
Signature of 'maybe different words?' by 17LeVE2fjEK7ncqxCToU4McytDHLUhKpyx: 304402206e1704baf1c1238077b420b74c07dcdf6964155614005fe20089ce83445e2895022009ebcd27124a52ecdc90a4398438c5c400cc9dcd259560ec90d752a876946178
Pubkey: 04321a3c84e2e380215518fc952fbd782f20ca8940366f7575953c136dfb585b33a93e9969f546d13fd2afbf407dfd44a745b1421d027ee4f16de31a0d7a3b7edb

Go back up, clear out the Key: field.  Paste the sig and public key into the correct boxes, Get Info.  Result:

Code:
Signature of 'maybe different words?' by 17LeVE2fjEK7ncqxCToU4McytDHLUhKpyx is NOT 304402206e1704baf1c1238077b420b74c07dcdf6964155614005fe20089ce83445e2895022009ebcd27124a52ecdc90a4398438c5c400cc9dcd259560ec90d752a876946178

I changed the message to "test" just to make sure the question mark wasn messing up the URL encoding, and it still failed verification.
Have you tested this one?
     msg: "Hi github users :p"
    "pubkey" : "04ef6e366cd6b0b8fbf02c0c25ad39fe892b90c597875899fdc9db16941cf43fb8c429e0534cb8b 972f5cc9f1a50f36dc3352ffad427f073e1c64a145828a3be6e",
    "sign" : "3046022100a80b6e0c7c54c54ba943f4e3cde12f5a7dc5313e3f0a15ce868f01683ced64fa02210 08b4ad7d3800a11c241dcef7aaf44c8224a7d9f1e54d3e669bf4887036b6d10af"


I hope it's ok because here it works

Good idea for the wallet flag, will do it as soon as I resolve that

legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
so if i want to use the new version of pywallet, do i need to run it without ecdsa, or is it just to test to make sure it works without crashing?
I just pushed the fix
Now if you run it, it should write that ecdsa is not present, and run normally except that you won't be able to sign/verify
kjj
legendary
Activity: 1302
Merit: 1026
Still nothing.

I tried it with a different key.  By the way, if you use --web, it ignores --wallet= on the command line.  It'd be nice if that carried over.

I went used Dump Your Wallet and copied out one of the "sec" values, scroll down to the info/sign/verify section, paste in the key, Get Info.  Results:

Code:
Address (Bitcoin): 17LeVE2fjEK7ncqxCToU4McytDHLUhKpyx
Privkey (Bitcoin): [secret]
Hexprivkey: [secret]
Pubkey: 04321a3c84e2e380215518fc952fbd782f20ca8940366f7575953c136dfb585b33a93e9969f546d13fd2afbf407dfd44a745b1421d027ee4f16de31a0d7a3b7edb

Type "maybe different words?" into the message box, Get Info.  Result:

Code:
Signature of 'maybe different words?' by 17LeVE2fjEK7ncqxCToU4McytDHLUhKpyx: 304402206e1704baf1c1238077b420b74c07dcdf6964155614005fe20089ce83445e2895022009ebcd27124a52ecdc90a4398438c5c400cc9dcd259560ec90d752a876946178
Pubkey: 04321a3c84e2e380215518fc952fbd782f20ca8940366f7575953c136dfb585b33a93e9969f546d13fd2afbf407dfd44a745b1421d027ee4f16de31a0d7a3b7edb

Go back up, clear out the Key: field.  Paste the sig and public key into the correct boxes, Get Info.  Result:

Code:
Signature of 'maybe different words?' by 17LeVE2fjEK7ncqxCToU4McytDHLUhKpyx is NOT 304402206e1704baf1c1238077b420b74c07dcdf6964155614005fe20089ce83445e2895022009ebcd27124a52ecdc90a4398438c5c400cc9dcd259560ec90d752a876946178

I changed the message to "test" just to make sure the question mark wasn messing up the URL encoding, and it still failed verification.
sr. member
Activity: 350
Merit: 251
so if i want to use the new version of pywallet, do i need to run it without ecdsa, or is it just to test to make sure it works without crashing?
Pages:
Jump to: