z_importkey - Zcash 5.5.0 RPC

z_importkey "zkey" ( rescan startHeight )

Adds a zkey (as returned by z_exportkey) to your wallet.
Import of Orchard keys is not supported.

1. "zkey"             (string, required) The zkey (see z_exportkey)
2. rescan             (string, optional, default="whenkeyisnew") Rescan the wallet for transactions - can be "yes", "no" or "whenkeyisnew"
3. startHeight        (numeric, optional, default=0) Block height to start rescan from

Note: This call can take a long time to complete if rescan is true.

  "address_type" : "xxxx",                 (string) "sprout" or "sapling"
  "type" : "xxxx",                         (string) "sprout" or "sapling" (DEPRECATED, legacy attribute)
  "address" : "address|DefaultAddress",    (string) The address corresponding to the spending key (for Sapling, this is the default address).


Export a zkey
> zcash-cli z_exportkey "myaddress"

Import the zkey with rescan
> zcash-cli z_importkey "mykey"

Import the zkey with partial rescan
> zcash-cli z_importkey "mykey" whenkeyisnew 30000

Re-import the zkey with longer partial rescan
> zcash-cli z_importkey "mykey" yes 20000

As a JSON-RPC call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_importkey", "params": ["mykey", "no"] }' -H 'content-type: text/plain;'

Maintained by @_garethtdavies; modified by: mdr0id;license of the docs is MIT (see zcash repo), license of the scripts and webpage is also MIT (github repo)

Note it uses a mainnet zcash node