Repository navigation
Add .stonk domain resolution (self-owned root, same pattern as .sns) - #1525
Open
0xleventis wants to merge 4 commits into
Open
0xleventis wants to merge 4 commits into
0xleventis wants to merge 4 commits into
Conversation
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryAdds
Acknowledged scope from Reviews (1) · Last reviewed commit: "Add .stonk test cases" · Reviewed by Greptile |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
.stonknames registered on ANS, so routing.stonkto its own root doesn't stop any existing name from resolving.Description
Adds search/resolve support for
.stonkdomains — Stonk Names, a self-owned naming service on Solana built directly on the same canonical SPL Name Service program.snsand.sol(historically) used, independent of SNS and ANS.This follows the exact pattern already established for
.snsinsns-name-service.ts: a fixed parent name account (STONK_PARENT_NAME_ACCOUNT), the same hash/PDA derivation, the same 96-byte registry layout. The newstonk-name-service.tsreusesgetHashedName/getNameAccountKeyfromsns-name-service.tsdirectly rather than duplicating them, since that logic is fully generic across any SPL Name Service root.Changes
app/entities/domain/lib/stonk-name-service.ts— TLD-specific helpers only (parseStonkLabel,formatStonkName,getStonkNameAccount), reusing the existing generic hash/PDA functions fromsns-name-service.ts.STONK_PARENT_NAME_ACCOUNTtoapp/entities/domain/lib/constants.ts..stonkinresolve-domain.ts's dispatcher, same shape as the existing.snsbranch..stonktest suite toresolve-domain.test.tsmirroring the existing.snstests, plus extends the routing test to cover all three paths (SNS/stonk/ANS derive to different addresses for the same label).Behavior Changes
name.stonksearch on mainnet now shows the domain owner..sns,.sol, or ANS domains.Testing
test.stonk/leventis.stonkresolve via the new path;leventis.stonkis a real, independently-verifiable mainnet registration (account2nJHMNjfgcVVTBUFGrFQNzeAM5a93Ma93DKTYgnDVSri, ownerJ152BBRTW8FJ5APogd5LNDBNErDv565mwAKTLmXwdwGP) — this PR's test fixture derives the same account address the real on-chain data has..stonknames, short/malformed data, and mixed-case input are covered the same way the existing.snstests cover them..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
.snsrather 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
sns-name-service.tsdirectly)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 promptlybuild:infoscript to update build information