Repository navigation
feat(registry): add name pricing with length-based registration feesΒ #1
Copy link
Copy link
Open
Labels
complexity: mediumStandard features or involved bug fixes (150 pts)Standard features or involved bug fixes (150 pts)enhancementNew feature or requestNew feature or requestexternal-contributorsSuitable for contributors outside the maintainer teamSuitable for contributors outside the maintainer team
Description
π Sidera β Stellar Name Service. Contribute via Drips Wave / GrantFox. Comment with your approach and wait for assignment before starting.
Description
Registration is currently free (register charges nothing), which invites name-squatting: one account can register thousands of short valuable names (bob, xlm, usdc) at zero cost. A paid registry needs a length-based fee β shorter names cost more β so scarcity is priced instead of grabbed.
Desired outcome: register requires an XLM payment attached to the invocation, priced by a public length-tier function, with the fee held by the contract (treasury distribution is a separate tranche).
Scope
- Crate/module:
crates/registry,src/lib.rs - API: new
fn price_for(env, name) -> i128read-only view;registergains a fee check on the attached payment - Storage: new
DataKey::FeeConfig(instance) for tier boundaries; contract XLM balance implicitly holds fees - Tests: pricing tiers (3β4 / 5β7 / 8β31 / 32 chars), insufficient-payment rejection, exact-payment acceptance, config update gated by admin auth
- Docs:
docs/pricing section + README note
Non-goals
- Fee distribution/treasury (separate issue)
- USDC or other token pricing
- Renewal fees (separate issue)
- Auctions or premium-name lists
What "done" looks like
-
price_forreturns deterministic tiers, e.g. len 3β4: 100 XLM-stroops scale, documented constants -
registerrejects underpayment with a newRegistryError::InsufficientFee(code 6) - Overpayment is accepted and NOT refunded (documented) or rejected β pick one, document it, test it
- Fee config update requires admin authorization
- Unit tests cover every tier boundary and both payment paths
-
cargo fmt --all -- --check, clippy-D warnings, full tests pass - WASM builds for wasm32v1-none and stays under 150 KB
Implementation guidelines
- Follow the existing pattern: validate β
require_authβ mutate β write (seeregisterinsrc/lib.rs) - Reuse the workspace error style in
RegistryError; add the variant at the next free code - Use
env.storage().instance()forFeeConfig(small hot config), consistent withDataKey::Count - Attached-payment checks: use the native XLM contract address via
token::StellarAssetClient/Clientpatterns already present in the SDK; do not introduce new dependencies - Keep all fallible validation before any storage mutation
Verification
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test -p sidera-registry --all-targets --locked
cargo build --locked --release --target wasm32v1-none -p sidera-registry
PR guidelines
- Get assigned before starting; do not start work on a reserved issue.
- Work in a fork; branch off
upstream/main; open the PR againstSidera-Protocol/sidera-contracts:main. - PR description must include
Closes #1. - All CI checks must pass; a human maintainer review is required (see CONTRIBUTING.md).
Metadata
- Affected crates/files:
contracts/registry/src/lib.rs,docs/ - Complexity label:
complexity: medium(150 base points) - Type labels:
enhancement
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
complexity: mediumStandard features or involved bug fixes (150 pts)Standard features or involved bug fixes (150 pts)enhancementNew feature or requestNew feature or requestexternal-contributorsSuitable for contributors outside the maintainer teamSuitable for contributors outside the maintainer team
Activity
Rodrigoue9 commentedon Oct 7, 2026
Hi @maintainer! I would like to implement length-based pricing tiers for domain registration.
Technical Outline:
calculate_fee(name: &String) -> i128):token::Client::new(&env, &token_address).transfer(&owner, &treasury, &fee)duringregister.Track Record
Looking forward to your assignment!