Author

Topic: Question about Bitcoin Core (Read 185 times)

brand new
Activity: 0
Merit: 0
August 27, 2024, 08:24:18 AM
#13
#Proof of authentication
Bitcointalk username:  Safi@11
Bitcointalk Profile: https://bitcointalk.org/index.php
Telegram Username: Khan61l
Joined Campaign: Twitter, Facebook, Instagram, Telegram, Article, Video,Tiktok, Discord
Bsc/Bep20:  0x4c09938AD7BE934D10b18c0878bC4B447fd5A65e
hero member
Activity: 1120
Merit: 540
Duelbits - Play for Free | Win for Real
August 21, 2024, 02:31:28 PM
#9
For descriptor wallets, you cannot export single private keys, but you can export the descriptor that contains the BIP32 extended private key from which the private keys are derived, for this you can use the command:

listdescriptors true
passphrase will be requested.

You will see the output descriptors containing the descriptors with the receiving and change addresses. Read more details in this topic.

If you want to view the extended public keys of the wallet, just type listdescriptors without the true argument.

To import descriptors into a bitcoin core descriptor wallet, see this topic.
copper member
Activity: 2338
Merit: 4543
Join the world-leading crypto sportsbook NOW!
August 21, 2024, 07:38:06 AM
#8
The hdseed=1 thats found in the wallet dump is the seed that the xpriv is derived from right?

That's correct.

Also, ABCbits reminded me; the master private keys of new wallets can be exported by using listdescriptors true.  The keys displayed by that command are the ones from which all keys are derived.  

Code:
listdescriptors ( private )

List descriptors imported into a descriptor-enabled wallet.

Arguments:
1. private    (boolean, optional, default=false) Show private descriptors.

Result:
{                                 (json object)
  "wallet_name" : "str",          (string) Name of wallet this operation was performed on
  "descriptors" : [               (json array) Array of descriptor objects (sorted by descriptor string representation)
    {                             (json object)
      "desc" : "str",             (string) Descriptor string representation
      "timestamp" : n,            (numeric) The creation time of the descriptor
      "active" : true|false,      (boolean) Whether this descriptor is currently used to generate new addresses
      "internal" : true|false,    (boolean, optional) True if this descriptor is used to generate change addresses. False if this descriptor is used to generate receiving addresses; defined only for active descriptors
      "range" : [                 (json array, optional) Defined only for ranged descriptors
        n,                        (numeric) Range start inclusive
        n                         (numeric) Range end inclusive
      ],
      "next" : n,                 (numeric, optional) Same as next_index field. Kept for compatibility reason.
      "next_index" : n            (numeric, optional) The next index to generate addresses from; defined only for ranged descriptors
    },
    ...
  ]
}

Examples:
> bitcoin-cli listdescriptors
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "listdescriptors", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
> bitcoin-cli listdescriptors true
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "listdescriptors", "params": [true]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
August 21, 2024, 03:18:45 AM
#7
Even though bitcoin core uses SQL for the backend, it still uses .dat as the file extension for wallets right?

Yes.

I also found out that the dumpwallet in bitcoin console is only for legacy wallets. Is there any built in function to dump sql wallet?

AFAIK no, but you can use listdescriptor true to get descriptor which represent extended private key.
copper member
Activity: 2338
Merit: 4543
Join the world-leading crypto sportsbook NOW!
August 21, 2024, 12:21:29 AM
#6
Yes im in the US but the issue is that i have limited internet speed and also limited mb per month.. Smiley

I could copy the block chain onto the drive before I send it to you, that's not a big deal.  I'm traveling at the moment and won't be home until Tuesday, but let me know if you want it and I'll get started on it next week.

I managed to use the console without downloading the whole blockchain so thats fantastic.

Yeah, as long as your pruned node is synced with the wallet you don't need the whole blockchain.

I also found out that the dumpwallet in bitcoin console is only for legacy wallets. Is there any built in function to dump sql wallet?

Unfortunately (or fortunately, depending on your take on the issue,) no.  That feature was disabled for new wallets from a few versions back (taproot implementation, I think.)  Using hdseeds to back up and restore wallets wasn't a great idea to begin with, so the dumpwallet command was obsoleted.  Here's an explanation by one of the bitcoin developers as to why it wasn't a good thing to do: https://bitcointalksearch.org/topic/m.53539363

You can still dump the private key of any specific addresses, though.

Code:
dumpprivkey "address"

Reveals the private key corresponding to 'address'.
Then the importprivkey can be used with this output
Note: This command is only compatible with legacy wallets.

Arguments:
1. address    (string, required) The bitcoin address for the private key

Result:
"str"    (string) The private key

Examples:
> bitcoin-cli dumpprivkey "myaddress"
> bitcoin-cli importprivkey "mykey"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "dumpprivkey", "params": ["myaddress"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
 (code -1)
copper member
Activity: 2338
Merit: 4543
Join the world-leading crypto sportsbook NOW!
August 20, 2024, 10:48:00 PM
#5
I almost forgot. I dont want to download the whole blockchain for this, so its not an option. pruning is not an option either.. So is it possible to use bitcoins RPC to work on wallets without having bitcoin core node hosted locally? Is there any service out there that runs a node for users like myself who want to interact without downloading the whole thing, not even pruning?

If hard drive space is your concern I can help with that.  I have a 2TB Seagate spinner that's just taking up space in my desk drawer.  If you're in the US I can ship it to you, I'd rather see it get used than go to a landfill.

To get the master private key you can use the dumpwallet command in the BitcoinQT's console.  Like others have mentioned, using a third party is not advisable especially for your use case.  You would be exposing your wallet to an anonymous server, compromising your security.

Code:
dumpwallet "filename"

Dumps all wallet keys in a human-readable format to a server-side file. This does not allow overwriting existing files.
Imported scripts are included in the dumpfile, but corresponding BIP173 addresses, etc. may not be added automatically by importwallet.
Note that if your wallet contains keys which are not derived from your HD seed (e.g. imported keys), these are not covered by
only backing up the seed itself, and must be backed up too (e.g. ensure you back up the whole dumpfile).
Note: This command is only compatible with legacy wallets.

Arguments:
1. filename    (string, required) The filename with path (absolute path recommended)

Result:
{                        (json object)
  "filename" : "str"     (string) The filename with full absolute path
}

Examples:
> bitcoin-cli dumpwallet "test"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "dumpwallet", "params": ["test"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
 (code -1)


The only problem is I don't know if you can use it on wallets.

If the server is hosted by someone who's trustworthy they most definitely have wallet RPC commands disabled.  If they don't, they're not trustworthy.
legendary
Activity: 3472
Merit: 3217
Playbet.io - Crypto Casino and Sportsbook
August 20, 2024, 11:34:46 AM
#4
I almost forgot. I dont want to download the whole blockchain for this, so its not an option. pruning is not an option either.. So is it possible to use bitcoins RPC to work on wallets without having bitcoin core node hosted locally? Is there any service out there that runs a node for users like myself who want to interact without downloading the whole thing, not even pruning?

I know a few of them I haven't tested them yet just found them when looking for a free server that can use API RPC calls, you don't need to download the whole blockchain and it supports RPC API calls free with higher limit calls.

The only problem is I don't know if you can use it on wallets. What exactly do you want to do with RPC calls? To recover your wallet? Like they said why trust 3rd party it's risky once you use a 3rd party service your wallet is not safe anymore.

Anyway, here's the link

- quicknode.com
- chainstack.com
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
August 20, 2024, 04:39:47 AM
#3
2. Is wallet.sql the new wallet type for bitcoin core since 2021?

Yes, Bitcoin Core v0.21.0 (released on 2021) introduce new wallet format which use SQLite backend.

I almost forgot. I dont want to download the whole blockchain for this, so its not an option. pruning is not an option either.. So is it possible to use bitcoins RPC to work on wallets without having bitcoin core node hosted locally? Is there any service out there that runs a node for users like myself who want to interact without downloading the whole thing, not even pruning?

FYI, you can use certain RPC call on your wallet.dat file without downloading the blockchain. If you use the GUI application, you can disable the network activity by clicking icon on bottom right and choose "Disable network activity".
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
August 20, 2024, 04:17:12 AM
#2
My first goal would be to extract the master seed from the .dat file
Why don't you use dumpwallet in Bitcoin Core itself?

Quote
I dont want to download the whole blockchain for this, so its not an option. pruning is not an option either.. So is it possible to use bitcoins RPC to work on wallets without having bitcoin core node hosted locally? Is there any service out there that runs a node for users like myself who want to interact without downloading the whole thing, not even pruning?
That sounds a lot like trusting third parties. Wouldn't Electrum be a better option to import your keys (or watch-only addresses)?

If downloading 600 GB is a problem, maybe you can find someone to ship you a disk with the full blockchain. Verify it after receiving and it's as good as downloading it yourself.
newbie
Activity: 9
Merit: 13
August 20, 2024, 02:55:25 AM
#1
-del
Jump to: