docs.waku.org/assets/js/a44b8792.68cd68b6.js
2025-08-13 03:52:48 +00:00

1 line
5.4 KiB
JavaScript

"use strict";(self.webpackChunkwaku_guide=self.webpackChunkwaku_guide||[]).push([[7092],{23229:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>p,frontMatter:()=>c,metadata:()=>r,toc:()=>h});const r=JSON.parse('{"id":"learn/concepts/dns-discovery","title":"DNS Discovery","description":"Built upon the foundation of EIP-1459: Node Discovery via DNS, DNS Discovery allows the retrieval of an ENR tree from the TXT field of a domain name. This innovative approach enables the storage of essential node connection details, including IP, port, and multiaddr.","source":"@site/docs/learn/concepts/dns-discovery.md","sourceDirName":"learn/concepts","slug":"/learn/concepts/dns-discovery","permalink":"/learn/concepts/dns-discovery","draft":false,"unlisted":false,"editUrl":"https://github.com/waku-org/docs.waku.org/tree/develop/docs/learn/concepts/dns-discovery.md","tags":[],"version":"current","lastUpdatedAt":null,"frontMatter":{"title":"DNS Discovery","hide_table_of_contents":true},"sidebar":"learn","previous":{"title":"Static Peers","permalink":"/learn/concepts/static-peers"},"next":{"title":"Discv5","permalink":"/learn/concepts/discv5"}}');var t=o(74848),i=o(28453);function s(e){const n={code:"code",li:"li",mermaid:"mermaid",ol:"ol",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.mermaid,{value:"sequenceDiagram\n Waku Node->>DNS Server: (1) Lookup TXT example.com\n DNS Server--\x3e>Waku Node: (2) enrtree-root:v1 e=U3...3Y ...\n Waku Node->>DNS Server: (3) Lookup TXT U3...3Y.example.com\n DNS Server--\x3e>Waku Node: (4) enrtree-branch:DU...VQ,J3..HU,IC...WE\n Waku Node->> DNS Server: (5) Lookup TXT DU...VQ.example.com\n DNS Server--\x3e>Waku Node: (6) enr:-M-4QLdAB-Kyz...Wt1Mg8\n Waku Node ->> Waku Node: (7) Decode ENR: Peer's connection details"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["DNS lookup query to retrieve TXT data stored on ",(0,t.jsx)(n.code,{children:"example.com"})," domain."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"enrtree-root"})," is returned, and the value of ",(0,t.jsx)(n.code,{children:"e"})," is the ",(0,t.jsx)(n.code,{children:"enr-root"}),", the root hash of the node subtree."]}),"\n",(0,t.jsxs)(n.li,{children:["DNS lookup query to retrieve TXT data stored on ",(0,t.jsx)(n.code,{children:"<enr-root>.example.com"})," domain."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"enrtree-branch"})," is returned; this tree contains hashes of node subtrees."]}),"\n",(0,t.jsxs)(n.li,{children:["DNS lookup query to retrieve TXT data stored on ",(0,t.jsx)(n.code,{children:"DU...VQ.example.com"})," domain, the first leaf of ",(0,t.jsx)(n.code,{children:"enrtree-branch"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"enr"})," record is returned."]}),"\n",(0,t.jsx)(n.li,{children:"Returned value is decoded, and peer connection details such as IP address and port are learned."}),"\n"]})]})}function d(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(s,{...e})}):s(e)}const c={title:"DNS Discovery",hide_table_of_contents:!0},a=void 0,l={},h=[{value:"Pros",id:"pros",level:4},{value:"Cons",id:"cons",level:4},{value:"Overview",id:"overview",level:2}];function u(e){const n={a:"a",code:"code",h2:"h2",h4:"h4",li:"li",p:"p",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["Built upon the foundation of ",(0,t.jsx)(n.a,{href:"https://eips.ethereum.org/EIPS/eip-1459",children:"EIP-1459: Node Discovery via DNS"}),", DNS Discovery allows the retrieval of an ",(0,t.jsx)(n.code,{children:"ENR"})," tree from the ",(0,t.jsx)(n.code,{children:"TXT"})," field of a domain name. This innovative approach enables the storage of essential node connection details, including IP, port, and multiaddr."]}),"\n",(0,t.jsx)(n.p,{children:"This bootstrapping method allows anyone to register and publish a domain name for the network, promoting increased decentralisation."}),"\n",(0,t.jsx)(n.h4,{id:"pros",children:"Pros"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Low latency, low resource requirements."}),"\n",(0,t.jsx)(n.li,{children:"Easy bootstrap list updates by modifying the domain name, eliminating the need for code changes."}),"\n",(0,t.jsx)(n.li,{children:"Ability to reference a larger list of nodes by including other domain names in the code or ENR tree."}),"\n"]}),"\n",(0,t.jsx)(n.h4,{id:"cons",children:"Cons"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Vulnerable to censorship: Domain names can be blocked or restricted."}),"\n",(0,t.jsxs)(n.li,{children:["Limited scalability: The listed nodes are at risk of being overwhelmed by receiving all queries. Also, operators must provide their ",(0,t.jsx)(n.code,{children:"ENR"})," to the domain owner for listing."]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"overview",children:"Overview"}),"\n","\n",(0,t.jsx)(d,{})]})}function p(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},28453:(e,n,o)=>{o.d(n,{R:()=>s,x:()=>d});var r=o(96540);const t={},i=r.createContext(t);function s(e){const n=r.useContext(i);return r.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:s(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]);