interledger / web-monetization-extension

An open-source browser extension that enables Web Monetization.
Apache License 2.0
49 stars 3 forks source link

[FEATURE REQUEST] Replace copy/paste of public key with URL parameter to wallet provider #311

Closed jeremiahlee closed 2 days ago

jeremiahlee commented 3 months ago

Describe the feature you would like to request

I would like the extension onboard to have fewer steps the user must complete.

In the alpha 1 release, the user must copy a public key from the extension and paste it into the wallet provider's website.

https://github.com/interledger/web-monetization-extension/assets/106775223/1a2527d3-cf01-4e6a-b94b-74296af99fbe

Describe the solution you would like

  1. User enters wallet address and taps connect.
  2. Extension opens the wallet provider's website with the extension's public key as a URL parameter.
  3. Wallet provider authenticates the user and saves the extension's public key when the user confirms they want to authorize the amount to use from the wallet.

Additional context

I'm not sure if additional information can be passed along with the grant approval. If not, then the desired solution would be to first confirm the user wants to use this browser for Web Monetization (as a way to approve saving the public key) and then the grant approval for the budget is a second approval.

While Interledger does not control the wallet provider website, but it could define a URI scheme as part of the wallet provider specification. Something like https:// (walletProvider.example/usersWalletAddress) /keys/add?key= (public key contents here). Because the key is a public key, it's fine for it to be passed as a URL parameter, where it might be included in server access logs.

sidvishnoi commented 2 months ago

Some related discussion in https://github.com/interledger/web-monetization-extension/issues/332 also (but about removing keys, not adding).

sidvishnoi commented 2 months ago

During Slovenia work week, I proposed a potential approach, which the team generally agreed with. As the extension can control web pages (and we already use those permissions), we can emulate user adding the key, without requiring manual copy-paste. We can add a button "connect keys" (or something) in extension which will do the automatic key addition - we still want it happening on user interaction only (though, goal is to reduce amount of interaction required). If we fail to add, we fallback to the current copy-paste approach. It's a bit fragile (wallets changing UI), but the happy path would reduce UX overload a lot. This would require some major rework on connect screen UI, so it may or may not make it to beta release, but we aim to do so.

I plan to discuss another (long-term) approach in today's Rafiki community call. But we'll likely go with above approach until/if all wallets support a standardized way.

jeremiahlee commented 2 months ago

From the Slovenija work week: the approach proposed at the top was agreed to be technically viable. However, @AlexLakatos said current wallet providers are not willing to do any additional integration work. The proposed approach remains a long-term option.

I do not support implementing extension-controlled user agent automation. Technical workarounds for business development problems should be a last strategy.

sidvishnoi commented 1 week ago

Filed an issue for the long-term idea (https://github.com/interledger/rafiki/issues/2995). We've decided to go with the "browser automation with extension" idea for now.

sidvishnoi commented 2 days ago

Closing in favor of https://github.com/interledger/web-monetization-extension/issues/613