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

Making a wallet for Masternode setup using dumpprivkey and importprivkey

chaeplin

Well-known member
* This guide use dumpprivkey and importprivkey
* Purpose of this guide is less hassle in wallet backup.
* Tested in testnet
* user ms06 and user ms05
* As address(private key) for NM is in both wallet, spend in main wallet could spend some portion of NM's 1K.
----> This will not break backup, but masternode could be invalided.

* If you spend using NM's wallet, backup is breaked, you should backup NM wallet also.
Keypool is diffrent in both wallet, so do not spend using NM's wallet.
Use backuped wallet, then backup backuped wallet.

* http://paper.darkcoin.io/
Code:
Spend your Darkcoins by importing your private key to the client wallet. 
Keep in mind when you import your single key to a Darkcoin p2p client and 
spend funds your key will be bundled with other private keys in the p2p client wallet. 
When you perform a transaction your change will be sent to another Darkcoin address 
within the p2p client wallet. You must then backup the p2p client wallet and 
keep it safe as your remaining Darkcoins will be stored there. 
Satoshi advised that one should never delete a wallet.



* Other scenario.
: dump privkey of existing NMs, import to existing(or new) wallet.



Code:
dumpprivkey <darkcoinaddress>
Reveals the private key corresponding to <darkcoinaddress>

Code:
importprivkey <darkcoinprivkey> [label] [rescan=true]

Adds a private key (as returned by dumpprivkey) to your wallet.
This may take a while, as a rescan is done, looking for existing transactions.
Note: There's no need to import public key, as in ECDSA (unlike RSA) this can be computed from private key.


* current main wallet, user ms06
Code:
ms06@x60t:~> darkcoind listaddressgroupings
[
    [
        [
            "mjSs4eLL18NsVcobKjSJsGChkK6YyeaZSr",
            1234.00000000,
            "ttt"
        ]
    ],
    [
        [
            "muj9oHwCtoWLcrALSfV7yQS2yh1KLpbXo6",
            1425.60000000,
            "0"
        ]
    ],
    [
        [
            "mgosBEJMvd27HiHcm1LLJqTekMAkaxHAvZ",
            5511.50020000,
            "123"
        ],
        [
            "mvz342xruamQuhz8XVwBy2tW15e3rFXZCK",
            0.04720000
        ]
    ]
]


* make a new address
Code:
ms06@x60t:~> darkcoind getaccountaddress NM01
n4kjkQ4GoB56gwhZDsTr9kWoc1cuKeBcqZ

* backup wallet
Code:
ms06@x60t:~> darkcoind backupwallet ~/darkcoind_wallet_0099.dat

* tx 1k to new address
Code:
ms06@x60t:~> darkcoind walletpassphrase password_long 100
ms06@x60t:~> darkcoind sendfrom 123 n4kjkQ4GoB56gwhZDsTr9kWoc1cuKeBcqZ 1000
49a28459d2adf8ebdd975bcc21c03090ea3398837143063e945fdd5a589c3162

* check balance
Code:
ms06@x60t:~> darkcoind listaddressgroupings
[
    [
        [
            "mjSs4eLL18NsVcobKjSJsGChkK6YyeaZSr",
            1234.00000000,
            "ttt"
        ]
    ],
    [
        [
            "muj9oHwCtoWLcrALSfV7yQS2yh1KLpbXo6",
            425.60000000,
            "0"
        ]
    ],
    [
        [
            "n4kjkQ4GoB56gwhZDsTr9kWoc1cuKeBcqZ",
            1000.00000000,
            "NM01"
        ]
    ],
    [
        [
            "mgosBEJMvd27HiHcm1LLJqTekMAkaxHAvZ",
            4508.69300000,
            "123"
        ],
        [
            "mxuX4HiZsw37Uy75kJwZYxs2gg9psMRcaW",
            2.80720000
        ],
        [
            "mvz342xruamQuhz8XVwBy2tW15e3rFXZCK",
            0.04720000
        ]
    ],
    [
        [
            "mgfmNyUwU92wKDRjJHHberGGudiBSNjyDw",
            1000.00000000,
            "NM02"
        ]
    ]
]

* dump privkey of new address
Code:
ms06@x60t:~> darkcoind dumpprivkey n4kjkQ4GoB56gwhZDsTr9kWoc1cuKeBcqZ
cQjuUGLHWqDTnyZRpMzejNd5wKjpHRWqJYMFUgjdjScuChewJnFA




* at user ms05, new wallet.
* balance is zero
Code:
ms05@x60t:~/.darkcoin> darkcoind listaddressgroupings
[
]

* import privkey
Code:
ms05@x60t:~/.darkcoin> darkcoind importprivkey cQjuUGLHWqDTnyZRpMzejNd5wKjpHRWqJYMFUgjdjScuChewJnFA 0 true
ms05@x60t:~/.darkcoin> darkcoind listaddressgroupings
[
    [
        [
            "n4kjkQ4GoB56gwhZDsTr9kWoc1cuKeBcqZ",
            1000.00000000,
            "0"
        ]
    ]
]

* encrypt wallet
Code:
ms05@x60t:~/.darkcoin> darkcoind encryptwallet passphrase
wallet encrypted; DarkCoin server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup.

done.


As long as you backup main wallet, backup of NM wallet(user ms05 wallet) is not needed.
 
Last edited by a moderator:
Yeah +1
I did this because I run multiple nodes and imported all private keys in one local backup wallet.
 
Yeah +1
I did this because I run multiple nodes and imported all private keys in one local backup wallet.

So with this method, we can have a separate wallet containing all the masternodes 1k addresses there? So we can manage all the payouts from that wallet? I did not know that was possible! How cool!

I had always thought the privatekey was valid for the entire poolkey of that wallet. In essence, having the privatekey was the equivalent having a wallet.dat backup. Guess I was wrong.
 
So with this method, we can have a separate wallet containing all the masternodes 1k addresses there? So we can manage all the payouts from that wallet? I did not know that was possible! How cool!

I had always thought the privatekey was valid for the entire poolkey of that wallet. In essence, having the privatekey was the equivalent having a wallet.dat backup. Guess I was wrong.
Read red color letter.

When spend, there should be grate care.
 
Will do chaeplin! Also read more on the subject before attempting anything. Thanks! Much to learn :cool:
 
Just dont use the masternode to send funds at all.

Now I am totally lost. In testnet, hot wallet setup, with the wallet config'ed to masternode=1, after payouts, say you have 1250 DRKs in the balance. We would try to send 251, but darkcoind would not let you. Basically it locked the 1k in. At least that was the way before 0.9.6. Sending out 250 would go through ok.

Now with local/remote, after you shut down the local wallet, if you want to cash out payouts, you have to fire up the local wallet with "darkcoind" - but no need to issues "masternode start" as the handshake has been done before. But masternode=1 is still in config file. I haven't tested the 1k deposit lock since, but say you have 1030 DRK by month's end, and want to cash out, what is the problem of sending out, for example 29 DRK ?

1k deposit would still be there.

I understand that if you dumpprivkey and import into a different wallet, and move out funds from the 1k deposit, this will break the Node. But if you always sure to cash out under 1k, will that be a problem?
 
If you want to be absolutely sure not to spend a fraction of your 1k and use the QT client, enable the coin control feature and select only other adresses as inputs. With daemon commands this should also be possible, didn't try that.
 
is it possible to have the masternode payments go to a seperate wallet then the masternode 1k coin wallet?
 
I tried the dumpprivkey on my masternode. I though private keys always start with "7" but mine did not. Tried putting it into a paper-wallet generator to see if it would output the correct darkcoin address, but it replied "Not a valid private key."
What does all this mean?
 
I tried the dumpprivkey on my masternode. I though private keys always start with "7" but mine did not. Tried putting it into a paper-wallet generator to see if it would output the correct darkcoin address, but it replied "Not a valid private key."
What does all this mean?
Ignore the paperwallet check, that is broken (someone noticed that somewhere else).
All my masternode private keys start with X and work as desired.
It's the compressed format or something...
 
I've been doing this for awhile. Really makes everything easier for maintainability.

When transferring coins from these addresses, all you need to use is coin control. No issues whatsoever.

Also note, it's safe to have a backup of the original MN wallet backed up as well as the wallet with the imported key.
 
Ignore the paperwallet check, that is broken (someone noticed that somewhere else).
All my masternode private keys start with X and work as desired.
It's the compressed format or something...
You're right! I searched a bit more and found a paper wallet which does validate the private key returned by the wallet. I am going to host a copy of this on PlanetCrypton.com, and when I do I will return to this thread and let you know. Could be several days, as I am swamped by my to-do list right now.
 
Back
Top