show_priv_key
The show_priv_key method returns the private key of the specified coin in a format compatible with coin wallets.
The output can be used for the importprivkey method (UTXO coins) or as a private key for MyEtherWallet (ETH/ERC20).
Arguments
| Structure | Type | Description |
|---|---|---|
| coin | string | the name of the coin of the private key to show |
Response
| Structure | Type | Description |
|---|---|---|
| coin | string | the name of the coin |
| priv_key | string | the private key of the coin |
📌 Examples
Command
POST show_priv_key
{
"userpass": "RPC_UserP@SSW0RD",
"method": "show_priv_key",
"coin": "HELLOWORLD"
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "show_priv_key",
"coin": "HELLOWORLD"
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "show_priv_key",
"coin": "HELLOWORLD"
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "show_priv_key",
"coin": "HELLOWORLD"
};
const response = await fetch("http://127.0.0.1:7783", {
method: "POST",
body: JSON.stringify(payload),
});
console.log(await response.json()); <?php
$payload = <<<'JSON'
{
"userpass": "RPC_UserP@SSW0RD",
"method": "show_priv_key",
"coin": "HELLOWORLD"
}
JSON;
$ch = curl_init("http://127.0.0.1:7783");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
echo $response; package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{"userpass":"RPC_UserP@SSW0RD","method":"show_priv_key","coin":"HELLOWORLD"}`)
resp, err := http.Post("http://127.0.0.1:7783", "application/json", bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
} require 'net/http'
require 'json'
require 'uri'
uri = URI("http://127.0.0.1:7783")
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "show_priv_key",
"coin": "HELLOWORLD"
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Show Response
Response (UTXO WIF)
{
"coin": "HELLOWORLD",
"priv_key": "UvCjJf4dKSs2vFGVtCnUTAhR5FTZGdg43DDRa9s7s5DV1sSDX14g"
}Response (0x-prefixed ETH private key)
{
"coin": "ETH",
"priv_key": "0xb8c774f071de08c7fd8f62b97f1a5726f6ce9f1bcf141b70b86689254ed6714e"
}