• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

Exporting/importing privkey issues

aka teslaalset

New member
Using QT wallet and exporting privkey to an unused QT Wallet on another PC, the new wallet's DASH credit does not reflect the wallet's credit that I exported the privkey from. The 'clone' wallet shows many spend transitions while I did not manually initiate these.
This may be due to the fact that I exported the privkey from my original wallet while not finializing a mixing action (PrivateSend state at 20%).
I retried this action after I finished a mixing options ( PrivateSend state indicated 100%), but no improvements achieved.

Any clue on how to get my clone wallet in sync again with the original wallet?
 
Did you use the console to export the private key or did you use a backup copy of the wallet.dat file? PrivateSend uses a lot of addresses and the wallet only generates 1000 by default so needs to generate new pools of 1000 addresses when it runs out, I'm not certain but iirc the private key won't re-create the newly generated addresses. The most recent wallet.dat file wont have that issue but if mixing is used a lot it needs to be backed up often, older backups wont contain newly generated pools of addresses so coins can be lost permanently.
 
I used the console to generate the private key of wallet #1 (using the dumpprivkey command) and then imported this private key via de console (using importprivkey command) of wallet #2.
 
Copying wallet.dat may be the solution, I'll try this later.

In principle QT Wallet should support exporting / importing private keys though.
My current observations are that it looks like it needs multiple consecutive export / import actions between involved wallets until the issue is resolved.
Mixing may have played a role, which may require as many private key actions as mixing addresses that have been applied by the mixing action of the original wallet.
I repeated the action today and observed a new private key being generated by the original wallet. Problem is that my other PC is at my working office.
I'll bring that one back home tomorrow, so I can perform the repeating action at home during one evening.
 
You're running the same wallet on multiple clients? That should really be avoided, come to think of it I've not heard it warned against for a long time now but it can cause all sorts of issues, that address generation issue for one but there are others. Maybe it could be possible to modify the client to create a single private key for all addresses but it would probably result in some extremely long private keys! It could be an interesting option, probably better keeping paper wallets to just a few addresses for long term storage though.
 
Exporting single private key (or private key for all receiving addresses) won't work here if you mixed coins because what mixing essentially does it sends coins in a special transaction to you fresh new addresses which are controlled by fresh new private keys. This is why we have 1000 keys by default (unlike 100 in bitcoin) and autobackup function. This is also why you should refresh your backup copy of wallet.dat after you mixed a lot. To have access to you funds on another computer you can either copy wallet.dat or use dumpwallet/importwallet commands.
 
You're running the same wallet on multiple clients?
I am exporting the private key of the first DASH wallet I activated.
I then imported this private key into two new wallets on different laptops.
No wallet.dat file has been exchanged.

Exporting single private key (or private key for all receiving addresses) won't work here if you mixed coins because what mixing essentially does it sends coins in a special transaction to you fresh new addresses which are controlled by fresh new private keys.

Now I understand what caused the trouble I am facing.
This shows that developers of wallets (for PC platforms) should be very careful in launching wallets with too much options for common users that have no knowledge these complexities. The Android version is much better with respect to simplicity.

This is also why you should refresh your backup copy of wallet.dat after you mixed a lot. To have access to you funds on another computer you can either copy wallet.dat or use dumpwallet/importwallet commands.

I've attached the outlne of the situation.
The exchange of privkey (W1) occurred while mixing DirectSend status was as 20% (mixing stopped manually).
Problem now is that W3 is not reflecting the right credit and won't update to a situation where credit is correct.
 

Attachments

  • Cloning Wallets using PrivKey2.jpg
    Cloning Wallets using PrivKey2.jpg
    64.2 KB · Views: 169
Last edited:
I am exporting the private key of the first DASH wallet I activated.
I then imported this private key into two new wallets on different laptops.
No wallet.dat file has been exchanged.
....

"wallet.dat" and "private key" are essentially the same thing except (as you're experiencing) there can be multiple private keys in a single wallet and that's where things are going wrong, you have the initial private key in both wallets but you don't have the key(s) for the newly generated addresses. Again, running the same wallet on multiple clients is extremely bad practice and can easily result in lost funds, it should be avoided at all costs unless you know exactly what your doing and how to address all the risks involved.

The problem is those kind of things where just common knowledge a few years back when a full Bitcoin node could be run on a regular PC but then it became far too heavy for regular users so practically everyone switched to much simpler lightweight clients. The same will happen with Dash as transaction volumes continue to rise but running full nodes will always have complications, an endless chain of fool-proofing mechanisms could be built up but there's not much point because that's what Masternodes do, incentivise administration of full nodes and expand on their capabilities so things can be as simple and streamlined as possible for regular users. Unfortunately PrivateSend still needs a full client, it will be possible with lightweight clients very soon and in simple installations the full client works just fine but it can still have these kind of pitfalls when things get complicated.
 
I wish I'd seen that vid before, it would've made things much simpler. Cheers :) Yeah, the terminology can get confusing sometimes, "wallet" and "private key" get treated as the same thing but it ain't so simple. Glad you where cautious and didn't get caught out by it :) A couple of months ago someone here lost a significant amount through that, they'd been using PrivateSend a lot and only had an old backup to restore from after a system failure, not a massive amount lost but still enough to hurt.
 
dumpwallet / importwallet worked for my second wallet running under Windows. That second wallet is now in sync with the 'master wallet'.

I am having problems importing my original wallet file using importwallet command of my macbook QT wallet.
In what OSX folder do I need to place the wallet file? Or how do I direct to the right OSX folder using the importwallet command?
 
Last edited:
To finish off the topic after I resolved the issues reported, thanks to the help offered in this discussion thread, here's what I did in total:

- Exchanged the wallet file of the wallet1 to wallet2 and wallet2 by using the console commands dumpwallet and importwallet. This synchronized the original transactions made by wallet1
- Exchanged the wallet file of the wallet2 to wallet3 using the console commands dumpwallet and importwallet. This synchronized the aditional transactions done by wallet2.

For Windows 7 the default directory of the file created by the dumpwallet command can be found in directory C:\Program Files\DashCore
For OSX the default directory is the root directory of the harddisk.

All wallets are in sync with each other now.
I totally agree with the comments that one should avoid using wallets that need to by synchronized using the same wallet files.
It's much smarter to use separate wallets and transfer DASH using the payment route although this may require a small fee.
 
What is code -8?

unlocked wallet first,
console command: dumpwallet file
Code:
cannot open wallet dump file (code -8)
 
What is code -8?

unlocked wallet first,
console command: dumpwallet file
Code:
cannot open wallet dump file (code -8)
it's "invalid parameter" meaning that file you provided as a parameter can't be opened for some reason - path doesn't exist or you have no permissions to write there
 
To finish off the topic after I resolved the issues reported, thanks to the help offered in this discussion thread, here's what I did in total:

- Exchanged the wallet file of the wallet1 to wallet2 and wallet2 by using the console commands dumpwallet and importwallet. This synchronized the original transactions made by wallet1
- Exchanged the wallet file of the wallet2 to wallet3 using the console commands dumpwallet and importwallet. This synchronized the aditional transactions done by wallet2.

For Windows 7 the default directory of the file created by the dumpwallet command can be found in directory C:\Program Files\DashCore
For OSX the default directory is the root directory of the harddisk.

All wallets are in sync with each other now.
I totally agree with the comments that one should avoid using wallets that need to by synchronized using the same wallet files.
It's much smarter to use separate wallets and transfer DASH using the payment route although this may require a small fee.

Thanks for the explanation. It worked for me.
 
Back
Top