Bitcoin Forum
February 25, 2020, 03:00:54 AM *
News: Latest Bitcoin Core release: 0.19.0.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Question: Generating address in bitcoin core using my xpub  (Read 65 times)
artofwar
Member
**
Offline Offline

Activity: 142
Merit: 25


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)
1582599654
Hero Member
*
Offline Offline

Posts: 1582599654

View Profile Personal Message (Offline)

Ignore
1582599654
Reply with quote  #2

1582599654
Report to moderator
1582599654
Hero Member
*
Offline Offline

Posts: 1582599654

View Profile Personal Message (Offline)

Ignore
1582599654
Reply with quote  #2

1582599654
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1582599654
Hero Member
*
Offline Offline

Posts: 1582599654

View Profile Personal Message (Offline)

Ignore
1582599654
Reply with quote  #2

1582599654
Report to moderator
1582599654
Hero Member
*
Offline Offline

Posts: 1582599654

View Profile Personal Message (Offline)

Ignore
1582599654
Reply with quote  #2

1582599654
Report to moderator
1582599654
Hero Member
*
Offline Offline

Posts: 1582599654

View Profile Personal Message (Offline)

Ignore
1582599654
Reply with quote  #2

1582599654
Report to moderator
pooya87
Legendary
*
Offline Offline

Activity: 1918
Merit: 2367


Remember tonight for it's the beginning of forever


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.

artofwar
Member
**
Offline Offline

Activity: 142
Merit: 25


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:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!