Bitcoin Forum
June 14, 2024, 03:37:54 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: BIP32  (Read 148 times)
DimitarAcev (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 3


View Profile
March 13, 2021, 07:45:32 PM
Last edit: March 13, 2021, 08:15:57 PM by DimitarAcev
 #1

Hello, since I want to learn more about bitcoin and how you would ago about a wallet, I'm stuck with being able to spend coins to an address derived from an extended public key ( non hardened) since you don't have the private key to do so unlike hardened keys. Say I use the BIP84 implementation, thus the derivation path being m/84'/0'/0'/0/0 for the first receiving address how do I get hold of the private key of said public key to allow me to sign transactions?
Thank you in advance!
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18587


View Profile
March 13, 2021, 07:49:43 PM
Merited by Charles-Tim (1)
 #2

If all you have is the extended public key, then you cannot spend the coins. The extended public key allows you to create all the child public keys and therefore all the addresses in that wallet, but it does not let you spend any of the coins stored at those addresses. This is known as a watch only wallet. There is no way to calculate a private key from only knowledge of a public key, be it an individual public key, an extended public key, or a master public key.

Also note that the first receiving address for the standard BIP84 derivation is actually m/84'/0'/0'/0/0.
DimitarAcev (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 3


View Profile
March 13, 2021, 07:54:48 PM
 #3

My apologies for the derivation path, how would somebody go about finding the corresponding private key to a public key that was derived from an extended public key?
hosseinimr93
Legendary
*
Offline Offline

Activity: 2436
Merit: 5380



View Profile
March 13, 2021, 08:17:53 PM
 #4

how would somebody go about finding the corresponding private key to a public key that was derived from an extended public key?
As already answered by o_e_l_e_o, that's impossible.

You need the extended private key or the seed phrase (mnemonic phrase).
If you have only the extended public key, there is no way to spend the fund.

How did you generate that extended public key?
What wallet did you use?

▄▄███████▄▄
▄██████████████▄
▄██████████████████▄
▄████▀▀▀▀███▀▀▀▀█████▄
▄█████████████▄█▀████▄
███████████▄███████████
██████████▄█▀███████████
██████████▀████████████
▀█████▄█▀█████████████▀
▀████▄▄▄▄███▄▄▄▄████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀
.
 MΞTAWIN  THE FIRST WEB3 CASINO   
.
.. PLAY NOW ..
Charles-Tim
Legendary
*
Offline Offline

Activity: 1582
Merit: 4954


Leading Crypto Sports Betting & Casino Platform


View Profile
March 13, 2021, 08:32:03 PM
 #5

Private key produces a digital signature that makes it possible for a corresponding public key to spend through a digital finger print known as bitcoin addresses.

My apologies for the derivation path, how would somebody go about finding the corresponding private key to a public key that was derived from an extended public key?
You need the private key, or seed phrase that can generate the private key. While creating a wallet, you will be given the seed phrase or private key. And as you meant extended public key, that means you created an HD wallet. You either need the seed phrase or the extended private key, or the private keys of the address(es) of your wallet the bitcoin is sent to.

..Stake.com..   ▄████████████████████████████████████▄
   ██ ▄▄▄▄▄▄▄▄▄▄            ▄▄▄▄▄▄▄▄▄▄ ██  ▄████▄
   ██ ▀▀▀▀▀▀▀▀▀▀ ██████████ ▀▀▀▀▀▀▀▀▀▀ ██  ██████
   ██ ██████████ ██      ██ ██████████ ██   ▀██▀
   ██ ██      ██ ██████  ██ ██      ██ ██    ██
   ██ ██████  ██ █████  ███ ██████  ██ ████▄ ██
   ██ █████  ███ ████  ████ █████  ███ ████████
   ██ ████  ████ ██████████ ████  ████ ████▀
   ██ ██████████ ▄▄▄▄▄▄▄▄▄▄ ██████████ ██
   ██            ▀▀▀▀▀▀▀▀▀▀            ██ 
   ▀█████████▀ ▄████████████▄ ▀█████████▀
  ▄▄▄▄▄▄▄▄▄▄▄▄███  ██  ██  ███▄▄▄▄▄▄▄▄▄▄▄▄
 ██████████████████████████████████████████
▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄
█  ▄▀▄             █▀▀█▀▄▄
█  █▀█             █  ▐  ▐▌
█       ▄██▄       █  ▌  █
█     ▄██████▄     █  ▌ ▐▌
█    ██████████    █ ▐  █
█   ▐██████████▌   █ ▐ ▐▌
█    ▀▀██████▀▀    █ ▌ █
█     ▄▄▄██▄▄▄     █ ▌▐▌
█                  █▐ █
█                  █▐▐▌
█                  █▐█
▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀█
▄▄█████████▄▄
▄██▀▀▀▀█████▀▀▀▀██▄
▄█▀       ▐█▌       ▀█▄
██         ▐█▌         ██
████▄     ▄█████▄     ▄████
████████▄███████████▄████████
███▀    █████████████    ▀███
██       ███████████       ██
▀█▄       █████████       ▄█▀
▀█▄    ▄██▀▀▀▀▀▀▀██▄  ▄▄▄█▀
▀███████         ███████▀
▀█████▄       ▄█████▀
▀▀▀███▄▄▄███▀▀▀
..PLAY NOW..
DimitarAcev (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 3


View Profile
March 13, 2021, 08:41:14 PM
Merited by o_e_l_e_o (2), ABCbits (1)
 #6

Thank you for the responses, in fact I'm implementing a hardware wallet and I do have the mnemonic/seed. Let me explain further though.
Say you have a mnemonic phrase and a passphrase, you put them in a function and you get out a seed, you put the seed into a hmac sha512 function and you get the master private key.
The BIP84 derivation path is derived as such: 84th hardened key, 0th hardened key, 0th hardened key, 0th normal key for receiving addresses.
Now I can generate receiving addresses without exposing any private keys and my question is how do you spend those coins that are derived from the xpub given that you have both the extended master key and the extended account private key.
Thank you!
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18587


View Profile
March 13, 2021, 09:39:54 PM
Merited by ABCbits (1), DimitarAcev (1)
 #7

If you have the account extended private key, then you can generate all the private keys for all the addresses in that account. So, for example, if you have the account extended private key for m/84'/0'/0', then you would simply use that to derive at 0/0 to obtain the first receiving address.

Once you are down to the account level, then your xprv and xpub will both be able to generate all the addresses at standard derivation paths since they are unhardened. The difference is that the xprv will generate the private keys then the public keys and addresses, whereas the xpub will only generate the public keys and addresses.
DimitarAcev (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 3


View Profile
March 13, 2021, 09:42:17 PM
 #8

Oh, I get it now, thank you so much!
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!