importdescriptors

Back to wallet

Wallet

Summary

Import descriptors. This will trigger a rescan of the blockchain based on the earliest timestamp of all descriptors being imported. Requires a new wallet backup.

Description

Import descriptors. This will trigger a rescan of the blockchain based on the earliest timestamp of all descriptors being imported. Requires a new wallet backup. When importing descriptors with multipath key expressions, if the multipath specifier contains exactly two elements, the descriptor produced from the second element will be imported as an internal descriptor. P2MR descriptors that depend only on BIP32 extended public keys are not accepted; use importpubkeydb for watch-only P2MR tracking.

Note: This call can take over an hour to complete if using an early timestamp; during that time, other rpc calls may report that the imported keys, addresses or scripts exist but related transactions are still missing. The rescan is significantly faster if block filters are available (using startup option "-blockfilterindex=1").

Arguments

  • requests (ARR, required): Data to be imported
  • value (OBJ): No description.
    • desc (STR, required): Descriptor to import.
    • active (BOOL): Set this descriptor to be the active descriptor for the corresponding output type/externality
    • range (RANGE): If a ranged descriptor is used, this specifies the end or the range (in the form [begin,end]) to import
    • next_index (NUM): If a ranged descriptor is set to active, this specifies the next index to generate addresses from
    • timestamp (NUM, required): Time from which to start rescanning the blockchain for this descriptor, in UNIX epoch time Use the string "now" to substitute the current synced blockchain time. "now" can be specified to bypass scanning, for outputs which are known to never have been used, and 0 can be specified to scan the entire blockchain. Blocks up to 2 hours before the earliest timestamp of all descriptors being imported will be scanned as well as the mempool.
    • internal (BOOL): Whether matching outputs should be treated as not incoming payments (e.g. change)
    • label (STR): Label to assign to the address, only allowed with internal=false. Disabled for ranged descriptors

Results

  • value (ARR): Response is an array with the same size as the input that has the execution result
  • value (OBJ): No description.
    • success (BOOL): No description.
    • warnings (ARR, optional): No description.
    • value (STR): No description.
    • error (OBJ, optional): No description.
    • value (ELISION): JSONRPC error

Examples

qbit-cli importdescriptors '[{ "desc": "<my descriptor>", "timestamp":1455191478, "internal": true }, { "desc": "<my descriptor 2>", "label": "example 2", "timestamp": 1455191480 }]'
qbit-cli importdescriptors '[{ "desc": "<my descriptor>", "timestamp":1455191478, "active": true, "range": [0,100], "label": "<my bech32 wallet>" }]'