Forum Thread: Pywallet and Berkley DB Files Question

Ok so I have a few wallet.dat files and I'm working on a python script I can use to easily send and recieve them on multiple computers (to easily back up my crypto wallets). I have written a script now which basically does an os.walk for the wallet files, opens them and sends it to a server both using TCPServerSocket and threading, waiting to receive the files. I have a few issues with this though:

1) when I transfer the files over it doesn't transfer correctly, and the resulting file is usually a lot smaller than the original. I haven't even tried opening one of them in a wallet because I feel like it'd be a waste of time and wont open correctly. I think the problem is with the specific file type wallets are (Berkley DB files, version 9) and the way I'm opening and sending them. Is there a specific way you're supposed to open and send BerkleyDB files in python other than anydbm (which sends it but i dont think it's sending the entire file) or bsdbb (which is deprecated)? Now that I think about it im pretty sure Berkley DB files are a type of binary file, and I wasn't using the binary option when I tried to regularly open and send it (that may be why it wasnt sending correctly and just created a text file with the line "wallet.dat" in it.

2) when I originally used pywallet to dump the wallet, I got a huge list of results with a section that had various different public and private keys. My question is, when I use pywallet to dump the file which pub/priv key pair relate to the wallet.dat file i'm trying to dump? or will importing the file with any of the priv keys displayed open it?

any help would be appreciated. I've learned a lot from this site and I plan on starting to give back soon, but this is my first time being so stumped I couldn't even find any answer on google. All I keep getting is that the bsdbb library is deprecated and for the file size being so much smaller (almost 4x smaller than the original) there was not even a clue. I'm honestly up for figuring out and testing and finding out how to complete the script if I can get a hand in the right direction, I don't really need a handout or someone to complete the code for me. I just need to know where to look to know how to finish.

Be the First to Respond

Share Your Thoughts

  • Hot
  • Active