SEP-43 extension, Wallet Provider Discovery #2017
Replies: 1 comment 1 reply
|
This has been mentioned a couple of times in the Discord server (how to discover available wallets). My answer has always been that thinking it that way only accounts for wallets that have access to the website you are visiting, which includes: mobile wallets opening the site within in-app browsers and browser extensions... while leaving out all the wallets that don't follow that logic: browser-based wallets (getting more traction thanks to passkeys) hardware wallets and bridge-based wallets like WalletConnect. So at the end of the day we will still need to handle multiple ways to know if a wallet is available or not, without matter if this is adopted by everybody. That being said, I think it's still valuable to extend SEP-43 with this so we expect the same behavior from most of the wallets on the network. One quick thing about your first pain point: this only happens because Freighter uses two separate ways to talk with a site based on the nature of the wallet, for example, if you're using the site from the wallet, it won't matter whether this is implemented or not because if the site has not configured WalletConnect, it will just be incompatible with Freighter. It's the same for Lobstr but not for xBull, because xBull with the same module handles if is being used form a mobile phone, from the web version or from the extension. If we want to remove that pain point from the Freighter experience, we need to do what stellar/freighter-mobile#1001 is suggesting, but I wouldn't put the SDK in the Regarding |
Uh oh!
There was an error while loading. Please reload this page.
Problem
SEP-43 standardizes what an application can ask a wallet to do. It does not standardize how it finds the wallet. Every wallet is discovered through a wallet-specific side channel, which requires projects like Stellar Wallets Kit to implement bespoke modules per wallet in order to account for the differences.
Examples of pain points/work-arounds
FreighterModule.isAvailable()return false andWalletConnectModule.isPlatformWrapper()return true from a hardcoded list of providers. Sites that never configured WalletConnect show "Install Freighter" inside Freighter Mobile.window.stellarglobal, which is open to collisions from any other script.Proposal
A new SEP or an extension to SEP-43 which defines discovery for wallets.
Similarly to EIP-6963, we can use window events for announcement.
stellar:announceProviderfor wallets to announce they are ready to connect, or in response to astellar:requestProviderfrom the page.{ info, provider }where info carries metadata like a session identifier and provider identifier.How it resolves the problem cases
{ rdns: "app.freighter", platform: "mobile", wrapsPage: true }andwrapsPagemaps to the existing pattern in Stellar Wallets Kit of theisPlatformWrapperflag. This gets rid of the hard-coded checks and any future mobile wallet can use this pattern without a change to the Stellar Wallets Kit.window.stellarobject. No need for the sdk or coordination on the global interface.agentorexternal, the signing can stay on the agent side and Stellar Wallets Kit needs no special agent mode.Alternatives
Standardize
window.stellar: fixes some of the issues but is still subject to clashes.User-Agent sniffing: requires additions for every new wallet and provider type.
Keep maintaining a layer, like Stellar Wallets Kit, that absorbs the differences between providers. This required changes for every new wallet and provider.
All reactions