|
| 1 | +import { BlogPostLayout } from '@/components/BlogPostLayout' |
| 2 | +import { MotionCanvas } from '@/components/MotionCanvas' |
| 3 | + |
| 4 | +export const post = { |
| 5 | + draft: false, |
| 6 | + author: 'ramfox, matheus23', |
| 7 | + date: '2025-02-25', |
| 8 | + title: 'iroh 0.33.0 - Browsers and Discovery and 0-RTT, oh my!', |
| 9 | + description: 'Iroh 0.33 release', |
| 10 | +} |
| 11 | + |
| 12 | +export const metadata = { |
| 13 | + title: post.title, |
| 14 | + description: post.description, |
| 15 | + openGraph: { |
| 16 | + title: post.title, |
| 17 | + description: post.description, |
| 18 | + images: [{ |
| 19 | + url: `/api/og?title=Blog&subtitle=${post.title}`, |
| 20 | + width: 1200, |
| 21 | + height: 630, |
| 22 | + alt: post.title, |
| 23 | + type: 'image/png', |
| 24 | + }], |
| 25 | + type: 'article' |
| 26 | + } |
| 27 | +} |
| 28 | + |
| 29 | +export default (props) => <BlogPostLayout article={post} {...props} /> |
| 30 | + |
| 31 | +Welcome to a new release of `iroh`, a library for building on direct connections between devices, putting more control in the hands of your users. |
| 32 | + |
| 33 | +We’ve got some exciting features for you this round! Iroh `v0.33` compiles to Wasm and can be used in the browser, `Discovery` now includes a way to pass in user-defined data, `iroh::Endpoint`’s now allow you to subscribe to a stream that updates with every newly discovered node, and we’ve enabled 0-RTT QUIC connections. |
| 34 | + |
| 35 | +## 🖥️ Browsers, now in `iroh` |
| 36 | + |
| 37 | +Iroh `v0.33` compiles to Wasm and can be used in the browser! |
| 38 | + |
| 39 | +Not only that, but [`iroh-gossip`](https://github.com/n0-computer/iroh-gossip), too! |
| 40 | + |
| 41 | +Can’t believe it? See these two examples we’ve cooked up: |
| 42 | + |
| 43 | +- An [iroh echo server in the browser](https://github.com/n0-computer/iroh-examples/tree/main/browser-echo). Check it out [in action](https://n0-computer.github.io/iroh-examples/main/browser-echo/index.html)! |
| 44 | +- An [browser chat room UI](https://github.com/n0-computer/iroh-examples/tree/main/browser-chat) based on the [iroh gossip chat example](https://iroh.computer/docs/examples/gossip-chat). Check it out [in action](https://n0-computer.github.io/iroh-examples/main/browser-chat/index.html)! |
| 45 | + |
| 46 | +We’ve had this on the roadmap for some time and are extremely excited to have reached this milestone. Keep in mind there are **some limitations** for `iroh` in the browser, such as not being able to establish direct connections right now. |
| 47 | + |
| 48 | +There is a lot to cover here, so for further info [take a look at the new page on our website](https://iroh.computer/docs/wasm-browser-support) that describes the features, limitations, and future plans for browser/Wasm work in `iroh`. Also, take a [look at the troubleshooting discussion](https://github.com/n0-computer/iroh/discussions/3200) on our github for fixes to typical issues that come up when compiling `iroh` to WebAssembly. |
| 49 | + |
| 50 | +## 🌐 Discovery Changes |
| 51 | + |
| 52 | +We’ve implemented two new features involving `Discovery` for this release! First, allowing users to publish and discover user-defined data. Second, creating easier APIs for users to track all of the nodes that have been discovered by `iroh`. |
| 53 | + |
| 54 | +### 🦾 User-Defined Data |
| 55 | + |
| 56 | +Folks have been asking for this feature for a while and we are thrilled to finally have it: you can now add user-defined data to be published and resolved during `Discovery`! |
| 57 | + |
| 58 | +The original ask from our users was to be able to receive information about what ALPNs the nodes they have discovered speak. Or, to be able to put in a special “application specific” string, that would help the app developer understand if a node they have discovered is useful in their network. But you can use it any way you want. |
| 59 | + |
| 60 | +This data is totally opaque and never read by `iroh`. As long as it can be encoded/represented by UTF-8 string of 245 bytes (so it can fit into a DNS TXT record), you can put in whatever you need! |
| 61 | + |
| 62 | +Check out PR https://github.com/n0-computer/iroh/pull/3176 for more details. |
| 63 | + |
| 64 | +### 🌊 subscription stream |
| 65 | + |
| 66 | +We do not maintain or keep around any sort of address book in `iroh`. If an `iroh` node is shutdown, it doesn’t contain any records of the nodes it discovered or communicated with once it has been spun back up. |
| 67 | + |
| 68 | +We give ways for folks to export any connection information for themselves (`iroh::Endpoint::remote_info_iter`) before shutting down, but this specifically does not include the user-defined data that we discover during `Discovery` (since `iroh` does not read or store this information). We now offer a new method `iroh::Endpoint::discovery_stream` that returns a stream of `DiscoveryItem`s. All information that `iroh` has discovered will be passed along on that stream, that way our users can build up their own address books if that information is important for them to keep around! |
| 69 | + |
| 70 | +Check out PR https://github.com/n0-computer/iroh/pull/3181 for more details! |
| 71 | + |
| 72 | +## ⚡ 0-RTT |
| 73 | + |
| 74 | +0-RTT allows you to skip a round-trip if you have connected to the given endpoint before and and stored the TLS session ticket from the previous session. |
| 75 | + |
| 76 | +Iroh `v0.33`, by default, will cache up to 8 session tickets per endpoint you connect to, and remember up to 32 endpoints maximum. |
| 77 | + |
| 78 | +This cache only lives in-memory. We might add customization to the `EndpointBuilder` in the future to allow for customizing this cache (allowing you to persist it), but that obviously has security implications, so will need careful consideration. |
| 79 | + |
| 80 | +You can enable 0-RTT via the `Endpoint::connect_with_opts` function, which - unlike `Endpoint::connect` - returns a `Connecting`, a state prior to a full `Connection`. By calling `Connecting::into_0rtt` you can attempt to turn this connection into a full 0-RTT connection. However, security caveats apply. See that function's documentation for details. |
| 81 | + |
| 82 | +Checkout PR https://github.com/n0-computer/iroh/pull/3163 for more! |
| 83 | + |
| 84 | +## ⚠️ Breaking Changes |
| 85 | + |
| 86 | +- iroh |
| 87 | + - removed |
| 88 | + - `iroh::test_utils::create_dns_resolver` is removed, use `iroh::dns::DnsResolver::new` instead |
| 89 | + - `iroh::dns::resolver` and `iroh::dns::default_resolver` are removed. There is no static, global DNS resolver anymore. If you want to share a DNS resolver between endpoints, create the resolver yourself with `iroh::dns::DnsResolver::new` and clone it into the endpoint builders (in `EndpointBuilder::dns_resolver`). If you want to reuse the DNS resolver from an endpoint, you can access it with `Endpoint::dns_resolver` and clone it to wherever you need it. |
| 90 | + - `iroh::dns::node_info::{IrohAttr, TxtAttrs, node_id_from_hickory_name}` are no longer public. Use `iroh::dns::DnsResolver::lookup_node_by_id` or `iroh::dns::DnsResolver::lookup_node_by_domain_name` to lookup node info from DNS. |
| 91 | + - `iroh::dns::node_info::{to_z32, from_z32}`are removed. Use the methods on `iroh::dns::node_info::NodeIdExt` trait instead. |
| 92 | + - `iroh::dns::ResolverExt` is removed. Use the methods on `iroh::dns::DnsResolver` instead. |
| 93 | + - `iroh::discovery::Discovery::publish` now takes `data: &NodeData` as its single argument. `iroh::discovery::NodeData` is a re-export of `iroh_relay::dns::node_info::NodeData`, and contains relay URL and direct addresses. See docs for `NodeData` for details. |
| 94 | + - `iroh::Endpoint::connect_with` was removed, use `iroh::Endpoint::connect_with_opts` instead |
| 95 | + - changed |
| 96 | + - `iroh::dns::DnsResolver` used to be a type alias and now is a reexport of `iroh_relay::dns::DnsResolver` struct |
| 97 | + - `iroh::dns::node_info` module is now a reexport of `iroh_relay::dns::node_info` |
| 98 | + - `iroh::discovery::dns::{N0_DNS_NODE_ORIGIN_PROD, N0_DNS_NODE_ORIGIN_STAGING}` are now reexports of `iroh_relay::dns::{N0_DNS_NODE_ORIGIN_PROD, N0_DNS_NODE_ORIGIN_STAGING}` |
| 99 | + - The methods in `iroh::dns::DnsResolver` now take an `impl ToString` instead of `impl hickory_proto::rr::domain::IntoName` for their `host` argument |
| 100 | + - `iroh::discovery::DiscoveryItem` no longer has any public fields. There are now getters for the contained data, and constructors for createing a `DiscoveryItem` from a `NodeInfo`. |
| 101 | + - `iroh_relay::dns::node_info::NodeInfo` is changed. |
| 102 | + - `NodeInfo::new` now has a single `NodeId` argument. Use `NodeInfo::with_direct_addresses` and `NodeInfo::with_relay_url` to set addresses and relay URL. Alternatively, use `NodeInfo::from_parts` and pass a `NodeData` struct. |
| 103 | + - `NodeInfo` now has two public fields `node_id: NodeId` and `data: NodeData`, and setter and getter methods for the relay URL and direct addresses. |
| 104 | + - `iroh::discovery::pkarr::PkarrPublisher::update_addr_info` now takes a `NodeData` argument |
| 105 | + - `iroh::endpoint::Connection::into_0rtt` now returns `iroh::endpoint::ZeroRttAccepted`, instead of `iroh_quinn::ZeroRttAccepted` |
| 106 | + |
| 107 | +### But wait, there's more! |
| 108 | + |
| 109 | +Many bugs were squashed, and smaller features were added. For all those details, check out the full changelog: [https://github.com/n0-computer/iroh/releases/tag/v0.33.0](https://github.com/n0-computer/iroh/releases/tag/v0.33.0). |
| 110 | + |
| 111 | +If you want to know what is coming up, check out the [v0.34.0 milestone](https://github.com/n0-computer/iroh/milestone/41), and if you have any wishes, let us know about the [issues](https://github.com/n0-computer/iroh/issues)! If you need help using iroh or just want to chat, please join us on [discord](https://discord.com/invite/DpmJgtU7cW)! And to keep up with all things iroh, check out our [Twitter](https://x.com/iroh_n0). |
0 commit comments