HNHacker News
TopNewBestAskShowJobs

rklaehn

1,071 karma · joined October 16, 2017

submissionscomments
rklaehn··on Iroh 1.0
libp2p does have QUIC, but it is one of many possible transports.

So libp2p builds many things on top of the underlying transport where we use QUIC directly and use existing mechanisms such as TLS ALPNs for protocol negotiation.

We also use the stream multiplexing that is built into QUIC instead of putting a stream multiplexer on top of QUIC.

You can think about it like this: libp2p abstracts transports as streams, and then puts many required features on top (protocol negotiation, stream multiplexing)

Iroh uses QUIC and abstracts transports below QUIC. We can work with any unreliable datagram transport that has (or can be hacked to have) a minimum MTU of 1200 bytes (needed to be QUIC compliant).

rklaehn··on Iroh 1.0
If you are a rust developer, you can just take a look at the examples in the iroh repo itself or in our iroh-examples repo.

None of them require an API key.

https://github.com/n0-computer/iroh/tree/main/iroh/examples

https://github.com/n0-computer/iroh-examples

rklaehn··on Iroh 1.0
Iroh is just a clever combination of existing standards such as QUIC with some draft RFCs and a tiny bit of clever custom logic added via TLS extensions.

So in theory a go implementation is possible using a go QUIC implementation that supports the multipath extension.

Our focus is the rust implementation, since it is very easy to use from compiled languages such as rust, C and C++ and to embed into languages such as js and python.

But there are some other projects that attempt to provide a native go implementation: https://github.com/tmc/go-iroh

Edit: since iroh is just a library, it is also possible to link iroh into a go program. Linking a go program from other native languages is a bit of a pain, but linking a C or rust library into a go program is relatively straightforward and high performance.

rklaehn··on Iroh 1.0
I would say it is an excellent building block for application developers to route around the segmentation. There are several projects that work well in restricted enviroments that use iroh for some features. E.g. https://delta.chat/en/

E.g. you could write an excellent encrypted chat app using iroh, the Tor or Nym custom transport, and BLE or direct wifi for local connections.

You have to be careful though to make sure you configure the transports correctly in order not to expose data you don't want exposed. Iroh can be used in highly restricted environments, but the defaults favour performance over complete metadata privacy.

rklaehn··on Iroh 1.0
I would say it is not a replacement but an addition.

IP isn't going anywhere any time soon, but we add two capabilities on top. The ability to dial an endpoint by key, and the ability to get direct connections whenever possible.

That being said, if some other technology becomes popular that actually replaces the IP address paradigm, iroh is well positioned to make use of it. From the point of view of an iroh application developer nothing would change. You still dial by key, and iroh will just make sure under the hood to get you the best possible connection, IP or otherwise.

rklaehn··on Iroh 1.0
First of all: the p2p address lookup is an optional feature. You have to explicitly enable it.

Mainline is incredibly frugal in terms of resource use, but we want it disabled by default so mobile apps don't look like bittorrent clients and get flagged by the OS.

When we do a p2p address lookup, every mainline server node could possibly be responding. Any bep_0044 record gets stored on 20 random mainline server nodes.

So a bittorrent client that participates in the DHT as a server and is long running enough to be included into the DHT routing tables will respond, yes.

rklaehn··on Iroh 1.0
Take a look yourself.

Our code is as good as we can make it, and everything is modular and well documented. For example our QUIC implementation noq which underlies every iroh connection can also be used as a standalone QUIC impl that implements QUIC multipath.

https://docs.rs/noq/latest/noq/

If we wanted to have "total bespoke and unusable code" we would have inlined all of this into the iroh repo to make it unusable.

rklaehn··on Iroh 1.0
A difference between iroh and many p2p networks is that we try to use existing IETF standards (QUIC, TLS) as much as possible instead of reinventing the wheel. An iroh connection is just a QUIC connection, using TLS and TLS ALPNs for protocol negotiation.

If you look at an iroh connection using wireshark, it is just a QUIC connection. You can use all the existing tools, and a lot of things you learn when using iroh transfers to traditional QUIC connections and vice versa.

Most iroh contributors come out of the p2p world, and you could say that we had a bit of abstraction fatigue after working on regular P2P networks for some years.

We have also so far resisted the temptation to write a DHT, opting instead to use the biggest existing DHT, bittorrent mainline, for our p2p address lookup needs. Many traditional P2P networks come with their own implementation of a DHT for discovery.

Note that there are some "regular p2p networks" that use iroh under the hood, e.g. holochain https://blog.holochain.org/dev-pulse-154-holochain-0-6-1-is-... as well as various p2p chat apps.

https://blog.holochain.org/dev-pulse-154-holochain-0-6-1-is-...

rklaehn··on Iroh 1.0
Iroh is QUIC. We are not trying to reinvent the wheel here, just combining existing IETF RFCs in a creative way.

Here is a concrete problem we solve. You have one device in your home WLAN behind a NAT. Your other device is in a 4g network, or behind another NAT at work.

In most cases we can give you a direct connection between the two devices very quickly via hole punching, so you get the highest possible bandwidth and the lowest possible latency.

This was not a solved problem until now.

rklaehn··on Iroh 1.0
If you run a public unauthenticated relay you act as a home relay for whoever has your relay configured in their relay map and is close in terms of latency.

So you might get a lot of traffic. You can configure rate limiting, as we do on our public relays.

The traffic is fully encrypted and can not be decrypted by the relay. The only information the relay has is what is necessary for it to function - the endpoint id and ip addresses of the endpoints that are connected to it at any given time, as well as endpoint pairings.

You relay encrypted traffic with no egress to the open internet. So if you want to compare it with Tor, it would be like a tor guard/middle relay, not an exit node.

rklaehn··on Iroh 1.0
Iroh is a project that combines existing IETF standards in an interesting way. For example we use raw public keys in TLS for the key exchange https://datatracker.ietf.org/doc/html/rfc7250 instead of coming up with our own key exchange scheme.

Our QUIC implementation noq is a standards compliant QUIC implementation that in addition to RFC9000 also implements the QUIC multipath draft RFC.

We try very hard not to invent new things unless absolutely necessary. In a few places we had to implement draft RFCs, QUIC multipath and QUIC NAT traversal. And there are some corners where we had to add our own extensions. But we try very hard to keep this to an absolute minimum.

rklaehn··on Iroh 1.0
A key distinguishing factor is that iroh is meant to be used as a library that you can embed into your desktop, mobile or embedded apps.

Up to now our users are mostly teams that have a rust or C/C++ core, such as https://delta.chat/ . But now that we have bindings teams who use other languages should be able to use iroh.

So you can write e.g. an android and ios app that uses iroh direct connections under the hood, and the app user does not have to know or care about this at all.

rklaehn··on Iroh 1.0
We have an answer, but it isn't really clever. We do have both built in and pluggable address lookup services.

Our default enabled address lookup service is using DNS in a creative way, but we also have a service that is fully peer to peer and is using the mainline DHT, specifically the bep_0044 extension that allows you to store a tiny bit of arbitrary data for an Ed keypair that you control.

https://www.bittorrent.org/beps/bep_0044.html

https://pkarr.org

Some custom transports such as TOR hidden services have a discovery system built in. In these cases we can just use the existing discovery system.

See for example https://github.com/n0-computer/iroh-tor-transport

rklaehn··on Iroh 1.0
I am one of the iroh developers.

A question that frequently comes up: when will iroh support webrtc, or BLE, or LoRa, or ...

Iroh as of now supports only IPv4, IPv6 and relay transports out of the box. There is such a large variety of potentially interesting transports out there that we can't support all of them without turning the codebase into an unmaintainable maze of feature flags.

But we have added the ability to implement custom transports. That way your transport implementation can live in a completely separate crate.

Existing experimental custom transports include Tor, Nym and BLE. https://github.com/mcginty/iroh-ble-transport

Here is how custom transports work under the hood: https://www.iroh.computer/blog/iroh-0-97-0-custom-transports...

rklaehn··on Datacenters in space aren't going to work
This article is written as if SpaceX does not exist. Every single comparison is against 30, 35 year old obsolete technology.

Power:

It uses the ISS solar arrays as reference. They are obsolete for decades. A much better reference for the purpose of cost estimation would be Starlink sats.

The total installed power of all Starlink sats is tens of megawatts, and will reach gigawatts once larger Starlink sats will be launched by Starship.

Starlink PV panels are simple silicon panels built by a taiwanese company, and are not much more expensive than terrestrial panels.

https://web.archive.org/web/20211102134305/https://techtaiwa...

Cooling:

Again, ISS. The ISS design is overly complicated because it is in low LEO and needs to be articulated. Also, it needs to use ammonia since the working temperature of humans is lower than that of GPUs.

A datacenter in space would be in a sun synchronous orbit and need no articulated radiators. Also, it could use a higher radiator temperature, which helps a lot due to Stefan Boltzmann black body radiation law.

Cosmic radiation:

The state of the art is to use current generation silicon and do error correction at software level. This isn't some fantasy or research project, but how each SpaceX Dragon flight computer and Starlink sat electronics works.

Communications:

Starlink sats have way more than 1 GiB/s bandwidth, and space based laser communication is state of the art and even commercially available.

https://www.pcmag.com/news/spacex-opens-up-its-starlink-lase...

This article is not a base for a realistic discussion about data centers in space. It just dismisses the concept without doing a honest discussion.

rklaehn··on Dumb Pipe
You can enable direct lookup and publishing on mainline.

See https://docs.rs/iroh/latest/iroh/discovery/pkarr/dht/struct....

If you use this discovery mechanism the iroh node will directly publish to and resolve from the DHT.

rklaehn··on Dumb Pipe
Iroh will do hole punching through NATs. It will even work in many cases when there are NATs on both sides.

There are some limitations regarding some double NATs or very strictly configured corporate firewalls. This is why there is always the relay path as a fallback.

If you have a specific situation in mind and want to know if hole punching works, we got a tool iroh-doctor to measure connection speed and connection status (relay, direct, mixed):

https://crates.io/crates/iroh-doctor , can be installed using cargo install iroh-doctor if you have rust installed.

rklaehn··on Dumb Pipe
I think the OP wants a built in solution to send unreliable datagrams larger than the MTU.
rklaehn··on Dumb Pipe
Nice list.

I think iroh checks all the boxes but one.

( ) Doesn't contain window logic to emulate best-effort datagrams over about 1500 bytes

So you want a way to send unreliable datagrams larger than one MTU. We don't have that, since we only support datagrams via https://datatracker.ietf.org/doc/html/rfc9221 .

You could just use streams - they are extremely lightweight. But those would then be reliable datagrams, which comes with some overhead you might not want.

So how hard would it be to implement window logic on top of RFC9221 datagrams?

rklaehn··on Dumb Pipe
I am not one of the cryptographers on the team, but I will try to answer to the best of my knowledge.

QUIC is specifying TLS, specifically TLS 1.3 or larger. From the RFC 9001 (Using TLS to Secure QUIC): "Clients MUST NOT offer TLS versions older than 1.3.".

For the first request, brute forcing would mean guessing a 32 byte Ed25519 public key. That is not realistically possible.

For subsequent requests, even eavesdropping on the first request does not allow you to guess the public key, since the part of the handshake that contains the public key is already encrypted in TLS 1.3.

With all that being said, if you want to have a long running dumbpipe listen, you might want to restrict the set of nodes that are allowed to connect to it. We got a PR for this, but it is not yet merged.

https://github.com/n0-computer/dumbpipe/pull/68

rklaehn··on Dumb Pipe
In this particular example there is no multiplexing. It's just one QUIC stream.

In other iroh based protocols the ability to have many cheap QUIC streams without head-of-line blocking is very useful. E.g. we got various request/response style protocols where a large number of requests can be in flight concurrently, and each request just maps to a single QUIC stream.

rklaehn··on Dumb Pipe
You can forward a locally running TCP service using dumbpipe listen-tcp.

E.g. you got a local development webserver running on 127.0.0.1:3000. You can expose this via dumbpipe using

dumbpipe listen-tcp --host 127.0.0.1:3000

You get a node ticket that contains details on how to connect. Put it into https://ticket.iroh.computer/ if you want to know what's in it.

Then on the other side, e.g. on a small box in the cloud, you can do this:

dumbpipe connect-tcp --addr 0.0.0.0:80 <ticket>

Any TCP request to the cloud box on port 80 will be forwarded to the dev webserver.

rklaehn··on Dumb Pipe
Anybody who has the ticket and therefore has the public key can connect.

Once connected, the connection is encrypted using TLS with the raw public keys in TLS extension ( https://datatracker.ietf.org/doc/html/rfc7250 ).

rklaehn··on Dumb Pipe
The value proposition of the ticket is that it is just a single string that is easy to copy and paste into chats and the like, and that it has a stable text encoding which we aim to stay compatible with for some time.

We have a tool https://ticket.iroh.computer/ that allows you to see exactly what's in a ticket.

rklaehn··on Dumb Pipe
Dumbpipe is using our set of relays. It is meant as a standalone tool as well as a showcase for what you can do with iroh.

If you use iroh as a library, you can specify your own relays.

It is important to mention that relays are interoperable, so you don't have isolated bubbles of nodes using certain relay networks. I can have the n0 relays specified and still talk to another node that is using a different set of relays.

rklaehn··on Dumb Pipe
We (n0) are running one set of relays. They are rate limited, so they basically only help with the hole punching process.

Projects or companies that use iroh can either run their own relays or use our service https://n0des.iroh.computer/ , which among many other things allows spinning up a set of dedicated relays.

rklaehn··on Dumb Pipe
Thank you for the praise! It is nice to hear that people enjoy these workshops.

I would love to see what people would build if they had a little bit more time with help from the n0 team. A one hour or even three hour workshop is too short.

rklaehn··on Dumb Pipe
Iroh is one of these low level libraries. It is basically p2p QUIC, where p2p means 1. addressing by node id and 2. hole punching.

Dumbpipe is meant to be an useful standalone tool, but also a very simple showcase for what you can do with iroh.

rklaehn··on Dumb Pipe
We do use DNS, but we also have an option for node discovery that uses pkarr.org, which is using the bittorrent mainline DHT and therefore is fully decentralised.

And, as somebody else remarked, the ticket contains the direct IP addresses for the case where the two nodes are either in the same private subnet or publicly reachable. It also contains the relay URL of the listener, so as long as the listener remains in the same geographic region, dumbpipe won't have to use node discovery at all even if the listener ip changes or is behind a NAT.

rklaehn··on Iroh: A library to establish direct connection between peers
There might be a small misunderstanding here. Our relays do two things. They relay user data, and relay a small number of special packets to help with hole punching. Other than that they are very simple. They never see unencrypted data, so they don't know anything more about the nodes they serve than what they need to function.

Connections are TCP https websocket connections, because this is most likely to get through even the most restrictive firewalls.

Discovery is handled outside the relays, via either a special DNS server or via the bittorrent mainline DHT. You can even implement your own discovery.

← PreviousPage 3 of 10Next →