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

Error when attempting to get private key of 0th address

virento

New member
Hello, I'm setting up a local/remote cold-storage DRK masternode following the guide @ planetcrypton and I'm having trouble obtaining the private key of the 0th address. When I issue the command to do so, I get the following error:

darkcoind dumpprivkey <0th address>
error: {"code":-4,"message":"Private key for address <0th address> is not known"}

I substituted the real 0th address with <0th address> just for this thread. Any idea what's going on here?
 
No, I didn't unlock the wallet before dumping the key however I haven't encrypted my wallet yet either. The planetcrypton guide I'm using is 'install-darkcoin-daemon' (sorry, I can't post URLs yet) and the wallet encryption/unlocking steps come after the current step I'm on unless I'm missing something. I'm at the step illustrated below:
--------------------------------------------------------------
"
Generate your "0th" Darkcoin address on the LOCAL machine:

darkcoind getaccountaddress 0



Now you're going to get the "private key" of the darkoin address which you just generated, and save it in a VERY secure location. This will protect our 1000DRK (and any other DRK which will be held in that address in the future) in the event of catastrophic hard-drive failure or other condition which could prevent you from accessing your LOCAL wallet. In the following line <darkcoin-address> is the address you just generated:

darkcoind dumpprivkey <darkcoin-address>"

--------------------------------------------------------------

When I issue the 'darkcoind dumpprivkey <darkcoin-address>' command using the value generated from the previous 'darkcoind getaccountaddress 0' command I receive the error I mentioned in my original post.
 
No, I didn't unlock the wallet before dumping the key however I haven't encrypted my wallet yet either. The planetcrypton guide I'm using is 'install-darkcoin-daemon' (sorry, I can't post URLs yet) and the wallet encryption/unlocking steps come after the current step I'm on unless I'm missing something. I'm at the step illustrated below:
--------------------------------------------------------------
"
Generate your "0th" Darkcoin address on the LOCAL machine:

darkcoind getaccountaddress 0



Now you're going to get the "private key" of the darkoin address which you just generated, and save it in a VERY secure location. This will protect our 1000DRK (and any other DRK which will be held in that address in the future) in the event of catastrophic hard-drive failure or other condition which could prevent you from accessing your LOCAL wallet. In the following line <darkcoin-address> is the address you just generated:

darkcoind dumpprivkey <darkcoin-address>"

--------------------------------------------------------------

When I issue the 'darkcoind dumpprivkey <darkcoin-address>' command using the value generated from the previous 'darkcoind getaccountaddress 0' command I receive the error I mentioned in my original post.

Did you receive an address with 'darkcoind getaccountaddress 0' command as believe you only need to type 'getaccountaddress 0'?
 
Not sure why you receiving that error but if you wallet is password protected why don`t you just back it up (from in wallet, File -> Back-up)which is probably the easier solution than trying to get the private key unless you specifically wanted the private key?
Is your MN up and running ok?
 
It seems the address I generated is valid according to the output of 'darkcoind validateaddress <darkcoinaddress>' as shown below:

darkcoind validateaddress <darkcoinaddress-removedforthread>
{
"isvalid" : true,
"address" : "<darkcoinaddress-removedforthread>",
"ismine" : true,
"isscript" : false,
"pubkey" : "<darkcoinaddresspubkey-removedforthread>",
"iscompressed" : true,
"account" : "0"
}

However I'm still receiving the same error as I mentioned in my original post when running 'darkcoind dumpprivkey <darkcoinaddress>'. Any help would be appreciated.
 
It seems the address I generated is valid according to the output of 'darkcoind validateaddress <darkcoinaddress>' as shown below:

darkcoind validateaddress <darkcoinaddress-removedforthread>
{
"isvalid" : true,
"address" : "<darkcoinaddress-removedforthread>",
"ismine" : true,
"isscript" : false,
"pubkey" : "<darkcoinaddresspubkey-removedforthread>",
"iscompressed" : true,
"account" : "0"
}

However I'm still receiving the same error as I mentioned in my original post when running 'darkcoind dumpprivkey <darkcoinaddress>'. Any help would be appreciated.
darkcoind knows <darkcoinaddress-removedforthread> is mine.

But darkcoind dumpprivkey <0th address>
error: {"code":-4,"message":"Private key for address <0th address> is not known"}

Hmmm. do you use same username as run "darkcoind validateaddress " ?

I think you have two wallet as diffrent user.
 
Hmmm, is anything in the debug file after issuing the "dumpprivkey" command?

Also just for curiosity, have you tried compiling the v0.9.11-5 source and seeing if it works? To do that do this:
Code:
git clone https://github.com/darkcoinproject/darkcoin
cd darkcoin
git checkout tags/v0.9.11.5
Then just compile as normal and retry the dumpprivkey command.
One last thing, to return to the main branch, use:
Code:
git checkout master
 
When I issue the dumpprivkey command and it fails, this is all I see in the debug log:

2014-07-22 16:21:44 ThreadRPCServer method=dumpprivkey

I also compiled v0.9.11.5-beta using the instructions you provided and I get the exact same error unfortunately. Any thoughts?
 
If it helps, I'm using Ubuntu 14.04 as suggested in the guide. Has anyone else successfully used that guide on Ubuntu 14.04?
 
Using 14.04 and 91105 and libdb5.1
(Testing address, wallet removed)
Code:
mainnet02@ip-172-31-4-239:~/.darkcoin$ darkcoind getaccountaddress 01
Xdz2HVsXhGv5ryo1kcCh4TXeCBuumLidai
mainnet02@ip-172-31-4-239:~/.darkcoin$ darkcoind dumpprivkey Xdz2HVsXhGv5ryo1kcCh4TXeCBuumLidai
XFjMmCHBUxSraChZADz2HknBX6pNoYb69Nrp7ik5VBrE6ZvQRRxw
mainnet02@ip-172-31-4-239:~/.darkcoin$ darkcoind validateaddress Xdz2HVsXhGv5ryo1kcCh4TXeCBuumLidai
{
    "isvalid" : true,
    "address" : "Xdz2HVsXhGv5ryo1kcCh4TXeCBuumLidai",
    "ismine" : true,
    "isscript" : false,
    "pubkey" : "0392fa3b406ca9a6572cf30ac8c48e4672dc0a5ae61c38d8e9332f01107f089a7a",
    "iscompressed" : true,
    "account" : "01"
}
mainnet02@ip-172-31-4-239:~/.darkcoin$ darkcoind dumpprivkey Xdz2HVsXhGv5ryo1kcCh4TXeCBuumLidai
XFjMmCHBUxSraChZADz2HknBX6pNoYb69Nrp7ik5VBrE6ZvQRRxw
mainnet02@ip-172-31-4-239:~/.darkcoin$ darkcoind dumpprivkey 'Xdz2HVsXhGv5ryo1kcCh4TXeCBuumLidai'
XFjMmCHBUxSraChZADz2HknBX6pNoYb69Nrp7ik5VBrE6ZvQRRxw
mainnet02@ip-172-31-4-239:~/.darkcoin$ darkcoind dumpprivkey 'Xdz2HVsXhGv5ryo1kcCh4TXeCBuumLidai"
> -su: unexpected EOF while looking for matching `''
-su: syntax error: unexpected end of file
mainnet02@ip-172-31-4-239:~/.darkcoin$ darkcoind dumpprivkey "Xdz2HVsXhGv5ryo1kcCh4TXeCBuumLidai"
XFjMmCHBUxSraChZADz2HknBX6pNoYb69Nrp7ik5VBrE6ZvQRRxw
mainnet02@ip-172-31-4-239:~/.darkcoin$ darkcoind dumpprivkey "Xdz2HVsXhGv5ryo1kcCh4TXeCBuumLidai "
XFjMmCHBUxSraChZADz2HknBX6pNoYb69Nrp7ik5VBrE6ZvQRRxw
mainnet02@ip-172-31-4-239:~/.darkcoin$ darkcoind dumpprivkey ' Xdz2HVsXhGv5ryo1kcCh4TXeCBuumLidai'
XFjMmCHBUxSraChZADz2HknBX6pNoYb69Nrp7ik5VBrE6ZvQRRxw
mainnet02@ip-172-31-4-239:~/.darkcoin$ darkcoind dumpprivkey <Xdz2HVsXhGv5ryo1kcCh4TXeCBuumLidai>
-su: syntax error near unexpected token `newline'
mainnet02@ip-172-31-4-239:~/.darkcoin$
mainnet02@ip-172-31-4-239:~/.darkcoin$ export LANG=ko.KR
mainnet02@ip-172-31-4-239:~/.darkcoin$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=ko.KR
LANGUAGE=
LC_CTYPE="ko.KR"
LC_NUMERIC="ko.KR"
LC_TIME="ko.KR"
LC_COLLATE="ko.KR"
LC_MONETARY="ko.KR"
LC_MESSAGES="ko.KR"
LC_PAPER="ko.KR"
LC_NAME="ko.KR"
LC_ADDRESS="ko.KR"
LC_TELEPHONE="ko.KR"
LC_MEASUREMENT="ko.KR"
LC_IDENTIFICATION="ko.KR"
LC_ALL=
mainnet02@ip-172-31-4-239:~/.darkcoin$ darkcoind dumpprivkey Xdz2HVsXhGv5ryo1kcCh4TXeCBuumLidai
terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid
Aborted (core dumped)
mainnet02@ip-172-31-4-239:~/.darkcoin$ LANG=en_US.UTF-8
mainnet02@ip-172-31-4-239:~/.darkcoin$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
mainnet02@ip-172-31-4-239:~/.darkcoin$ darkcoind dumpprivkey Xdz2HVsXhGv5ryo1kcCh4TXeCBuumLidai
XFjMmCHBUxSraChZADz2HknBX6pNoYb69Nrp7ik5VBrE6ZvQRRxw


Question : Did you copy wallet.dat from other computer ?
 
I'm using a fresh wallet, not copied from another source. I'm also using libdb4.8 as recommended by the darkcoin source documentation located in doc/build-unix.md instead of 5.1 or 5.3. Should I be using something different than libdb4.8?
 
Back
Top