Author

Topic: Confused about addresses (Read 1019 times)

erl
newbie
Activity: 14
Merit: 0
November 23, 2012, 01:05:40 AM
#6
Guess i got what i need.

Generating addresses

Code:
./vanitygen -k -o keys.txt ""

Mass import

Code:
#!/bin/bash

p=$(basename $0)
pywallet_bin="./pywallet.py"


if [ $# -lt 2 ];then echo "Usage: $p "; exit 1; fi

file=$1
wallet=$2

if [ ! -f "$file" ];then echo "$p: file '$file' not found."; exit 1; fi
if [ ! -f "$wallet" ];then echo "$p: wallet '$wallet' not found."; exit 1; fi
if [ ! -f "$pywallet_bin" ];then echo "$p: pywallet '$pywallet_bin' executable not found"; exit 1; fi

private_keys=($(grep "Privkey: " "$file" | awk -F " " '{ print $2; }'))

echo "Private keys found: ${#private_keys[*]}"

for key in "${private_keys[@]}";
do
#echo $key
$pywallet_bin --datadir=$(dirname "$wallet") --wallet=$(basename "$wallet") --importprivkey=$key --dont_check_walletversion
done

exit 0
erl
newbie
Activity: 14
Merit: 0
November 22, 2012, 04:50:37 PM
#5
[earl@b2x2:~/.bitcoin]$ pywallet.py --datadir=./ --wallet=wallet.dat --dumpwallet | grep "$ADDRESS_VISIBLE_IN_BITCOIN_QT"

You probably are missing the error message.

Try just this.

 $ pywallet.py --dumpwallet

And if the wallet is encrypted, you'll need to add --password=PASSWORD


Well that was strange. I deleted the old wallet and let the bitcoin-qt generate a new one, then created a few new addresses, re-run pywallet and finally got what i need. :-)

And yes, there's a message about 'ecdsa' but I dont think I need that feature:

Quote
'ecdsa' package is not installed, pywallet won't be able to sign/verify messages
legendary
Activity: 2506
Merit: 1010
November 22, 2012, 02:27:45 PM
#4
Code:
[earl@b2x2:~/.bitcoin]$ pywallet.py --datadir=./ --wallet=wallet.dat --dumpwallet | grep "$ADDRESS_VISIBLE_IN_BITCOIN_QT"

You probably are not seeing the error message.

Try just this.

 $ pywallet.py --dumpwallet

And if the wallet is encrypted, you'll need to add --password=PASSWORD
erl
newbie
Activity: 14
Merit: 0
November 22, 2012, 02:07:54 PM
#3
I'm trying to dump addresses from the wallet.dat using pywallet but the results confuse me. I expect to see all addresses visible via bitcoin-qt interface but when grepping the output from pywallet none of them are found.

Not sure why that is.

You could also try Gavin's bitcoin tools, which has a dumpwallet.

According to the README (https://github.com/gavinandresen/bitcointools):

Quote
These tools are becoming obsolete as we move away from using Berkeley DB in
Bitcoin-Qt/bitcoind.

If you are looking for a tool to manipulate the wallet.dat file, you might
want to try https://github.com/joric/pywallet

Again I'm running in the circles. Thanks to your reply I got the idea I'm doing something wrong with pywallet so I'll try to fiddle with it a little more.

Here's how i call pywallet:

Code:
[earl@b2x2:~/.bitcoin]$ pwd
/home/earl/.bitcoin
[earl@b2x2:~/.bitcoin]$ pywallet.py --datadir=./ --wallet=wallet.dat --dumpwallet | grep "$ADDRESS_VISIBLE_IN_BITCOIN_QT"
# empty result
legendary
Activity: 2506
Merit: 1010
November 22, 2012, 07:16:22 AM
#2
I'm trying to dump addresses from the wallet.dat using pywallet but the results confuse me. I expect to see all addresses visible via bitcoin-qt interface but when grepping the output from pywallet none of them are found.

Not sure why that is.

You could also try Gavin's bitcoin tools, which has a dumpwallet.


erl
newbie
Activity: 14
Merit: 0
November 22, 2012, 12:36:23 AM
#1
I'm trying to dump addresses from the wallet.dat using pywallet but the results confuse me. I expect to see all addresses visible via bitcoin-qt interface but when grepping the output from pywallet none of them are found.

Am I missing something?

-- Erl Cash
Jump to: