Bitcoin Forum
October 31, 2024, 07:59:49 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: importing public keys, derivation paths and zero balance  (Read 107 times)
blapaz (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 5


View Profile
May 05, 2024, 03:54:57 PM
 #1

hi,
i used bitcoin core long time ago and exported the public keys.
i have a file like this:

```
combo(xpub.../0'/0'/*')#6h...
combo(xpub.../0'/1'/*')#23...
pkh([fd.../44'/0'/0']xpub.../0/*)#59...
pkh([fd.../44'/0'/0']xpub.../1/*)#93...
sh(wpkh([fd.../49'/0'/0']xpub.../0/*))#6ls...
sh(wpkh([fd.../49'/0'/0']xpub.../1/*))#077...
tr([fd.../86'/0'/0']xpub.../0/*)#7253...
tr([fd.../86'/0'/0']xpub.../1/*)#073...
wpkh([fd.../84'/0'/0']xpub.../0/*)#w9xl4...
wpkh([fd.../84'/0'/0']xpub.../1/*)#l3r7...
```

i created 5 wallets and imported the public keys.
the import accepted only the 'xpub...' part.

why do i see zero balance? i had some funds in it.
why don't i see the addresses that i previously used?

i just want to have a watch only wallet, from which to check:
- the addresses
- the balance

thanks in advance
Charles-Tim
Legendary
*
Offline Offline

Activity: 1722
Merit: 5190


Leading Crypto Sports Betting & Casino Platform


View Profile
May 05, 2024, 04:00:35 PM
 #2

It is because the address is not funded or because the coins on it has been spent.

..Stake.com..   ▄████████████████████████████████████▄
   ██ ▄▄▄▄▄▄▄▄▄▄            ▄▄▄▄▄▄▄▄▄▄ ██  ▄████▄
   ██ ▀▀▀▀▀▀▀▀▀▀ ██████████ ▀▀▀▀▀▀▀▀▀▀ ██  ██████
   ██ ██████████ ██      ██ ██████████ ██   ▀██▀
   ██ ██      ██ ██████  ██ ██      ██ ██    ██
   ██ ██████  ██ █████  ███ ██████  ██ ████▄ ██
   ██ █████  ███ ████  ████ █████  ███ ████████
   ██ ████  ████ ██████████ ████  ████ ████▀
   ██ ██████████ ▄▄▄▄▄▄▄▄▄▄ ██████████ ██
   ██            ▀▀▀▀▀▀▀▀▀▀            ██ 
   ▀█████████▀ ▄████████████▄ ▀█████████▀
  ▄▄▄▄▄▄▄▄▄▄▄▄███  ██  ██  ███▄▄▄▄▄▄▄▄▄▄▄▄
 ██████████████████████████████████████████
▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄
█  ▄▀▄             █▀▀█▀▄▄
█  █▀█             █  ▐  ▐▌
█       ▄██▄       █  ▌  █
█     ▄██████▄     █  ▌ ▐▌
█    ██████████    █ ▐  █
█   ▐██████████▌   █ ▐ ▐▌
█    ▀▀██████▀▀    █ ▌ █
█     ▄▄▄██▄▄▄     █ ▌▐▌
█                  █▐ █
█                  █▐▐▌
█                  █▐█
▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀█
▄▄█████████▄▄
▄██▀▀▀▀█████▀▀▀▀██▄
▄█▀       ▐█▌       ▀█▄
██         ▐█▌         ██
████▄     ▄█████▄     ▄████
████████▄███████████▄████████
███▀    █████████████    ▀███
██       ███████████       ██
▀█▄       █████████       ▄█▀
▀█▄    ▄██▀▀▀▀▀▀▀██▄  ▄▄▄█▀
▀███████         ███████▀
▀█████▄       ▄█████▀
▀▀▀███▄▄▄███▀▀▀
..PLAY NOW..
Yamane_Keto
Hero Member
*****
Offline Offline

Activity: 616
Merit: 510



View Profile WWW
May 05, 2024, 06:25:49 PM
 #3

why do i see zero balance? i had some funds in it.
why don't i see the addresses that i previously used?

Search for the addresses in the block explorer. If there are no previous transactions, then the problem is most likely with derivation paths.

Since you did not generate xpub (in this case we call it Extended Public Key and not master private key) using electrum, you will need to modify the path to:

Code:
 m/49'/0'/0'/49'/0'/0'/0

This is assuming that we are talking about Legacy address.


What are you trying to do here? The easiest solution is to sync Bitcoin Core and then create a new Electrum wallet and send bitcoin to it.
after that export your master private key a.k.a watch-only wallet


えいごをはなせますか。
BitMaxz
Legendary
*
Offline Offline

Activity: 3430
Merit: 3161


Is the $100k BTC possible?


View Profile WWW
May 05, 2024, 10:57:29 PM
 #4

i used bitcoin core long time ago and exported the public keys.


Are you talking about Electrum or Bitcoin core?

Weird the public key you posted above generated seems not from Bitcoin core but Electrum?

I think the post above is right your wallet might be in a different derivation path but if you can't find it there's another way to scan it and look for the right derivation path just make sure that you only paste the xpub(Master public key) of your wallet, not a master private key.

Here's the tool below and take note it only works on legacy wallets so if the wallet you generated before is segwit version then this won't work.

- https://blockpath.com/wallets/local/101?action=appxpub

For segwit wallet, you can use this tool

- https://github.com/LedgerHQ/xpub-scan

█████████████████████████
████████▀▀████▀▀█▀▀██████
█████▀████▄▄▄▄████████
███▀███▄███████████████
██▀█████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
██▄███████████████▀▀▄▄███
███▄███▀████████▀███▄████
█████▄████▀▀▀▀████▄██████
████████▄▄████▄▄█████████
█████████████████████████
 
 BitList 
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
REAL-TIME DATA TRACKING
CURATED BY THE COMMUNITY

.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
 
  List #kycfree Websites   
nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6309


Self-proclaimed Genius


View Profile
May 06, 2024, 04:51:59 AM
Merited by Cricktor (2)
 #5

why do i see zero balance? i had some funds in it.
why don't i see the addresses that i previously used?
That's because Electrum only derived the legacy addresses at xpub/0/* and xpub/1/* of the provided xpub from your Bitcoin Core's descriptors.
To import the correct addresses, you'll need to convert your xpub to other formats with the command convertxkey().
And read the notes at the bottom.

These for example:
pkh([fd.../44'/0'/0']xpub.../0/*)...
pkh([fd.../44'/0'/0']xpub.../1/*)...
sh(wpkh([fd.../49'/0'/0']xpub.../0/*))...
sh(wpkh([fd.../49'/0'/0']xpub.../1/*))...
-snip-
wpkh([fd.../84'/0'/0']xpub.../0/*)#...
wpkh([fd.../84'/0'/0']xpub.../1/*)#...
In the order given:
  • For "pkh()" descriptors, the xpub should already restore the correct receiving and change legacy addresses by restoring the xpub to Electrum.
  • For "sh(wpkh)" descriptors, you should convert the 'xpub' into 'ypub' with the command;
    ("View->Show Console" then open the 'Console' tab): convert_xkey(xkey="xpub.....",xtype="p2wpkh-p2sh")
    Then import the ypub to a new Electrum wallet, the restored addresses should be nested-SegWit
  • For "wpkh()" descriptors, convert the 'xpub' into 'zpub': convert_xkey(xkey="xpub.....",xtype="p2wpkh")
    Then import the zpub to a new Electrum wallet, the restored addresses should be Native SegWit

Quote from: blapaz
tr([fd.../86'/0'/0']xpub.../0/*)...
tr([fd.../86'/0'/0']xpub.../1/*)...
Your TapRoot, "tr()" descriptors aren't supported by Electrum at the moment
so your only choice is to create an imported watch-only wallet using the bech32m addresses instead via "Import bitcoin addresses or private keys" new wallet option.

Quote from: blapaz
combo(xpub.../0'/0'/*')#6h...
combo(xpub.../0'/1'/*')#23...
This one is tricky, since Electrum is designed to take 'extended public key' at the account_index (the "xpub/0/*" above).
And the derivation path indicates that the lower hierarchy should be derived with hardened derivation: you can't import that to Electrum because it doesn't support hardened addresses

Instead, you should just import the addresses associated with your funds to Electrum.

Note: Those "combo()" desccriptors are probably your keystore before migrating to a descriptor wallet and most probably where your bitcoins are if you've just migrated.
The other descriptors are the ones created after migrating and probably empty. (those descriptors tell that it's a migrated wallet)

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
blapaz (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 5


View Profile
May 06, 2024, 09:58:21 AM
 #6

thank you.

Quote
Note: Those "combo()" desccriptors are probably your keystore before migrating to a descriptor wallet and most probably where your bitcoins are if you've just migrated.
The other descriptors are the ones created after migrating and probably empty. (those descriptors tell that it's a migrated wallet)

indeed, i migrated the wallet time ago (using bitcoin core).
i know that i have the funds, because 2 of my addresses have funds.

i just want a way to:
- check the balance of all my addresses
- have a list of all my addresses that i can give around to people (don't want to reuse the same wallet address)
- don't want to download the whole blockchain (eg. using bitcoin core)

any solution for this?
i thought that i could do this with the public keys but i think i was wrong.

ps: i am not afraid of the console, if there was a way to connect bitcoin core to an external node i'd use that
nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6309


Self-proclaimed Genius


View Profile
May 07, 2024, 04:45:48 AM
 #7

any solution for this?
i thought that i could do this with the public keys but i think i was wrong.
This depends on the addresses associated with your UTXOs. (those 2 addresses with balance)
If its parent descriptor is indeed those "combo()" descriptors, then,
there's no way you can import the descriptor's master public key pair of the master private key to Electrum due to its key derivation which entirely uses "hardened derivation".

To make sure, use Bitcoin Core's console and use the command: getaddressinfo "address" and it'll show you its parent descriptor.

If it's in any of the other descriptors (excluding "tr"), then you can do the instructions in my previous reply.

Quote from: blapaz
i just want a way to:
- check the balance of all my addresses
- have a list of all my addresses that i can give around to people (don't want to reuse the same wallet address)
- don't want to download the whole blockchain (eg. using bitcoin core)
If it's still in the combo() descriptors;
One way to do this is to send all of your coins to your newly generated address that is a child of your new descriptors or to a new wallet.
Then those descriptor's extended public key can be imported to Electrum.

For the latter (new wallet); you can use an Electrum "Cold Storage" setup which uses an offine Air-Gap Electrum and an online watch-only Electrum.
Basically, create a new Electrum wallet in an offline machine, import its xpub to an online Electrum, then this'll fulfill your requirements.
Link: https://electrum.readthedocs.io/en/latest/coldstorage.html

For the former (same Bitcoin Core wallet); get a new addresses (not bech32m) in Bitcoin Core's receive tab and use getaddressinfo command.
Among the results, "ismine" and "solvable" should be both true, then "parent_desc" isn't the migrated combo descriptor from your legacy wallet.dat which Electrum doesn't support.
Then to absolutely make sure that you're not using a watch-only Bitcoin Core wallet, use getwalletinfo command and see if "private_keys_enabled" is true.

After confirming those, you can import its parent descriptor's extended public key to Electrum to restore that address and all of your (future) address of the same script type.
You can double-check Electrum's 'Addresses' tab (View->Show Addresses) to see if it has same addresses you create in Bitcoin Core's 'Receive' tab. (same address type selected)


Lastly, to send your current bitcoin to your selected destination without the blockchain (using Electrum and Bitcoin Core):
  • In Electrum, create a new watch-only imported wallet by selecting "Import new addresses or private keys" in new wallet menu, then paste the two addresses there.
  • Wait for the balance to sync, then create an unsigned transaction using the 'Send' tab. (send to either your new wallet's address or your new descriptor' address)
  • Export that transaction by clicking "Share->Save to file/Copy to Clipboard".
  • In Bitcoin Core, select the correct wallet if you have multiple loaded, then import the transaction using the menu: "File->Load PSBT from...".
  • Sign it and then copy the signed PSBT string, open the console and use the command: finalizepsbt "copied_PSBT_string"
  • Copy the result signed raw transaction and import that to Electrum using "Tools->Load transaction->from Text", review everything and click broadcast to send it.

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
blapaz (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 5


View Profile
May 07, 2024, 06:37:49 AM
 #8

ok, then there's no easy way.
wonder if the devs or people who work on this never think about certain scenarios.

i figured it would be easier (and safer for me) to get the full blockchain + bitcoin core (the same version i used previously) on a non connected laptop and just watch the addresses.

thanks anyway a lot for the help.
nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6309


Self-proclaimed Genius


View Profile
May 07, 2024, 07:12:46 AM
 #9

ok, then there's no easy way.
wonder if the devs or people who work on this never think about certain scenarios.
Problem is that's kind of unique to Bitcoin Core (at least "was").
Its legacy wallet uses a BIP32 derivation path that uses all hardened derivation from extended key-> account_index ->chain_index -> address_index.
Wallets such as Electrum don't follow that standard.

But in new wallets created in newer versions of Bitcoin Core, you see that it's possible to restore it Electrum in the way I've provided.

Plus Bitcoin Core already stopped generating legacy wallet.dat and will soon drop support to it so implementing such feature could be a waste of effort.
But it's certainly possible if Electrum's future version that supports descriptor can take full derivation path and hardened addresses.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
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!