Bitcoin
bitcoin cli – Import data to a non-watch-only wallet
I plan to use the private key, address, and public address I created myself. (For educational purposes).
I’m working with bitcoin-cli by inserting input I created myself. (from CMD)
The following code:
C:\Program Files\Bitcoin\daemon>bitcoin-cli -regtest -named -rpcwallet="legacy" importmulti "(\"scriptPubKey\":\"address\":\"<my P2PKH address>\",\"timestamp\":\"now\",\"pubkeys\":(\"<my compressed public address in hex format>\"),\"keys\":(\"<my private key in WIF format>\"))" "\"rescan\":false"
It returns the following output:
(
"success": true,
"warnings": (
"Some private keys are missing, outputs will be considered watchonly. If this is intentional, specify the watchonly flag.",
"Importing as non-solvable: some required keys are missing. If this is intentional, don't provide any keys, pubkeys, witnessscript, or redeemscript."
)
)
But I don’t know which key is missing because I generated everything based on the same key (the order in which I generated the data:
- seed
- master key
- Derivation of subkeys – From now on we will only use subkeys.
- Public key based on subkey
- P2PKH address based on public key
- I copied the subkey, public key, and P2PKH values and entered them in the correct locations in the template I added above.)
Is this because I only use subkeys and not the master key? How do I prevent this data from being imported for view-only use? My main goal is to do most of the functionality myself with minimal calls.
- All code to generate data has already been checked and is working exceptionally (Python code can be provided).
- We want to use import so that we can use this data in registration test mode for transactions.
Thank you in advance!