Pages:
Author

Topic: [HIRING] 1.5 BTC for wallet.dat inspection tool [Raised from 0.5 to 1 to 1.5BTC] (Read 2029 times)

member
Activity: 83
Merit: 10
BTC 1.0015 well received. Thank you! Will check and update on the new additions and errors.

Edit: Found the bug with Ultracoin/Blackcoin etc. they use a slightly different format, nothing big and should be working in the next push tomorrow. Ultracoin was missing from the coins list, added it, blackcoin seems to be working fine.

Edit 2: The VTC error is related to the vertcoin explorer. Try pasting the address at the end of: https://explorer.vertcoin.org/chain/Vertcoin/q/addressbalance/ and you would see the same behavior. I will try to find another explorer if I can, or we have to live with this bug.
member
Activity: 65
Merit: 10
Removed db_env creation, no more __db files and the app is now fully readonly and should work any filesystem, tried on read-only filesystem and worked without errors.

Brilliant!  Much easier to use now.  I can already tell this is going to replace pywallet as the go-to tool for working with wallets.

I sent you 1 BTC at 16xe1bCgnDLe27FAWHb4pmKzjiEWzMxLG8.  My list below contains some things not in the OP so I'll bump up the total to 2.0 BTC (1.0 BTC left) if these are added.

  • --wallet: Can we get rid of the need to type --wallet?  Instead just use the first non-option parameter as the wallet file, i.e. wi.py --is-encrypted somewallet.dat
  •   Note/warning/error formats: For any note/warning/error, let's follow these rules:
      
    • Notes start with NOTE:, warnings start with WARN:, errors start with ERR:
    • Always go to stderr instead of stdout
    • Always one line
    • For any command that requires decrypting the wallet (e.g. --list-keys, --list-private-keys) and an incorrect or missing passphrase is provided, continue running the operation but output wherever an unencrypted private key would normally appear
  •   Note/warning/error conditions:  These are the places I can think of where a message is needed now:
      
    • WARN: whenever a command requires decrypting the wallet and an incorrect/missing passphrase is provided (except for --test-passphrase since that is the whole point of the command)
    • NOTE: whenever a command requires decrypting the wallet, the wallet is encrypted, and the correct passphrase is provided
    • NOTE: when the wallet is unencrypted and a passphrase is provided
    • ERR: whenever the script encounters an error condition during processing it should output an ERR line and keep going if possible.  Ideally only one line will be output and not a traceback/debug dump unless a --debug type option is provided.  If a traceback/dump is output though it should go to stderr.
    • ERR: when --determine-coin is used but the coin is unknown (even if the script knows the "otherversion" still output an ERR since we don't know the coin name.  So the output would be ERR to stderr and Unknown,123 to stdout where 123 is the otherversion)
  • --balances: This is the major change and why I'm adding the 0.5 BTC since this may take some work.  For BTC, LTC, and any other currency that blockr.io supports, use their multi-request API in order to get multiple balances at once.  You can pass up to 20 addresses at a time (I think it's 20) and that will greatly speed up --balances.
  • --balances: For other non-blockr.io currencies, can the script re-use the existing connection to the web server instead of closing and starting a new request?  That should help the speed too.
  • --balances: Currently if a lookup fails for one address the script stops.  Instead it should output an ERR line and output the public key with "Error" as the balance and keep going.
  • --list-public-keys, --balances: Add an --include-contacts option.  When this is provided the public keys/balances for addresses in the contact list will be included in the output too.  No label is needed, the addresses from the contact list should appear in the output the same way as local addresses.
  • --balances: VTC addresses that have not been seen on the network are reported as having a balance of 7.0 by the script.  It should report 0.
  •     Blackcoin/Ultracoin/Mintcoin: Any command I run on Blackcoin/Ultracoin/Mintcoin wallets gives this error message:
        
Code:
Traceback (most recent call last):
  File "wi.py", line 1562, in parse_wallet
    d['txIn'].append(parse_TxIn(vds))
  File "wi.py", line 1502, in parse_TxIn
    d['sequence'] = vds.read_uint32()
  File "wi.py", line 782, in read_uint32
    return self._read_num('  File "wi.py", line 838, in _read_num
    (i,) = struct.unpack_from(format, self.input, self.read_cursor)
error: unpack_from requires a buffer of at least 4 bytes
ERROR parsing wallet.dat, type tx
[...]
    
    [/li]
member
Activity: 83
Merit: 10
Removed db_env creation, no more __db files and the app is now fully readonly and should work any filesystem, tried on read-only filesystem and worked without errors.
member
Activity: 83
Merit: 10
Fixed the passphrase segfault. Make sure you install pycryto python module or else decryption will be dead slow. Everything should work as expected now.

Great.  I might not have time to test for a while, so please send me your BTC address and I'll send 0.75 BTC now and the rest after I test.

In the one test I did I got an error message:

Code:
$ python wi.py --is-encrypted --wallet=/home/user/wallet1.dat
Traceback (most recent call last):
  File "wi.py", line 1823, in
    db_env = create_env(db_dir)
  File "wi.py", line 1158, in create_env
    (DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN | DB_THREAD | DB_RECOVER))
bsddb.db.DBInvalidArgError: (22, 'Invalid argument -- mmap: Invalid argument')

Tried it with a couple wallet files and got the same error.  The user has read/write permission to the directory.  I have the python-crypto package installed.

Could it be the bsddb module version you have? I tried the exact same command and got no error. I will just post a set up guide to make sure we're installing the correct python/module versions.

Actually just did a quick search, it could be python version issue as mentioned http://stackoverflow.com/questions/15958917/bsddb-4-2-52-dbinvalidargerror-22-invalid-argument

Can you try with python 2.7? If not I will downgrade to python 2.5

Actually, I figured out what is causing the problem.  I'm using VirtualBox and the wallet files are on a shared drive, and for some reason BSDDB can't work with that directory.  All other tools I've used can read/write fine to it, they treat it just like any other directory.  My suggested fix will actually fix two issues:

- Suggested fix: Create a temporary working directory in /tmp, do the operation, remove the directory.

This addresses the issue with the shared drive and also fixes the issue that currently lots of __db.00X files are left behind in the directory after the script finishes.  If you can do the operation using the temporary directory and leaving the wallet file in its current place, that is best.  If you need to have the wallet file in the temporary directory, then copying it over would be ok.

And please send me your Bitcoin address so I can send you half now.  I've been slow to test but I want to make sure you know I'm good for the BTC and to keep you motivated to make these fixes.

/tmp is a good idea and I will implement that. I am completely fine with receiving the whole amount once you're happy with the script, however if you really want to send half now then you can use the address on my profile i.e. 16xe1bCgnDLe27FAWHb4pmKzjiEWzMxLG8

Thanks
member
Activity: 65
Merit: 10
Fixed the passphrase segfault. Make sure you install pycryto python module or else decryption will be dead slow. Everything should work as expected now.

Great.  I might not have time to test for a while, so please send me your BTC address and I'll send 0.75 BTC now and the rest after I test.

In the one test I did I got an error message:

Code:
$ python wi.py --is-encrypted --wallet=/home/user/wallet1.dat
Traceback (most recent call last):
  File "wi.py", line 1823, in
    db_env = create_env(db_dir)
  File "wi.py", line 1158, in create_env
    (DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN | DB_THREAD | DB_RECOVER))
bsddb.db.DBInvalidArgError: (22, 'Invalid argument -- mmap: Invalid argument')

Tried it with a couple wallet files and got the same error.  The user has read/write permission to the directory.  I have the python-crypto package installed.

Could it be the bsddb module version you have? I tried the exact same command and got no error. I will just post a set up guide to make sure we're installing the correct python/module versions.

Actually just did a quick search, it could be python version issue as mentioned http://stackoverflow.com/questions/15958917/bsddb-4-2-52-dbinvalidargerror-22-invalid-argument

Can you try with python 2.7? If not I will downgrade to python 2.5

Actually, I figured out what is causing the problem.  I'm using VirtualBox and the wallet files are on a shared drive, and for some reason BSDDB can't work with that directory.  All other tools I've used can read/write fine to it, they treat it just like any other directory.  My suggested fix will actually fix two issues:

- Suggested fix: Create a temporary working directory in /tmp, do the operation, remove the directory.

This addresses the issue with the shared drive and also fixes the issue that currently lots of __db.00X files are left behind in the directory after the script finishes.  If you can do the operation using the temporary directory and leaving the wallet file in its current place, that is best.  If you need to have the wallet file in the temporary directory, then copying it over would be ok.

And please send me your Bitcoin address so I can send you half now.  I've been slow to test but I want to make sure you know I'm good for the BTC and to keep you motivated to make these fixes.
member
Activity: 83
Merit: 10
Fixed the passphrase segfault. Make sure you install pycryto python module or else decryption will be dead slow. Everything should work as expected now.

Great.  I might not have time to test for a while, so please send me your BTC address and I'll send 0.75 BTC now and the rest after I test.

In the one test I did I got an error message:

Code:
$ python wi.py --is-encrypted --wallet=/home/user/wallet1.dat
Traceback (most recent call last):
  File "wi.py", line 1823, in
    db_env = create_env(db_dir)
  File "wi.py", line 1158, in create_env
    (DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN | DB_THREAD | DB_RECOVER))
bsddb.db.DBInvalidArgError: (22, 'Invalid argument -- mmap: Invalid argument')

Tried it with a couple wallet files and got the same error.  The user has read/write permission to the directory.  I have the python-crypto package installed.

Could it be the bsddb module version you have? I tried the exact same command and got no error. I will just post a set up guide to make sure we're installing the correct python/module versions.

Actually just did a quick search, it could be python version issue as mentioned http://stackoverflow.com/questions/15958917/bsddb-4-2-52-dbinvalidargerror-22-invalid-argument

Can you try with python 2.7? If not I will downgrade to python 2.5
member
Activity: 65
Merit: 10
Fixed the passphrase segfault. Make sure you install pycryto python module or else decryption will be dead slow. Everything should work as expected now.

Great.  I might not have time to test for a while, so please send me your BTC address and I'll send 0.75 BTC now and the rest after I test.

In the one test I did I got an error message:

Code:
$ python wi.py --is-encrypted --wallet=/home/user/wallet1.dat
Traceback (most recent call last):
  File "wi.py", line 1823, in
    db_env = create_env(db_dir)
  File "wi.py", line 1158, in create_env
    (DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN | DB_THREAD | DB_RECOVER))
bsddb.db.DBInvalidArgError: (22, 'Invalid argument -- mmap: Invalid argument')

Tried it with a couple wallet files and got the same error.  The user has read/write permission to the directory.  I have the python-crypto package installed.
member
Activity: 83
Merit: 10
Fixed the passphrase segfault. Make sure you install pycryto python module or else decryption will be dead slow. Everything should work as expected now.
member
Activity: 83
Merit: 10
Committed with all the fixes. Passphrase decryption is not working and gives segmentation fault, found the problem statement will be fixing it soon. In the meantime if you can check if all your previously mentioned issues have been resolved. Also note I have put a different blockchain explorer for zetacoin so balance should work now.
member
Activity: 83
Merit: 10
Please check https://github.com/unicoinex/walletinfo

What works:

Everything except balance (just need to put regex for each explorer. Mostly trivial work left) Balances also added.

Only included top 10 coins for this initial release. New coins will be added gradually.

So essentially the app is complete and just needs the remaining coins addition

Please note that since its in python, for the sake of completeness, I have kept the coin details within the file.

Thanks cointra!  I'll be able to check it out in detail in this weekend and will post any feedback here.

Hi coiner8, did you get the chance to check it out?

Hi cointra,

I can't test it easily or fully because it uses pywallet's strange and broken --datadir.  The script needs to be able to work by providing just the path to a wallet file, no --datadir option.  Also pywallet's implementation only opens files named "wallet.dat", even if you specify a different file.  The script should be able to handle a wallet with any filename.  If it requires a working directory it should handle that internally.

  • --list-keys: The format of the public and private keys should be the "usual" format.  For the public key, that is the format shown in the client and block explorers (i.e. 1GoK6fv4tZKXFiWL9NuHiwcwsi8JAFiwGK).  For the private key, it should be the format used by the client's "dumpprivkey" and "importprivkey" commands.  For long term planning perhaps adding a --format option where the default is the "usual" format would be a good way to go.
  • --list-keys: When I do --list-keys (or pretty much any other command) the script needs to output the warning/notice about the encryption status as the first line of stdout.  See the OP for details.
  • --is-encrypted: This is outputting "Encrypted" even for wallets I'm sure are unencrypted.  I haven't been able to get it to say "Unencrypted" yet.
  • --is-encrypted: When I ran this on a newly created encrypted Blackcoin wallet I got this error:
Code:
Traceback (most recent call last):
  File "wi.py", line 1685, in parse_wallet
    item_callback(type, d)
  File "wi.py", line 1323, in item_callback
    if passphrase:
NameError: global name 'passphrase' is not defined
ERROR parsing wallet.dat, type mkey
key data: mkey
key data in hex: 046d6b657901000000
value data in hex: 3086c443a92ac09f438ff7d70d9caea2d35bf0de063cf8b8e948540c95e3196f39a5a02201eb0db22e03d20f93977f00f108ac026eb2a53908a200000000a861000000
    [/li]
    [li]--test-passphrase: Same error as above.[/li]
  • --list-contacts: The labels should be in double quotes.  If there is no label for an address, output "".
  • --balances: I tested with a Zetacoin wallet and it gave an error for each address: "Error reading balance for address".  The URL in the script returns a 404 when I visit it in my browser.
  • --explore-url: Should be named --explorer-url.  Also it output "None" as the last line.  Not sure why that was, but each line should either be a URL or an error message.

This list of issues doesn't represent a full thorough test.  The inconvenience of the --datadir/wallet.dat filename issue was enough that I only tried a few different wallet files.  Once that issue is fixed I'll do a more complete test of all features with more wallets.

And despite the list of issues, I do think the tool is coming along well.  It seems like it has the core routines it needs, it just needs to be polished for user friendliness.

Resolved most of your reported issues:
- is-encrypted now works
- datadir is removed (use --wallet and pass wallet path, works with any name)
- Zetacoin is an issue with zetachain.cc but I don't blame them they clearly mention that they're in beta. Will see if I can find any other zetacoin explorer
- list-contacts now show labels in double quotes

Some things still left, I will commit the whole later today once they are all done.
member
Activity: 65
Merit: 10
Please check https://github.com/unicoinex/walletinfo

What works:

Everything except balance (just need to put regex for each explorer. Mostly trivial work left) Balances also added.

Only included top 10 coins for this initial release. New coins will be added gradually.

So essentially the app is complete and just needs the remaining coins addition

Please note that since its in python, for the sake of completeness, I have kept the coin details within the file.

Thanks cointra!  I'll be able to check it out in detail in this weekend and will post any feedback here.

Hi coiner8, did you get the chance to check it out?

Hi cointra,

I can't test it easily or fully because it uses pywallet's strange and broken --datadir.  The script needs to be able to work by providing just the path to a wallet file, no --datadir option.  Also pywallet's implementation only opens files named "wallet.dat", even if you specify a different file.  The script should be able to handle a wallet with any filename.  If it requires a working directory it should handle that internally.

  • --list-keys: The format of the public and private keys should be the "usual" format.  For the public key, that is the format shown in the client and block explorers (i.e. 1GoK6fv4tZKXFiWL9NuHiwcwsi8JAFiwGK).  For the private key, it should be the format used by the client's "dumpprivkey" and "importprivkey" commands.  For long term planning perhaps adding a --format option where the default is the "usual" format would be a good way to go.
  • --list-keys: When I do --list-keys (or pretty much any other command) the script needs to output the warning/notice about the encryption status as the first line of stdout.  See the OP for details.
  • --is-encrypted: This is outputting "Encrypted" even for wallets I'm sure are unencrypted.  I haven't been able to get it to say "Unencrypted" yet.
  • --is-encrypted: When I ran this on a newly created encrypted Blackcoin wallet I got this error:
Code:
Traceback (most recent call last):
  File "wi.py", line 1685, in parse_wallet
    item_callback(type, d)
  File "wi.py", line 1323, in item_callback
    if passphrase:
NameError: global name 'passphrase' is not defined
ERROR parsing wallet.dat, type mkey
key data: mkey
key data in hex: 046d6b657901000000
value data in hex: 3086c443a92ac09f438ff7d70d9caea2d35bf0de063cf8b8e948540c95e3196f39a5a02201eb0db22e03d20f93977f00f108ac026eb2a53908a200000000a861000000
    [/li]
  • --test-passphrase: Same error as above.
  • --list-contacts: The labels should be in double quotes.  If there is no label for an address, output "".
  • --balances: I tested with a Zetacoin wallet and it gave an error for each address: "Error reading balance for address".  The URL in the script returns a 404 when I visit it in my browser.
  • --explore-url: Should be named --explorer-url.  Also it output "None" as the last line.  Not sure why that was, but each line should either be a URL or an error message.

This list of issues doesn't represent a full thorough test.  The inconvenience of the --datadir/wallet.dat filename issue was enough that I only tried a few different wallet files.  Once that issue is fixed I'll do a more complete test of all features with more wallets.

And despite the list of issues, I do think the tool is coming along well.  It seems like it has the core routines it needs, it just needs to be polished for user friendliness.
member
Activity: 83
Merit: 10
Please check https://github.com/unicoinex/walletinfo

What works:

Everything except balance (just need to put regex for each explorer. Mostly trivial work left) Balances also added.

Only included top 10 coins for this initial release. New coins will be added gradually.

So essentially the app is complete and just needs the remaining coins addition

Please note that since its in python, for the sake of completeness, I have kept the coin details within the file.

Thanks cointra!  I'll be able to check it out in detail in this weekend and will post any feedback here.

Hi coiner8, did you get the chance to check it out?
member
Activity: 83
Merit: 10
Added more coins bringing a total to 21 coins (from the top 50 market cap list excluding the ones that don't have a blockchain or blockchain explorer)
member
Activity: 65
Merit: 10
Please check https://github.com/unicoinex/walletinfo

What works:

Everything except balance (just need to put regex for each explorer. Mostly trivial work left) Balances also added.

Only included top 10 coins for this initial release. New coins will be added gradually.

So essentially the app is complete and just needs the remaining coins addition

Please note that since its in python, for the sake of completeness, I have kept the coin details within the file.

Thanks cointra!  I'll be able to check it out in detail in this weekend and will post any feedback here.
member
Activity: 83
Merit: 10
Please check https://github.com/unicoinex/walletinfo

What works:

Everything except balance (just need to put regex for each explorer. Mostly trivial work left) Balances also added.

Only included top 10 coins for this initial release. New coins will be added gradually.

So essentially the app is complete and just needs the remaining coins addition

Please note that since its in python, for the sake of completeness, I have kept the coin details within the file.
member
Activity: 65
Merit: 10
Now raised the bounty to 1.5 BTC (+0.25 BTC bonus)!  That's pretty reasonable I think.  $660-$770 at current price of $440/BTC.  And it's a pretty fun project that will be widely used after you make it!

Any takers?  All the info you should need is in the OP.  Just get started, maybe put it up on Github during development and take my money!

Anyone else want to contribute to the bounty?  If so state the amount in the thread.
member
Activity: 65
Merit: 10
https://github.com/jackjack-jj/pywallet does this already.
* on second look pywallet works with block explorer. The tough part is that they want the tool to be able to work with new coins by adding coinname/blockchain url in a config file, but that would work only if all block explorers use a common api which is sadly not the case.

Not all block explorers use the same API, but there are certainly common ones.  ABE is one but I've noticed other ones that are used by many coins.  Also there are services that handle many coins like blockr.io and cryptocoinexplorer.com and those use the same API for each coin.   As long as the tool supports adding new coins for the major APIs/sites that is fine.
member
Activity: 65
Merit: 10
Pywallet might be a good place to start, but it doesn't handle most of the functions I want.  I use pywallet a lot and I end up having to do lots of operations manually (like figuring out which coin the wallet file is for, what the otherversion is, etc.).

@lyth0s.  I'll PM you too, but stating the amount you're willing to contribute here will be most helpful.

I'll raise my bounty to 1BTC (+0.25BTC bonus).  Does that work for you E.exchanger?  If you start off by putting it on Github there maybe be multiple people willing to chip in code & bounties.
member
Activity: 83
Merit: 10

I don't see the function listed where it can decrypt a wallet with a given password. Is there an option for that within that python script?

You can just use openssl decrypt the private keys (which is the only things encrypted in the wallet) it uses the AES-256-CBC.

pywallet works on wallets that are updated by some Bitcoin client, the OP wants a tool that works with only the wallet.dat file and not require presence of a local blockchain. The only for that is as the OP mentions by getting balance updates from block explorers. * on second look pywallet works with block explorer. The tough part is that they want the tool to be able to work with new coins by adding coinname/blockchain url in a config file, but that would work only if all block explorers use a common api which is sadly not the case.
legendary
Activity: 1260
Merit: 1000
World Class Cryptonaire

I don't see the function listed where it can decrypt a wallet with a given password. Is there an option for that within that python script?
Pages:
Jump to: