Skip to content

Latest commit

 

History

History
57 lines (39 loc) · 848 Bytes

importprivkey.md

File metadata and controls

57 lines (39 loc) · 848 Bytes

importprivkey Method

Imports the private key to the wallet.

  1. Install the plugin RpcServer
  2. Call the RPC method openwallet to open the wallet first.
{
  "jsonrpc": "2.0",
  "method": "importprivkey",
  "params": [key],
  "id": 1
}

Parameter Description

  • key: The WIF-format private key.

Example

Request body:

{
  "jsonrpc": "2.0",
  "method": "importprivkey",
  "params": ["L5c6jz6Rh8arFJW3A5vg7Suaggo28ApXVF2EPzkAXbm94ThqaA6r"],
  "id": 1
}

Response body:

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "address": "Ad8S24trcuchyLfEbJWqRP7BUScUT4t2pw",
        "haskey": true,
        "label": null,
        "watchonly": false
    }
}

Response description:

Returns the address corresponding to the key.