Author

Topic: What is an derived Public Key? (Read 415 times)

legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
June 02, 2017, 07:25:39 AM
#2
The derived public key you are referring to here is the master public key(xpub). It is linked with the master private key (xpriv) and it can be used to generate addresses that can also be generated from xpriv.

The xpub can be taken from Electrum by going to wallet>Master public key if the wallet is generated from a seed.
newbie
Activity: 6
Merit: 0
June 02, 2017, 07:05:26 AM
#1
Hello,
I have a BTC Depositor, basically a nodejs script for payment in bitcoin, apparently you can create Bitcoin Adresses, that "belong" to you, by generating them with your Public Key, or am I missunderstanding something?
And where do I find my derived Public Key
Little Code snippet
Code:
var derivedPubKey = 'xpub6AK3Pskqnn12yJmiAA313sFBE5EABrqH1Ldb2WNUmXYxbQGW481hSCEQFvwdQoHkw7NuYbyN3*****************************';
if (!derivedPubKey)
    throw new Error('Must set env var BIP32_DERIVED_KEY');

var hdNode = bitcoinjs.HDNode.fromBase58(derivedPubKey);

exports.deriveAddress = function(index) {
    return hdNode.derive(index).pubKey.getAddress().toString();
};

And this code doesnt work anymore, I had a friend that gave me his, and I gave him the Adress that it spit out, he said that the command "bitcoin-client validateadress " said that the Wallet exists, but it doesnt belong to him
Please help me Cheesy
Jump to: