How It Works?
Somnia Domain Services (SDS) is powered by a simple yet secure smart contract deployed on the Somnia Shannon Testnet.
Users claim names like erick.som by paying a fixed fee (1 STT). This fee is paid in Somnia's native token, and the name is permanently associated with their wallet address.
The contract enforces the following logic:
🧱 Core Mechanics
Only 1 name per wallet is allowed
Names are case-insensitive (all normalized to lowercase)
Names are unique and cannot be re-claimed
Registration requires exactly
1 STTThe STT payment is stored in the contract and withdrawable by the owner (deployer)
🔗 Public Functions
claimName(string)– Claim a domain (only once, requires 1 STT)resolveName(string)– Get the wallet address of a.somnamereverseLookup(address)– Get the.somname assigned to a wallet addressisAvailable(string)– Check if a name is available
💰 Withdrawals
The contract deployer (owner) can call withdraw() to transfer all collected STT fees to their wallet.
🧠 Domain Rules
Names shorter than 3 characters are rejected
.somsuffix is automatically added in logicAll names are stored as full
.somstrings (e.g.erick.som)
Next: Let’s install and use the SDK 👇
Last updated