# WalletLogin by WalletConnect A simpler solution for wallet interactions ## Abstract An iframe-based SDK that onboards users into their default wallet per application. Supporting Metamask, WalletConnect and Torus. ## Problem The goal of this SDK is to reduce the choice fatigue that we currently have for Ethereum applications to connect to a wallet provider. Solutions like WalletConnect's Web3Modal and Blocknative's onboard.js have made it easier to display multiple choice for users to select a wallet but can also be overwhelming everytime you have to interact every time. Most importantly users unaware of these providers do not even know what to choose ## Solution An SDK called WalletLogin that cuts the choices down to three providers based on the user. Depending on the user's answers it will walk through multiple paths that will lead the user to a wallet provider. Additionally if the user provides an email it will record the user's option for each application and default to the previously selected option when re-visiting. Finally the user will be able to switch their option at any point by opening the pop-up in the right bottom corner (Intercom-style) to switch, connect or disconnect. ## User Paths All applications will display a button to "Connect" or "Login" for the user to trigger the modal. ### Email Prompt Cookie will be checked to verify the user's account if it has been logged in before. If not then the email will be verified to log in, but the user always has the option to skip the email. A returning user would default to the previous wallet use for the application otherwise it would be prompted to select wallet. ![](https://i.imgur.com/oujaWKy.png) ### Select Wallet If the user verified its email then we would be able to select a previously connected wallet and if not we would check if the user has an injected provider which would prompt them to maybe use it and if rejected then it would add a new wallet. ![](https://i.imgur.com/UuLvWcH.png) ### Add New Wallet When adding a new wallet there is only two possible choices because it has already been ruled out that the user does not have or want to use the injected one. Therefore we ask if the user has any wallet: if yes we ask them to use WalletConnect and if not we use the Torus account associated to the email. ![](https://i.imgur.com/k1hyFrZ.png) ### Open Popup Once the user has succesfully logged in then the user might want to switch or connect a new wallet so it can go back to any of the previous user stories through the popup in the bottom right corner. ![](https://i.imgur.com/nz9KYfa.png) ## UX Considerations The most important part of this SDK is that it removes most of the bandwidth required by the user to keep in mind which wallets has connected before to which applications. Additionally thanks to WalletConnect 2.0 features it can re-open new sessions easily with existing wallets without having to scan the qrcode again. Finally it would abstract a lot of inconsistencies that exist today with wallet management between different applications where some apps do not allow you to disconnect or switch wallets. ## Security Considerations All the user data can be encrypted using keys genereated from the HD wallet associated with the email. The email would be used for passwordless authentication through an OAuth provider which then can retrieve the Torus key that will be used for entropy. From that HD Wallet we can derive keys for multiple blockchains beyond Ethereum but also create keys for encrypting data. The recorded activity of the user in past applications can be encrypted to be stored on the server and only decrypted client-side. The client-side SDK would abstract all this sensitive data through an iframe which would contain all the session logic. ## Conclusion This SDK would basically bring together a lot of the white-label developed by Linkdrop plus the UX developed Unilogin team but without any of gas expenses required by smart contract wallets. It would rely simply on an email OAuth provider and the Torus network to recover keys to encrypt data and login to some applications. Most importantly it would still be compatible for users that want to use Metamask and WalletConnect while having an improved UX that memorizes their wallets of choice per each application.