Overview
The names API provides a privacy-preserving name system for stealth addresses. Users can register human-readable names (e.g., “alice”) that resolve to meta-address public keys.Endpoints
Resolve Name
Resolve a name to meta-address public keys.Path Parameters
Name to resolve (3-20 characters)
Response
The resolved name
Spend public key (hex string)
View public key (hex string)
Sui addresses are NEVER returned to preserve privacy.
Example Request
Example Response
Error Responses
Register Name
Register a new name with stealth meta-address and ZK identity proof.The backend builds the registration transaction, sponsors gas, and submits it on-chain.
Request Body
Name to register (3-20 characters)
Spend public key (hex string)
View public key (hex string)
Identity commitment (32 bytes hex)
Groth16 ZK proof (256 bytes hex)
ZK public inputs (N * 32 bytes hex)
Response
Sui transaction digest of the registration
Example Request
Example Response
Error Responses
Implementation Details
Name Resolution Flow
When resolving a name (seeroutes/names.ts:14-61):
- Check Cache: Query database for cached name
- Return Cached: If found, return
spendPubkeyandviewPubkey - On-Chain Lookup: If not cached, call
suiService.resolveName() - Store Cache: Cache result in database
- Return Result: Return public keys only (no Sui address)
Privacy Invariants
This ensures:- Senders cannot link names to blockchain addresses
- Name lookups don’t reveal user balances
- On-chain activity remains unlinkable to names
Registration Flow
When registering a name (seeroutes/names.ts:66-104):
- Validate Input: Check name format, public key formats, ZK proof
- Build Transaction: Construct registration transaction with ZK proof
- Submit On-Chain: Backend signs with admin key (gas sponsor) and submits
- Cache Result: Store name and public keys in database
- Return Digest: Return Sui transaction digest
The backend builds and submits the transaction. Wallets don’t need to sign (privacy benefit).
ZK Identity Proof
Name registration requires a zero-knowledge proof that:- The registrant owns a valid identity credential
- The credential’s commitment matches
identityCommitment - The proof doesn’t reveal any identity attributes
Caching Strategy
Names are cached in the database after first resolution:- On first resolution from on-chain
- On registration
- On conflict resolution (upsert)
Database Schema
Thenames table stores:
No Sui address is stored, preserving privacy.
Use Cases
Payment Request
A merchant can create a payment request using a name:Direct Send
Users can send directly to a name:Related Endpoints
- Pay Requests - Create payment requests by name
- Announcements - Query stealth address announcements
- Transactions - Send to stealth addresses
