Name Resolving
Resolve a Name
Resolves a PIVX name to retrieve its associated PIVX Address, its proof details, synchronization checkpoints, and registration data.
Endpoint
GET https://indexer.pivx.name/v1.0/resolve/{name} (Just name resolving)
POST https://indexer.pivx.name/v1.0/resolve/{name} (If additional parameters are required)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
{name} | string | Yes | The PIVX name to resolve (e.g., richard.pivx). |
Request Body
The request body must be a JSON object containing the following parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
extended | boolean | false | If true, additionally returns domain_tx (the TX hash of the domain registration). |
with_checkpoint | boolean | false | If true, returns the current Indexer's checkpoint to which the Indexer is synced. |
Code Examples
- cURL
- JavaScript
- Python
- PHP
curl -X POST https://indexer.pivx.name/v1.0/resolve/richard.pivx \
-H "Content-Type: application/json" \
-d '{
"extended": true,
"with_checkpoint": true
}'
const url = 'https://indexer.pivx.name/v1.0/resolve/richard.pivx';
const data = {
extended: true,
with_checkpoint: true
};
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(result => console.log(result))
.catch(error => console.error('Error:', error));
import requests
url = "https://indexer.pivx.name/v1.0/resolve/richard.pivx"
payload = {
"extended": True,
"with_checkpoint": True
}
headers = {
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
<?php
$url = 'https://indexer.pivx.name/v1.0/resolve/richard.pivx';
$data = [
'extended' => true,
'with_checkpoint' => true
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
print_r($result);
?>
Response Example
{
"response": {
"domain_name": "bob.pivx",
"target_address": "ps12qtzaw6x3dh35xuukrqgk06e9ffx8szg2n2huqncwjsnj3ajczmklqgcx97kn63vwlge6gj2cmn",
"owner_pubkey": "1111111111111111111111111111111111111111111111111111111111111111",
"price": 250000000,
"nonce": 1780000002,
"smt_root": "5892c31e50ad3a4cf0407b91b3012a196d60c4e4f53e37261ac6747dea180eea",
"merkle_proof": [
"29bc98ae3a939618e50ba72e11a25ba30b37bb53a168a17463b9ef3fe90495d8",
"0000000000000000000000000000000000000000000000000000000000000000"
],
"proof_depth": 2,
"proof_terminal": "Occupied"
}
}
| Field | Type | Description |
|---|---|---|
domain_name | string | The registered name |
target_address | string | Target PIVX address |
owner_pubkey | string | Public key of the name owner |
price | int | price tag (used for Marketplace) |
nonce | int | incremental nonce |
smt_root | string | Current Merkle tree root (hex) |
| (if with_checkpoint:false, otherwise see "checkpoint" for SMT Root) | ||
merkle_proof | string[] | sibling hashes, hex; [0] is deepest. Length equals proof_depth |
proof_depth | int | number of siblings — verify it equals merkle_proof.length |
proof_terminal | string | object | "Occupied", "Vacant" or {"Blocked":{…}} — see below |
| extended: | ||
created_block_id | int | domain creation PIVX block_id |
updated_block_id | int | domain last update PIVX block_id |
domain_tx | string | The PIVX transaction hash of the name registration |
| with_checkpoint: | Fields inside "checkpoint": | |
idx | int | Position in the anchor contract’s rootChain array; the resume cursor for checkpoint discovery |
block_id | int | The PIVX block_id of the latest SMT Proof generated |
smt_root | string | Current Merkle tree root (hex) |
proof_terminal
Describes what sits at the end of the proof path. This is what makes absence provable rather than merely asserted:
| Value | Meaning |
|---|---|
"Occupied" | the name's own leaf is there — a successful resolution. Reject any resolution whose terminal is not this. |
"Vacant" | an empty subtree is there — the name is unregistered |
{"Blocked": {"record": {…}}} | a different name's leaf occupies that position, so the queried name is unregistered. The blocking record is included in full so you can verify the claim rather than trust it. |
Verification code for all of this, in Python, PHP and JavaScript, is on Verifying Proofs.
Reverse Name Lookup
Provide a PIVX Address to perform a reverse resolving:
GET/POST https://indexer.pivx.name/v1.0/resolve/reverse/{address}
The POST params are described above.
Names by Owner
All names owned by a given Ed25519 public key.
GET/POST https://indexer.pivx.name/v1.0/resolve/owner/{Ed25519_public_key}
The POST params are described above.