At EthCC 2020 we introduced our new method for making Dapps faster, cheaper and safer to access from mobile wallets.
Weāve done this with Wallet Connect, the standard for securely connecting mobile wallets to desktop Dapps.
Hereās how, why it matters, and what you can do as a Dapp or Wallet developer to speed its adoption. You can also see the full talk here.
Weāve open sourced our work as we want everyone to be able to easily access Dapps. For Dapp developers itās just four new lines of code.
Quick background on Argent
For those new to Argent, the picture below is a quick overview. Weāre a smart contract wallet with the ease of use and security of a bank ā without the bank.
We also make it radically easier to access Dapps.
The Argent foundation from which you can explore the world of Dapps
Using Wallet Connect today
Argentās first integration with Wallet Connect ā note that āPre-authoriseā and āCall Contractā are separate steps, something we later solved, as detailed in this post
Argent first integrated Wallet Connect a few months ago. This meant you could use your mobile Argent wallet to access a desktop Dapp like Pool Together.
Importantly, we designed our integration differently to the traditional Wallet Connect approach. Why?
1. You should only approve what you want to spend
Most Dapps ask you to authorize them to potentially take a nearly unlimited amount of tokens (10āµā° actually) from your wallet. Argent only prompts you to approve the amount you want to spend.
2. You should be protected by your daily limit
With Argent, when you authorize a Dapp to interact with your wallet youāre protected by your daily transfer limit. This means thereās no risk of anyone draining your wallet. You can go over your daily limit with the help of your Guardians (friends or hardware wallets you trust).
3. You should be able to easily revoke a Dappās access to a token
Changed your mind about a Dapp? Revoke their access with a tap.
We felt our integration was as smooth as any involving a blockchain but we werenāt fully satisfied.
The problem was having to approve an ERC20 before a contract call. In Pool Together, for example, this meant having to make two transactions to buy some tickets. And having to wait for the first transaction to be mined.
The result could be a little cumbersome, wasnāt the best use of gas and time, and left room for further minimising the risks of super high ERC20 approvals.
We pushed ourselves to find a better way.
How can we do better?
Fortunately we can harness the power of smart contract wallets as they can bundle lots of transactions into one. This significantly simplifies the experience.
How have we done this?
- We have added a new approveAndCall() method to the wallet
- This orchestrates the approval of the exact amount of token required THEN executes the contract call.
All in one atomic transaction!
The result is a faster, cheaper and safer Dapp experience, as the video below showsā¦
The new and improved Dapp experience
Hereās how it works for Dapps
Weāve tried to make things easier for Dapp developers by creating a small NPM library: @argent/smartwallet-utils.
Itās only four new lines of code. The library also solves the problem Dapp developers have with smart contract wallet signatures.
Hereās Julien explaining it in more detail at ETHCC.
Weād love other smart-contract based wallets to add their config
Weāve open sourced this work. To increase adoption our library defines a simple interface to represent a wallet. Other smart contract wallet providers can simply add their implementation of that interface in the library to enable its features. It can be enabled in 50 lines of Javascript.
Next steps for Dapp Developers
- Check out our Github: https://github.com/argentlabs/argent-js
- Get in touch: dapps@argent.xyz
- Download Argent and test it out for yourself.
- Follow us on Twitter ā weāve got some exciting native DeFi integrations coming up
[Easier], better, faster, stronger ā Ethereum 2020
ā