Iroh
S01:E01

Iroh

Episode description

Peer-2-Peer starts with a connection. Iroh does just that. Floris joins us and brings us along in exploring the decisions along the way which have shaped Iroh into what it is today.

In this episode we introduce how connections are made through ~NAT traversal~ for P2P networks, and why it matters at all.

This is the first episode of Solarcast and the kick-off of the P4Podcast series.

Download transcript (.srt)
0:25

Usually I go by Floris, but Flub is

0:29

also fine, I don't mind.

0:30

Just go with Floris, it's okay.

0:32

Floris, okay.

0:33

I only have the Delta chat.

0:39

Maybe your email was your name, I don't

0:41

remember.

0:42

No, that's probably Flub.

0:44

Okay.

0:48

Okay, Floris, do you want to add a

0:51

last name or would you rather not?

0:54

No, it's fine.

0:55

I wouldn't be able to pronounce it anyway.

0:59

That's probably true.

1:01

I remember seeing your last name on your

1:03

presentation at FOSN.

1:05

Yeah, on the slides.

1:06

Yeah.

1:08

I was like, that's a long last name.

1:14

Welcome to the first episode of SolarCast.

1:20

I'm so happy to have you with us

1:23

here today.

1:25

And this may not be the first episode

1:27

that we're or I'm recording, but it is

1:32

the first episode to be released to the

1:34

public.

1:35

And I'm a little bit nervous.

1:40

But I'm sure it's going to be fantastic

1:43

because today's guests are wonderful.

1:48

It may take some figuring out to understand

1:51

exactly why, especially for those who are new

1:53

to these realms of the peer-to-peer

1:56

internets.

1:57

But we will get that plentifully explained.

2:02

Today's guest is Iroh.

2:04

That's spelled I-R-O-H.

2:07

To describe a bit about the project, explain

2:11

to us how it works.

2:15

And before that, we'll be looking a little

2:18

bit at the history of the internet, just

2:21

to get a bit of a context for

2:23

why hole punching has become so essential.

2:27

So with no further ado, let's dive into

2:32

the history of the internets.

2:45

Iroh evolved like in concept what it was

2:47

as well.

2:48

The very first version of Iroh was aiming

2:51

to be the second implementation of IPFS.

2:54

But then it kind of evolved into how

2:57

do we set up reliable connections.

2:59

And that is what Iroh is today.

3:02

It's like reliable direct connections.

3:04

The reason to do that part is because

3:07

we think it's a great enabler for creating

3:11

user agency.

3:12

That's something that we think is important in

3:14

building the internet.

3:16

And direct connections are a difficult thing to

3:19

do on the internet today.

3:21

And therefore, we decided if we can solve

3:23

that problem, then we can enable other application

3:27

developers to work on top of that and

3:29

to leverage that and hopefully build very cool

3:33

projects.

3:37

As Floris describes, connecting peer-to-peer is

3:42

nowadays quite difficult.

3:45

Unless you have solutions like Iroh, of course.

3:50

But it has not always been that way.

3:54

And as a little bit of an intro

3:56

and a precursor to the episode today, we're

4:00

going to go through a little bit of

4:01

the history of how we ended up here

4:03

and some of the terminology that will be

4:05

reoccurring in this episode.

4:08

So to start out, this is the first

4:11

in the series on peer-for-peer.

4:14

So we'll establish some of the base concepts

4:18

already now.

4:19

The first concept that might be good to

4:21

have a grasp on is peer.

4:24

What the hell is a peer?

4:27

So a peer would be a device, but

4:29

it can also mean a person.

4:33

In more like actor network theory, one might

4:36

call it an actor.

4:37

And in peer-to-peer systems, it would

4:41

mean that one device is connecting directly to

4:45

another device or one peer is connecting directly

4:47

to another peer.

4:49

In the origins of the Internet, back in

4:53

1969, there were actually four of these devices

4:57

or peers or computers connected to one another

5:01

like this.

5:02

By 1977, there were 23 of these nodes

5:06

in the network.

5:06

And by 1994, there were close to four

5:10

million, a form of exponential growth.

5:14

So what happened?

5:16

The whole issue that occurred was that we

5:20

ran out of IP addresses.

5:23

And the way this was solved back in

5:27

the 90s was to make changeable addresses.

5:32

Every computer had their own address, their own

5:36

IP.

5:37

And post-90s, there were these central middle

5:42

servers called domain name servers.

5:46

And these domain name servers would then hold

5:49

an address book of all the IPs to

5:52

the different computers in their regional networks.

5:55

But these IPs were no longer static or

5:59

fixed.

6:00

These IPs were instead variable and would change

6:05

every now and then.

6:08

This means that there was suddenly no direct

6:13

connection possible device-to-device unless you already

6:19

knew the IP address and the IP address

6:22

was not going to change.

6:24

Known static IP addresses right now is what's

6:27

often referred to the dark web.

6:28

We won't get into that very much at

6:31

this moment.

6:34

But there's nothing inherently dark about them.

6:38

They're simply just not listed.

6:41

That said, the large issue that we're now

6:45

to this day trying to solve is connecting

6:49

directly peer-to-peer.

6:51

And connecting directly peer-to-peer becomes important

6:54

when you don't necessarily know that you will

6:58

forever and ever be able to trust whoever

7:01

is in the middle.

7:02

So the issue we're having in a lot

7:04

of different nations and countries is where government

7:10

controls the domain name servers and thereby also

7:15

controls who can communicate with who, what people

7:18

can see, what people can do online.

7:22

So essentially this system of dynamic IPs and

7:28

network address translation is enforcing a hierarchy on

7:34

the internet, making sure that there are servers

7:37

and clients rather than peers connecting to peers.

7:44

So we're diving into one of the core

7:48

aspects of peer-for-peer networks, which is

7:52

offline-first, local-first, and peer-to-peer

7:56

communication networks.

7:58

And this episode will entirely focus on connecting

8:05

peer-to-peer.

8:07

So something that Floris brings up almost immediately

8:11

off the bat is IPFS.

8:13

And IPFS is one of these types of

8:16

peer-for-peer networks, trying to establish means

8:20

of communication that can be long-distance, can

8:24

route via alternative paths than just what we

8:28

know as the internet right now, but maybe

8:31

also Bluetooth and radio.

8:33

It stands for Interplanetary File Sharing System and

8:37

is probably the most well-known out of

8:39

all the peer-for-peer protocols until this

8:43

point, at least in time.

8:45

A new approach that is emerging is something

8:50

that IRO is also spearheading, which is the

8:53

ecosystem approach of networks, where different modules come

8:59

together.

8:59

And this focus will be on IRO.

9:06

Throughout the episode, whenever I hear terminology that

9:09

might be new, that might be confusing, I'll

9:12

do as best as I can, both for

9:13

myself and for the listeners, to give context

9:17

while also trying to give some form of

9:20

technical depth.

9:23

So bear with me if I don't go

9:26

deep enough.

9:26

Bear with me if I don't explain enough.

9:30

It's difficult to strike that gentle balance.

9:36

So no more from me and let's dive

9:39

in until next time something needs to be

9:43

explained.

9:45

Thank you.

9:50

But I guess IRO sort of refined, as

9:53

I said, it was an IPFS thing, but

9:55

it refined to basically the core thing that

9:58

we call IRO now is just a peer

10:00

-to-peer connection between two endpoints.

10:04

It is not even trying to make anything

10:07

bigger than that, just concentrating on two endpoints

10:10

and you want a direct connection between them.

10:12

And you want that direct connection to be

10:14

100% reliable.

10:16

You want it to be able to send

10:18

bytes on it from the very start without

10:21

having to wait.

10:23

And the trade-offs it makes are derived

10:25

from there.

10:25

And then it's up to the user to

10:29

build more complex things on top of that.

10:32

Like we do have some, I mean, basically

10:36

what IRO have been calling custom protocols.

10:38

And we do provide some of them because

10:41

partially because we already had them and partially

10:43

because they're useful.

10:46

The main ones, the two main ones, I

10:50

think are Blobs and Gossip, which is like

10:53

Blobs is like a verified streaming of any

10:56

kind of amount of data, I guess.

10:58

And then Gossip is like a broadcast network

11:02

to a larger number of nodes in your

11:06

network.

11:08

And then whatever else people want to build

11:11

on top.

11:12

But yeah, the core is really just two

11:14

endpoints, direct connectivity between that.

11:17

And that's already plenty of things.

11:19

And yeah.

11:21

Just so I can orient it among terminology

11:25

that I know, are you aiming for not

11:28

punching them?

11:29

Is that what you're solving?

11:31

Yeah, totally.

11:33

So direct connections is like hole-punching, not

11:35

hole-punching, whichever terminology is not traversal, I

11:39

think is the more IDFE term, I guess.

11:41

It's a huge thing you're solving.

11:44

Like it's been a big issue in peer

11:46

-to-peer community for quite a while.

11:49

So we decided to just make that the

11:51

main focus.

11:52

And so that it also doesn't compete with

11:55

the higher stacks that you can build on

11:57

top, kind of.

11:58

Yeah.

12:00

You mentioned also here that users would build

12:04

more complex things on top.

12:06

So I think in a lot of contexts,

12:08

when you say users, people are thinking of

12:10

the end users, right?

12:12

Yeah, end users.

12:13

Yeah, nice.

12:16

Could you talk more into who your users

12:18

are?

12:20

Yeah, so our users are basically people who

12:24

want to build peer-to-peer applications themselves,

12:28

not end users.

12:31

We make a base, yeah, a base technology,

12:34

a base protocol, but we need other people

12:37

to build on top of it because we

12:39

have a few demos that are sort of

12:42

a little bit end-user-y facing.

12:45

They're not our focus, and you can see

12:47

that in how much more you could do

12:49

with them and how much more user-friendly

12:50

you could make them, et cetera.

12:52

Actually, I think this weekend, someone turned one

12:56

of our demos into something way more polished

12:58

with the UI and everything.

12:59

So that's quite cool to see.

13:02

That's really cool.

13:04

It's always exciting when people pick up your

13:06

projects and then make cool stuff with it,

13:08

right?

13:09

Yeah.

13:10

So what you're focusing on polishing is not

13:13

necessarily that whatever interface people will be interacting

13:16

with.

13:18

It's the piece of the puzzle that other

13:21

peer-to-peer developers can utilize.

13:24

Yeah.

13:24

So establishing the direct connections or doing the

13:28

whole punching and giving you a reliable connection,

13:31

that is what we...

13:34

There's plenty of work to improve that, even

13:36

though it already works quite well, what we

13:38

have.

13:39

How did you end up there?

13:42

How did we end up there?

13:44

With that as a focus.

13:46

Because it's pretty rare to have a group

13:48

have the focus of end users being other

13:52

developers.

13:54

Unfortunately.

13:57

I don't know.

13:58

I guess it depends.

14:00

I think in the world I have been,

14:04

I don't know.

14:06

In what I'm used to, there are a

14:08

lot of places like that, I guess, where

14:10

all the developers are the focus.

14:12

But then I come from a background in

14:14

tools, et cetera.

14:14

So I guess maybe I'm very biased in

14:16

that respect.

14:19

But how did we end up there?

14:21

I mean, IRO started as a...

14:23

Initially, it was going to be a reimplementation

14:25

of IPFS.

14:28

Why?

14:33

Why is mostly social reasons, I would say.

14:38

Because the people who created IRO, the two

14:41

founders, came from that kind of background.

14:43

And IPFS was, at the time, probably still,

14:50

I don't know, looking for alternative implementations.

14:54

They wanted to be more of a spec

14:56

instead of a single implementation.

14:59

And at the same time, the reference implementation

15:02

was not performing enough for some use cases.

15:08

Or so I was told.

15:09

I don't claim to have any knowledge over

15:11

IPFS.

15:12

Or its history, really.

15:14

But this is sort of what I learned,

15:18

I guess, from that.

15:20

But the performance part is important because that

15:22

is basically why IRO eventually, after a while,

15:27

decided not to chase becoming another IPFS implementation.

15:33

And then IRO spent a while trying to

15:35

figure out what IRO actually is.

15:38

I think that journey started as something like,

15:43

how do we do content-addressed transfers that

15:47

are fast and better?

15:50

And that's kind of, I say better because

15:52

it's very vaguely.

15:54

Because that's where the content-addressed kind of

15:58

data thing was one of the main things

16:00

from IPFS, I guess, that people want from

16:02

IPFS.

16:03

So that was the first thing you sort

16:06

of started randomly experimenting what could that look

16:08

like in a world where you didn't have

16:10

to carry a lot of data around.

16:13

And that's where the Blake 3 streaming kind

16:18

of came from.

16:19

Just implement one hash function and it gives

16:23

us a very much simpler world for transferring

16:29

content-addressed data between two pieces.

16:34

And what was this called?

16:36

The hash function is like Blake 3.

16:38

Blake 3.

16:40

Yeah.

16:41

Have you heard of MD5 or SHA1 or

16:45

that kind of hash functions?

16:47

Honestly, no.

16:49

All right.

16:50

Don't worry.

16:53

Where are they used?

16:55

Do you know hash functions at all?

16:57

Yeah.

16:59

You take whatever kind of file and you

17:02

can reduce it to, I don't know, in

17:06

Blake 3, I think it's 32 bytes.

17:09

How many bytes?

17:09

Anyway, some sort of short string or whatever.

17:12

And whenever you change any single thing in

17:14

the original data, the short string is supposed

17:17

to change, right?

17:18

Yeah.

17:20

And there's this cryptography, so there are a

17:23

whole bunch of algorithms for this.

17:26

Blake 3 is a more modern version.

17:29

MD5 is probably the oldest, very well-known

17:32

version, but by now also insecure because they

17:35

know how to make collisions.

17:39

So a quick note here.

17:41

Hash functions are used for storing and specifically

17:45

retrieving data.

17:47

And a hash collision is when a certain

17:51

set of data has the same hash as

17:54

another certain set of data.

17:56

And that causes a collision because if you

17:58

then fetch for this hash 02, you would

18:02

potentially then receive two different data sets.

18:06

And notice over.

18:10

Blake 3 is a modern version and it

18:13

has some very nice properties that allows us

18:15

to basically, as we receive a file, we

18:21

can continuously know that the peer is actually

18:23

still sending the right data, which is sometimes

18:28

a problem in a naive implementation from like

18:32

a decade ago, say, where you could be

18:34

transferring a gigabyte and then at the end

18:36

discover actually no, they sent the wrong thing.

18:39

So that was the first kind of experiment

18:42

of IRO, I guess, of like, where does

18:44

it go if we abandon IPFS?

18:47

And then the second part was like, how

18:50

do we do hole punching if we don't

18:52

have to do any backwards compatibility?

18:56

And there we ended up basically going like,

18:58

well, let's converge towards, let's build everything on

19:02

top of QUIC because QUIC is a sort

19:07

of the transport protocol that's been built for

19:10

HTTP3.

19:12

And it has some very nice properties for

19:15

hole punching, very studied, very standardized protocol.

19:19

I mean, it's quite young as well, I

19:21

guess, but it's widely, it's getting widely adopted

19:24

and has some nice properties.

19:28

A lot of the, like, Google Cloudflare, Meta,

19:32

et cetera, are starting to use this and

19:35

at least in the, like, the connections to

19:39

end user devices, not so much in, like,

19:44

connections inside data centers, et cetera, it's not

19:46

that interesting.

19:48

But for us, it is also very good

19:50

because it's built on top of UDP and

19:53

that is a lot nicer to hole punch

19:56

than TCP.

19:57

It makes lives a bit simpler.

20:00

Those were the two main things that we

20:01

started with.

20:03

And for a while, we had, like, IRO

20:06

was like this combination of the hole punching

20:10

stuff and the blob transfer and then I

20:13

think some other, probably gossip, et cetera, was

20:16

added at some point.

20:17

I don't know exactly the ordering anymore.

20:19

But that was also confusing to people.

20:22

People didn't know what IRO wanted to be,

20:24

what, whether they would, they could rely on

20:28

just the connectivity part or whether we would

20:30

just take that away again because we had

20:32

our own things higher up the stack competing

20:36

with that.

20:37

And that's sort of where eventually we ended

20:40

up on, well, maybe we should just make

20:42

IRO just the base, the connectivity because there

20:46

are so many great P2P projects already that

20:52

that can be adapted to work with good

20:54

connectivity and, like, solving the connectivity is a

20:57

huge thing in its own.

20:59

And we didn't, like, yeah, this way we

21:03

can be a base for everyone who wants

21:06

to build, I don't know, different gossips, different

21:08

synchronization, different anything.

21:11

And yeah, that's sort of where we are.

21:13

Okay, now I'm mostly asking out of curiosity

21:16

because I've been having this conversation with, like,

21:18

among other people like Alyosha.

21:21

How did you arrive at that conclusion?

21:25

To just call IRO the base connectivity?

21:29

Yeah.

21:30

From speaking to people of yeah, mostly speaking

21:35

to other people who are, like, trying to

21:36

use IRO.

21:39

We saw partially the adoption that we saw

21:41

was like a lot of it was interested

21:44

in parts and almost always the hole punching

21:47

part was part of that, but not necessarily

21:50

all the other parts.

21:51

And then also we talked to people that

21:54

didn't use us and the main feedback there

21:58

we got that we thought, you know, could

22:00

be kind of interesting users.

22:03

And the main feedback there was that they

22:05

were just confused and worried about what IRO

22:08

wanted to be.

22:10

And the worry basically being that, well, can

22:13

we actually rely on this thing staying at

22:15

the base connectivity there?

22:18

So it sounds like you've been in pretty

22:20

close contact and communication with other end users.

22:26

I'll stick to the term users now, even

22:28

though in my mind, I just get confused

22:30

with end users.

22:30

Developers if you want.

22:31

What term do you like?

22:33

Developers?

22:33

No, developers is great because then I won't

22:37

mix it up.

22:42

I talk to a lot of UX testers

22:44

and stuff as well.

22:45

Which is completely different.

22:46

Exactly.

22:49

But OK, developers.

22:51

So you were talking a lot to the

22:53

developers, other developers who are using IRO.

22:57

And you realize this was the most important.

23:02

And I was going somewhere with this.

23:06

So moving forward, like number one, how are

23:10

you organized?

23:12

Because like that's always a question when it

23:16

comes to peer to peer projects.

23:17

Like in Scuttlebutt, we were not organized, actively

23:21

not organized in a structured way.

23:27

So it was very much like social networks,

23:31

navigating, rotating roles, dissolving our structures, stuff like

23:36

that.

23:37

But then other people work with companies, other

23:39

people have non-profit foundation, open collectives.

23:45

How do you do it?

23:48

IRO is a project run by a company

23:52

called Number Zero.

23:55

And it was set up essentially as a

23:57

by two people that came from the IPFS

24:02

world.

24:03

There was funding from IPFS at some point

24:06

or still.

24:08

I'm not entirely sure.

24:09

Don't ask me for details on that.

24:14

But the founders basically funded Number Zero.

24:17

And so it is a company and it

24:19

is almost entirely like developed inside the company.

24:26

But IRO and all the protocols are fully

24:29

open source.

24:31

So it's a very central structure, I guess.

24:35

But it's a small company.

24:37

There's nine people, I think.

24:39

Yeah, there's nine of us.

24:41

Two questions.

24:43

What's the license and what's the revenue model?

24:51

The license is, I believe, MIT or Apache,

24:55

too.

24:56

And that's the license we use on everything.

25:00

The revenue model is something we're still looking

25:03

for.

25:05

So far, we have done essentially custom consulting

25:10

for people that want advice on how do

25:14

I make connections on the Internet and how

25:18

these things work.

25:20

But we're also trying to figure out how

25:23

to sort of make that less consultancy.

25:26

So we have more time for actually working

25:29

on IRO.

25:31

And as part of that, we're basically looking

25:34

towards a trend we have noticed that is

25:37

a lot of our developers want to end

25:41

up running.

25:43

You can say users.

25:44

I get it.

25:45

I also get that it's confusing for you

25:47

because then developers become your own team, right?

25:50

Yeah.

25:51

But it's fine.

25:56

A lot of your developers or users?

25:59

Yeah, a lot of our users, I guess,

26:03

end up running.

26:04

OK, so this runs into how IRO technically

26:07

works partially as well.

26:09

So we want to OK, I'll go a

26:13

slight sidetrack on that.

26:15

Technically, like I said, like we want 100

26:17

% reliable connections, hole-punched connections.

26:21

And that's not possible, right?

26:23

Anyone in peer-to-peer knows that.

26:26

So one of the key things I did

26:28

was like kind of be pragmatic about this

26:31

and to establish direct connections, you already need

26:36

some information from outside, usually provided by servers.

26:40

This is traditionally like stern services.

26:44

So the approach IRO takes is basically you

26:46

have relay servers that we call them relay

26:49

servers.

26:50

They do slightly more.

26:51

So basically the idea is when you are

26:54

waiting, when you're ready and waiting to accept

26:56

connections, you always register with a relay server

27:00

and you somehow advertise this as your home

27:04

relay server.

27:05

So you can have many relay servers that

27:09

don't know about each other and it all

27:11

still works together.

27:12

So you just advertise like I'm on this

27:14

home relay.

27:14

If you want to reach me, you can

27:16

find me via this home relay server.

27:20

As soon as you start a connection to

27:22

this, we will initially send the traffic via

27:24

the relay server, which is obviously not ideal.

27:28

At the same time, the relay server will

27:30

do all the work required to help you

27:33

hole punch and will also coordinate the hole

27:36

punching.

27:37

And then as soon as you manage to

27:40

successfully hole punch, the traffic is moved to

27:43

the direct connection and the relay server does

27:45

nothing.

27:46

So that's sort of required to go back

27:51

to how we hope to make money.

27:52

Like a lot of our users are deploying

27:55

their own relay service.

27:56

Currently we basically work on offering that as

27:58

a service, essentially.

27:59

So people can have their own private relay

28:02

service, but we will operate them and hopefully

28:05

that helps everyone a little bit.

28:10

Cool.

28:11

So you'll do, so it's a multi-pronged

28:14

like self-sustaining economic model.

28:19

Both like supporting people with hosting the relay

28:22

servers and supporting people with like through consultancy.

28:27

But as you were talking, I realized that

28:30

you were really practically starting to answer the

28:34

what question from the podcast and it was

28:37

so good.

28:39

So I was wondering if we can continue

28:40

a little bit on that note.

28:42

And I'll do a follow-up question in

28:46

relation to when I worked on Scuttle, but

28:51

we did a project called Rooms 2, which

28:55

was an extension and that was also a

28:57

hole-punching project, which of course, as you

29:01

said, was not possible, so then we had

29:02

to do these relay servers, which we called

29:04

Rooms.

29:08

And one of the things that we were

29:10

very careful with while doing this was that

29:14

the relay server wouldn't be able to store

29:16

any of the data, so it doesn't become

29:20

like an accidental middleman.

29:22

How do you solve that?

29:26

Yeah.

29:26

Very good question.

29:30

So this goes, I guess, into well, yeah.

29:35

So the first part towards that is that

29:39

every end point, the end point for us

29:41

is node end point one.

29:44

It either accepts or creates a connection.

29:47

Every end point has a node ID, what

29:51

we call it, which is essentially a public

29:54

-private key pair.

29:55

And the public part is the node ID.

29:58

In order to