bitcoin cli – importing data to a wallet as not watch-only

on

|

views

and

comments


I am trying to use private keys, addresses, and public addresses I generated myself. (for educational purpose).

I am working with bitcoin-cli by inserting the inputs I’ve generated myself. (in 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}"

returns this 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 what keys are missing since I’d generated everything based on the same key
(the order I generated the data:

  1. seed
  2. master key
  3. derived a child key – from now on, I only used the child key
  4. public key based on the child key
  5. P2PKH address based on the public key
  6. copied the values: child key, public key, P2PKH and typed them in the correct place in the template I added above)

Is this because I use only the child key andf not the master key?
How can I prevent importing this data as watch-only?
my main goal is to try to do most of the functions by myself with the least amount of calls necessarily.

  • all the code for generating the data has already been checked and is working as excepted (can provide python code)
  • I intend to use the import so I could use this data in regtest mode for transactions

Thank you all in advance!

Share this
Tags

Must-read

The Great Bitcoin Crash of 2024

Bitcoin Crash The cryptocurrency world faced the hell of early 2024 when the most popular Bitcoin crashed by over 80% in a matter of weeks,...

Bitcoin Gambling: A comprehensive guide in 2024

Bitcoin Gambling With online currencies rapidly gaining traditional acceptance, the intriguing convergence of the crypto-trek and gambling industries is taking place. Cryptocurrency gambling, which started...

The Rise of Bitcoin Extractor: A comprehensive guide 2024

Bitcoin Extractor  Crypto mining is resources-thirsty with investors in mining hardware and those investing in the resources needed as the main beneficiaries. In this sense,...

Recent articles

More like this