scantxoutset

Back to blockchain

Summary

Scans the unspent transaction output set for entries that match certain output descriptors.

Description

Scans the unspent transaction output set for entries that match certain output descriptors. Examples of output descriptors are: addr(

) Outputs whose output script corresponds to the specified address (does not include P2PK) raw() Outputs whose output script equals the specified hex-encoded bytes combo() P2PK, P2PKH, P2WPKH, and P2SH-P2WPKH outputs for the given pubkey pkh() P2PKH outputs for the given pubkey sh(multi(,,,...)) P2SH-multisig outputs for the given threshold and pubkeys tr() P2TR tr(,{pk()}) P2TR with single fallback pubkey in tapscript rawtr() P2TR with the specified key as output key rather than inner wsh(and_v(v:pk(),after(2))) P2WSH miniscript with mandatory pubkey and a timelock

In the above, either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one or more path elements separated by "/", and optionally ending in "/" (unhardened), or "/'" or "/*h" (hardened) to specify all unhardened or hardened child keys. In the latter case, a range needs to be specified by below if different from 1000. For more information on output descriptors, see the documentation in the doc/user/wallet/descriptors.md file.

Arguments

  • action (STR, required): The action to execute "start" for starting a scan "abort" for aborting the current scan (returns true when abort was successful) "status" for progress report (in %) of the current scan
  • scanobjects (ARR): Array of scan objects. Required for "start" action Every scan object is either a string descriptor or an object:
  • descriptor (STR): An output descriptor
  • value (OBJ): An object with output descriptor and metadata
    • desc (STR, required): An output descriptor
    • range (RANGE): The range of HD chain indexes to explore (either end or [begin,end])

Results

  • value (OBJ): No description.
  • success (BOOL): Whether the scan was completed
  • txouts (NUM): The number of unspent transaction outputs scanned
  • height (NUM): The block height at which the scan was done
  • bestblock (STR_HEX): The hash of the block at the tip of the chain
  • unspents (ARR): No description.
    • value (OBJ): No description.
    • txid (STR_HEX): The transaction id
    • vout (NUM): The vout value
    • scriptPubKey (STR_HEX): The output script
    • desc (STR): A specialized descriptor for the matched output script
    • amount (STR_AMOUNT): The total amount in QBT of the unspent output
    • coinbase (BOOL): Whether this is a coinbase output
    • height (NUM): Height of the unspent transaction output
    • blockhash (STR_HEX): Blockhash of the unspent transaction output
    • confirmations (NUM): Number of confirmations of the unspent transaction output when the scan was done
  • total_amount (STR_AMOUNT): The total amount of all found unspent outputs in QBT
  • success (BOOL): True if scan will be aborted (not necessarily before this RPC returns), or false if there is no scan to abort
  • value (OBJ): No description.
  • progress (NUM): Approximate percent complete
  • value (NONE): No description.

Examples

qbit-cli scantxoutset start '["raw(76a91411b366edfc0a8b66feebae5c2e25a7b6a5d1cf3188ac)#fm24fxxy"]'
qbit-cli scantxoutset status
qbit-cli scantxoutset abort
curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "scantxoutset", "params": ["start", ["raw(76a91411b366edfc0a8b66feebae5c2e25a7b6a5d1cf3188ac)#fm24fxxy"]]}' -H 'content-type: application/json' http://127.0.0.1:8352/
curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "scantxoutset", "params": ["status"]}' -H 'content-type: application/json' http://127.0.0.1:8352/
curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "scantxoutset", "params": ["abort"]}' -H 'content-type: application/json' http://127.0.0.1:8352/