ZcashNames

ZNS RPC API Reference

The ZNS indexer exposes a read-only JSON-RPC 2.0 API over TCP.

Default endpoint: http://127.0.0.1:3000

Methods

resolve

Look up a name or address in the registry.

Request:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "resolve",
  "params": { "query": "alice" }
}

The query parameter accepts either a name or a Zcash unified address. If the query parses as a valid Zcash address, it looks up by address; otherwise it looks up by name.

Response (found):

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "name": "alice",
    "address": "utest1f32kn6c4...",
    "txid": "c03eb391...",
    "height": 3903307,
    "nonce": 3,
    "signature": "R2hTYbdEO/5OGFKc...",
    "listing": null
  }
}

Response (not found):

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}

Fields:

FieldTypeDescription
namestringRegistered name
addressstringZcash unified address
txidstringTransaction ID of the registration
heightnumberBlock height of the registration
noncenumberCurrent nonce (incremented by admin actions)
signaturestring | nullLast admin action signature (base64)
listingobject | nullActive listing, if any

Listing object:

FieldTypeDescription
namestringListed name
pricenumberPrice in zatoshis
txidstringTransaction ID of the listing
heightnumberBlock height of the listing
signaturestringEd25519 signature of the LIST action

list_for_sale

Get all active marketplace listings.

Request:

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "list_for_sale",
  "params": {}
}

Response:

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "listings": [
      {
        "name": "bob",
        "price": 100000000,
        "txid": "fed321...",
        "height": 3901250,
        "signature": "CQID..."
      }
    ]
  }
}

Listings are ordered by block height descending (newest first).


status

Get indexer synchronization status.

Request:

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "status",
  "params": {}
}

Response:

{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "synced_height": 3902500,
    "admin_pubkey": "eJ1mZqeYaQKe77xcgMrFD5sgUFYZzToKnNFEqVA43+8=",
    "ufvk": "uviewtest1qqq...fff",
    "registered": 42,
    "listed": 3
  }
}
FieldTypeDescription
synced_heightnumberLatest block the indexer has processed
admin_pubkeystringEd25519 public key (base64) used to verify admin actions
ufvkstringUnified full viewing key the indexer watches
registerednumberTotal registered names
listednumberTotal names currently for sale

Error codes

CodeMeaning
-32700Parse error
-32600Invalid request
-32601Method not found
-32602Invalid params
-32603Internal error