WalletConnect 🛠️ Mobile-First: Building Web3 Mobile dapps with WalletConnect Modal - Tom Terrado

ETHGlobal Paris 2023 · 31 Jul 2023 · 19:38

Tom Terrado, who leads developer relations at WalletConnect, makes the case for mobile-first web3 apps. He describes WalletConnect as an open, chain-agnostic protocol connecting wallets and dapps, previews Web3Modal and Web3Inbox, and outlines hackathon prize tracks covering mobile, authentication, token-bound accounts and design. A walkthrough of a React Native example shows the WalletConnect Modal hook and provider setup, with Kotlin, Swift and Flutter options also mentioned.

Speakers

Topics

From ETHGlobal Paris 2023, hosted by ETHGlobal.

Transcript

foreign [Music] thank you so much for everyone being here um so my name is Tom and today going to pretty much be talking about mobile first um and this Workshop um and just general overview is around why we should be building on mobile and pretty much a quick example app of how to build a web 3 mobile dap with wallet connect cool uh so just as an introduction for myself my name is Tom I lead devrel um relations at wallet connect and spent several years as a mobile engineer prior to this hence my interest in doing a lot more mobile development at wallet

connect cool um so for those who aren't as familiar with wallet connect um the simple way to put it is we're a protocol that enables two parties to connect um in the two parties we essentially have is daps and wallets in this space and we're encrypted trustless open source and chain agnostic so we started several years ago one single QR code and now we would say you know several hundred wallets power us and many dapps use this under the code so we're really trying to facilitate um connections between the two parties I.E wallets and apps so that's maybe how you might be knowing us and I might want to just quickly touch on what we've been working on recently and how this kind of

relates to our hypothesis and reasoning for mobile cool uh so just as an introduction so to further extend maybe give you Insight that um you know while it connects is more than just a QR code signing protocol and also a common question we get is is wallet connector wallet um the answer is no we're not a wallet uh we're a wallet infrastructure and adapt infrastructure kind of like as a communication protocol infrastructure and these are the things that we've been busy on recently so web3 wallet is something that a lot of wallets I guess use under the hood um and most the 300 400 wallets that are out in the space that we power um they're the ones that using that one

so this has lots to do with chain switching and things like that that you might have seen recently um and then web3 wallet modal is kind of the part that we want to talk about today particularly around dapps so every time you might have seen a connect wallet button and a QR code that's kind of the core product that we started with so A lot's been happening in that space and I think more recently you guys have might have seen communication signed to happen within web3 so I did a talk on uh mobile uh mobile wallets the other day and it's kind of interesting in that we started in 2017 2018 particularly with say a wallet called Toshi wallet also known as coinbase wallet and they were actually doing messaging four years ago

they actually kind of stopped that and now it seems like it's kind kind of opening the floodgates of that so we're also work in the works around web3 inbox so web3 inboxes around push notifications notifications and chat so this is something that these are the product Suites that we've been working across and particularly wanted to focus on web3 model today cool uh so web3 model there's some I guess some Alpha of what's coming up it looks very different to what we have right now this is the direction we're heading in so you might be very familiar with connecting with metamask connecting with Mo coinbase and any of your other respective favorite wallets um so this is what web3 model focuses on and pretty much every wallet you have

out there whether it's a cloud-based smart contract based web-based mobile based they're all available through web3 model these days and we're going to be extending it further with other features new UI and today I want to particularly talk around how we're going to work on the just do a demo on the light version of why how quick it is to spin up mobile development these days cool uh and just since we're all here for hackathon and to win prizes I think that's all we're here for um of course but to learn so thank you for being here um so we have around 20 grand of uh cash prizes to give out this week a weekend um first one particularly around mobile that's kind of what I'm speaking around

um and we've got some documentation all across all of this but we've got six grand for web3 mobile if you use react native uh flood us with the kotlin um to spin up adapt uh going to provide some prices around that Innovation um this is our first time doing this track um and six grand around that so if you're interested to work on ZK proofs the ZK snarks and then use wallet connect as a connection through that there are many great ZK um evm kind of blockchain systems out there so feel free to use that and another topic that you guys might have seen is six five five one uh so this is around token bound accounts and it really relates to to the wallet space uh if we talk about wallets right now everyone talks about AAA account

abstraction which is great it's another form of onboarding um and personally another one that I'm interested is 6551 token bound accounts um so the tldr of it is if you generate from tom.eth you can and then you you purchase say a a crypto Punk or whatever then you can that is kind of as generated as a token bound nft Wallet account that you can start to identify yourself as okay this this Punk now gets you know um if you think maybe more around loot I think that's a bit more plausible it's kind of like a composable way to build your inventory um and identity so really excited about that authentication so this is something uh like really interesting Partners like Instagram and stuff I've used to kind of

verify okay I am 0x123 connect sign and authenticate so it's a really simple API and really encourage you to do that and the last one is for those who aren't developers actually here um and we're doing a design track of our Cloud app looks a bit Bland um can do a lot more Improvement um so feel free to drop a figma and trying to re-create like how would you do user design flows and so that's mobile Innovation or in cloud and then we have a pool prize of anyone who wants to just work on web3 mode or web-based stuff you'll be in a pool prize for two to 200 bucks or so so that's that um and yeah so I kind of wanted to to go around a thesis around mobile um and it actually might work to talk

about the wallet Paradigm first so uh while the connect has an extreme pleasure uh to talk to every single wallet out there to talk about to talk to every other dap out there um so yeah every day we get to talk to them we have to understand what they're facing um and I don't know how much you guys have talked to while it's in this HCC week but a lot of them have just been like well it's other problems well it's the problem towards the Gateway and stuff like that and they're like there are three camps actually around the future of mobile there's strong pessimism of like oh well it's on doing enough and innovating fine if you want to take that camp we can stay there there's the other one of there's going to be a super wallet uh this kind of around this thing called the fat fat

wallet thesis by a16z a while ago and it's kind of like hey there's going to be a few wallets that are just going to do really well and then unlock Innovation for us and then the Third Kind Camp is they might be really Niche wallets out there that are really just specifying on chat nft and all of these things so there probably are many other hypothesis of how personally that I'm seeing how wallets are being talked about but the thing is the we also have to focus on the doubt Paradigm is why we're here for the use cases if people are uh part of my French are going to on while it's not being good enough there also has to be better use cases within the DAP Paradigm particularly on a mobile-friendly environment um so that's kind of what I've particularly seen a lot around FCC more

recently is sure there are problems on wallet we're fixing with onboarding AA and all these cool other bolt-on features we also have to start now focusing on the DAP Paradigm it's kind of a chicken and egg problem so here at wallet connect uh we really started on mobile first we figured out a way of how do you connect your browser to your wallet about three four years ago and now we just really want to extend it to like how can we make this even further how can we make this connect wallet Button as seamless as possible how do we make actual better use cases out there so that's currently our take and as to why we're really focused on mobile um as long so alongside like multi-chain and a lot of these other things so that's currently our stance that we really want to help innovate and provide

better Dev tooling for both sides of this spectrum right on this wallet and dap paradigm cool um so just before I get into like the demo and the the development of things so you might have seen this as web 3 modal and what we do is we're really experimenting a lot more um so this could be considered the full version we're going to be releasing social login emailing and pretty much you can uh access all of your wallets um and wag me as a as a library ethers and we're making as composable as possible and for the sake of uh Builders and hackathons it's much easier to use our light version It's kind of just think about the skinnier version that allows you to bring your own Library allows you to bring your own tooling and have it go

there so that's just some distinction just to give you more clarity if you do read our documentation cool all right so I this was kind of taken from a previous thing in that I think we really need to this kind of actually is the wallet and dab Paradigm actually onboarding is that wallets let's just think about the left hand side is more about wallets and the right hand side is dapps right so we really need to start thinking about like cool account extraction AP MPC uh Web author and all these cool things are coming out there are great we're getting there we're getting to a better place but like that stuff needs to be fixed for sure but then we have to start thinking about the DAP features and that's where we're

trying to bring more tooling into the DAP side of like how do you financially read and write through staking and all of these like really cool ideas that you guys are going to hack on this weekend how do we innovate more on nfts or onboarding in in that same Paradigm so maybe tokenbound accounts namespaces identity you know the ZK identity uh with like sismo and then there's like ens lens dids disco all these cool things uh transaction simulation those are copy paste but multi-chain I think that's also something we've really missed I failed to see many good multi-chain applications either on the wallet or dap side and I think it's because we're still figuring it out and right now the whole L2 summer or whatever we want to call it l100s however many else layers were going to

go down like we really need to focus on this um so this is why we're really trying to encourage the these dap features cool um so yeah uh this is on the right hand side is a GitHub uh GitHub repo of an example we have uh that I built out so this is the most relevant thing for the hackathon if you end up wanting to build a react native uh wallet connect modal um so just as an FYI I'm not leaving out any native folks out there there is there is kotlin actually there is uh IR Swift and then there is a flutter so I'm not trying to leave anyone out there but this is just for the most easiest spoilerplate thing and just as a general thing of like

development out there wallet connect we across several sdks we do Unity even um and yeah like uh this is just for react native react native seems to be very popular within the DAP framework and wallet framework so that's just also a heads up if you're willing to bootstrap in that Network so that's just the GitHub repo hopefully that worked um so this is our one-liner um of course it's like uh pretty pretty bland pretty quick there are some polyfills that you need to do and this works for react native CLI but also for Expo we're actually thinking a lot more and optimizing on Expo for any react native developers out there as as a mobile developer three years ago Expo

wasn't there but now we're really in a place where I can just spin up an application for react native and mobile get it done very quickly so really bullish on Expo and how we've done that so I might quickly show you a demo before I get through all of this code snippet so I am not going to risk doing a live demo because the Wi-Fi and even though I love Expo development um I think it's just going to take a bit of a bit of time to um compile um so yeah so left hand side some code that I'll go through in a bit so the right hand side is let's just kind of assume this is the simulator so if I go back here it's just some tutorial it says it the state of it is not connected

and then we want to go through the connect button so it's just the pressable function very simple can you guys yeah you guys can see it yeah let me zoom in on the code for a bit later um so yeah pretty much just clicking the connect button um this brings up a UI you can bring your bring along your favorite wallets that you use these days probably minimize trust or whatever else that you use pretty much click into it um then I pick trust wallet enter your code whatever has your address 0x6 something redirection and voila so I think if we can get to a state where we're easily figuring out how to do wallet development in a very seamless manner I think that's the goal um and not there

are probably more JS web developers than JS uh mobile developers or even native mobile developers and and that's the short truth um but I think what I want to pause and think about is that if in three years we're still using metamask extension as the first onboarding for your grandma or your like child or your friend like we've kind of messed up so I think we want to get to a place where we're trying to push more and kind of ask for like better ways to do handling of mobile and just ranting on and thinking about it there's like better ways that we can even handle keys and do like op claves and with author and through like face ID and Native account abstraction all these things so like there are

really cool things in the mobile space that are happening and I really wish that we moved towards there because once again in three five years if the majority of us are still onboarding through metamask like window dot ethereum we're kind of messed up so that's my personal take um so yeah that was the connection I believe it kind of restarted just take you through the whole flow again very and then you connected so that's your Xerox address and then I can press the disconnect button um and then from then on so this is the boilerplate um for those who are in these platforms you can use something like ethers or or uh VM or wag me and there are other native libraries for

Swift and kotlin um that you can use to help you think about the use cases so it kind of comes back to this how do we feel build better use cases out there so that we can work with this whole wallet in that Paradigm of things cool so that's that um still keeping it quite short um so going back here so this is just essentially the wrapper of the schema that I wanted to share um essentially you'd be just importing a wallet connect modal just as a UI component project ID so that's through Cloud so it gives you better tracking and measurement and this understanding about your project um and then there's dap side um exporting of the function going through it opening up the Moodle and just

injecting some data so what's the name your dap description URL and redirect so this is something I want to point out for mobile developers out there or anyone if you don't redirect your app people are going to get pissed off so please do that like um you you need to actually really figure out like you know just doing these schemas is really essential a lot of even the top wallet out there um does not do this very well so please handle these kind of things um so like you saw when trust quickly redirected back this very important so something is to take into consideration cool uh this is further extending the code of it um and the most important line is um const open and use wallet connect modal

Corp um so we just made it really simple and we give you the power um to think more around the provider and stuff like that so opening function um disconnect function is done through the provider is connected as a Boolean address so pretty bare bone stuff that we've given you and really don't want to complicate uh mobile development for anyone um so the the function of handling that's pretty self-explanatory and then we just use the book um to to open so that's that uh I'm going to do one click click run through all of it just in the vs code format so you can kind of understand where everything is happening um so yeah so very typical if you

understand JS it should be pretty self-explanatory if you haven't done react native project ID um go get it yourself providing the metadata of what you do that's fine here I imported the use wallet connect modal um just through the top hierarchy um here I can I know if that hooks I don't know if the internet is great but these are the other parameters you have I think I've exposed more most of them so this is what we have great um and then all you have to do is wrap it really with this and then you can handle the rest of your app so if you want to navigate and do that do this as the top hierarchy then some very very simple styling

so yeah um that's the code there uh I wanted to wrap things up and cool uh yeah so once again just finishing it up um really encourage you to kind of think about when people are talking a lot around wallets daps and all of that there's really this negative cap that I'm really feeling as a sentiment wow while it's on innovating so let's really try um figure out how can we encourage better adapt development as well on mobile so that people can feel more reassured okay these wallets are having actual good use cases so it's a chicken and egg problem but I really encourage you guys to to give mobile a crap um if you have the opportunity but if not for the rest of the hackathon feel free to

innovate on different different sectors feel free to think about authentication or if you're a designer think about the cloud so I wanted to wrap it up and uh for us I will connect we really think the future is built on mobile so thank you and these are some documentations um [Applause] good uh pushing yeah yeah go for it uh if you want to do uh ZK stocks of token bound accounts built on uh react native go for it yeah yeah that qualify for like both prizes yes that would qualify for both prices yeah

so if it's Innovative enough and you build say a react native app um but it also exposes token bound accounts and this and that uh you could technically enter in the two trucks okay yes thanks thank you