Friday, November 22, 2024

bitcoin cli – importing knowledge to a pockets as not watch-only

I’m attempting to make use of non-public keys, addresses, and public addresses I generated myself. (for academic goal).

I’m working with bitcoin-cli by inserting the inputs I’ve generated myself. (in CMD)

the next code:

C:Program FilesBitcoindaemon>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."
    ]
  }
]

however I do not know what keys are lacking since I would generated every thing based mostly on the identical key
(the order I generated the info:

  1. seed
  2. grasp key
  3. derived a baby key – any longer, I solely used the kid key
  4. public key based mostly on the kid key
  5. P2PKH deal with based mostly on the general public key
  6. copied the values: little one key, public key, P2PKH and typed them within the right place within the template I added above)

Is that this as a result of I take advantage of solely the kid key andf not the grasp key?
How can I forestall importing this knowledge as watch-only?
my principal purpose is to attempt to do a lot of the capabilities on my own with the least quantity of calls essentially.

  • all of the code for producing the info has already been checked and is working as excepted (can present python code)
  • I intend to make use of the import so I may use this knowledge in regtest mode for transactions

Thanks all upfront!

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles