importprivkey - Hush 3.10.3 RPC

importprivkey "hushprivkey" ( "label" rescan height secret_key)

Adds a private key (as returned by dumpprivkey) to your wallet.

Arguments:
1. "hushprivkey"   (string, required) The private key (see dumpprivkey)
2. "label"            (string, optional, default="") An optional label
3. rescan               (boolean, optional, default=true) Rescan the wallet for transactions
4. height               (integer, optional, default=0) start at block height?
5. secret_key           (integer, optional, default=188) decimal value used to import WIFs of other coins

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

Examples:

Dump a private key
> hush-cli dumpprivkey "myaddress"

Import the private key with rescan
> hush-cli importprivkey "mykey"

Import using a label and without rescan
> hush-cli importprivkey "mykey" "testing" false

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

Import with rescan from a block height
> hush-cli importprivkey "mykey" "testing" true 1000

Import a BTC WIF with rescan
> hush-cli importprivkey "BTCWIF" "testing" true 0 128

Import a BTC WIF without rescan
> hush-cli importprivkey "BTCWIF" "testing" false 0 128

As a JSON-RPC call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importprivkey", "params": ["mykey", "testing", true, 1000] }' -H 'content-type: text/plain;' http://127.0.0.1:18031/


Maintained by The Hush Developers

Welcome to the Hush full node RPC developer documentation!!! You finally made it.