We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Crossing the Bifröst - Bridging All The Things with Matrix

00:00

Formal Metadata

Title
Crossing the Bifröst - Bridging All The Things with Matrix
Subtitle
In which we bridge together as many comms systems as possible via Matrix
Title of Series
Number of Parts
490
Author
License
CC Attribution 2.0 Belgium:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
Matrix is an open source project developing an open protocol and network for decentralised end-to-end-encrypted communication, providing a viable open alternative to the proprietary communication silos of WhatsApp, Slack, Discord and friends. One of Matrix's main goals is to provide a highest-common-denominator open network which can bridge together existing communication silos. In this talk, we'll show off Bifröst, our new application framework for building bridges, and demonstrate high quality bridging with XMPP, Slack, Discord, WhatsApp, and more! Matrix owes its name to the idea of binding together existing communication platforms into an open 'matrix' in which they can interoperate. Over the last year the wider Matrix ecosystem has been focusing increasingly on bridging, with lots of exciting development happening around: Bifröst - a TypeScript application framework for building bridges, including high quality XMPP support via xmpp.js and freeform protocol support via libpurple Slack - matrix-appservice-bridge, including bridging edits, reactions, threads, and full DM support via "puppetting" WhatsApp - mautrix-whatsapp, a fully functional WhatsApp bridge (using the API from WhatsApp Web) Discord - matrix-appservice-discord, with experimental puppetting support for full IRC - matrix-appservice-irc We'll explain all the flavours of bridging available these days (from bot-based, virtual users, puppetted, gatewaying etc) and show off Bifröst providing full gatewayed bridging between Matrix & XMPP (so that anyone in Matrix can reach anywhere in XMPP and vice versa), as well as double-bridging (e.g. IRC<->Slack via Matrix) - and generally illustrate how Matrix can be used to heal fragmented communities which have ended up shattered between Slack, Discord, IRC and other platforms.
System programmingBridging (networking)Matrix (mathematics)Standard deviationTelecommunicationService (economics)Computing platformArchitectureNetwork topologyHuman migrationComputer networkMatrix (mathematics)Bridging (networking)SoftwarePoint (geometry)TelecommunicationHuman migrationConvolutional codePlanningMobile appOpen sourceStandard deviationSurjective functionVirtual machineClient (computing)Server (computing)Presentation of a groupQuicksortData conversionReal-time operating systemConnected spacePhysical systemNatural numberRow (database)Information technology consultingSingle-precision floating-point formatVideo gameINTEGRALDirection (geometry)Computer animation
Bridging (networking)Beta functionLibrary (computing)Lie groupComputer clusterSoftware developerTrailFrame problemMessage passingQuicksortBit rate2 (number)Process (computing)Group actionCodeTraffic reportingRight anglePower (physics)Sound effectBlock (periodic table)BitWordRemote procedure callBridging (networking)ForestGoodness of fitReading (process)Virtual machineMatrix (mathematics)Parity (mathematics)Client (computing)Electric generatorGateway (telecommunications)Computer iconSystem callExtreme programmingSoftwareCommunications protocolVideo gameForcing (mathematics)Endliche ModelltheorieServer (computing)ExistencePlanningFacebookMeasurementEvent horizonData storage deviceInheritance (object-oriented programming)Connectivity (graph theory)Profil (magazine)Identity managementConnected spaceDocument management systemLibrary (computing)Module (mathematics)Stack (abstract data type)Selectivity (electronic)File formatSoftware frameworkAbstractionConvolutional codeDifferent (Kate Ryan album)Wide area networkComputer animation
Machine visionWebsiteWeb pageConnected spaceComputer clusterBridging (networking)Principal idealRight angleQuicksortLimit (category theory)CodeClient (computing)Service (economics)Focus (optics)Axiom of choiceMessage passingType theoryEvent horizonMatrix (mathematics)Vapor barrierDemo (music)File formatMedical imagingLibrary (computing)Presentation of a groupSlide ruleSoftwareFreewareTouchscreenMultiplication signForm (programming)BitServer (computing)Scaling (geometry)EncryptionAbsolute valueUniform resource locatorComputer animation
INTEGRALSoftwareMultiplication signMessage passingMereologyModule (mathematics)File formatRoutingIdentifiabilityRemote procedure callMatching (graph theory)Bridging (networking)Matrix (mathematics)Identity managementRule of inferenceDomain nameSpacetimeLimit (category theory)Series (mathematics)Computer iconDemo (music)Computer animationLecture/Conference
FreewareInformation privacyInformation securityMatrix (mathematics)DisintegrationMatrix (mathematics)Computer iconMessage passingComputer animation
Matrix (mathematics)MaizeMatrix (mathematics)Modal logicBridging (networking)Web pageInformationBitSlide ruleComputer virusComputer animation
Matrix (mathematics)TouchscreenShared memoryBridging (networking)Matrix (mathematics)Presentation of a groupSynchronizationProjective planeBitWeb pageClient (computing)Proper mapMultiplication signSlide ruleEvent horizonView (database)Video gameCAN busFrustrationComputer animation
Point cloudFacebookOpen source
Transcript: English(auto-generated)
So hi, I'm Halfshot, and I do all the Bridge.ly stuff, most of the org foundation stuff. So this is RSC XMPP Bridge.ly stuff. And this is Crossing the Bifrost, which is basically we bridge everything into matrix at once and see what could go wrong. But first let's go through sort of what matrix is.
So how many of you have heard of matrix? That's literally everyone. I shall, yeah, it's the movie, right? This is the movie presentation. I will not go too much over this. It's a, this is an open source standard for interoperable, centralized, real-time communication over IP.
But you guys will know that already. It is also, no single party ends your conversations. It means it gets shared across. But you guys also know that already. So let's get through to the meat of the thing, which is bridges. So how many of you know about bridges? That's still pretty much everyone. Right, good, this is redundant. This is what a bridge looks like. It is basically a bridge that sits on the outside
of your home server and it talks into a remote network. Here we've got XMPP, talking TCP, XML, talks to the bridge, talks to matrix. And we have two APIs that do this. We have the AS API, which is how the home server will push things into your bridge and then gets pushed along to XMPP.
Or in the other way direction, we have the client server API, which is basically the same as the client API, which pushes stuff from the bridge into matrix. It's pretty damn neat. This is why, why do we bridge? Why would we bridge a tool, what's the point? These are the points, there are also other points. So importantly, it connects your communities together. So in such a way that if you have a community on RSC,
community on XMPP, community on Slack, how do you get them to talk? Traditionally, we use humans to do this, where humans talk between them and it was a mess and it goes wrong and meaningless and it's dreadful. Humans are bad at communication. We have solved this problem with software and such that matrix will do this problem for you
and everybody can talk in the same place and it just works. There are other reasons, such as using one app for your communication. I currently have five different things running on my PC to talk. Putely for this demo, I don't usually do that, but you might find your battery drains if you have five apps in your machine. This is one of our shared bridging, it's not great, but it's a good thing to have.
It's a great migration path. If you want to move from RSC onto XMPP, anywhere else, or possibly onto matrix, that would be nice, you can do that as well because you basically just set up your room in such a way of RSC in it and then people join from matrix and then slowly you kick RSC people out of it and say goodbye and now it was on matrix. Master plan achieved. Finally, bots, integrations, and other bridges.
Because matrix is matrix, if you add other things to your room, wow, now you can talk to them from RSC. You can talk to get help from RSC. How cool is that? You didn't even have to talk to RSC directly yourself because you've written the stuff in matrix. You don't even have to think about other protocols. It just works. Isn't that cool? This is me knocking the cable.
Come back. There, we have half a slide. This is fine. So, if you had this on your QR code, you could see this on your screens, but it's okay to see important things, which is RSC and Slack, which you actually just care about.
This is an updated graphic of an XKCD comic we did a few years ago where we show what we bridge and why you should bridge and all the things that just work. So the bubbles here represent, yeah, so here we have Slack, RSC, and everything connected together in such a way that you can still have your communities together. It's sort of a lazy graphic to explain what I just said, really.
And let's go into more about the bridging techniques of how we do things. So there are different things. We have portal rooms, plumbed rooms, in such a way that we have portal bridges. These are basically representing your remote network on matrix in a remote network native format. It's a really hard to see graphic.
Basically, this is an RSC channel here, which is on matrix on the right, and the way it works is fundamentally, you could join a room, everything is managed by the remote network. All the ACLs, all permissions, even the icons look rubbish because it basically looks like RSC. It's designed to be native, feeling like RSC. It works, but it doesn't lack the things
to do like nicely tuning your room and such and so on. For plumbed rooms, it's the opposite effect. You have a matrix room, you want to get people from remote networks into that room. And the way this works is you have a matrix room, you click a button, and then you can add RSC, Discord, select Telegram, Slack,
Gitter, XMPP, which isn't listed here, but it does work, and others. Basically, you can just add things into your room as you need them. It's more dynamic, it's more fun, and it requires five seconds more setup. It's what you should be doing, basically. But this is half the story because you can bridge things in, but how do they look on a remote network? That's very important.
If they just look like text with no usernames, you can't even trust a bridge, right? So you need something that looks sane and you can understand it. So we have different names for these as well because we have lots of names for this thing. So we have BridgeBot style, which is where you have a, just a username and some text, and this sort of just, this is all it is. There's no like impersonation or profiles
or anything like that. It's just sending a message in as a bot, username, message. It's really lazy and it works. I mean, if you have nothing else, it's a good way to bridge, but it looks kind of like meh. It's not technically great. And it's useful for things like Facebook where you can't just make accounts on the fly. So we've made this thing called one-way puppeting, which is basically where you sign in
as your Discord identity or your IC identity or something like that on Matrix and say, right, when I send a message into Matrix, from Matrix into my network, I want to see my messages appear like they look like they belong in a remote network. This is trustworthy. You can do DMs. You can do all the fancy things in a remote network. And it's awesome.
And it works pretty much all the bridges. For IRC and XMPP, this is native. You don't have to do any work. It will just make you an account using the components API or composed XEP or the RSC TCP connection rubbish. And that's how that just works. It looks indistinguishable because, you know, you see here, and if you really parent the screen, it looks like I'm talking in Discord.
Actually, I just sent a message from Matrix over here. This is pretty cool. And the last thing to talk about is double-puppeting. This is puppeting, but both ways. This is where if you send a message from Telegram into Matrix, your Telegram will use your Matrix account to send messages into Matrix, and no one can tell what you're doing. No one can even see the bridge.
It's completely indistinguishable. This is the holy grail. There even should be emojis there to explain this. But the important thing here is that it does use your Matrix account. And it's something we're trying to improve by using OAuth style scope support rather than just giving them access to your whole Matrix account, which is why we don't support this yet in a sort of fuller way.
But it's where we're gonna go next, if it makes sense. So this is all great. These all exist. We have technology. We have words. We have names. But then how do you do it? This is sort of a mock-up of a Slack XMP RSC Discord separated network setup. And you can, as you see here, it's completely discordant, if you use the pun. It is not really great.
No one can really talk to each other. So what we do is a WAN matrix in there like that, different home servers all connected up. Oh God, everyone can now talk to each other. This is great. This is basically what we do here. Very simple. All you're really doing is sticking a matrix glue in so everyone can start talking to each other. And it just works, if I can find the point out. So the thing I actually came here to talk to you about
was Bifrost, which is the whole name of the thing, right? This is a new bridge which supports various cool things such as gatewaying. Gatewaying is the ability to connect to matrix rooms from a non-matrix protocol without any setup. Currently, you have to have a friend on the matrix side to say, yeah, you can come in or no, you can't go away.
Well, what we do is we basically automate this process so you can sit on your XMPP, your client, and talk straight to matrix with no setup required. Only XMPP supports this right now. This is a Bifrost special feature, and it's super cool. So the Fosten room currently on RSC, which is bridged into matrix, can be accessible from XMPP because we've done this gatewaying stuff.
So Bifrost, to use lots of cheesy phrases, is a next generation bridge. It gives developers a modular framework so it abstracts away the complications of matrix and just lets you write your tiny little block of code for remote network access. It's a pretty damn cool thing because it basically solves all this issue of how to write a lot of code to achieve basically a very small problem.
And it allows you to fill in the gaps. It's written in TypeScript. Everyone likes TypeScript, if you like JavaScript anyway, and it currently powers on our XMPP gateway bridge. It looks like this. The full stack of Bifrost, and that purple does not come out well, is that you have your home server, the API, you have the JavaScript libraries in the middle
to sort of glue it all together, and at the top there, you can sort of see the modular approach where we have storage, event processing, a module API, and on top of that, the various modules. We used to use Node-Purple for XMPP. I'm sure everybody knows how good purple is at bridging stuff, and how good it is at XMPP, and how old our data is. We tried this for two weeks, or three weeks, and gave up and used a native XMPP library.
It was much better. I strongly recommend everyone doing XMPP work. Use like XMPP.js if you're using JavaScript. Do not use purple's examples. They're not fantastic. But demo time. This is what you all came to see, right? The demos. So we have, we have, we have Discord. We don't want Discord. Go away, Discord.
We want, we want. This is my world domination department. As you can see here, we have various bridges already in there. You can see here we have a sort of a room with many people in it. I am H. This is half short for H or something. And we have a bunch of people in it. But we're bridging into Discord, as you just saw. So this is a Discord room. Let's say hello.
And if we go back. Oh look, it just came through. Let's try the other way around. And if we go back. Ooh. Did I just?
That's not the impressive bit. There's more bridges. We're gonna keep going. Ah, look at that. If we go back. Ah, there it goes. We're gonna keep going. Come on.
It comes through. I'm not touching my cable ever again. IRC is not helping. This is not gonna go well. Oh, there it goes. Latency of IRC and free nodes is great, everyone. Really use the free node. It's really, really good. Let's keep going to the last one. Not the last one.
Hello from Slack. That's why we always say it. Is this gonna come through? He's typing. Could it mean something? Ah, there we go. Four bridges for free. This is not enough. This is not enough. Because we have XMPP and we've got to prove that it actually works, right? I've basically lied to you all.
So say hello for XMPP. And it will even tell me straight back to the message I'm hoping this will actually work. Yes, we have XMPP support, everyone. And my network connection has just died. That is amazing. Thank you, everyone. And I will just get a slide up to say
that actually thanks, because we did actually write a thanks slide. So, that's it. Five bridges or so, all exist.
Yeah, probably questions, I guess, right? Someone's very eager to have questions. Yep, there are a lot of questions. There's quite time for some questions. I think it was fast, but I guess to post a question, he wants to...
What? What's with the QR code? You can read the presentation because it's federated. You can just look at it and open it on your screens. I forgot to tell everyone that. You can do it now and go back through it. All right? Oh, for... Right, how about, how about, how about? Yes, that has also happened.
It's a data URL. It's gonna be really fun to zoom into. There, is that good? It's now coming. Let's just delete matrix. We just delete matrix.
Right, you can all read that in your own leisure if you don't understand what I just said. Any other questions? There's a guy at the back, he's desperate. Oh. For the double-puffing stuff?
Yeah, absolutely. It's something we do for Telegram, but unless you trust the other guy at the other end, you don't want to give your access token away. This is why we're doing the whole Oh Wolf style thing, all right? Because it makes sense to have access scoping. But yeah, other questions on matrix or anything? You don't need to write the connector
to post a question, no. Wait. To multiple users? You mean as in... Sorry, would you repeat the question for me? Yeah, I didn't hear it actually. Does the bridge scale out to multiple thousand users yet? Sure, there's no real limit. I mean, the Freenode bridge, for example, does 26,000 users, and the XMPP one
is just one connection sending back and forth. It easily scales. Sure. Hello, so XMPP, as matrix's website used to say, is horribly fragmented with a whole lot of things,
which obviously I disagree with, but there we are. But what do you do about supporting the kind of the end-to-end principle with these gateways? We're in encryption style stuff, or? No, the end-to-end principle. The end-to-end principle. Ah, right. So the end-to-end principle is basically so that, for example, with XMPP clients,
you can pop arbitrary data in and not worry about the server support because the server's not interested. I can actually talk about that. So matrix... For example, things that would be useful for matrix are things like typing notifications, but there's potentially other things as well. I mean, do you just have to constantly track these?
So what we, do we have the, yeah. There's probably two ways to answer this question. The first way for now is we would track, as I'm doing when I was looking for XDPs and sort of adding them to the bridge as I go. In the future, we have this thing called extensible events where we have, we say to clients, right, these are several different ways you can represent this message, and you choose the best way for you. So it might be a simple text body for simple things,
which I'm sure XMPP is a way of interpreting most messages with some sort of message of a simplified form. And then you can extrapolate out to show me a calendar or show me a calendar and an image, and you can have a rich format or a cheap format, and there's less work on abridging people. The other thing is Bifrost is designed so that we take these problems away from users and focus on me. So, you know, if you need to add support for things,
the people writing the modules don't have to care, if that makes sense. Cool, questions? More questions here? So I may not have noticed it in the demo,
but how did you, from Matrix, decide where the message went out? Oh, yes, so I didn't actually go through a set, a problem of setting up, because that would have taken about the whole time slot to set up. But, yep, I'll ignore that. So for XMPP, it just looks,
the name is the local part and the domain, so it has a identifier which you can automatically route across, because on XMPP you join the room name directly, so it knows where to go. For other bridges, you do a, so you click on, well, I wish I, there's an integration match you click on, and you click a button, say add remote network into room,
and you give it the channel name and the network name, and it will just, you set it up with just a UI, if it makes sense. But we didn't set that all up for now, because it doesn't, there's no time for that kind of thing. So practically it was like connecting from the other networks to the same room? And all the other network getting whatever you, Yeah, yeah.
And you propagate from one network to matrix and to the other network? Yeah, oh yes, all the networks, all the messages, it all does that. It's this, hang on, before I go, before I go, before I go. Ta-da, this is the new UI, we've completely got to show you guys, which shows where all the networks are coming from and how it's all set up, so you can see there the workspace, the channel, and who's managing the bridge, even the pretty icon.
So even on the matrix side, you can actually see where your messages are now actually going, if that makes sense. If there was more space, there'd probably be an XMPP on there, but we are apparently quite limited on more into space. Any other questions? Okay, one or two more. Okay, you say it and you repeat it, because I can't get it.
Yes, that's a really good question. So he's asking about where do you find how to add these bridges, the information on it. And there is a website called mace.org slash bridges. If you go to that, there is a huge page of bridges and how to set them up, and it's very simple to do.
Cool. Okay, maybe one last question or so. Hello. Sorry, can you repeat that? The slides. Oh, the slides. Oh, great.
Yeah, yeah, yeah. And this is a, this is a presentation. Repeat the question first. Oh, yes, the question. The question is, how did I do this? Is this using matrix? And what is it? This is matrix presents, which is a thing I wrote two weeks ago in view.js, which is basically we use events in a room as slides, and you just go through them and it renders them on a page. It looks a bit like this. And I'm sure in the future
it will actually render properly. But for now, how it works is you, everyone joins the room, they get federated messages across, and then they can just use the client to see the presentation as I do. And the cool thing is I can actually move my thing around in here. And if you had it on your phone, it also moves around on your phone. That's pretty cool because now you're actually in sync with the presenter's slides. So it's a cool use of matrix.
And can I edit live? Can I edit live from my phone? You can. This is the fun thing. So Matthew has motion in the room and he can totally edit my slides as I'm going and start writing rude comments about them if you really wanted to. So yeah, it's a really dangerous and useful thing to have. Yeah, okay. Great. Okay, I think it's time to close. Very interesting presentation
and of course interesting project. Thanks for having me.