New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

XMTP 🛠 Native web3 Messaging with XMTP

ETHGlobalSun, Oct 9, 2022, 12:00 AM

Join Peter Denton of XTMP for a workshop titled "Native web3 Messaging with XMTP." This workshop is part of HackFS 2022, a three-week long virtual hackathon focused on building a digital world that is censorship-resistant, decentralized, and trustless. For HackFS, ETHGlobal has partnered with Protocol Labs - the organization building Filecoin and IPFS - to run an event centered on dapps, web3, decentralized storage, and everything in between. ---------------------------------------------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com

Transcript

[Applause] [Music] um okay everyone hi um my name is cree i am part of the youth global team um really excited to have peter from xmtp join us he's going to be giving his talk native web 3 messaging with xmtp um before i let him kick it off though i will just let you guys know that we will do we'll probably save questions for the very end so maybe like the last 10 minutes um so if you want to do q a um you can just do the like raise your hand reaction thingy um and and peter can choose you and you can come up from you and ask the question or if you are like me and you're quite shy um you could just drop your question in the chat and we will have them all answered um and yeah without further ado peter feel free to take it away yeah thank you so much um we're really excited to be here like i love this event um and you know i i want to uh just kind of give an overview of what xmtp is get into a little bit of the technical details but mostly just kind of give you a primer of of what we're trying to do in web3 and then at the end have a couple ideas of like um hackathon ideas that we have um that we've been working on and just encouraging people to reach out um hoping that over this month we can be really collaborative uh we just got done with obviously nyc and that was an awesome event so just really excited to keep meeting people and building cool things um so to begin with i just want to give an overview you know what is xmdb kind of the core concepts of our protocol and then i'm going to go through the sdk a little bit give some examples and and get into ideas and then point you to resources that we have available to really make um you know building with xmdp pretty pretty easy uh so what is xmdp um at a big picture right like if you think about the name it's very similar to smtp and that's very intentional you know we're all um spent a lot of our careers in in messaging and email and and the idea here was can we build an open protocol and standards to let wallets message each other right so our goal is to really establish this protocol in which client develop you know people building apps can plug into our network and protocol and enable messaging out of the box and not just you know centralized messaging but true uh native web 3 messaging and that you know on the encryption and the storage is done on nodes and that over time it'll be fully decentralized um so it's really about building this open composable decentralized communication network uh for web3 in which you know all of the code will be open source and it'll really be community owned technically how it works is we built it on top of waku which is kind of a wrapper on lib p2p um and we spent a lot of time really making that production uh capable so um you know where messages don't disappear and it can really scale to you know unbounded extents the idea is that messages would live forever so that's a big engineering task and we're really just focused on the protocol part like we don't want to go out and build you know the gmail for web 3 or something like that we really want to be the pipes so we spend a lot of our time and energy just focused on you know encryption storage so that messages can really be reliably delivered and that users can really message from anywhere across web3 so we think about it as you know we're not only enabling like a protocol for developers used to send mail but we're also building a network right so if you think about it with a wallet you know a user of your application who wants to send a message and they put in another wallet id that other wallet id needs to know that that message was sent so what we're doing is you know we're working with a lot of wallets we're working a lot of application developers you know dapps to really build out this network so that you can reliably reach people and that your users can have like a really good messaging experience um and so with that you know why you know hackathons like hack fs are like so core to this is then we're just trying to build use cases um with developers so really cool things like token gated chat somebody built like nft bartering over messaging on top of xmtp and openc so that's where we're at right now is just trying to work with developers to build you know really valuable use cases that will then create value for end users and and help build the network so that's really our core mission um you know we've been working on this for about a year a lot of that again has been sort of like core protocol uh engineering work and now we're starting to get up and you know extend upon the sdk so the core concepts um are really uh at the protocol level you know users just send and receive encrypted messages um through through authenticated clients by way of a wallet signature right and messages are persisted in nodes upon the xmtp network enabling portability of people's communications so it really is this thing where you know users own their messages so if you think about the decentralized nodes they all goss about the messages a user at any point in time could go on and pull down all of their messages from any one of those nodes or clients right even somebody could quickly spin up their own client and pull down you know authenticate and sign and then pull down all of their messages so this really is getting into the territory of where users own their communications you know we're not building another walled garden and then node operators anybody can come along and host a node when we're decentralized and be part of that network and again like i mentioned before clients and peers are implemented as waku-2 peers um but we built more specialization on top of that functions and capabilities to make it just better at doing this at the client level um clients really encode and decode uh message formats using a standard interface so if you think about it um what we do is we when somebody signs we encrypt and then send that message and then the client when the user signs it decrypts that message right so encrypting and decrypting and coding message content that's what clients do and we think about clients that's clients on the network and obviously submitting and retrieving encrypted messages to and from the network and then generating secure wallet-based identities capable of encrypting and decrypting messages so i would say that right now um a lot of people would think like oh is messaging on chain or off it we're not on chain what we're doing is building you know a parallel network um something closer to probably like a file coin um so when you sign with the xmtp network we generate this key pair relationship and then then a client can access that and then pull down and decrypt messages right um and then what we're working on is persisting wall based identities locally or within the network so that the user experience is good where they're not signing all the time but where we could persist it in the browser someplace where users could have a really good experience so that's at like the client level and then nodes nodes are really you know relaying they're all about relaying and health of the network so when encrypted messages get uh stored to the network nodes just really um relay them and then retrieve them uh and then deliver them to clients so in the future you know when we have a lot of node operators on the decentralized network they're really creating health of the network um and then that's where it becomes you know really uh community owned uh where nobody can really prevent uh messages from being sent to received and the more node operators there are the better the network um health is so let's just you know at a very simple level look at uh kind of the current state of the architecture so if you think about you know a wallet might have you know composer functionality that uses the xmtp sdk and an inbox so users um like the wallets that we're working with users will have an inbox and they'll be able to compose and receive messages facilitated through the sdk and that will talk to the xmtp network so in the beginning uh xmtp will host all of our nodes right so we are sort of in production now um production doesn't mean something like mainnet um it's still on a test net but production means that you know we're not wiping the network uh messages were persist it doesn't mean that there won't potentially be a breaking change or something as as we go but we're able for clients to ship um messaging based applications to production and we have production level support right so we're um you know ensuring up time we're we're on call we're doing all the things necessary to make sure that clients have a good experience we are hosting our nodes in the beginning because we want to ensure that um you know one we can prevent denial of service attacks so we want to ensure there's a healthy network and we want to be able to control like attack vectors in ways that might be on you know unknown to us it now so what we're doing is um we're hosting our unknowns to prevent something bad from happening but we're on a you know progressive decentralization roadmap where these nodes will then go to probably app partners who are building apps and then to anybody who wants to host a node but how it works at the top level is all the same so whether you're a wallet or an app you know adapt you all can just plug into the network and use the sdk out of the box to really you know bring messaging into your apps in in a few hours in the future state this is really what we're working on um so right now you can think about it's very uh sort of simple messaging right texts can be sent back uh back and forth between wallets and the network facilitates it um but there's a huge opportunity for the ecosystem to keep expanding and that's why i think it you know like an event like this is so core because there's so much opportunity to create value in the messaging stack right so if you think about things like spam or safety so we will be the dumb pipes and just like smtp will you know deliver email that gets sent over it um we're the same way we're not going to be in the business of trying to provide you know like block spam at the protocol level what can happen is that the client level the client can do this and there's all these new and unique ways to do that in web3 right so if you think about like token gated chat where a user can say hey i only want to you know say i want to use lens or i want to use the lit protocol i want to create rules on who can you know send messages to me or who i receive messages from or different channels that i'm part of so you have these cool opportunities to build these tools that don't necessarily need to be an end client meaning like a messaging application but there will be a lot of services in the stack that create a lot of value whether that's spam and safety right like controlling attack factors um or that's using a thing like a social graph so like lens or cyber connect or you know obvious identity so i think it's important to start thinking about you know the different layers on the messaging stack across different things like wallets dapps you know marketplaces as they all have unique needs and so we really see this ecosystem of development partners where we're sort of the network and then people are creating a lot of value um you know on top of that in in for all of the application developers so just like um you know traditional messaging stacks get incredibly complex you know the same thing will happen here um so we look at that as a great opportunity for people to not only build cool projects but actually these will turn into companies and i'll talk a little bit about that in the end um so you know messages are off-chain um in essentially all blockchain uh wallets are supported right um well on on ethereum so you know we're using evm chain and then um you know it'll literally just like work on polygon um so anywhere that evm is supported uh we're interoperable across those chains um including test sets so it's pretty cool like it'll just work out of the box in those environments so getting into the sdk uh so we have a javascript sdk cerriac js um that's open source now and what this really handles is authentication as i mentioned the connection management uh you know generating the key pair uh for the relationship key storage in the signing um relationship initiation so between you know a sender and a receiver establishing that relationship um and then obviously creating a conversation um sending a message retrieving the history of all your messages like all of your conversations streaming messages so when a new message comes in you know sending it out uh to the clients content validation so i'll talk a little bit about content types but essentially we send across a payload so the sdk can validate that content and if it's not correct can gracefully degrade and then format validation similar to that sorry let me i'll peek at the chat um so message attachments this is really good and i'll talk about this in a little bit what we're working on um is sort of a community driven uh process we call xip so if you think about eips these are x ibs and one of those is called xip5 which is message format so if you think about uh mime and smtp it's the same thing that we're building in xmtp right now it's just string right um it's just strings of text next thing that we're working on are things like images um and then obviously video there's other really cool things like buttons so you know links obviously lead to a lot of fraud and spam and so what we're building with developers is the definition of those standards around the payloads so that we can support unique um unique attachment types right so i would say that we're not there yet um but that's where we're going and that's being driven with development partners um currently so as you think about these experiences you want to build that's something that you can come in you know right in with ex within xap um define it put it out to the community and then people sort of refactor on it and then it becomes part of the standard and then over time the protocol really um it becomes part of the protocol so it's like a standard set in stone um let me just keep going just so i can get through a couple more slides and then i'll get back to the chat um so the sdk uh is i would say it very simple like the thing that i think we've done well here is um you can really spin up a messaging client in in a couple hours and we also have a fully functional example uh react uh chat app um that's open source as well so that has all of sort of the ui tied to the sdk but the sdk is intentionally simple right now it's in react.js only um we're currently working on react native and then we'll get more into you know mobile like swift and go down that path and then server to server um supported wallets i kind of talked about this um but the sdk doesn't include it you know wallet abstraction um it's assumed we're assuming that you already have a way of obtaining a wallet connection like a wallet connect or something like that so we don't handle that um and identities must be generated um you know using generated from an associated with an ethereum wallets public address and private key so those are like things that we expect clients to be able to and those are like core requirements um on generating identities uh i talked i just talked about content types i think this is one of the coolest things that will come as part of the development of the protocol xmtp and that's really just these content types right so as i mentioned it could be images and videos but what we're starting to see from developers are just really cool things like uh somebody at ethan nyc built this bartering system on top of opencnc port and xmtp where you could essentially chat back and forth with somebody who had an nft you don't even need to know their public identity just their wallet address and then as part of that payload um he included links generated from seaport that would basically say like accept offer or reject offer um and if you accepted the offer it would actually execute the transaction right um right now you know that's driven through like link based urls but that could be a button content type right where you could literally see accept offer or reject offer happening completely over messaging protocol and that that's enabled because when clients adopt the standard then clients can trust that structure and render those buttons and if you see a link then we can like you know get rid of links um that are leading to so many like you know spoofing and fraud issues so you know obviously with web 3 and you know on chain data there's all these completely new and unique ways of thinking about those experiences and messaging so i just wanted to call this out specifically because i think it's a really fun way to engage and think about different experiences you can build and then again as we're as we're early in the in the protocol development it's really an opportunity to come in and help define this so what we've seen is you know developers go out and build something they come back and they're just sharing it with the community and then our job is to kind of triangulate this stuff and help it become a standard um security so um you know what we're really focused on is you know establishing secure unfalsifiable relationships between identities right so that's what we're trying to focus on is is helping people enable these trusted communications in which they can verify you know uh sender and receiver and and trust the identities um and the other thing is you know only those parties can then you know encrypt and decrypt messages like we can't we have no visibility into the contents of messages it will literally only be um the sender and receiver um through the encryption and decryption process um and the other thing that's that's cool is you know we purposely designed the protocol with the ability to like replace algorithms um so the algorithm set when on encryption and security will be extensible in that we understand that things will change and so we've sort of added this layer of abstraction um in a backward compatible manner but that way we can replace things in the future so it's it's sort of a future safe model and again i think this opens itself up to obviously you know being open source and people improving upon the protocol itself and contributing so just something that i i want to keep reinforcing as a theme is you know we're not going to be this black box protocol we're really uh you know obviously going to be community and open source but it's a fun time to come in and help sort of design some of these uh standards at the security algorithm level you know at the content type level and then obviously at the node level uh on the network so um what you know what we are trying to show uh with xmtp is you know we want to be part of this composable web right we are very focused on you know being one of many protocols that live in the messaging stack um you know one of many protocols that live in client you know messaging applications and uh building a community in which you know we're collaborating um you know with other protocols and developers because we believe that you know what three people are just going to build you know user experience that have never been seen before what we don't want to build is a walled garden um so you know things that have been you know a lot of uh had a lot of success hackathons um in fact at ethanyc two two out of the ten were finalists um using xmdp it's just you know using these different protocols to assemble um you know these client experiences so if you think about like xmtp inlet um uh being able to add uh inbox filters using lens we've done things where it's xmtp and cyberconnect where people can just leverage a social graph out of the box so people can already see their known connections on who they can send messages to and receive messages from so you know please by all means build whatever you want we're offering three prizes um and then a prize pool and you know we're gonna always be rewarding people are being creative so think as crazy as you wanna think um we're just trying to encourage this this view of web3 in which all these protocols work together and the more that we can collaborate um the better so resources um github.com xmtp as i mentioned it has the javascript sdk it does have this fully functional react chat app and that has everything so obviously the authentication conversation views all of your conversations message composition retrieving messages all of the things the sdk just works out of the box in the react app um and a pretty good quick start guide uh to get you going um we have our docs at docs.xmtp.org and then you know we're very active on discord and we'll be very active in the uh hack fs uh discord channel as well um the other thing if you look at uh our listing on the heck fs site uh we've listed a ton of previous hackathon examples and pointed to the repos and demo apps um so there's like different different ways to render the conversation views um different ways of showing this composability of web3 so if you if you need something or need an example just hit me up in discord and i'll send it to you if not check out our page on the hackfest site and i think it has a ton of uh resources um so i know i only have a couple minutes i'll stop our roadmap is very much focused on you know this progressive decentralization um and you know obviously in future enhancements of the protocol i would say the number one thing that we're focused on is reliability of security message uh transport and storage and then just working to support you know all of the all the applications on on top of the protocol so hopefully this wasn't too boring i know it was pretty dry but i think it's just really important in how you think about xmtp as you start to build applications um and and hopefully it's helpful in in this hackathon yeah that was that was awesome thank you peter um i was just gonna say um yeah it seems like you have a lot of questions in the chat um so that's really cool so um we are good to go over like uh five minutes past uh past the original time uh just so you can get those answered if you'd like um yeah so one thing i'll say um i'm gonna take all these questions i'm not an engineer um so i'm i'm sort of like a technical product manager um but some of these questions i may not be able to answer or i i don't wanna answer them uh incorrectly so i'll be sure to respond to everybody um but something like um how we handle key storage i don't know like at a deep level um so or i'll i'll follow up and and get that question answered to you um i would say with zach so could you know file pick video attachments be included through a file coin bridge um totally right i think that if you think about the payload um you can you can build any client experience you want and people are already doing this where they'll they're using filecoin they're using you know ipfs to do different things in fact in that message nft message partnering system he was using ipfs to store all the all the contents up there so we're really encouraging people and it'll it'll work like it's easy to work with xmtp and other services i think the key is then um how do other clients understand this meaning you can build an application and use uh filecoin um no question what we're trying to do is then is there a standard to be developed and how you do that so the pa the payload itself can become standardized where other clients on the network understand that payload and can render that um so that's really the work that we're trying to do um and so i think that you know the answer is yes and then how it becomes permanent is the is the question over the next six months um emojis totally supported um we don't have an emoji picker in the example chat app but you can um you know i built examples on my own just with npm plugins that work and the emojis will get sent across and rendered in the clients um yes so how does waku fit in xmt waku is just you know uh lib p2p like it's a pure messaging protocol that um is open sourced currently available so what we did is we started with something that kind of had the base structure of what we wanted and we built on top of it and it just helped us move faster right and it doesn't mean that we made we had to make less compromises to go faster long term we'll probably build our own um waku will replace it but it really is just think about like a pretty stable foundation to build upon i'd say we've done a lot of work and you can see like we've done a lot of pull requests that have been accepted into waku to be a little bit more stable and reliable um but it's just it's a peer-to-peer messaging protocol that was available that we built upon um uh yes so our our goal is fully i'm reading uh dyson's are their plans to decentralize the xmtp network um our plans are to be fully decentralized no questions um and it's really because we want to establish an open protocol in which uh messages are immutable right um in that anybody can host a node and can reliably you know send and receive messages so we look at that as an essential requirement to how messaging would work in web 3 for everyone's benefit so it's going to take us some time and that's okay because we want to do it right our engineering team has like deep expertise and security and building these systems so it's not going to happen overnight but it's something that um is is going to happen um with you know not only as a tenant of our own road map but with our development partners it's sort of like a key requirement for them as well um so kit's question is do you have to pay for each message transaction like window mentions a descent does someone have to sign off on the cost at any point so right now no everything is free um it's important to to note that it won't be free forever um and that i think that's really important and how we're looking at it is you know there'll be a micro transaction between entities that do not have an established connection meaning you may have an established connection through like lens or through a social graph or you may have established a connection on a marketplace with other people so you would be able to send and receive messages for free um but say that an entity wanted to reach a bunch of people they did not have established connections with they would pay a microtransaction for that and presumably node operators would share in that revenue now i will say that there's a lot of questions in tbd on this it's not going to happen for quite some time but it will be something in which the market would set the price meaning we won't be the the entity to set the price and collect the revenue it would be something where you know the market economics would would drive the price um and that everyone participating at the node level would share in it but again that will be quite some time down the road so zhan asks could xmtp use to easily identify users accumulating idea of information of different platforms and protocols um yeah so in for example world coin eth names unstoppable domains and similar um yeah absolutely right i think that um what we will build is a network and that network will have identities um and those identities will become you know more and more known over time again i think we'll be trying to make ourselves as um functional with entities i mean ens is already supported um you know we've we've somebody built something with world coin uh in at ethnyc so is world coin identity um with xmtp and as you think about you know the network itself um it will will understand those identities over time and i think that's really important as those identities then have a social graph attached and we're able to understand um you know who those people would want to message or receive messages from you you can quickly see that it becomes like really core um to what we build so great question um just scrolling up through the questions here uh i frain i think i covered your um which wallets are supported it's just really any evm wallets um will work uh yeah so circar asked how does this differ from the block scan chat and other chat platforms so i think this is really important um we're building a fully decentralized messaging protocol which is um completely different from a centralized messaging platform so you know uh block scan it you can sign you know you can you can sign with uh with a wallet but then the back end is completely centralized so um now i don't know what they're doing on the back end but presumably they could uh you know read contents um they could be doing things that um a centralized messaging service would do um it it it probably makes a big deal a big difference you know when we're fully decentralized it really becomes a community owned and run network in which we don't then become the governing body over all of the decisions in fact if you looked at our term sheet like we will be a minority holder um of node operators um in in the incentives model of the network so uh over time centralization and decentralization will really matter um in that not one entity can control the network so we look at that um as a as a really important distinction in in our mission in that we're trying to enable something like smtp where not one single entity owns it and that's really important with messages because that means that messages can always live in a decentralized network um versus if a single entity owns it they can they can control what um what can what can go through what can actually reach users and control the cost and different things so we want to avoid that um uh but how are you so i'm looking at zon but how are you going to teach community to drive itself properly i don't know i mean those are those are just questions that we'll have to encounter i think if you look at something like smtp that's sort of an established paradigm in which there's an open source protocol and people can spin up and host smtp nodes and handle the sending and receiving of messages so i don't think it's about people behaving properly or improperly i think it's about you know building a global network in which developers can use to send and receive messages reliably and then typically the market will govern itself um what we don't want to be is in the censorship business or or regulating who can send or receive messages it's really about establishing a protocol in which wallets can message each other so we're we're not trying to be you know in in sort of the political mindset what we're trying to do is build technology that allows communication between wallets and those wallets can expose their identities or those wallets could just be wallets right so our mission is really building this protocol and not governing um than the people who use the protocol awesome okay well we are at time um thank you so much peter that was yeah super super helpful um thank you everyone for the questions if you have any more um or if like peter said you need a more technical answer um hit up their uh discord channel um go ask your questions there anytime you want um and they'll be monitoring it and yeah thanks again peter um oh and yeah this will be recorded and posted for you guys too if you need to refer back to it yup thank you so much everyone

Automatic transcript — names and jargon may be misspelled.