Skip to main content

Name Resolving

Resolve a Name​

Resolves a KNS name to retrieve its associated Kerrigan Address, its proof details, synchronization checkpoints, and registration data.

Endpoint​

GET https://indexer.kerrigan-name.space/v1.0/resolve/{name} (Just name resolving)
POST https://indexer.kerrigan-name.space/v1.0/resolve/{name} (If additional parameters are required)

Path Parameters​

ParameterTypeRequiredDescription
{name}stringYesThe KNS name to resolve (e.g., richard.krgn).

Request Body​

The request body must be a JSON object containing the following parameters:

ParameterTypeDefaultDescription
extendedbooleanfalseIf true, additionally returns created_block_id, updated_block_id and domain_tx (the hash of the transaction of the name's latest operation).
with_checkpointbooleanfalseIf true, also returns checkpoint: the anchored checkpoint whose root (the same as smt_root) this proof was built against. It is null while a sync is being committed; repeat the request. updated_block_id comes with it as well.

Code Examples​

curl -X POST https://indexer.kerrigan-name.space/v1.0/resolve/richard.krgn \
-H "Content-Type: application/json" \
-d '{
"extended": true,
"with_checkpoint": true
}'

Response Example

{
"response": {
"domain_name": "richard.krgn",
"target_address": "ks166cahjdadxwwrajd7mqqyscmrzy9xpt94vy7xptq7luetq6258qclhmmmxlelnj36an6ah632vp",
"owner_pubkey": "1111111111111111111111111111111111111111111111111111111111111111",
"price": 250000000,
"nonce": 1793536201,
"created_block_id": 181240,
"domain_tx": "9fe75bfbbf10ad4f5e3517ee65908da0f13da09f04f63d08caf0bd74fa884849",
"updated_block_id": 181655,
"smt_root": "02c6c822fb1b7f51f0474a5b3a22b7672d32e8baf30e4e16a0b3d503cc5a81fa",
"merkle_proof": [
"29bc98ae3a939618e50ba72e11a25ba30b37bb53a168a17463b9ef3fe90495d8",
"0000000000000000000000000000000000000000000000000000000000000000"
],
"proof_depth": 2,
"proof_terminal": "Occupied",
"checkpoint": {
"idx": 5,
"block_id": 181702,
"smt_root": "02c6c822fb1b7f51f0474a5b3a22b7672d32e8baf30e4e16a0b3d503cc5a81fa"
}
}
}

This is an example, not an answer of indexer.kerrigan-name.space: its values are made up, and its address has a wrong checksum, so that nobody pays it. Its proof is complete all the same: it folds to its own root with the code on Verifying Proofs. The root changes with every new batch of operations, so requests made at different times may return another smt_root and other siblings.

FieldTypeDescription
domain_namestringThe registered name
target_addressstringTarget Kerrigan address
owner_pubkeystringPublic key of the name owner
priceintprice tag (used for Marketplace)
nonceintincremental nonce
smt_rootstringThe Merkle tree root (hex) the proof was built against, in every answer
merkle_proofstring[]sibling hashes, hex; [0] is deepest. Length equals proof_depth
proof_depthintnumber of siblings — verify it equals merkle_proof.length
proof_terminalstring | object"Occupied", "Vacant" or {"Blocked":{…}} — see below
extended:
created_block_idintdomain creation Kerrigan block_id
updated_block_idintdomain last update Kerrigan block_id
domain_txstringThe Kerrigan transaction hash of the name's latest operation: its registration, until the name is updated, transferred, listed, unlisted or bought
with_checkpoint:Fields inside "checkpoint" (null while a sync is being committed):
idxintIndex of the root in the anchor contract’s rootAt mapping (0 is the genesis root); the resume cursor for checkpoint discovery
block_idintThe Kerrigan block_id the checkpoint covers
smt_rootstringThe checkpoint's root (hex) — the same as smt_root above

proof_terminal​

Describes what sits at the end of the proof path, which is what lets a proof show absence as well as presence:

ValueMeaning
"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.

A name the indexer does not know is answered with the error Domain not found, without a proof: the API does not return Vacant or Blocked proofs yet, so a "not found" is the indexer's word. Check it with a second indexer before relying on it.

If new names are being saved while the node answers, a lookup can get the error The names are being updated, repeat the request: repeat it a moment later. All the errors are listed on Errors.

Verification code for all of this, in Python, PHP and JavaScript, is on Verifying Proofs.

Reverse Name Lookup​

Provide a Kerrigan Address to perform a reverse resolving:

GET/POST https://indexer.kerrigan-name.space/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.kerrigan-name.space/v1.0/resolve/owner/{Ed25519_public_key}

The POST params are described above.

Paging the Lists​

The reverse and owner lookups answer one page of names at a time, in name order (A to Z). Two more POST parameters page through them:

ParameterTypeDefaultDescription
countinteger500Names per page, 1 to 500. A larger value is cut to 500.
afterstring—The last name of the page before: this page starts after it. Leave it out for the first page.

A page holding count names may have more after it: ask again with after set to its last name. A shorter page is the last one, and a page past the last name is an empty list, [].

curl -X POST https://indexer.kerrigan-name.space/v1.0/resolve/owner/{Ed25519_public_key} \
-H "Content-Type: application/json" \
-d '{"count": 100, "after": "alice.krgn"}'