HIP018 re-record Add narrow Rerecord A and AAAA support - #955
HIP018 re-record Add narrow Rerecord A and AAAA support#955shadstoneofficial wants to merge 1 commit into
Conversation
|
Thank you for putting this together. Excited about this! |
|
Approved. Also please add TLSA and MX records |
|
I like this idea! |
|
love to see this happen, what does it take to get this live? |
|
I really like this proposal. I hope the administrator can review and merge this proposal. |
|
Thanks for submitting this change. My only concern is about the undocumented necessary order in the record types. If a domain has A/AAAA and other record type, the A/AAAA needs to appear last. But than we merge and release a new version of HSD, a few weeks later someone else creates a PR to support MX, which needs to be new latest. After that a new PR for TLSA. None of them break the version rule and old nodes will parse as much as they know before stopping. This is not a deal break, just a concern point. |
|
+1 on the ordering concern. It’s a valid long-term issue with the v0 extension approach. Suggestion: Since this PR is already adding new record types, would it make sense to also include the next likely ones (MX and TLSA) in the same change? That would let us define the canonical ordering rule now instead of rediscovering it with every future record-type PR. Proposed type numbersDS: 0
NS: 1
GLUE4: 2
GLUE6: 3
SYNTH4: 4
SYNTH6: 5
TXT: 6
A: 7
AAAA: 8
MX: 9
TLSA: 10Recommended rule to documentAlways serialize records in ascending type-ID order. This gives older nodes the best compatibility: they parse as many records as they understand and stop cleanly at the first unknown type. Example: {
"records": [
{ "type": "TXT", "txt": ["v=spf1 ..."] },
{ "type": "A", "address": "192.0.2.1" },
{ "type": "AAAA", "address": "2001:db8::1" },
{ "type": "MX", "preference": 10, "exchange": "mail.example." },
{ "type": "TLSA", "usage": 3, "selector": 1, "matchingType": 1, "certificate": "d2abde..." }
]
}Benefits
If adding MX/TLSA is out of scope here, then this PR should at least clearly document the “ascending type-ID order” rule and ideally include a helper like What do you think? |
|
this is what we've been waiting for ! I do not recall anyone over the years against this - this gives more value and usage to onchain transactions |
|
Thanks, this is a very fair concern. I agree the v0 extension path needs a clear ordering rule, otherwise every future record-type PR can accidentally create a new compatibility edge case. My preference for this PR is to keep the implementation narrow at A/AAAA only, then document and test the forward-compatibility rule explicitly:
I think adding MX/TLSA is valuable, but I would rather not expand this PR yet. The goal here is to make the smallest useful HIP018 step that gives direct apex A/AAAA resolution without mixing in email/DANE semantics, additional validation rules, or a larger review surface. That said, I agree this PR should not leave ordering implicit. A good next update here would be:
For MX/TLSA, I think those should be a follow-up HIP018 extension PR using the same rule, for example: DS: 0
NS: 1
GLUE4: 2
GLUE6: 3
SYNTH4: 4
SYNTH6: 5
TXT: 6
A: 7
AAAA: 8
MX: 9
TLSA: 10So I am supportive of MX/TLSA, but I think A/AAAA should land first as the conservative base layer. |
|
re: what does it take to go live The practical path is:
This PR intentionally avoids the broader PR #952-style changes. No supply/foundation/fund changes, no tree interval changes, just the narrow A/AAAA Rerecord path. |
|
I guess it should have been implemented much earlier. I don't see any negative in this from usage point of view. Those who are not in favor or opposing this, what's their point ? |
===> I am also in favor of this - but to put the other side of the argument : I believe I had heard from JJ or someone - back in 2018 when the chain was being outlined, a DNS representative visited them for a long day session and explained there is no need for these records on the root - that it was meant for the TLD owners to then host these. More like ICANN is now. The second reason is this will add more space on the chain to host - but I feel that is negligible and it gives more utility and mining fees to the chain. |
|
I this this feature is cool! |
|
This proposal is logical and appropriate. If implemented, it would also broaden the use-case potential for every name on the chain. As for adding other records like mx and tsla, please do so. Now is the moment to address records in general. |
|
Thanks everyone. Reading the comments, I think there is clear support for the core HIP018/Rerecord direction, and I also hear the concern that approval cycles are slow enough that we should not create unnecessary follow-up bottlenecks. My current view is:
So I am open to either path, depending on what maintainers prefer:
The proposed type order would be: DS: 0
NS: 1
GLUE4: 2
GLUE6: 3
SYNTH4: 4
SYNTH6: 5
TXT: 6
A: 7
AAAA: 8
MX: 9
TLSA: 10Either way, I think we should treat the ascending type-ID order as the blanket compatibility rule for v0 resource extensions. That lets us move A/AAAA now and gives MX/TLSA a clear path without reopening the same ordering discussion every time. This remains separate from PR #952-style changes. No supply/foundation/fund changes, no tree interval changes, and no tokenomics changes are being proposed here. |
|
When hsd is parsing the DNS records, it stops at the first unknown record and don't parse anything else. Don't throw an error, just returns the previous records. This creates a problem where a DNS record could be hidden under a new record type. Which could cause wrong NSEC/NSEC3 signatures: a new hsd resolver would return the TXT and sign the records while an old hsd would not return and sign confirming it doesn't exists. I'm not sure what would be the consequence if the DS record appear last, or a second DS record appear last. My suggestion is: we need to ensure the records are parsed only if they respect the order. Note: TLSA isn't that useful, since its only use is for DANE, which also needs name like Edit: addressing the previous comment: my suggestion is:
I'd say all at once, but 2 and 3 could be extract to a new PR, as long as we merge it first. |
|
This makes sense, thanks for spelling it out. I agree this is more than just a documentation issue. The hidden-record example is a good reason to enforce the ordering rule in code, not only recommend it for wallets/UIs. If an older node stops at the first unknown type, then a newer node should not keep accepting lower-numbered/older record types that appear after a newer type. Otherwise the two versions can disagree about which records exist, including denial/NSEC behavior. So I think the right rule is:
Using your example, I also agree TLSA can wait. Without on-chain record owner names/subdomains like So a revised path could be:
That seems like a better compatibility rule than just documenting the preferred order. |
|
Great initiative! Less dependencies of centralized infrastructure is always a good thing for Handshake. |
|
Excellent work keeping the scope focused while maintaining compatibility and clear delegation behavior. Looking forward to seeing HNS evolve further. |
|
This requires a new version, imo. Relying on the order of records is not desirable.
There is no need to mix delegation with direct records and this allows for a clean separation. Version
We should also consider adding other record types like |
|
Thanks rhymincymon , this is a helpful framing. I agree that a true v1 resource format could be cleaner than continuing to stretch v0 forever, especially if we want owner labels/subdomains, TTLs, HTTPS/SVCB/ECH, TLSA, and a clean direct-resolution mode. One small clarification: v0 is not purely delegation-only today. It already has TXT and synthetic records, and hsd can answer TXT directly when there is no NS delegation. But I agree with the larger point that delegation records and direct-resolution records are conceptually different and a v1 format could separate them more cleanly. My concern is scope. A v1 format with optional labels, TTL handling, TLSA, HTTPS/ECH, and direct-vs-delegation rules is more than a small hsd patch. That sounds like a spec/HIP design pass first, then an implementation PR after the details are agreed. So I think there are two possible paths:
I am open to either path if maintainers prefer it. I just want to avoid quietly turning this PR into a full v1 serialization redesign without a written spec everyone can review. On TLSA/HTTPS/ECH: I agree they are worth discussing, but they seem to depend on the owner-label/subdomain model. For example TLSA commonly needs names like |
|
I'm all for the second path. Without a |
|
Thank you for keeping HNS alive and suggesting improvements. I will also be using the new Shakedex download that Mike made available to host my collection of foreign language domains. |
|
Following up on the v1 / second-path discussion here, I opened a separate docs/spec PR for resource v1 direct resolution: #956 I kept it as a proposal rather than rewriting this implementation PR, so the larger design questions can be reviewed directly: version If maintainers prefer the v1 path, #956 can supersede this narrow v0-compatible A/AAAA implementation path. If maintainers still prefer a staged implementation, this PR can remain the smaller prototype/reference. |
|
Thanks again for the v1 framing here. To make this easier to review separately, I opened #956 as a docs/spec proposal for the second path rhymincymon suggested. That proposal treats #955 as the narrow A/AAAA prototype/reference, but moves the broader path into a resource version
If maintainers and reviewers prefer this second path, I think #956 is the better place to move that design forward, and #955 can remain useful as implementation context / proof of feasibility rather than being expanded into a full serialization redesign. |
Summary
Implements a narrow HIP018 / Rerecord v1 path for
hsd.This adds support for TLD-level
AandAAAAresource records so a Handshake TLD owner can point the bare TLD directly at IPv4/IPv6 addresses without running a separate nameserver.Scope
This PR intentionally keeps the scope small:
A = 7AAAA = 80Out Of Scope
This is not the broader #952 proposal.
This PR does not include:
Compatibility
Current resource version
0decoding stops at the first unknown record type.To preserve the best legacy behavior, writers should continue serializing legacy-known records first, then A/AAAA after them.
Example:
{ "records": [ {"type": "TXT", "txt": ["legacy-compatible data first"]}, {"type": "A", "address": "203.0.113.10"}, {"type": "AAAA", "address": "2001:db8::10"} ] }Older software should decode the known prefix and stop at the unknown record type. Upgraded software decodes the full resource.
DNS Behavior
If a resource has no NS delegation,
hsdcan answer A/AAAA at the TLD apex:If a resource has NS delegation, referral behavior wins and A/AAAA are not answered directly from the root resource.
Tests
Passed:
Passed:
Full test suite was attempted locally:
The local full-suite failures appear environmental: Bob was already listening on
127.0.0.1:12037, causingEADDRINUSEand downstream SPV timeouts. The focused Rerecord/resource/resolver tests passed cleanly.Review Questions
0the preferred compatibility path?A = 7andAAAA = 8acceptable type assignments?