Bitcoin Forum
May 06, 2024, 05:50:07 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Question: Generating address in bitcoin core using my xpub  (Read 162 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)
The grue lurks in the darkest places of the earth. Its favorite diet is adventurers, but its insatiable appetite is tempered by its fear of light. No grue has ever been seen by the light of day, and few have survived its fearsome jaws to tell the tale.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715017807
Hero Member
*
Offline Offline

Posts: 1715017807

View Profile Personal Message (Offline)

Ignore
1715017807
Reply with quote  #2

1715017807
Report to moderator
1715017807
Hero Member
*
Offline Offline

Posts: 1715017807

View Profile Personal Message (Offline)

Ignore
1715017807
Reply with quote  #2

1715017807
Report to moderator
1715017807
Hero Member
*
Offline Offline

Posts: 1715017807

View Profile Personal Message (Offline)

Ignore
1715017807
Reply with quote  #2

1715017807
Report to moderator
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10550



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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
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!