What format is expected for importprivkey?

+1 vote
I tried passing base58 encoded key, and also a WIF string generated by this page: https://gobittest.appspot.com/PrivateKey

It doesn't work and I'm now stuck.

Thanks in advance.

Alex
asked Oct 14, 2017 by alexbreadman

1 Answer

–1 vote
MultiChain addresses and private keys use extended version bytes and are slightly different from bitcoin addresses and private keys, unless you explicitly set your chain up to use compatible address. Detailed information about this can be found here: https://www.multichain.com/developers/address-key-format/
answered Oct 14, 2017 by MultiChain
I have already set the params.dat fields to allow bitcoin addresses to work. This is verified working on a live node, and I have copied the params.dat file to the cold wallet.

Could you please tell me what format to send the private key to importprivkey as per original question.

Thanks in advance.
The private key format is also described in the above link. If you set private-key-version=80 and address-checksum-value=00000000 then bitcoin formatted private keys should import fine into MultiChain. If that's not the case, please let us know.
Using the privkey from the instructions page:

VEEWgYhDhqWnNnDCXXjirJYXGDFPjH1B8v6hmcnj1kLXrkpxArmz7xXw

 I get 'invalid format for importprivkey', and for signmessage I get:

multichaind/signmessage: Invalid address or private key

...for an rpc call which is 'signmessage <key> <message>'
I used a the WIF key from the link I provided to signmessage and it seemed to work. I guess I must be constructing the importprivkey command incorrectly. Guess I will figure it out. Realised the demo multichain key wouldn't work because the chain is set to use btc addresses.
OK, let us know if you have any further problems.
...