Joystream / joystream

Joystream Monorepo
http://www.joystream.org
GNU General Public License v3.0
1.42k stars 115 forks source link

Idea: WalletConnect Support for Joystream #4862

Closed bedeho closed 9 months ago

bedeho commented 1 year ago

Just starting this discussion here, because the forum is so hard to use without email notifications, impossible to keep track of replies.

I'm wondering whther the best path to allow all sorts of third party wallets to work with Joystream, such as Tangem for example, is to make Pioneer and other apps be able to use WalletConnect. Previously I thought WalletConnect was only for Ethereum, but that no longer seems to be the case, as it today supports Polkadot, Solana, NEAR and many other chains. Read more about this here https://docs.walletconnect.com/2.0/advanced/multichain/chain-list.

I'm not sure what exactly this will unlock for us, but we should explore it, if only for the reason to allow Tangem to work with Pioneer, so people can vote and stake through Pioneer.

kdembler commented 1 year ago

That's great news. I think WalletConnect is great, mostly because of improved security that comes from possible decoupling of browsing and wallet devices. You could:

I found SDK by parity to manage wallet connections and it actually has WalletConnect built in: https://github.com/paritytech/polkadot-onboard Haven't looked very closely at the API and how easy it would be to integrate into our apps but I really doubt it would be a lot of effort. SubWallet already supports WalletConnect and I was able to use my mobile wallet for signing transactions which is pretty neat, I wasn't aware they have support.

bedeho commented 1 year ago

I hope you can propose something in builders to get some integration going.

kdembler commented 1 year ago

So when this SDK, it is something we use in our apps, like Pioneer & Atlas, and when that is integrated, then any wallet connect wallet can use those apps, is it really that easy?

Yes, it would be used in apps like Pioneer & Atlas. Any wallet that supports Substrate and WalletConnect should be able to connect. So for example SubWallet, but not Metamask because it only supports EVM (without Snap plugin at least)

How does wallet connect ensure that the wallet actually can sign with the right kind of signature scheme? so for example, Metamask works with wallet connect, but I don't think metamask can sign with keys corresponding to our chain, because signature scheme is different?

Like above, wallet needs to support Substrate as well. The chain also needs to be "registered" in list of WalletConnect supported networks as I understand.

I think the most valubale thing for us is def. unlockin use of TAngem wallet with Pioneer, most narrowly, because it allows secure & convenient particiation in the DAO for council, leads, voters, stakers, and we really lack this.

Yeah, that would be definitely great although I cannot speak on Tangem support as I don't own it and can't test.

bedeho commented 1 year ago
kdembler commented 1 year ago

I don't know the specifics but there's definitely some kind of handshake/verification step.

Metamask supports two modes (maybe more, idk) of connection:

  1. "directly" where Metamask will inject its JS code into browser window so the app can interact with it by calling various functions,
  2. "relayed" via WalletConnect where the communication between user browser and the wallet happens over the internet, via some WalletConnect relay.

Depends on what your specific needs are, one of those may be more suitable for you. Direct method is probably more reliable because it's all local and I guess it may also offer some additional Metamask-specific APIs, but WalletConnect should be more secure and also let you connect a wallet that's not available in the browser.

kdembler commented 1 year ago

FYI, managed to send a tx via WalletConnect (with SubWallet): https://joystream.stg.subscan.io/extrinsic/4061263-1

bedeho commented 1 year ago

oh nice, from what app?

kdembler commented 1 year ago

localhost 😆

kdembler commented 9 months ago

Closing in favor of the implementation epic #5010