I previously (months ago) generated a Signet address on a Bitcoin Core PR branch and obtained some Signet from the faucet to that address. How can I locate that private key in my file system if I know the Bitcoin address? How can I locate that private key if I have forgotten the Bitcoin address?
1 Answer
As Pieter says in the comment the private key is in the wallet.dat file and you can use:
./src/bitcoin-cli -signet dumpprivkey insert_signet_address
to get the private key for that signet address.
There are separate wallet.dat files for each chain (mainnet, testnet, signet, regtest) that persist across the different PR branches and different versions of Bitcoin Core you run. These aren't ever replaced or written over. If you have signet Bitcoin on one PR branch, then you build and run another PR branch you will still have access to that same signet Bitcoin that you had on the previous branch in the usual way.
Pieter added below:
Every chain has its own distinct default datadir, and everything in that datadir (including blocks, chainstate, peers.dat, onion addresses/keys, ban data, fee estimates, mempool dumps, ...) is shared between all codebases that use that chain.
-
1Indeed, but this isn't unique to wallets either. Every chain has its own distinct default datadir, and everything in that datadir (including blocks, chainstate, peers.dat, onion addresses/keys, ban data, fee estimates, mempool dumps, ...) is shared between all codebases that use that chain. Commented Jan 25, 2021 at 19:02
dumpprivkey
to get the key. Is that what you are asking? There isn't anything signet specific about this.