If you type any command in the console without any additional arguments you'll get the help menu for that command. Below are the optional arguments for the commands you'll need:
Since you want to be able to import a single private key, you'll need a "Legacy Type" wallet file, in other words a
non-descriptor wallet. To create one you'll need to add a string to your bitcoin.conf file, or start bitcoind with the option mentioned in the instructions for descriptors (option #6.) Once you're able to create the type of wallet you want, you'll need to set the other options to be able to import a private key; i.e. you want it blank, so you can import your own private keys; obviously you'll want private keys enabled, so you can interact with the private key that you want to import; and so, based on that logic you need to apply the appropriate arguments to the
createwallet command in the order they appear in the optional arguments list below:
Step 1:
Shutdown Bitcoin Core (or QT,) open your bitcoin.conf file and add the following line, then restart:
Step 2:
Use the
createwallet command to create a "Legacy Type" wallet
Arguments:
1. wallet_name (string, required) The name for the new wallet. If this is a path, the wallet will be created at the path location.
2. disable_private_keys (boolean, optional, default=false) Disable the possibility of private keys (only watchonlys are possible in this mode).
3. blank (boolean, optional, default=false) Create a blank wallet. A blank wallet has no keys or HD seed. One can be set using sethdseed.
4. passphrase (string, optional) Encrypt the wallet with this passphrase.
5. avoid_reuse (boolean, optional, default=false) Keep track of coin reuse, and treat dirty and clean coins differently with privacy considerations in mind.
6. descriptors (boolean, optional, default=true) Create a native descriptor wallet. The wallet will use descriptors internally to handle address creation. Setting to "false" will create a legacy wallet; This is only possible with the -deprecatedrpc=create_bdb setting because, the legacy wallet type is being deprecated and support for creating and opening legacy wallets will be removed in the future.
7. load_on_startup (boolean, optional) Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged.
8. external_signer (boolean, optional, default=false) Use an external signer such as a hardware wallet. Requires -signer to be configured. Wallet creation will fail if keys cannot be fetched. Requires disable_private_keys and descriptors set to true.
Example:
createwallet "testing123" false true "testing321" true false false false
Step 3:
Select or enable the wallet you just created, then use the
walletpassphrase command to unlock the wallet:
Arguments:
1. passphrase (string, required) The wallet passphrase
2. timeout (numeric, required) The time to keep the decryption key in seconds; capped at 100000000 (~3 years).
Example, this will unlock the wallet 10 minutes.:
walletpassphrase "testing321" 600
Step 4:
Use the
importprivkey command to import your private key:
Arguments:
1. privkey (string, required) The private key (see dumpprivkey)
2. label (string, optional, default=current label if address exists, otherwise "") An optional label
3. rescan (boolean, optional, default=true) Scan the chain and mempool for wallet transactions.
Example:
importprivkey "L1dybNT1HRMRcj39t3cAbEccbVvexUTFaHudGWBzUTvrR2MA2Sf2" "somethingsomethingdarkside" false