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 name

  • reverseLookup(address) – Get the .som name assigned to a wallet address

  • isAvailable(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 logic

  • All names are stored as full .som strings (e.g. erick.som)


Next: Let’s install and use the SDK πŸ‘‡

Last updated