DimensionDev / Maskbook

The portal to the new, open Internet. ([I:b])
https://mask.io
GNU Affero General Public License v3.0
1.51k stars 310 forks source link

[Demand] External Wallet Provider Interface #1131

Closed neruthes closed 4 years ago

neruthes commented 4 years ago

Metadata

Field Value
Previous Stage ...
Figma Link Figma_Link_Here____
Expected UX prototype due 2020-W??-5
Actual UX prototype release -
Expected engineering due 2020-W??-5
Corresponding Pull Request -
Completion Version -

Introduction

A user shall be able to connect Maskbook to external wallet providers.

When connected, the user shall be able to see wallets provided by the External Wallet Provider in the list of Wallets.

General Principles

Local wallets will be marked as "Local". External wallets will be marked as "External". When no external wallet is added, both labels are invisible.

The External Wallet Provider can return an array of available wallets, where a wallet can already exist in the current Maskbook database as Local Wallet or External Wallet.

A wallet can come from multiple sources, including both Maskbook Local Wallet Database and External Wallet Providers. It is listed as multiple entries in the list of Wallets (Dashboard, wallet selection dialogue, etc).

Notes

wpmonty commented 4 years ago

Support for MetaMask in Gitcoin plugin or as P2P payments would be a game changer!

Jack-Works commented 4 years ago

Yes, we have a plan to support Metamask and did some experiment (but no active change these days)

Jack-Works commented 4 years ago

In #1349 currently, it can only use MetaMask as the wallet provider. I don't have a clue about how to merge the local wallet with the MetaMask wallet in the code level and UI/UX level. The easiest way to do this is to add a switch control. In local wallet mode, wallets from Metamask are not available and vice versa. But this way might not good for UX (they need to switch between if they need to use both).

neruthes commented 4 years ago

I suggest that both Providers should coexist for a long time before we gradually deprecate the native Provider.

On the UX level, some places require an indicator for Provider. These include:

Maskbook should display the same wallet as multiple wallet instances according to their Providers in the list of Wallets, because:

Suppose that a wallet may have multiple Providers. Maskbook knows that Wallet1 is included in the native Provider, and remembers that Wallet1 is also available in MetaMask; however, when the user removes MetaMask from the browser or removes Wallet1 from MetaMask, Maskbook can hardly be notified. Maskbook might still think that MetaMask has this Wallet. For a single-provider wallet, the user might have to manually delete the entry to delete the wallet (native provider) or the placeholder (external provider). For a multi-provider wallet, things are complicated.

Also notice that in future we may make desktop apps on macOS, Windows, and Linux (Catalyst, DotNET, Electron, GTK, etc). Maskbook apps in these environments can hardly communicate with MetaMask which is installed within Chrome/Firefox.

septs commented 4 years ago

I think it can be divided into two types of management

Jack-Works commented 4 years ago

Now in the code (metamask branch) we already have two types of wallets.

Managed wallets and Exotic wallets

neruthes commented 4 years ago

Now we have 3 competing terminology sets:

Probably we will have to choose one and use it consistently across discussions. A voting should be good?