Skip to content

Commit d06ce64

Browse files
committed
feat: SWIP-38
1 parent c095c4d commit d06ce64

1 file changed

Lines changed: 78 additions & 0 deletions

File tree

SWIPs/swip-38.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
SWIP: 37
3+
title: Resolve ENS BZZ text record as website root hash
4+
author: significance (@significance)>
5+
discussions-to: github pr
6+
status: Draft
7+
type: Standards Track
8+
category Interface
9+
created: 2025-04-08
10+
---
11+
12+
<!--You can leave these HTML comments in your merged SWIP and delete the visible duplicate text guides, they will not appear and may be helpful to refer to if you edit it again. This is the suggested template for new SWIPs. Note that a SWIP number will be assigned by an editor. When opening a pull request to submit your SWIP, please use an abbreviated title in the filename, `SWIP-draft_title_abbrev.md`. The title should be 44 characters or less.-->
13+
## Simple Summary
14+
<!--"If you can't explain it simply, you don't understand it well enough." Provide a simplified and layman-accessible explanation of the SWIP.-->
15+
Enhance gateway ENS functionality by deferencing a "bzz" ENS TEXT record as well as the currently supported content record with "bzz://" protocol prefix to enable ENS users to simultaneously use Swarm as well as other providers, eg. IPFS.
16+
17+
## Motivation
18+
<!--The motivation is critical for SWIPs that want to change the Swarm protocol. It should clearly explain why the existing protocol specification is inadequate to address the problem that the SWIP solves. SWIP submissions without sufficient motivation may be rejected outright.-->
19+
When the "content" field of ENS was conceived, it was not initally forseen that there would be multiple networks hosting the same website. With the addition of TEXT records to ENS, this became possible. There are two clear use cases, backwards compatibility/migration (eg. an IPFS user wants to migrate to Swarm but needs to support legacy users still using IPFS) and simultaneous hosting (e.g. a Swarm user wants to also support users that use IPFS).
20+
21+
## Specification
22+
<!--The technical specification should describe the syntax and semantics of any new feature. The specification should be detailed enough to allow competing, interoperable implementations for the current Swarm platform and future client implementations.-->
23+
24+
At present, when an ENS name is presented a Swarm gateway, the content hash is checked and, upon finding that it is a 32 byte hex value prefixed by the bzz protocol indicator "bzz://".
25+
26+
Now, if the content hash is empty, or not prefixed by bzz://, the ENS TEXT records will next be checked. Upon finding a record with key "bzz", which consists of a 32 byte hex value, handle this in the same way as if it as if it had been found in the content hash.
27+
28+
## Rationale
29+
<!--The rationale fleshes out the specification by describing what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work, e.g. how the feature is supported in other languages. The rationale may also provide evidence of consensus within the community, and should discuss important objections or concerns raised during discussion.-->
30+
31+
32+
## Backwards Compatibility
33+
<!--All SWIPs that introduce backwards incompatibilities must include a section describing these incompatibilities and their severity. The SWIP must explain how the author proposes to deal with these incompatibilities. SWIP submissions without a sufficient backwards compatibility treatise may be rejected outright.-->
34+
Since this is just an enhancement, and all prexisting functionality to deference ENS content hashes should be retained and preferred if present, there are no backwards compatibility considerations.
35+
36+
## Test Cases
37+
<!--Test cases for an implementation are mandatory for SWIPs that are affecting changes to data and message formats. Other SWIPs can choose to include links to test cases if applicable.-->
38+
ENS records
39+
40+
### Happy
41+
42+
#### success: render contenthash value as website
43+
44+
contenthash: valid and available swarm
45+
TEXT: bzz, valid and available
46+
47+
#### success: render TEXT value as website
48+
49+
contenthash: valid but unavailable swarm
50+
TEXT: bzz, valid and available hash
51+
52+
contenthash: invalid swarm (i.e. bzz://n0t4h4sh...)
53+
TEXT: bzz, valid and available hash
54+
55+
contenthash: invalid swarm (eg. valid IPFS or something else)
56+
TEXT: bzz, valid and available hash
57+
58+
contenthash: empty
59+
TEXT: bzz, valid and available hash
60+
61+
62+
63+
### Fail
64+
65+
#### fail: return error
66+
67+
contenthash: empty
68+
TEXT: bzz, invalid hash
69+
70+
contenthash: empty
71+
TEXT: bzz, valid but unavailable hash
72+
73+
74+
## Implementation
75+
tbc
76+
77+
## Copyright
78+
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).

0 commit comments

Comments
 (0)