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 STT
The 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.som
namereverseLookup(address)
β Get the.som
name 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
.som
suffix is automatically added in logicAll names are stored as full
.som
strings (e.g.erick.som
)
Next: Letβs install and use the SDK π
Last updated