Core Concepts
Last updated
Last updated
🐡 PNS (Polkadot Name Service) is a distributed, open, and extensible naming system built on the Polkadot ecosystem. Similar to ENS (Ethereum Name Service), PNS allows human-readable names to be mapped to Polkadot addresses and other resources.
The is the core contract of PNS. It keeps track of all domains and subdomains, storing three critical pieces of information:
The owner of the domain
The resolver for the domain
The time-to-live (TTL) for all records under the domain
Registrars are contracts that own a domain and specify rules for the allocation of their subdomains. The primary registrar in PNS is the .dot
registrar, which allows users to register second-level domains. is simple implemmentation of a registrar and be extended to include additional business logic.
Resolvers are responsible for the process of translating names into addresses. A resolver can implement any number of public resolution interfaces that other smart contracts or external clients can query.
Key resolver features:
Address Resolution: Maps domain names to Polkadot addresses. ()
Metadata Storage: Stores additional information about domains. ()
Names in PNS follow a hierarchical dot-separated format:
Example: "wallet.dot" or "sub.wallet.dot"
Important Rules:
Labels must be normalized according to UTS46 rules
Case-insensitive (folded during normalization)
Recommended length: max 64 chars per label, 255 chars total name
Names are processed using the namehash algorithm to create unique fixed-length identifiers:
Example hashes:
PNSRegistry.sol
Central registry contract
Maintains ownership and resolver mapping
Controls domain and subdomain creation
BaseRegistrar.sol
Manages the registration of second-level domains
Implements domain expiration and renewal logic
Can be extended to implement controls pricing and registration rules
Resolvers
PublicResolver.sol: Basic name resolution
MetadataResolver.sol: Additional metadata storage
The frontend application is built using Next.js and provides:
Domain search and registration interface
Domain management dashboard
Resolver configuration
Integration with Polkadot wallets
Human-Readable Names
Transform complex Polkadot addresses into memorable names
Support for multiple name formats
Decentralized Operation
Fully on-chain resolution
No central authority
Community-driven governance
Extensibility
Custom resolvers can be implemented
Support for various record types
Upgradeable architecture
Security
Based on proven ENS architecture
Secure ownership model
Protected against common attack vectors
Registration Process
Resolution Process
Update Process