Repository navigation
feat(registry): subname registration under parent namesΒ #4
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
Every payment app on Stellar could issue names to its users (bob.qiuckex.sid) instead of making them compete for top-level names. The registry stores bare names only β there is no hierarchy. Subnames turn every registrant into a distribution channel and are the adoption engine for the whole protocol.
Desired outcome: a name owner can register subnames under their name (register_subname(parent, sub, owner, address, memo)), bounded by a per-parent cap to keep storage bounded; subnames resolve like top-level names via their full dotted key.
Scope
- Crate/module:
crates/registry,src/lib.rs - API:
register_subname(parent, sub, owner, address, memo),set_subname_address(parent, sub, ...),unset_subname(parent, sub);resolveaccepts dotted input (bob.parent.sidβ keybob.parent) - Storage: subnames stored as full-string keys (
"bob.parent") in the sameDataKey::Namenamespace β no new key shape; parent gains aSubCountinstance key - Tests: owner-auth on parent for all three entrypoints; cap enforcement (
MAX_SUBNAMES_PER_PARENT); sub of missing parent βNotFound; subname resolves via dottedresolve;validate_nameextended (dots only as separators, no empty labels); subname cannot itself be a parent (one level only β documented) - Docs: subname section + updated validation rules
Non-goals
- Multi-level nesting (
a.b.c.sid) β one level only for this tranche - Subname fees (inheritance of pricing is a later design decision)
- Subname transfer independent of parent
- Off-chain subnames (L2/merkle approaches)
What "done" looks like
-
register_subnamerequires parent-owner auth; stores key"{sub}.{parent}" - Parent
SubCountenforced against a documentedMAX_SUBNAMES_PER_PARENTconstant; exceeding β newSubnameCapReachederror (next free code) -
resolve("bob.parent")(and dottedresolveinput with.sidstripped) returns the subname record -
unset_subnamedeletes the record and decrements the count; owner-auth required - Existing names unaffected;
validate_namerejects malformed dotted input (empty labels, leading/trailing dots) - New tests: cap, auth, dotted resolution, validation matrix
- All gates pass
Implementation guidelines
- Keep subnames in the SAME
DataKey::Name(String)map β dotted keys makeresolveuniform and avoid a second storage class total_namessemantics decision: count only top-level names (document it) β subnames getsub_count(parent)- Dot-handling belongs in
validate_name's caller: split input into labels, validate each with the existing 3β32/charset rule except the LAST label (sub label may be shorter? β document your choice, min 1β2 chars is defensible) - TTL: subname writes extend their own keys; parent-owner check reads the parent's Owner key (existing TTL rules apply)
Verification
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test -p sidera-registry --all-targets --locked
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 #4. - All CI checks must pass; human maintainer review required.
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 take on issue #4 to enable hierarchical subname registration under parent domain records (e.g.
user.app.sid).Technical Implementation Plan:
DataKey::Subname(String, String)representing(parent, sublabel).parent_owner.require_auth()during subname creation and administrative revocations.resolveto recursively or deterministically resolve dot-separated labels, maintaining backward compatibility with bare names.cargo fmt,cargo clippy -D warnings, andcargo test -p sidera-registry.Track Record
Recently delivered and merged Soroban smart contract contributions:
Ready to implement upon assignment. Could you please assign this issue to me?