Pages:
Author

Topic: Pywallet 2.2: manage your wallet [Update required] (Read 208285 times)

HCP
legendary
Activity: 2086
Merit: 4363
I'm not able to get a specific time this happened ... snip

Last edit on the OP (according to BCT) appears to have been in September 2014:


Seems to check out, with that wayback machine URL showing the post in April 2014 not having the weird characters.

legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
Can someone please explain this gibberish to me, or am I the only one seeing them like that?

It seems to be just gibberish added sometime between 2014 and 2016: https://web.archive.org/web/20140417115312/https://bitcointalk.org/index.php?topic=34028

I'm not able to get a specific time this happened given that loyce.club doesn't keep an edit history, and ninjastic was too new to be able to capture the edit which occurred many years ago.

But I don't think it was intentional. Maybe it's some Unicode that's been trashed by the Windows character encoding.
copper member
Activity: 1330
Merit: 899
🖤😏
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

Can someone please explain this gibberish to me, or am I the only one seeing them like that?
newbie
Activity: 10
Merit: 0
legendary
Activity: 2464
Merit: 4415
🔐BitcoinMessage.Tools🔑
C:\Users\YX\OneDrive\Desktop\test>python pywallet.py --dumpwallet --wallet=.\wallet.dat>wallet.log
Traceback (most recent call last):
  File "pywallet.py", line 2290, in parse_wallet
    d['txIn'].append(parse_TxIn(vds))
  File "pywallet.py", line 2257, in parse_TxIn
    d['prevout_n'] = vds.read_uint32()
  File "pywallet.py", line 2183, in read_uint32
    def read_uint32(self): return self._read_num('  File "pywallet.py", line 2222, in _read_num
    (i,) = struct.unpack_from(format, self.input, self.read_cursor)
error: unpack_from requires a buffer of at least 4 bytes


Prompt this, what should I do?
It looks like a problem with one of the transaction inputs, the wallet tries to parse it with its internal algorithm defined in read_uint32 function but fails to do so. Try putting this part of the code in a try-catch block and see what happens, maybe it will skip problematic addresses and parse everything else successfully. Or maybe, you need to install an earlier version of Python.
newbie
Activity: 28
Merit: 9
C:\Users\YX\OneDrive\Desktop\test>python pywallet.py --dumpwallet --wallet=.\wallet.dat>wallet.log
Traceback (most recent call last):
  File "pywallet.py", line 2290, in parse_wallet
    d['txIn'].append(parse_TxIn(vds))
  File "pywallet.py", line 2257, in parse_TxIn
    d['prevout_n'] = vds.read_uint32()
  File "pywallet.py", line 2183, in read_uint32
    def read_uint32(self): return self._read_num('  File "pywallet.py", line 2222, in _read_num
    (i,) = struct.unpack_from(format, self.input, self.read_cursor)
error: unpack_from requires a buffer of at least 4 bytes


Prompt this, what should I do?
newbie
Activity: 14
Merit: 1
is it possible if using a pywallet can open a wallet without a passphrase?
there are several wallet.dat without password, but I open them with pywallet and they can't. Please give me all your experiences.  Wink
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
This is the format I get from the successful dump of the original .dat file: (Empty and Not Relevant Data)
       
            "addr": "LWKGCUr8wkrnsrJSaZ6f5vQwqWcG9VsxEL",
            "compressed": true,
            "encrypted_privkey": "14534d57630494bf2f0c0282a2f0d7ad2dcac4df7941e89b613c881e29df29c31bed8fb819cf5e4 f4a69a92449fa93d1",
            "hexsec": -snip-
            "pubkey": "02a8cb41f246ffd774dec89e74d57bfddf9cd149d95d20a78ea2d830b542030010",
            "reserve": 1,
            "sec": -snip-
            "secret": -snip-
You might want to snip-out the secret part of the contents of your dump.txt file since the private key and WIF private key are in there.
Even if it's empty, it's not a good idea to share your old wallet's keys and addresses.

For some reason, the WIF private key isn't formatted correctly for Litecoin;
perhaps there's something wrong with your --otherversion arg or it doesn't support LTC.

The workaround is to use "hexsec" which is your ECDSA Private key and encode it into WIF using encoding tools.
For example, the "Wallet Details" tab of liteaddress.org can convert it into WIF (but only use it offline).
Source Code: https://github.com/litecoin-project/liteaddress.org
newbie
Activity: 1
Merit: 0
Hi, I found an old corrupted wallet.dat (LTC) and was trying to recover it. I have tried to import it in most wallets like Electrum-LTC, LTC Core and BTC Recover but no success nothing can be dumped off the platforms because it's corrupted. I have in my hand, the wallet.dat (Corrupted) and the valid and verified passphrase. I have started using pywallet to try to recover or dump the privkey but it got into a sticky situation. The option I used was directly dumping the data from the wallet.dat file and successfully got a dump file the HexSec, Sec, Encrypted Key etc. Thing is, the hexsec value after conversion does not link properly to the right address (I verified with liteaddress.org offline). I verified the other wallets in the list, converted random hexsec values from other data in the list and the conversion goes well, the address and pubkey is the right one for other addresses. Now that is what I don't understand, the main wallet I tried to recover, the hexsec doesn't convert correctly and the pubkey doesn't match so that means the hexsec is not valid. I find myself confused. Any help is appreciated. PS: I tried to dump recovered wallet files as well, but nothing of importance is dumped on recovered files only on the original wallet.

I used this version of pywallet: https://github.com/jackjack-jj/pywallet

Command line used: python pywallet.py --dumpwallet --otherversion=ltc,0x30,0x05,0x36,ltc --wallet=wallet.dat --passphrase=password > dump.txt


This is the format I get from the successful dump of the original .dat file: (Empty and Not Relevant Data)
       
            "addr": "LWKGCUr8wkrnsrJSaZ6f5vQwqWcG9VsxEL",
            "compressed": true,
            "encrypted_privkey": "14534d57630494bf2f0c0282a2f0d7ad2dcac4df7941e89b613c881e29df29c31bed8fb819cf5e4 f4a69a92449fa93d1",
            "hexsec": "38145142896de4e60da72cbc86119126ab2c041a4406b47fb6967e732e6293a2",
            "pubkey": "02a8cb41f246ffd774dec89e74d57bfddf9cd149d95d20a78ea2d830b542030010",
            "reserve": 1,
            "sec": "92C4WaMgc4DzbtkGaS9qvAbgqKqdtTgHZVkS2oEPhU5AEBj6JCKY",
            "secret": "38145142896de4e60da72cbc86119126ab2c041a4406b47fb6967e732e6293a201"


Regards,

AzizLeBG
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
EDIT : pywallet complains if the wallet version is > 81000
Any chance that the wallet is created by later versions of Bitcoin Core?
Because if so, pywallet doesn't support "descriptor" wallet.dat which is the new default.

$ ./pywallet.py --version
./pywallet.py:22: UserWarning: Python 3 support is still experimental, you may encounter bugs
version says pywallet.py 1.1
(or is it 22?)
Version is '1.1'
The number '22' belongs to the error message.
sr. member
Activity: 268
Merit: 256
I've installed pywallet on Debian bookworm
You may need to do this :

attempting to install python-dev causes lots of problems

install build-essential python2-dev python-bsddb3

edit #!/usr/bin/env python to #!/usr/bin/env python3

$ pywallet needs 'bsddb' package to run, please install it

install python3-bsddb3

$ ./pywallet.py --version
./pywallet.py:22: UserWarning: Python 3 support is still experimental, you may encounter bugs
version says pywallet.py 1.1
(or is it 22?)

EDIT : pywallet complains if the wallet version is > 81000
copper member
Activity: 427
Merit: 29
Those timestamps are date & time of each individual keys in your wallet.dat.
Upon creation of the wallet, it will immediately preload thousands of keys for receiving and change addresses to the wallet.dat,
Thus, all those keys' timestamp should be the similar (may differ in a few seconds) so your hypothesis may be correct about the "timestamp" of the unencrypted wallet.

After setting a passphrase, Core will drop the unused keys from the wallet, create a new 'HDSeed' and derive a new keypool from it.
Thus, the new keypool has an updated timestamp based from when the wallet is encrypted;
However, if you just changed the passphrase of an already-encrypted wallet, the 'HDSeed' will remain the same so the timestamp will stay the same for the already-derived keys.

Yes, I figured out this problem, now I understand everything, thanks everyone for the help!
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
These experiments mean that even if the wallet does not have a password,
then "Timestamp" is still there and it means the date and time the wallet was created,
but if the password is set, then "Timestamp" means the date and time the password was set?
I can only guess based from Bitcoin Core's behavior in generating the keypool.

Those timestamps are date & time of each individual keys in your wallet.dat.
Upon creation of the wallet, it will immediately preload thousands of keys for receiving and change addresses to the wallet.dat,
Thus, all those keys' timestamp should be the similar (may differ in a few seconds) so your hypothesis may be correct about the "timestamp" of the unencrypted wallet.

After setting a passphrase, Core will drop the unused keys from the wallet, create a new 'HDSeed' and derive a new keypool from it.
Thus, the new keypool has an updated timestamp based from when the wallet is encrypted;
However, if you just changed the passphrase of an already-encrypted wallet, the 'HDSeed' will remain the same so the timestamp will stay the same for the already-derived keys.
copper member
Activity: 427
Merit: 29
For example I create new wallet in version 12 BTC Core and no password yet setup, I see this:

    "names": {
        "1A25wzkhegudPKb7rXhxCBu63R89vwfsHA": ""
    },
    "pool": [
        {
            "addr": "13DKzYCvn82UKTc2pExz9x3FnNsxvjwszD",
            "n": 2,
            "nTime": 1645911646,
            "nVersion": 120100,
            "public_key_hex": "0394ab2c6c28a5cee86236768532bebfd6b616b3c27525033e162260e03b802870"

1645911646 - after Run Timestamp To Date Converter I see this: 2/27/2022, 12:40:46 AM


after setup password I see this:

"names": {
        "1A25wzkhegudPKb7rXhxCBu63R89vwfsHA": ""
    },
    "pool": [
        {
            "addr": "1HTScVXbtXinEeqs3kcDaQBh58FJpzLsty",
            "n": 1,
            "nTime": 1645911925,
            "nVersion": 120100,
            "public_key_hex": "029b96cc029808b21f424fd8bb1fbecafcbf81233d9122051755e994411569843a"

1645911925 - after Run Timestamp To Date Converter I see this: 2/27/2022, 12:45:25 AM


These experiments mean that even if the wallet does not have a password,
then "Timestamp" is still there and it means the date and time the wallet was created,
but if the password is set, then "Timestamp" means the date and time the password was set?

HCP
legendary
Activity: 2086
Merit: 4363
I have an old wallet.dat. I don't know which coin it is about.
If you have a look through the wallet.dat in a normal text editor... you should be able to find various "name" fields. These will be followed by the address in plain text... here is an example of a Dogecoin wallet:


You can see the addresses start with a "D", which is a clue that it is a dogecoin wallet.dat.

So, try opening the file in a text editor and see if you can find some addresses to see what coin it is... It may not be worth your while attempting to recover the contents if it's a dead or worthless coin.


NOTE: as always, make sure you have backups of the original wallet.dat file, and only work on copies... you don't want to take the chance of accidentally corrupting the original wallet.dat!

jr. member
Activity: 38
Merit: 3
I have an old wallet.dat. I don't know which coin it is about.
I'm trying to scan it with this python script. I'm on Windows, that's what I tried for now:

Downloaded PWI_0.0.3.exe
Installed in Download folder
Once I go into the Download folder directory, there is an install.bat file, but I've already installed it (it runned automatically)
Now I got this GnuWin32 folder

What's the next step? Can't find any pywallet.bat file
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
Im one step closer thank you.

Now getting this error message when running that code

C:\Python27>pywallet.py --dumpwallet --wallet=.\wallet.dat
Warning: 'ecdsa' package is not installed, so you won't be able to sign/verify m
essages but everything else will work fine
This is just for the mentioned features;
but if you wish to get rid of the error, just install ecdsa package through pip: pypi.org/project/ecdsa

Quote from: wallet.duh
(22, 'Invalid argument -- C:\\Python27\\wallet.dat: unexpected file type or form
at')
ERROR:root:Couldn't open wallet.dat/main. Try quitting Bitcoin and running this
again.

I tried to open this file with Bitcoin core before using pywallet and got a similar "data is not in recognized format" error.

Wondering if im SOL
That indicates that the wallet.dat may be corrupted, also Bitcoin Core throws a similar error so that should confirm it.


I think you need to start your own thread in Bitcoin Technical Support board for corrupted wallet.dat recovery options.
Link to the board: http://bitcointalk.org/index.php?board=4.0
newbie
Activity: 3
Merit: 1
What would be the up to date command to run to get the contents of this file assuming i have that file and pywallet in the same folder and have a command window open from that directory already.
In that case, do not use --datadir and put ".\" before "wallet.dat";
that will tell pywallet to look for the wallet.dat file in the working directory:
Code:
python pywallet.py --dumpwallet --wallet=.\wallet.dat

Im one step closer thank you.

Now getting this error message when running that code

C:\Python27>pywallet.py --dumpwallet --wallet=.\wallet.dat
Warning: 'ecdsa' package is not installed, so you won't be able to sign/verify m
essages but everything else will work fine
(22, 'Invalid argument -- C:\\Python27\\wallet.dat: unexpected file type or form
at')
ERROR:root:Couldn't open wallet.dat/main. Try quitting Bitcoin and running this
again.

I tried to open this file with Bitcoin core before using pywallet and got a similar "data is not in recognized format" error.

Wondering if im SOL

legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
What would be the up to date command to run to get the contents of this file assuming i have that file and pywallet in the same folder and have a command window open from that directory already.
In that case, do not use --datadir and put ".\" before "wallet.dat";
that will tell pywallet to look for the wallet.dat file in the working directory:
Code:
python pywallet.py --dumpwallet --wallet=.\wallet.dat
newbie
Activity: 3
Merit: 1

I saw the post that datadir has been removed and im getting that message when i try to follow old guides to dump a wallet.dat file i have.

What would be the up to date command to run to get the contents of this file assuming i have that file and pywallet in the same folder and have a command window open from that directory already.


Error i get when trying to dump wallet

Depreacation
  The --datadir option has been deprecated, now the full path of the wallet file should go to --wallet
  If you're not sure what to do, concatenating the old --datadir content, then a directory separator, then the old --wallet should do the trick
  If not, ask for help in the Pywallet thread: https://bitcointalksearch.org/topic/pywallet-22-manage-your-wallet-update-required-34028
A mandatory option is missing

|I appreciate any guidance you can provide.
Pages:
Jump to: