Skip to content

extend SMP protocol to support name availability queries - #1863

Draft
brenzi wants to merge 20 commits into
ab/snrc-resolver-expiry-and-availabilityfrom
ab/snrc-resolver-SMP-NAVL
Draft

extend SMP protocol to support name availability queries#1863
brenzi wants to merge 20 commits into
ab/snrc-resolver-expiry-and-availabilityfrom
ab/snrc-resolver-SMP-NAVL

Conversation

@brenzi

@brenzi brenzi commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Let users query name availability by labelhash (without revealing plaintext name unless it resolves)
They should get a precise answer with details in all possible cases (expired, grace, auction, reserved)

  • also lets resolver report auction info: Name is available, but at premium price - or wait.

Assumes these get merged and deployed for .simplex, but PR works against .testing names as well.

Comment thread src/Simplex/Messaging/Server/Names.hs Outdated
Comment thread src/Simplex/Messaging/Server/Names.hs Outdated
Comment thread src/Simplex/Messaging/Protocol.hs Outdated
Comment thread src/Simplex/Messaging/Protocol.hs Outdated
Comment thread src/Simplex/Messaging/Protocol.hs Outdated
Comment thread src/Simplex/Messaging/Protocol.hs Outdated
Comment thread src/Simplex/Messaging/Protocol.hs Outdated
Comment thread src/Simplex/Messaging/Protocol.hs Outdated
Comment thread src/Simplex/Messaging/Protocol.hs Outdated
brenzi and others added 7 commits September 7, 2026 14:20
Co-authored-by: Evgeny <evgeny@poberezkin.com>
Co-authored-by: Evgeny <evgeny@poberezkin.com>
Co-authored-by: Evgeny <evgeny@poberezkin.com>
Co-authored-by: Evgeny <evgeny@poberezkin.com>
Co-authored-by: Evgeny <evgeny@poberezkin.com>
Comment thread src/Simplex/Messaging/Protocol.hs Outdated
Comment thread src/Simplex/Messaging/Protocol.hs Outdated
Comment thread src/Simplex/Messaging/Protocol.hs Outdated

instance Encoding NamePricing where
smpEncode NamePricing {rentPrices, minLabelLength} =
smpEncodeList rentPrices <> smpEncode (fromIntegral minLabelLength :: Word16)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
smpEncodeList rentPrices <> smpEncode (fromIntegral minLabelLength :: Word16)
smpEncode (EncList rentPrices, fromIntegral minLabelLength :: Word16)

Comment thread src/Simplex/Messaging/Protocol.hs Outdated
Comment thread src/Simplex/Messaging/Protocol.hs Outdated
Comment thread src/Simplex/Messaging/Protocol.hs Outdated
Comment thread src/Simplex/Messaging/Protocol.hs Outdated
Comment thread src/Simplex/Messaging/Protocol.hs
strP = parseDomain . safeDecodeUtf8 <$?> boundedNonSpace
where
parseDomain s = AT.parseOnly (nameLabelP `AT.sepBy1` AT.char '.' <* AT.endOfInput) s >>= mkDomain
parseDomain s = AT.parseOnly ((labelHashP <|> nameLabelP) `AT.sepBy1` AT.char '.' <* AT.endOfInput) s >>= mkDomain

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we cannot change this instance to allow parsing hash as name, SimplexDomain should only be used to represent names, not their hashes. It's used in UI that should not accept hashes.

"simplex" : name : sub -> registryDomain TLDSimplex name sub
"testing" : name : sub -> registryDomain TLDTesting name sub
_
| any isLabelHash lowered -> Left "labelhash requires a registry TLD"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment here

lowered = map T.toLower labels
-- Only the second-level label is a registry key, so only it may be hashed.
registryDomain tld name sub
| any isLabelHash sub = Left "only the second-level label may be a labelhash"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

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.

2 participants