# Introduction

## **Welcome to the Sonic Name Service!**

**Sonic Name Service (SNS)** is a fully modular, extensible, and on-chain naming protocol built for the Sonic network. Inspired by ENS but purpose-built for speed, composability, and scalability, SNS enables users and developers to register `.s` domains that resolve across wallets, dApps, and smart contracts.

Each `.s` domain is represented as an ERC721 NFT, ensuring true ownership, transferability, and integration with existing Web3 infrastructure. The protocol’s architecture is built around a lightweight **Ledger**, a flexible **Registrar (Caster)**, and a suite of optional modules for referrals, resellers, renewals, blacklists, and subdomains — all working together through clean, minimal interfaces.

### SNS is designed from day one to be:

* 🧩 **Composable** — Each module (e.g. FeeRouter, RenewalEngine, ResellerHub) is deployable and replaceable without touching core logic.
* ⚡ **Gas-optimized** — Packed storage, minimal calldata, and a short TLD `.s` reduce every byte of cost.
* 🧪 **Tested and Transparent** — Deployed with full coverage and modern testing (Viem + Hardhat), and readable by anyone.
* 🔒 **Secure and Permissioned** — Role-based access controls are enforced on all write actions.
* 🔁 **Upgradeable by Design** — While core contracts are immutable, logic lives in modules that can evolve independently.
* 🧠 **Developer-first** — Interfaces and libraries are structured for easy contract-to-contract use and off-chain resolution tooling.

### Why `.s`?

Unlike verbose alternatives (e.g. `.sonic`, `.network`, `.xyz`), `.s` minimizes calldata, storage, and UI clutter. In fact, `.s` is one of the shortest possible valid TLDs — saving bytes in every transaction and every EVM call. This is not just a branding choice — it’s a performance optimization.

### How it works

At the heart of SNS is a **name-to-token mapping**, where:

* Each domain (e.g. `rex.s`) maps to a `tokenId` (`keccak256(name)`),
* Metadata is stored on-chain in a packed format inside the **Ledger**,
* Ownership of the token is canonical — this is the root controller of the domain,
* Subdomains (`app.rex.s`) are stored and resolved separately using `SubdomainHub`.

The SNS system follows the principle of **clean separation of concerns**: resolution logic, metadata, fees, access control, and registry state are all isolated and replaceable.

### License and Open-Source Vision

SNS is currently released under a **source-available license**:

```
SPDX-License-Identifier: BUSL-1.1
Copyright (c) 2025 Sonic Name Service
Source-available for audit, integration, and visibility only.
Forking, modification, or commercial use requires written permission.
```

This allows auditability, developer integration, and transparency — while protecting the protocol’s core mechanics during early growth. SNS is committed to fully open-sourcing under a license such as Apache 2.0 in the future, once the ecosystem and governance mechanisms have matured.

### What’s inside this documentation

This GitBook provides:

* 🔍 A complete guide to the SNS contract architecture
* 📦 Technical specs for all modules and storage layouts
* 🛠 Integration examples for dApps, wallets, and registrars
* 🧪 Testing tips and security considerations
* 🧭 A roadmap of future modules and governance

Whether you’re building a wallet integration, writing a registrar frontend, or extending the SNS protocol itself, this guide is designed to help you understand and contribute confidently.
