Smart contract wallets and mainstream adoption
ETHCC 3 · March 2020 · 26:28
Itamar Lesuisse and Julien Niset examine smart-contract wallets and mainstream adoption.
Speakers
Topics
From ETHCC 3, hosted by Ethereum France.
Transcript
you thank you so my name is Julian easy i'm
one of the co-founder of argent and today i will be speaking about smart contracts wallets and the app adoption but before i get started i wanted to briefly recap what argent is for those who don't know origin works and then what it means for fadap and app developers so origin the idea of Argent's basically is to provide the best feature of a modern mobile banking application but without the bank that means that we'd Arjun you can lose your phone you still can recover your fund arjun will block fraudulent transaction will freeze your account you can set trusted contacts there is no transaction fees there is no cryptic addresses because we we give you an S to all our
users so basically what we've done is is abstracting all of the complexity of the blockchain and to enable a great user experience and the reason we have managed to do that it's because we use smart contracts so all these oddities work so when you instant you download the app on your phone you'll have a key which is stored safely on your phone and this key doesn't hold any funds but it act as a remote control to your wallet and your real wallet is a smart contract on the blockchain so when you interact with the app anyone executor transactions it transfers some token what actually happens is that that key will sign an intention to the people call it meta transactions which will be
related to the blockchain with that transaction which your wallet your wallet will check if that key is indeed authorized to make that transaction to call that method will check if the context of the wallet is correct as the this wallet being frozen is it being recovered and so on if everything is okay then the wallet will execute the transaction so so far I've described your wallet as a smart contract actually or architecture is a bit more richer than that and we've developed a modular smart contract wallet what I mean by that is that every single user of origin has a single smart contract that we call the is what it that really all's your fans your identity your collectibles and so
on and this base what I define a set of modules that are authorized to invoking and make him do a call on the blockchain so transfer some talk and invoke a contract and so on what's interesting is that all these modules they contain a different piece of the business logic and there are sure between all the users so when you actually make a transaction on your Archon wallet what you are doing is making a transaction to a module that will check the authorization check the context do some business logic and if ok we'll make a call to your own wallet and say transfer some funds so the reason why we choose these architectures is
twofold there's two main benefits the first one is that it makes it easier and safer to upgrade your wallet why because if we develop a new feature we want to enable something new we can create a module put it on the blockchain and then invite the users to authorize that new module and I insist on the fact that it is not us pushing a new module and upgrading all our users wallet it's really just presenting a new functionality and only the owner of a given wallet has the right to authorize that new functionality and of course what works to add new functionalities can also work to upgrade a feature say we want to enrich a certain module we can actually doing the same inviting the
users to depreciate your module and enable a new module so when you do an upgrade instead of having to replace your entire wallet which is a bit scary on the blockchain you can actually only upgrade or touch the piece of the logic that you want to improve so it makes it simpler and safer to upgrade your wallet the second the second feature in one of the main motivation for us to go in in that direction is because it makes the Contract easier to edit not easy to edit because the riddling solidity is very tricky but it makes it easier why because you have a good separation of the logic each module contains a certain piece of the logic and it's much easier to reason about
that given piece of the logic without having to consider the entire small contract and to give you some benchmark or base wallet so the contract that holds your funds your identity or collectible is less than 100 lines of course so that's more or less ok to add it basically all it does is enabling authorizing at the authorizing modules and then the module on average there will be a few hundred lines so really the two benefit of this approach is upgradability and easier to audit so what does that mean for the apps so as some of you may know we've done some some native integration of defy protocol how did we do that we
create a specific module that we put on Shane and that orchestrate the interaction of your wallet with a given protocol so for example we've enabled makers EDP maker dsr we know will soon enable make a vault and the way it works is that we can really orchestrate a set of operation for those who try to obey the CDP say seven or eight months ago you may remember that it require you to to send I think seven or eight transaction on the blockchain so for every transaction you had to sign a transaction wait for the transaction to be mines and a second one a third one it was a kind of a tedious process and because we use a smart contract with it you can actually put all the logic of that that that process all that orchestration in your smart contract and
what it means for the user is that in one click you can actually do something very complex and fully integrate with a protocol so and this is just one atomic transaction you can open a CDP wanted to make one transaction you can close the CDP and actually the use case of closing a CDP is very interesting because to close the CDP maker you need to have died to repay your debt and you need to have maker token to pay off fee and some of our users most of our users don't even make a token to pay this fee so what we realize is by using their orchestration we can actually connect different defy protocol together and so on Arjun when you actually close the CDP your wallet the contract will check does the user as died if not I will swap some it for the I does the user also make a
token if not I will swap someone unis WAP and then close the CDP so again closing a CDP something that could have taken I think 11 12 transaction if you didn't have the or make a token no just open in one transaction so for the user it's it's kind of a cool thing to do and to illustrate that we've made us a short video this is our DSR integration and you see how simple it is you define how much that you want to put in the DSR if you happy with the number you click Save my die and in one transaction once that transaction is mine that's it you've put some some die into DSR and you can start earning interest so that was a great start but we also knew from the start
that it was not a role to create a module a smart contract for every single defy protocol every single gap on the blockchain so as a second step we start thinking how can we open the arjun wallet to all the stuff that people are building on the ethereum blockchain and a solution we found to do that is to use what I'd connect so for those of you don't know what it connect the idea of what it connect is basically to establish a secure communication channel between ad app and a mobile wallet so we've integrated while it connect into argent so what will happen is that if you go to an app you can say I wanna sign in with wallet connect if the dev support it of court the app will show
you a QR code you scan that QR code you see a pop up on your phone do you want to connect to that DAP you say yes that's the first screen and once that done when you interact when you click on the button on the dap every time the dap needs to do an operation on the blockchain you will see a pop up on your wallet arch and wallet and you can confirm if you want to actually do that operation or not and what we managed to do is was to integrate when it connect within us a security model as i mentioned at the beginning of the torque with argent we have the concept of a daily limit that means that for a given 24 hours period you can only set assert send a certain amount of token to address that you don't know you don't trust the idea that
if for some reason someone has access to your phone they cannot drain your wallet because it will be bounded by whatever you have decide to set as you daily limit initially when you interact with the apps that app will ask you to approve certain amount of tokens and of course if you do that you are opening your wallet to consume you opening your wallet for the dab to consume this token so we added to embed that in our securing model and in our daily limit and I will show you in a second or that works and of course once you've done that you can do you can call a contract so this for example is a video of of using wallet connect to interact with pull together so as you can see it's quite simple you say I want to connect with one it connect you scan
the QR code you see the pop up of your on your phone you accept that's nice you say I want to buy 10 ticket you click buy ticket no put together ask you to approve to take some die and I want you to look at that number that's very interesting pull together is asking you to approve more than 10 billion die and most apps do that of course that's not secure so because our integration is with a within our security model we give you the possibility to modify that number if you know you wanna buy 10 die you shouldn't approve put together to take 10 billion die you should approve pull together to just take the precise amount off of dial once you approve your your Die transaction is being mine and then you can buy your ticket and when that's done that's cool you have new a10
you pull to get a ticket so we believe that that that's that's a good good user experience and it's probably as good as you can get today on the blockchain combining pull together which is a adapt with a great UI combining what it connect and combining Arjun which is awesome you get a pretty good user experience but we ask ourselves the question can we do better and of course we can do better in the previous video there is a clear pain point in that in that user experience is the fact that you need to approve your token I just want to buy 10 tickets why do I need to make 2 transaction why do I need to wait for that first transaction to be mined first of all it's it's complicated to understand for people in terms of
security is not good most apps like pull together ask you to approve an insane basically an infinitely large number of off token but most users they don't look at this contract they're approving I mean I did because I work with pull together to understand their contract but most users don't know which contract they are approving actually most contracts are becoming upgradeable so or do you know that the contract you approved the proxy you approved will not be changed in two month so basically by approving a large amount of token you're saying whoever control that address can take as much token as they want from for my wallet and that's the experience - they're on the blockchain so of course that's not acceptable finally - is gas in time because I need to make two transactions so that's
costly and I need to wait for two transactions to be mine so I mean overall it's just terribly bad our UX but as I showed you with our native integration with smart contract you can build bundle transactions so that's exactly what we've done but we've just been told two transactions so we've created a new method on a wallet call a proven call and with that all is the it does is that it approves some token and then it calls a contract that will consume the token that you have approved so in one atomic transaction you can actually do this approve of token and coding a contract and what's really cool another I'm excited to show you is that we've worked with pull together to actually enable that on the adapt so
it's not yet ready on the production side it's on the staging but they will add that in the coming days so you see first time I go to pull together same experience I scan the code fine I approve pull together know when I come back I say well buy 10 tickets and actually in the background pull together as detected that I am an argent wallet and that I have this new functionality approving call so it's just no it's just one transaction boom this is twice faster than the previous interaction so we are we've been working with pull together to enable that it should be live in a couple of days I think we are working with savvy as well so severe
we'd enable that that same feature so all as it works for apps so as a DAP developer of course we wanted to make that simple so we've created a small library that you can download on NPM we've call it smart wallet utils because actually it contains a few other utilities for small contract wallets all you need to do is basically define what it helper by passing your way through provider and the address of the wallet that is connected to you as a DAP and that helper will detect on the blockchain the type of what a that it is and if it's an urgent wallet or if it's a wallet that support disapprove and call then it will make an approving call if it's not it will do the normally
interaction so basically if it supports a proven call show one button if it does not show two button as the labs do today so literally has a dub developer this is for new lines of code and as I mentioned that library is called smart wali you tilt because it has contains a few more than utilities well for the moment just one more we also realized that a big pain pounds for that developer was to understand smart contract what it signatures because as you know smart contract cannot sign what is signing is a key that is authorized by the spa wallet to sign so there's a great IP to serve that AIP 1271 but actually most up don't support that yet so as part of that that's my wallet is library we've basically enabled that so know if you
connect to a one it connects to adapt by using a small helper you can actually validate the signature whether it's anyway or it's an argent wallet or any other wallet so that's that that's how easy it is for Deb to actually enable that now of course there's other smart one it out there I see a few folks from you know this over there what would be really nice of course is that if all smart wallet would actually be supported and supported experience and we know that nosy support bundle transaction I think etherium suppose that as well so basically we structured the library such that for another smart contract when a company all they need to do is define a configuration file that implements that
interface and that will basically contain the logic that is custom to to their wallet so in 50 lines of JavaScript you can basically enable that if we add that to the library that means that no these users coming with what it connect would also automatically be detected by the the wallet helper and they can use this approve and call functionality that we think is very interesting so all this is open source public so if you wanna we'll be happy for people to collaborate so check out get up and and reach to us if you're interested so that's actually the main part of what I wanted to show you today of course at Arjun we have a lot of stuffs coming so I wanted to kind of tease you with a few months we have a lot more natively for
integration coming so for now we have mainly maker khyber and compound we will support a lot more when I mean a lot I mean really a lot more defy protocol very soon so I think that's quite exciting another pain point that we identified discussing with apps like sadly and pull together is that they noticed that a lot of people these days they start to be a bit more mainstream that we have been used to and so that means there are people coming they've heard about this cool pulled together DAP but they don't much they don't know about the interim a blockchain yet and so when they come there they don't have a wallet and most of the youth these users they drop at that point because they don't understand what they're supposed to do so what we want to do is fix that that first step of the
onboarding experience which is enabling users that don't have a wallet to actually interact with we didn't exist in depth in the ideas that is to create a smart contract quality imagine wallet in the background no need to download the app you just sign in with say email and password and in two seconds you actually have a smart contract well it running in the background and you can start interact with the apps and after two weeks 2 month if you want to go further you want to do more on this day on blockchain then we invite you to to download the application and you can claim your Argent wallet to fully benefit from what it has to offer and with this I'm already done for those of you don't have an urgent wallet please
scan that code it will give you a golden token called the token is a way to skip the waiting list that we have for the moment so basically within 15 minutes or 5 minutes depending on me or how fast the block confirmation time is you will get an urgent wallet you can also do the same by hitting that link over there and of course you can ping us or Twitter or by email we'll be more than happy to engage and answer your questions thank you thank you [Applause] do we have question in the room anyone practical question I got the wallet on
my phone but I was sort of expecting that I could use an existing address an existing what address No now what's the reasoning behind it and will it be coming blah blah blah well your wallet is a smart contract so we need to deploy that smart contract and that smart contract as a given address so your address your identity will be the address of that smart contract now if you mean using an existing key to be the owner of your wallet that's not something we enable because for us we want this key should not be it should not surface in your application it's just a remote control it's part of your remote control so we'll rather create a fresh new one hide it and secure it as low as possible in your device so that
it is very unlikely that it will be compromised or exposed that's the reason so are you storing the private keys in the secure storage of the phone it's not in a secure Enclave because as actually explaining the talk before the secure Enclave does not support the curve that we use on a theorem of Bitcoin but of course we use the secure Enclave to encrypt yoki yeah so your keys is protected by the secure Enclave but it's not actually stored in the secure and clear because today it's not possible and so for the onboarding flow where you don't use the native application yet is
it as secure today or can you see that again for some reason I don't hear properly here so for the the flow where you don't require users to install the native application yet mm-hmm is this a key stored as secure as it is in the native app er so this flow we are still actually considering different options for exactly that first step there's this different possibility one route we are considering so this key can actually be stored in the storage of your web browser that's one thing local storage we are not too big fan of that solution another possibility would be to store it on on on TMS on Amazon but you would be the only one having access to to that key
that's one solution we are also discussing with partners like for example tourists tourists they can recreate a key using Shammi key spitting in your browser so that could be a solution to where that key so there's this different option we know the flow they still a few details that we need to decide what we want to implement or if you want to support different option and let the dubs decided this is not completely defined yet but we'll be happy to discuss further if you are interested thank you we have time for one last question if you want anyone hi I have a question that if have you
considered to creating a bridge for example if I have a CDP open on my own wallet and I really like origin but you open up a bridge like it's just weird or actually Olivia was in the room there is the one has written our integration transition to the vault so the vaults are coming I don't I don't think do we do do we that do that in so yes he's confirming we can do that in one operation so if you know you have a CDP in one operation it will be migrated to a vault and thank you ology okay that was a short one we still have time for one question if you want otherwise all right well thanks a lot more for the
incubation