Repository navigation
names: available names carry the terms their buyer accepts - #2003
Open
brenzi-agent wants to merge 6 commits into
Open
brenzi-agent wants to merge 6 commits into
brenzi-agent wants to merge 6 commits into
Conversation
A bona fide community name can be registered only by someone who accepts the community terms its name policy keeps. NRAvailable gains bonaFideTerms_: the terms' text when it fits the answer, else the 0x hex keccak256 of the text; Nothing for any other name. Nothing is omitted from the JSON, so a plain name's answer is unchanged, and an answer without the field decodes as a plain name. Claude-Session: https://claude.ai/code/session_014JqabRiGc38JjH4KrE5LEU
…eeps The name policy keeps the community terms' text compressed in one zstd frame, and a buyer accepts the keccak256 of that frame. An available bona fide name carries the frame when it fits the answer, else its hash. ZstdTerms is base64url in JSON, as other bytes are. Claude-Session: https://claude.ai/code/session_014JqabRiGc38JjH4KrE5LEU
Every registration accepts terms, not only a bona fide name's. The name policy keeps the general name terms and the community terms, each as a zstd frame. NRAvailable's nameTerms is NTName with the general terms, or NTBonaFide with a bona fide name's community terms, which include them; either carries the frame when it fits the answer, else its hash. It is absent only from a router before v24. Claude-Session: https://claude.ai/code/session_014JqabRiGc38JjH4KrE5LEU
brenzi
marked this pull request as ready for review
October 29, 2026 16:50
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.
Every name can be registered only by someone who accepts the terms its name policy keeps: the community terms for a community name, the general terms for any other (simplex-network/ens-contracts#40, #42, #45, and the terms links of simplex-network/ens-contracts#47). A lookup answers an available name as plain
available, so a client cannot show the buyer which terms registering it means accepting.This PR adds those terms to name lookups, behind a new SMP version.
The first commits only change the type, for review before the rest. The name policy keeps two links, each to one file at one commit on git.simplex.chat, with the file's sha256 in the link: the general terms, and the community terms of community names, which include the relevant general ones. A buyer accepts the link's keccak256.
NRAvailablegainsnameTerms :: Maybe NameTerms, holding either:NTGeneralwith the general terms (JSON taggeneral);NTCommunitywith a community name's community terms (JSON tagcommunity).Either one carries a
TermsDoc:termsLink, the link the name policy keeps;termsZstd, the linked file in one zstd frame, when it fits the answer.A client hashes the link to accept the terms, and shows the frame's text after checking its sha256 against the link. A router that sends another link or file only makes that check or the acceptance fail: the name policy compares the accepted hash with the current one. The frame is base64url in JSON, as other bytes are. On the SMP wire it will travel outside the JSON, so it costs no base64: about 15.8 KB fits, and the 39 KB
PRIVACY.mdcompresses to 12.4 KB at zstd 19.nameTermsis absent only from a router before v24, asexpiresis from one before v22. The three tests that build anNRAvailableset it toNothing.Still to come, after the type is agreed:
RNAMEcarrying the frame as bytes after the JSON, and the router attaching the frame by what fits the block, directly and through a proxy;communityNamesand the applicable link (generalTermsLinkorcommunityTermsLink) from the name policy, fetching the file at the link's commit and checking its sha256;