Bitcoin Forum
December 30, 2024, 07:33:52 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: What is an derived Public Key?  (Read 419 times)
XizT (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
June 02, 2017, 12:05:26 PM
 #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 <adress>" said that the Wallet exists, but it doesnt belong to him
Please help me Cheesy
ranochigo
Legendary
*
Offline Offline

Activity: 3080
Merit: 4459


Crypto Swap Exchange


View Profile
June 02, 2017, 12:25:39 PM
 #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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!