Get Public Key
get_public_key
The get_public_key method returns the compressed secp256k1 pubkey corresponding to the user’s seed phrase.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| None | N/A | – | This method has no parameters. |
Response Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| public_key | string | ✓ | User's pubkey |
📌 Examples
Command
POST Get Public Key
get_public_key {
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "get_public_key",
"params": {},
"id": 0
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "get_public_key",
"params": {},
"id": 0
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "get_public_key",
"params": {},
"id": 0
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "get_public_key",
"params": {},
"id": 0
};
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",
"mmrpc": "2.0",
"method": "get_public_key",
"params": {},
"id": 0
}
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","mmrpc":"2.0","method":"get_public_key","params":{},"id":0}`)
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",
"mmrpc": "2.0",
"method": "get_public_key",
"params": {},
"id": 0
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Show Get Public Key Response
Response (success)
{
"mmrpc": "2.0",
"result": {
"public_key": "0366d28a7926fb20287132692c4cef7bc7e00e76da064948676f8549c0ed7114d3"
},
"id": 0
}