UQRP Protocol

Universal Query Response Protocol for DNS-Based Data Storage

Overview

ResolveDB transforms DNS infrastructure into a data distribution platform. Data is encoded in DNS queries and responses, leveraging global DNS caching for sub-millisecond access.

Client                    DNS Resolver              ResolveDB
   |                           |                          |
   |-- get.newyork.weather.public.v1.resolvedb.net ----->|
   |                           |                          |
   |<-- TXT "v=rdb1;s=ok;d={"temp":72}" -----------------|
   |                           |                          |
   |-- (cached locally) ------>|                          |

Query Format

UQRP queries are structured DNS hostnames with each component serving a specific purpose:

<operation>.<params>.<resource>.<namespace>.<version>.resolvedb.<tld>
ComponentRequiredDescription
operationYesAction to perform (get, put, delete, etc.)
paramsNoEncoded parameters
resourceYesData resource name
namespaceYesScope (public, user, system)
versionYesProtocol version (v1)
resolvedbYesProtocol marker
tldYes.com, .net, .org, .io

Examples

# Weather by city name
get.newyork.weather.public.v1.resolvedb.net

# Weather by GPS coordinates (Base64 encoded JSON)
# {"lat":40.7128,"lon":-74.0060} -> eyJsYXQiOjQwLjcxMjgsImxvbiI6LTc0LjAwNjB9
get.b64-eyJsYXQiOjQwLjcxMjgsImxvbiI6LTc0LjAwNjB9.weather.public.v1.resolvedb.net

# Authenticated request
get.auth-eyJhbGciOiJFZDI1NTE5In0.profile.acme.v1.resolvedb.net

Operations

OperationDescriptionAuth RequiredTransport
getRetrieve dataNo (public) / Yes (user)DNS
putStore dataYesHTTP API
deleteRemove dataYesHTTP API
listList resourcesDependsDNS
searchSearch resourcesDependsDNS
watchSubscribe to changesYesDNS (returns WebSocket URL)
infoResource metadataNoDNS
healthSystem healthNoDNS
geoipClient IP geolocationNoDNS

Note: Write operations (put, delete) are handled via the HTTP API at api.resolvedb.io, not via DNS queries. DNS is optimized for reads; writes flow through the API.

Parameter Encoding

Parameters requiring special characters are encoded using DNS-safe prefixes. All prefixes use hyphens (-) as separators since colons are not valid in DNS labels per RFC 1035.

PrefixEncodingUse Case
(none)Plain alphanumericSimple keys
b64-Base64 URL-safeJSON, binary, complex params
b32-Base32Case-insensitive
hex-HexadecimalBinary hashes
auth-JWT tokenAuthentication
chunk-Chunk referenceLarge data
h-Hash referenceContent-addressed
ts-Unix timestampReplay protection
nonce-Random stringReplay protection
cursor-Pagination cursorList/search pagination
limit-Result limitPagination (1-1000)
offset-Result offsetPagination
geo-CoordinatesGeoIP queries

Token Hash References

JWT tokens often exceed the 63-character DNS label limit. Use hash references for long tokens:

# Full token (may exceed label limit)
get.auth-eyJhbGciOi...longtoken....resource.namespace.v1.resolvedb.net

# Hash reference (always fits)
get.auth-h-a1b2c3d4e5f6g7h8i9j0k1l2.resource.namespace.v1.resolvedb.net

Register your token via the API to receive a hash reference. Hash references require at least 32 hex characters (128 bits).

Response Format

Responses are returned as DNS TXT records with a structured format:

v=rdb1;s=<status>;t=<type>;e=<encoding>;f=<format>;ttl=<seconds>;d=<data>
FieldDescriptionValues
vProtocol versionrdb1
sStatus codeok, notfound, auth, error...
tResponse typedata, url, multi, stream, encrypted
eEncodingplain, b64, b32, hex, compressed, encrypted
fFormatjson, xml, text, binary
hSHA-256 hashFirst 16+ hex chars
ttlCache durationSeconds
errError codeE001-E017
retryRetry afterSeconds
dData payloadEncoded data

Response Examples

# Success with JSON
v=rdb1;s=ok;t=data;e=plain;f=json;ttl=300;d={"temp":72,"unit":"F"}

# URL redirect for large data
v=rdb1;s=redirect;t=url;ttl=3600;d=https://cdn.resolvedb.cloud/blob/abc123

# Rate limited
v=rdb1;s=ratelimit;err=E010;retry=60;ttl=1;d=Rate limit exceeded

Status Codes

CodeHTTP EquivDescription
ok200Success
partial206Partial content
redirect301See URL in data
invalid400Malformed query
auth401Authentication required
forbidden403Access denied
notfound404Resource not found
ratelimit429Too many requests
toolarge413Response exceeds limits
secviol400Security violation (signature invalid, replay detected)
error500Server error
unavail503Service unavailable

Error Codes

Machine-readable error codes for programmatic handling:

CodeStatusDescriptionRetryable
E001invalidMalformed query syntaxNo
E002invalidUnknown operationNo
E003invalidInvalid encoding prefixNo
E004notfoundResource does not existNo
E005notfoundNamespace does not existNo
E006authMissing authenticationNo
E007authToken expiredNo
E008authToken invalidNo
E009forbiddenInsufficient permissionsNo
E010ratelimitRate limit exceededYes
E011toolargePayload exceeds 64KBNo
E012errorInternal server errorYes
E013unavailService temporarily unavailableYes
E014secviolEncrypted transport requiredYes
E015toolargeResponse requires TCPYes
E016secviolReplay attack detectedNo
E017invalidCursor validation failedNo

Namespaces

ResolveDB organizes data into hierarchical namespaces:

resolvedb.<tld>
├── public.resolvedb.<tld>    # Public data services
├── user.resolvedb.<tld>      # User-owned namespaces
├── system.resolvedb.<tld>    # System operations
└── registry.resolvedb.<tld>  # Service registry

Public Namespace

Globally accessible data through standardized interfaces:

current.celsius.newyork.weather.v1.public.resolvedb.net
price.aapl.nasdaq.stock.v1.public.resolvedb.net

User Namespace

Isolated data storage for individuals and organizations:

profile.settings.alice.user.resolvedb.net
config.myapp.prod.acme-corp.user.resolvedb.net

Namespace Rules

RuleConstraint
Length1-32 characters
Charactersa-z, 0-9, - (hyphen)
Start/EndMust be alphanumeric
CaseCase-insensitive (normalized to lowercase)

Reserved Namespaces: public, system, registry, admin, root, api, www, cdn, dns, ns*, mail, resolvedb, rdb, and all underscore-prefixed names (_*).

Dual Addressing

Organizations receive both a vanity name and a stable hash ID:

config.myapp.acme-corp.user.resolvedb.net      # vanity (readable)
config.myapp.a7f3b2c4e8d9f012.user.resolvedb.net  # hash ID (stable)

Hash IDs are 16 hex characters (64-bit) and remain stable across renames.

TTL & Caching

ResolveDB leverages the global DNS caching infrastructure. When a response is returned with a TTL, every resolver in the hierarchy caches it independently, dramatically reducing origin queries.

TTL Classes

ClassTTLUse Case
immutable7 daysHash-addressed content, versioned data
stable24 hoursReference data, documentation
standard1 hourDefault for most data
dynamic5 minUser data, frequently changing content
volatile30-60 secReal-time status, health checks
nocache0Write confirmations, errors

Write Operations

Write operations (put, delete) use the HTTP API, not DNS. See API Reference for details.

# Create/update a record
curl -X POST https://api.resolvedb.io/api/v1/records \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"record": {"key": "config.myapp.v1", "data": "eyJoZWxsbyI6IndvcmxkIn0="}}'

# Delete a record
curl -X DELETE https://api.resolvedb.io/api/v1/records/rec_abc123 \
  -H "Authorization: Bearer YOUR_API_KEY"

After a write, data is immediately available via DNS queries.

Pagination

For list and search operations, use cursor-based pagination:

# First page (50 results)
list.limit-50.resources.myapp.v1.resolvedb.net

# Next page (use cursor from previous response)
list.cursor-eyJsYXN0IjoiZm9vIn0.resources.myapp.v1.resolvedb.net

Response includes pagination metadata:

{"items": [...], "cursor": "eyJsYXN0IjoiYmFyIn0", "hasMore": true}

Large Data

For data exceeding 4KB, use chunked retrieval:

# 1. Get manifest
dig get.manifest.bigfile.tenant.v1.resolvedb.net TXT

# 2. Retrieve chunks in parallel (format: chunk-index-total-hash)
dig get.chunk-0-5-abc123def4567890.bigfile.tenant.v1.resolvedb.net TYPE=NULL
dig get.chunk-1-5-abc123def4567890.bigfile.tenant.v1.resolvedb.net TYPE=NULL

Verify each chunk's hash before reassembly. See PROTOCOL.md for full chunking specification.

Security

ResolveDB implements multiple security layers:

Layer 1: DNSSEC

ECDSA P-256 signing, automatic key rotation, NSEC3 for authenticated denial.

Layer 2: Content Integrity

SHA-256 hash verification, Ed25519 signatures, Unix timestamps for replay protection.

Layer 3: Encryption

AES-256-GCM symmetric encryption, X25519 key exchange, ChaCha20-Poly1305.

Layer 4: Query Privacy

DNS-over-HTTPS (DoH) / DNS-over-TLS (DoT) for sensitive queries.

Authentication

JWT tokens are passed via the auth- prefix:

get.auth-<jwt>.resource.namespace.v1.resolvedb.net

# JWT Claims
{
  "sub": "user-id",
  "tenant": "namespace",
  "exp": 1234567890,
  "scopes": ["read", "write"]
}

Complete Specification

For the full protocol specification including formal grammar (ABNF), encryption wire formats, WebSocket security, and implementation requirements, see PROTOCOL.md.


Ready to build?

Create an account and start using the UQRP protocol.

Get Started