deriveaddresses

Back to util

Summary

Derives one or more addresses corresponding to an output descriptor.

Description

Derives one or more addresses corresponding to an output descriptor. Examples of output descriptors are: pkh() P2PKH outputs for the given pubkey wpkh() Native segwit P2PKH outputs for the given pubkey sh(multi(,,,...)) P2SH-multisig outputs for the given threshold and pubkeys raw() Outputs whose output script equals the specified hex-encoded bytes tr(,multi_a(,,,...)) P2TR-multisig outputs for the given threshold and pubkeys mr(pk()) P2MR output for a 32-byte PQC pubkey mr(pk(pqc(/87h/.../*))) P2MR outputs derived from private BIP32 key material rawmr() P2MR output with the specified 32-byte Merkle root

For legacy, segwit, and taproot descriptors, 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 "/", where "h" represents a hardened child key. For P2MR descriptors, is a 32-byte PQC public key. pqc(/...) wraps private BIP32 key material used to derive the committed PQC pubkey; public pqc(xpub/...) descriptors are not a watch-only derivation interface. Use exportpubkeydb/importpubkeydb for watch-only P2MR tracking. For more information on output descriptors, see the documentation in the doc/user/wallet/descriptors.md file.

Arguments

  • descriptor (STR, required): The descriptor.
  • range (RANGE): If a ranged descriptor is used, this specifies the end or the range (in [begin,end] notation) to derive.

Results

  • value (ARR): No description.
  • address (STR): the derived addresses
  • value (ARR): The derived addresses for each of the multipath expansions of the descriptor, in multipath specifier order
  • value (ARR): The derived addresses for a multipath descriptor expansion
    • address (STR): the derived address

Examples

First three native segwit receive addresses
qbit-cli deriveaddresses "wpkh([d34db33f/84h/0h/0h]xpub6DJ2dNUysrn5Vt36jH2KLBT2i1auw1tTSSomg8PhqNiUtx8QX2SvC9nrHu81fT41fvDUnhMjEzQgXnQjKEu3oaqMSzhSrHMxyyoEAmUHQbY/0/*)#cjjspncu" "[0,2]"
curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "deriveaddresses", "params": ["wpkh([d34db33f/84h/0h/0h]xpub6DJ2dNUysrn5Vt36jH2KLBT2i1auw1tTSSomg8PhqNiUtx8QX2SvC9nrHu81fT41fvDUnhMjEzQgXnQjKEu3oaqMSzhSrHMxyyoEAmUHQbY/0/*)#cjjspncu", "[0,2]"]}' -H 'content-type: application/json' http://127.0.0.1:8352/