docs.waku.org/assets/js/a44b8792.24d52410.js
2024-02-20 09:23:32 +00:00

1 line
7.0 KiB
JavaScript

"use strict";(self.webpackChunkwaku_guide=self.webpackChunkwaku_guide||[]).push([[5787],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>v});var r=n(67294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=r.createContext({}),c=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},d=function(e){var t=c(e.components);return r.createElement(s.Provider,{value:t},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,a=e.originalType,s=e.parentName,d=l(e,["components","mdxType","originalType","parentName"]),p=c(n),m=o,v=p["".concat(s,".").concat(m)]||p[m]||u[m]||a;return n?r.createElement(v,i(i({ref:t},d),{},{components:n})):r.createElement(v,i({ref:t},d))}));function v(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=n.length,i=new Array(a);i[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[p]="string"==typeof e?e:o,i[1]=l;for(var c=2;c<a;c++)i[c]=n[c];return r.createElement.apply(null,i)}return r.createElement.apply(null,n)}m.displayName="MDXCreateElement"},33447:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>c,default:()=>f,frontMatter:()=>s,metadata:()=>d,toc:()=>u});var r=n(87462),o=(n(67294),n(3905));const a={toc:[]},i="wrapper";function l(e){let{components:t,...n}=e;return(0,o.kt)(i,(0,r.Z)({},a,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("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"}),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},"DNS lookup query to retrieve TXT data stored on ",(0,o.kt)("inlineCode",{parentName:"li"},"example.com")," domain."),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("inlineCode",{parentName:"li"},"enrtree-root")," is returned, and the value of ",(0,o.kt)("inlineCode",{parentName:"li"},"e")," is the ",(0,o.kt)("inlineCode",{parentName:"li"},"enr-root"),", the root hash of the node subtree."),(0,o.kt)("li",{parentName:"ol"},"DNS lookup query to retrieve TXT data stored on ",(0,o.kt)("inlineCode",{parentName:"li"},"<enr-root>.example.com")," domain."),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("inlineCode",{parentName:"li"},"enrtree-branch")," is returned; this tree contains hashes of node subtrees."),(0,o.kt)("li",{parentName:"ol"},"DNS lookup query to retrieve TXT data stored on ",(0,o.kt)("inlineCode",{parentName:"li"},"DU...VQ.example.com")," domain, the first leaf of ",(0,o.kt)("inlineCode",{parentName:"li"},"enrtree-branch"),"."),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("inlineCode",{parentName:"li"},"enr")," record is returned."),(0,o.kt)("li",{parentName:"ol"},"Returned value is decoded, and peer connection details such as IP address and port are learned.")))}l.isMDXComponent=!0;const s={title:"DNS Discovery",hide_table_of_contents:!0},c=void 0,d={unversionedId:"learn/concepts/dns-discovery",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, using the standardised ENR format.",source:"@site/docs/learn/concepts/dns-discovery.md",sourceDirName:"learn/concepts",slug:"/learn/concepts/dns-discovery",permalink:"/learn/concepts/dns-discovery",draft:!1,editUrl:"https://github.com/waku-org/docs.waku.org/tree/develop/docs/learn/concepts/dns-discovery.md",tags:[],version:"current",lastUpdatedAt:1700737292,formattedLastUpdatedAt:"23 Nov 2023",frontMatter:{title:"DNS Discovery",hide_table_of_contents:!0},sidebar:"learn",previous:{title:"Static Peers",permalink:"/learn/concepts/static-peers"},next:{title:"Discv5",permalink:"/learn/concepts/discv5"}},p={},u=[{value:"Pros",id:"pros",level:4},{value:"Cons",id:"cons",level:4},{value:"Overview",id:"overview",level:2}],m={toc:u},v="wrapper";function f(e){let{components:t,...n}=e;return(0,o.kt)(v,(0,r.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"Built upon the foundation of ",(0,o.kt)("a",{parentName:"p",href:"https://eips.ethereum.org/EIPS/eip-1459"},"EIP-1459: Node Discovery via DNS"),", DNS Discovery allows the retrieval of an ",(0,o.kt)("inlineCode",{parentName:"p"},"ENR")," tree from the ",(0,o.kt)("inlineCode",{parentName:"p"},"TXT")," field of a domain name. This innovative approach enables the storage of essential node connection details, including IP, port, and multiaddr, using the standardised ",(0,o.kt)("a",{parentName:"p",href:"https://rfc.vac.dev/spec/31/"},"ENR format"),"."),(0,o.kt)("p",null,"This bootstrapping method allows anyone to register and publish a domain name for the network, promoting increased decentralisation."),(0,o.kt)("h4",{id:"pros"},"Pros"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"Low latency, low resource requirements."),(0,o.kt)("li",{parentName:"ul"},"Easy bootstrap list updates by modifying the domain name, eliminating the need for code changes."),(0,o.kt)("li",{parentName:"ul"},"Ability to reference a larger list of nodes by including other domain names in the code or ENR tree.")),(0,o.kt)("h4",{id:"cons"},"Cons"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"Vulnerable to censorship: Domain names can be blocked or restricted."),(0,o.kt)("li",{parentName:"ul"},"Limited scalability: The listed nodes are at risk of being overwhelmed by receiving all queries. Also, operators must provide their ",(0,o.kt)("inlineCode",{parentName:"li"},"ENR")," to the domain owner for listing.")),(0,o.kt)("h2",{id:"overview"},"Overview"),(0,o.kt)(l,{mdxType:"DNSDiscovery"}))}f.isMDXComponent=!0}}]);