





1



2 Shares

In How to Use Coinkite’s Multi-Signature Wallets with Bitcore we explained how to create a multisignature wallet on Coinkite and cosign it with Bitcore. We used Coinkite’s offline tool to generate a key pair. Although it is easier to use Coinkite to generate the private key, it is a good security practice to generate it independently. Below, we explain how to do this with Bitcore.

In the following dialog choose “Import Key” and you will see the “Import Extended Pubkey” dialog:

Separately, we will have to generate the key and signature with Bitcore and its add-on library Bitcore Message:

var bitcore = require('bitcore'); var Message = require('bitcore-message'); var hdPrivateKey = new bitcore.HDPrivateKey(bitcore.Networks.testnet); console.log('xprivkey: ' + hdPrivateKey.xprivkey); console.log('xpubkey: ' + hdPrivateKey.xpubkey); var signature = Message('Coinkite').sign(hdPrivateKey.privateKey); console.log('Signature for message "Coinkite": ' + signature); 1 2 3 4 5 6 7 8 9 var bitcore = require ( 'bitcore' ) ; var Message = require ( 'bitcore-message' ) ; var hdPrivateKey = new bitcore . HDPrivateKey ( bitcore . Networks . testnet ) ; console . log ( 'xprivkey: ' + hdPrivateKey . xprivkey ) ; console . log ( 'xpubkey: ' + hdPrivateKey . xpubkey ) ; var signature = Message ( 'Coinkite' ) . sign ( hdPrivateKey . privateKey ) ; console . log ( 'Signature for message "Coinkite": ' + signature ) ;

This is a sample output:

xprivkey: tprv8ZgxMBicQKsPdhaer1ZSHH2ZU6CbPforhVuVAn6qUgxfdMNLLGRTGM33N5CaSEoLmoB5kZF9w5dXBz12j3WXyTvBMgqap1xwM28gJyooATU

xpubkey: tpubD6NzVbkrYhZ4XAcSjfE2gggg37iXYzzmGoWGTJ98txm4Tqd6xfF3SqeuYCkMNsAKy9hnyJimaMo8FoHkg4DmTpUF4B85nnLfKAWzgq11TJB

Signature for message "Coinkite": H2uhiyw4+FQWRx4mniYVAvPZ+pl7Wmur/IvYOOjAARuFUy9HTXoy6s3J9k7M9QKbCh9GQbPupuNTzjK43ZJZh6U=



With this, you can submit the xpubkey and signature to Coinkite, and store the xprivkey safely on your end.