Documentation exported from Bitcoin Core 32.0

derivehdkey (32.0.0 RPC)

blockchain

control

mining

network

rawtransactions

signer

util

wallet

zmq

derivehdkey "path" ( {"private":bool,"hdkey":"str",...} )

Derive extended public or private key from HD key in the wallet at a given path.
Derivation uses wallet private key material.

Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.

Arguments:
1. path       (string, required) BIP 32 derivation path with at least one hardened step.
2. options    (json object, optional) Options object that can be used to pass named arguments, listed below.

Named Arguments:
private    (boolean, optional, default=false) Show private key
hdkey      (string, optional, default=Either the HD key of an unused(KEY) descriptor, or any other active descriptor.) The HD key that the wallet knows the private key of, listed using 'gethdkeys', to use for derivation

Result:
{                      (json object)
  "origin" : "str",    (string) Fingerprint and path for use in descriptors
  "xpub" : "str",      (string) The extended public key
  "xprv" : "str"       (string, optional) The extended private key if "private" is true
}

Examples:
> bitcoin-cli derivehdkey m/87h/0h/0h
> curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "derivehdkey", "params": ["m/87h/0h/0h"]}' -H 'content-type: application/json' http://127.0.0.1:8332/
> bitcoin-cli -named derivehdkey path=m/87h/0h/0h private=true
> curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "derivehdkey", "params": {"path":"m/87h/0h/0h","private":"true"}}' -H 'content-type: application/json' http://127.0.0.1:8332/