langerhans / dogecoinj-new

Fork of bitcoinj ported to dogecoin
Apache License 2.0
56 stars 42 forks source link

wallet-tool: Unknown network parameters ID org.dogecoin.production #19

Open evranch opened 6 years ago

evranch commented 6 years ago

While attempting to recover my keys from an android wallet, I can't get wallet-tool to work. The wallet backup file is intact and a raw dump succeeds, but I can't do a regular dump as this error is thrown:

~/doge/dogecoinj-new/tools$ ./wallet-tool --wallet=../../wallet-decrypted-backup dump
Failed to load wallet '../../wallet-decrypted-backup': Unknown network parameters ID org.dogecoin.production
org.bitcoinj.wallet.UnreadableWalletException: Unknown network parameters ID org.dogecoin.production
    at org.bitcoinj.wallet.WalletProtobufSerializer.readWallet(WalletProtobufSerializer.java:436)
    at org.bitcoinj.tools.WalletTool.main(WalletTool.java:332)

If I change org.dogecoin.production to org.bitcoin.production in the wallet file, wallet-tool will attempt to load it, but then fail as the parameters are different. It appears that this tool is still set up for Bitcoin?

langerhans commented 6 years ago

Yes, this repository solely exists for some very minor patches the Android wallet requires. You will need to compile https://github.com/dogecoin/libdohj . And then also update wallet-tool to actually use the appropriate Dogecoin network parameters. I'm currently working on a simpler recovery solution of Andorid wallet backups but it's far from done yet, sorry.

evranch commented 6 years ago

I've managed to extract the keys from the wallet using a modified version of https://github.com/jleni/wallet-decrypt, and confirmed their validity with libbitcoin-explorer's bx. I am still having an issue with spending the private key, but at least I was able to generate the address from the private key and confirm the location of the Dogecoin.

Once I get it working properly I'll send you the modified script to pass along to other people looking for their lost Doge.

nvanhoesel commented 3 years ago

Please tell me how you got the private keys

MrMoonlight101 commented 3 years ago

I've managed to extract the keys from the wallet using a modified version of https://github.com/jleni/wallet-decrypt, and confirmed their validity with libbitcoin-explorer's bx. I am still having an issue with spending the private key, but at least I was able to generate the address from the private key and confirm the location of the Dogecoin.

Once I get it working properly I'll send you the modified script to pass along to other people looking for their lost Doge.

is there any chance you ever finished this? my coins are trapped in my phone and I need to be able to get my private key from the backup file I have

iwoolf commented 3 years ago

I downloaded libdohj, but I don't know how to modify wallet-tool. I downloaded wallet0decrypt, but it didn't help.

MrMoonlight101 commented 3 years ago

I downloaded libdohj, but I don't know how to modify wallet-tool. I downloaded wallet0decrypt, but it didn't help.

I've been trying to work with this https://github.com/evranch/wallet-decrypt but having some troubles printing out my keys

iwoolf commented 3 years ago

I encrypted my protobuf wallet with openssl, but wallet-decrypt gives me errors instead of keys: Traceback (most recent call last): File "wallet-decrypt.py", line 59, in main() File "wallet-decrypt.py", line 50, in main w = get_wallet(args.filename, args.password) File "wallet-decrypt.py", line 39, in get_wallet w.ParseFromString(pbdata) google.protobuf.message.DecodeError: Error parsing message

evranch commented 3 years ago

What do you mean by "troubles printing out my keys"?

Unfortunately I'm not a python dev, I just hacked it into shape until it worked on my wallet years ago because it was the only thing I had to work with. The fork published in https://github.com/evranch/wallet-decrypt was working at the time, no idea if anything has changed since. My Dogecoin were long ago removed from this wallet format, I can try to help out a bit but I don't really maintain this software.

iwoolf commented 3 years ago

When I use your evranch fork of wallet-decrypt I get these errors: Traceback (most recent call last): File "./wallet-decrypt.py", line 64, in main() File "./wallet-decrypt.py", line 52, in main w = get_wallet(args.filename, args.password) File "./wallet-decrypt.py", line 39, in get_wallet w.ParseFromString(pbdata) google.protobuf.message.DecodeError: Error parsing message

MrMoonlight101 commented 3 years ago

What do you mean by "troubles printing out my keys"?

Unfortunately I'm not a python dev, I just hacked it into shape until it worked on my wallet years ago because it was the only thing I had to work with. The fork published in https://github.com/evranch/wallet-decrypt was working at the time, no idea if anything has changed since. My Dogecoin were long ago removed from this wallet format, I can try to help out a bit but I don't really maintain this software.

Well I managed to run the script to the point where it said "Extracting key pairs....", it even outputs a file. However nothing appears after that and while the file has a lot of headings, any text that would be useful is encrypted or scrambled.