Skip to content

gonkalabs/gns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Gonka Name Service (GNS) Contract

CosmWasm smart contract powering the Gonka Name Service used by gonka.gg/names. This is a product by gonkalabs.com.

GNS lets users register human-readable .gnk names (for example, mike.gnk) that resolve to gonka1... addresses, set reverse lookup, manage text records, and trade names via an on-chain marketplace. More than 1300 names are already registered.

Contract Address

Features

  • Register available .gnk names
  • Resolve name -> address
  • Set reverse lookup (address -> primary name)
  • Set and delete text records (profile metadata)
  • Transfer names between accounts
  • List, delist, and buy names in a native token marketplace
  • Admin-configurable registration controls and fees

Contract Overview

  • Name format: 3-63 chars, lowercase a-z, digits 0-9, and -
  • .gnk suffix is optional in inputs; contract normalizes both mike and mike.gnk
  • Registration uses a flat fee in configured native denom
  • Overpayment is refunded
  • Names are currently set to never expire in contract logic (expires_at = u64::MAX)
  • Marketplace sales are peer-to-peer transfers with seller payout in the configured denom

Instantiate

{
  "admin": "optional_admin_address",
  "denom": "ngonka",
  "registration_fee": "1000000000",
  "grace_period": 2592000
}
  • admin (optional): defaults to sender
  • denom: native chain denom used for fees and sales
  • registration_fee (optional): defaults to 1000000000 (1 GNK if 9 decimals)
  • grace_period (optional): defaults to 30 days (seconds)

Execute Messages

  • register { name, address? }
  • set_address { name, address }
  • set_record { name, key, value }
  • delete_record { name, key }
  • transfer { name, new_owner }
  • set_primary { name }
  • list_for_sale { name, price }
  • delist_from_sale { name }
  • buy { name }
  • update_config { admin?, registration_fee?, grace_period?, registration_open? } (admin only)

Query Messages

  • resolve { name }
  • reverse_lookup { address }
  • is_available { name }
  • get_record { name, key }
  • marketplace { start_after?, limit? }
  • config {}

Build

Prerequisites:

  • Rust toolchain
  • wasm32-unknown-unknown target
  • Optional: wasm-opt (Binaryen) for size optimization

Build contract:

RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown --lib

WASM output:

  • target/wasm32-unknown-unknown/release/gns_contract.wasm

Test

Run unit tests:

cargo test

Deployment Notes

When deploying, make sure your instantiate message matches this contract's current InstantiateMsg fields (denom, registration_fee, grace_period, optional admin).

Repository Hygiene

Recommended ignore paths:

  • target/
  • local env/secret files

See CONTRIBUTING.md and SECURITY.md for contribution and vulnerability reporting guidance.

About

Gonka Name Service - Smart contract powering gonka.gg/names

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages