이름 해석
이름 해석하기
PIVX 이름을 해석해 연결된 PIVX 주소, 증명 세부 정보, 동기화 체크포인트, 등록 데이터를 가져옵니다.
엔드포인트
GET https://indexer.pivx.name/v1.0/resolve/{name}(이름 해석만)
POST https://indexer.pivx.name/v1.0/resolve/{name}(추가 매개변수가 필요한 경우)
경로 매개변수
| 매개변수 | 타입 | 필수 | 설명 |
|---|---|---|---|
{name} | string | 예 | 해석할 PIVX 이름(예: richard.pivx). |
요청 본문
요청 본문은 다음 매개변수를 담은 JSON 객체여야 합니다:
| 매개변수 | 타입 | 기본값 | 설명 |
|---|---|---|---|
extended | boolean | false | true이면 created_block_id, updated_block_id, domain_tx(해당 이름의 최근 작업의 트랜잭션 해시)도 함께 반환합니다. |
with_checkpoint | boolean | false | true이면 checkpoint도 반환합니다. 이 증명이 만들어진 루트(smt_root와 같음)를 가진, 앵커링된 체크포인트입니다. 동기화가 커밋되는 동안에는 null이니 요청을 다시 보내세요. updated_block_id도 함께 반환합니다. |
코드 예시
- 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": {
"domain_name": "richard.pivx",
"target_address": "ps1zu2xyry4rc5j0trs3w9zqr5ayhw8h3ulhsfw4reufcg8c62gpg3rzcj7tkasn7tlwgc9y4emwtq",
"owner_pubkey": "ba17d58e11e9828a4ffc140560730ce1b410c924043c1d60cf52a127bde47544",
"price": 750000000000,
"nonce": 1793384994,
"created_block_id": 5648982,
"domain_tx": "a1003dace6ed2ea966aba28926c6ecb7cb5436229db329ce72d118d2cf502d66",
"updated_block_id": 5649418,
"smt_root": "5613850a42087074b88a35dfd6c878d53267f6fa571438026a437c059cbc8245",
"merkle_proof": [
"5a9acd90db63c21d8eff4b656d4526c1bb4b5f9f5e7cf6c5a22719c4d8854bec",
"0000000000000000000000000000000000000000000000000000000000000000",
"d8f11c6213a091087e5bcf8aeac624c7f768d9436af9b6883880155e28e3f4a7",
"ed05b1037b96221bda47b2dd76aa37a93f3d39cb336f8e6f8a203f8fb1ea2a98",
"3af379894717ec7000caf91fcd2bf0e570fda54befa24f5a5770275728dcb11e",
"50e173401bd419424082e3cb2caf9ee62e0808e79e8c8ade99d3396f35e995ce",
"4c1b349c97b95c712f4777b357de9ff1535aad68bb7c56134273a88fefe8bef5",
"3695b047cfbd47f93c899c03736d085924a23ba48d51a6db8382bb2a7452c4b6",
"badcf46ab543cb4a9a1ad7335a07b87d8ede6dc241cf4b4168894f4822f08325",
"e33ad310acd0cc3f5a4261ed6a24615e60e91de423a8ace2f6716c0b60aa351c"
],
"proof_depth": 10,
"proof_terminal": "Occupied",
"checkpoint": {
"idx": 31,
"block_id": 5671618,
"smt_root": "5613850a42087074b88a35dfd6c878d53267f6fa571438026a437c059cbc8245"
}
}
}
위 요청에 대한 indexer.pivx.name의 응답으로, 체크포인트 31(PIVX 블록 5671618) 시점의 것입니다. 루트는 새 작업 배치마다 바뀌므로 나중에 요청하면 다른 smt_root와 다른 형제 해시가 반환될 수 있지만, 이 응답은 증명 검증의 코드로 여전히 자신의 루트로 접힙니다.
| 필드 | 타입 | 설명 |
|---|---|---|
domain_name | string | 등록된 이름 |
target_address | string | 대상 PIVX 주소 |
owner_pubkey | string | 이름 소유자의 공개 키 |
price | int | 가격표(마켓플레이스에서 사용) |
nonce | int | 증가하는 nonce |
smt_root | string | 증명이 만들어진 머클 트리 루트(16진수), 모든 응답에 포함 |
merkle_proof | string[] | 16진수 형제 해시들. [0]이 가장 깊음. 길이는 proof_depth와 같음 |
proof_depth | int | 형제 노드 수 — merkle_proof.length와 같은지 확인하세요 |
proof_terminal | string | object | "Occupied", "Vacant" 또는 {"Blocked":{…}} — 아래 참조 |
| extended: | ||
created_block_id | int | 도메인이 생성된 PIVX block_id |
updated_block_id | int | 도메인이 마지막으로 갱신된 PIVX block_id |
domain_tx | string | 해당 이름의 최근 작업의 PIVX 트랜잭션 해시: 이름이 업데이트, 이전, 판매 등록, 판매 취소 또는 구매되기 전까지는 등록 트랜잭션입니다 |
| with_checkpoint: | "checkpoint" 내부의 필드(동기화가 커밋되는 동안에는 null): | |
idx | int | 앵커 컨트랙트 rootAt 매핑에서 루트의 인덱스(0은 제네시스 루트). 체크포인트 탐색의 재개 커서 |
block_id | int | 체크포인트가 다루는 PIVX block_id |
smt_root | string | 체크포인트의 루트(16진수) — 위의 smt_root와 같음 |
proof_terminal
증명 경로의 끝에 무엇이 있는지 설명합니다. 이 덕분에 증명은 존재뿐 아니라 부재도 보여 줄 수 있습니다:
| 값 | 의미 |
|---|---|
"Occupied" | 그곳에 그 이름 자신의 잎이 있음 — 성공적인 해석. 터미널이 이것이 아닌 해석 결과는 모두 거부하세요. |
"Vacant" | 그곳에 빈 서브트리가 있음 — 이름이 등록되어 있지 않음 |
{"Blocked": {"record": {…}}} | 그 자리를 다른 이름의 잎이 차지하고 있으므로 조회한 이름은 등록되어 있지 않습니다. 차단 레코드가 통째로 포함되어 있어, 그 주장을 신뢰하는 대신 검증할 수 있습니다. |
인덱서가 모르는 이름에는 증명 없이 Domain not found 오류로 답합니다. API는 아직
Vacant나 Blocked 증명을 돌려주지 않으므로, 「not found」는 인덱서의 말일
뿐입니다. 그것에 기대기 전에 두 번째 인덱서로 확인하세요.
이 모든 것에 대한 Python, PHP, JavaScript 검증 코드는 증명 검증에 있습니다.
역방향 이름 조회
역방향 해석을 하려면 PIVX 주소를 지정하세요:
GET/POST https://indexer.pivx.name/v1.0/resolve/reverse/{address}
POST 매개변수는 위에 설명되어 있습니다.
소유자별 이름
주어진 Ed25519 공개 키가 소유한 모든 이름.
GET/POST https://indexer.pivx.name/v1.0/resolve/owner/{Ed25519_public_key}
POST 매개변수는 위에 설명되어 있습니다.
목록 페이지 나누기
역방향 조회와 소유자별 조회는 이름을 한 번에 한 페이지씩, 이름 순서(A부터 Z)로 반환합니다. POST 매개변수 두 개를 더 사용해 페이지를 넘깁니다.
| 매개변수 | 타입 | 기본값 | 설명 |
|---|---|---|---|
count | integer | 500 | 페이지당 이름 수, 1~500. 더 큰 값은 500으로 줄어듭니다. |
after | string | — | 이전 페이지의 마지막 이름. 이 페이지는 그 다음부터 시작합니다. 첫 페이지에서는 생략합니다. |
이름이 count개인 페이지 뒤에는 이름이 더 있을 수 있습니다. after를 그 페이지의 마지막 이름으로 지정해 다시 요청하세요. 그보다 짧은 페이지가 마지막 페이지이며, 마지막 이름 뒤의 페이지는 빈 목록 []입니다.
curl -X POST https://indexer.pivx.name/v1.0/resolve/owner/{Ed25519_public_key} \
-H "Content-Type: application/json" \
-d '{"count": 100, "after": "alice.pivx"}'