Skip to content

Add .stonk domain resolution (self-owned root, same pattern as .sns) - #1525

Open
0xleventis wants to merge 4 commits into
solana-foundation:masterfrom
0xleventis:add-stonk-domain-support
Open

0xleventis wants to merge 4 commits into
solana-foundation:masterfrom
0xleventis:add-stonk-domain-support

Conversation

@0xleventis

Copy link
Copy Markdown

Replaces #1373, which was closed during a cleanup of old PRs. It uses the same branch and the same commit (0fa1004). Nothing in the code has changed.

On Greptile's ANS note from #1373: there are no .stonk names registered on ANS, so routing .stonk to its own root doesn't stop any existing name from resolving.

Description

Adds search/resolve support for .stonk domains — Stonk Names, a self-owned naming service on Solana built directly on the same canonical SPL Name Service program .sns and .sol (historically) used, independent of SNS and ANS.

This follows the exact pattern already established for .sns in sns-name-service.ts: a fixed parent name account (STONK_PARENT_NAME_ACCOUNT), the same hash/PDA derivation, the same 96-byte registry layout. The new stonk-name-service.ts reuses getHashedName/getNameAccountKey from sns-name-service.ts directly rather than duplicating them, since that logic is fully generic across any SPL Name Service root.

Changes

  • Adds app/entities/domain/lib/stonk-name-service.ts — TLD-specific helpers only (parseStonkLabel, formatStonkName, getStonkNameAccount), reusing the existing generic hash/PDA functions from sns-name-service.ts.
  • Adds STONK_PARENT_NAME_ACCOUNT to app/entities/domain/lib/constants.ts.
  • Routes .stonk in resolve-domain.ts's dispatcher, same shape as the existing .sns branch.
  • Adds a .stonk test suite to resolve-domain.test.ts mirroring the existing .sns tests, plus extends the routing test to cover all three paths (SNS/stonk/ANS derive to different addresses for the same label).

Behavior Changes

  • A name.stonk search on mainnet now shows the domain owner.
  • No existing behavior changes for .sns, .sol, or ANS domains.

Testing

  • test.stonk / leventis.stonk resolve via the new path; leventis.stonk is a real, independently-verifiable mainnet registration (account 2nJHMNjfgcVVTBUFGrFQNzeAM5a93Ma93DKTYgnDVSri, owner J152BBRTW8FJ5APogd5LNDBNErDv565mwAKTLmXwdwGP) — this PR's test fixture derives the same account address the real on-chain data has.
  • Non-existent .stonk names, short/malformed data, and mixed-case input are covered the same way the existing .sns tests cover them.
  • Existing .sns/.sol/ANS tests are unchanged and still pass.

Not included in this PR: the "domains owned by this address" reverse-lookup (the Domains tab) — that path calls Bonfida's hosted API for .sns rather than an on-chain scan, which is a larger, separate piece of work. Happy to follow up with that if this is a direction you're open to.

Checklist

  • My code follows the project's style guidelines (mirrors sns-name-service.ts directly)
  • I have added tests that prove my fix/feature works
  • All checks pass locally (pnpm test, pnpm lint, pnpm typecheck) — built via GitHub's Contents API rather than a local checkout; please let me know if CI surfaces anything and I'll fix promptly
  • I have run build:info script to update build information

@greptile-apps

greptile-apps Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no actionable issues were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Adds .stonk owner lookup through a fixed SPL Name Service root.

  • Searches now resolve .stonk names to their owners.

Acknowledged scope from 0xleventis: routing .stonk away from ANS is intentional because no existing ANS registrations use it. Adding owned .stonk names to the Domains tab is explicitly deferred.

Reviews (1) · Last reviewed commit: "Add .stonk test cases" · Reviewed by Greptile

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant