Bitcoin Forum
November 15, 2024, 09:06:40 AM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Question: Generating address in bitcoin core using my xpub  (Read 182 times)
artofwar (OP)
Member
**
Offline Offline

Activity: 142
Merit: 26


View Profile
November 03, 2018, 03:22:44 AM
 #1

Hi there, from my understanding, generating an address will also generating private key assosiated to that address simultaniously

but, If I generate address using master public key in my server (xpub), where is the private key stored?


so now I have electrum wallet, I use my wallet's xpub to generate address in my website.

but how can I sign transaction? using my master private key? (xprv)
pooya87
Legendary
*
Offline Offline

Activity: 3640
Merit: 11033


Crypto Swap Exchange


View Profile
November 03, 2018, 05:00:06 AM
 #2

Hi there, from my understanding, generating an address will also generating private key assosiated to that address simultaniously
in a way you are correct but it is not a correct statement.
what happens is that when you request a new address your wallet generates a new private key first and then uses that key to derive your public key and then converts that public key to a desired address format that you want.

Quote
but, If I generate address using master public key in my server (xpub), where is the private key stored?
things work a little differently in BIP32. what we have here is two things:
- a master private key
- a master public key
the design here is unique and is in a way that you can use your master public key to derive the future public keys without needing the master private key. but this master public key is derived from that master private key so in a way it is still the same as above.
meaning you first created a private key then used that to get the public keys.
so your private key(s) is that master key (xprv)

Quote
so now I have electrum wallet, I use my wallet's xpub to generate address in my website.
but how can I sign transaction? using my master private key? (xprv)
you have to have another wallet that contains the master private key so that it can generate the private key corresponding to that address you are spending from so that you can sign a transaction.

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
artofwar (OP)
Member
**
Offline Offline

Activity: 142
Merit: 26


View Profile
November 03, 2018, 11:26:53 AM
 #3

Hi there, from my understanding, generating an address will also generating private key assosiated to that address simultaniously
in a way you are correct but it is not a correct statement.
what happens is that when you request a new address your wallet generates a new private key first and then uses that key to derive your public key and then converts that public key to a desired address format that you want.

Quote
but, If I generate address using master public key in my server (xpub), where is the private key stored?
things work a little differently in BIP32. what we have here is two things:
- a master private key
- a master public key
the design here is unique and is in a way that you can use your master public key to derive the future public keys without needing the master private key. but this master public key is derived from that master private key so in a way it is still the same as above.
meaning you first created a private key then used that to get the public keys.
so your private key(s) is that master key (xprv)

Quote
so now I have electrum wallet, I use my wallet's xpub to generate address in my website.
but how can I sign transaction? using my master private key? (xprv)
you have to have another wallet that contains the master private key so that it can generate the private key corresponding to that address you are spending from so that you can sign a transaction.

OHHHH!!! I GET IT.

so one master key can be use to sign hundreds of transaction for my public keys created by the "Master public key"

and master private key can be use to restore our wallet with other wallet provider.

so now the only thing that I have to put attention to is Master Private Key (xprv)
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!