Closed AmmarHumackicSQA closed 2 years ago
WalletConnect official social accounts
WalletConnect: Connecting wallets to dapps WalletConnect 2.0 - To Interchain and Beyond!
The above videos provide answers for the below questions:
Should we start implementing it in this stage of the project?
Are there any potential blockers regarding its implementation?
After doing more research and trying to find other implementations of wallet connect found this site: https://stellarterm.com/wallet-connect/
They have all the code of this website in github, and here is a service where they implement the integration with WalletConnect: https://github.com/stellarterm/stellarterm/blob/master/src/lib/driver/WalletConnectService.js
When visiting the first link if we try to login with WalletConnect a modal will be opened and you will notice the QRcode and also there's a description like: Open your WalletConnect-compatible app with Stellar support, like LOBSTR wallet, and scan the QR code to connect.
As I understand from what I have currently read about WalletConnect, in order for the pairing to be successful (between dApp and a Wallet) the configuration for WalletConnect which is setup inside the dApp in our case near-wallet-selector
when we try to create a connection(session) both the dApp and the wallet which implements WalletConnect need to know about the network of the blockchain(NEAR) in which they're trying to make the connection.
To prove this when visiting the first link and if we open the WalletConnect modal if we try to scan the QR code with any other wallet thant LOBSTR there will be no successful connection and the QRcode scanner will simply close.
Another resource worth having a look at is Binance docs for walletconnect, there you see a List of Wallets Supporting WalletConnect on Binance Chain which indicates that not only the dApp needs to have support for the Binance chain but also the wallet which the dApp is trying to connect with.
Thanks @kujtimprenkuSQA we're looking to build the integration for WalletConnect and cannot wait for another team to help. Thanks for the investigation
Description
The aim of this spike is to investigate the potential implementation of the WalletConnect protocol.
As mentioned by Mike, the WalletConnect should eventually show up as an option for the Wallet Selector. The idea is when someone chooses the WalletConnect option, the QR code is presented to the user on the website (dApp). The user then will open an app that implements a WalletConnect SDK on his mobile phone device (which has the private key).
The mobile phone scans and reads the QR code and gets two things:
The frontend and the mobile phone now can communicate. They know the same private key. They could sign some message and broadcast that signed message through the relay address, which is just a websocket connection, essentially. On the receiving end, the frontend or phone app can say, that the msg is received and the message was signed by the same key "grabbed" from the QR code.
So now there is a secure communication channel established between frontend and mobile phone.
For example, the user is on some dApp, buying some tokens, or getting ready for some DeFi trade, and when they click "Submit" the payload is signed and sent through the relayer to mobile phone. The payload would be something like:
There if the message is trusted, the transaction can be constructed, signed, and sent to the blockchain. (Or, send the bytes through the relay to the frontend, which sends it to the blockchain).
Resources
Available WalletConnect documentation: https://docs.walletconnect.com/
https://github.com/WalletConnect
https://moralis.io/what-is-walletconnect-the-ultimate-walletconnect-guide/
Onboard.js example:
https://zapper.fi/
https://github.com/blocknative/onboard/blob/develop/src/modules/select/wallets/wallet-connect.ts
Outcome
Time Box: 2 days