Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make user’s networks available to the app #170

Open
617a7aa opened this issue Oct 1, 2021 · 8 comments
Open

Make user’s networks available to the app #170

617a7aa opened this issue Oct 1, 2021 · 8 comments
Labels

Comments

@617a7aa
Copy link

617a7aa commented Oct 1, 2021

During the code injection, we should also make the network endpoints that are setup in the wallet available for the app to get.

Eg, we could retrieve the user's chosen endpoint for the 'mainnet' key through a function and return it as a URI to the app, eg 'https://stacks-node-api.mainnet.stacks.co'.

This is essential for decentralisation so apps prefers don't use their own hosted ones, but users use their ones locally.

@sub100ms is working on an superfast API for Stacks (codenamed Earth) that will be optimal for server-side rendered web apps. Data is fetched server-side from Earth rapidly and served to the user, then the user's browser validates the data with the user's local API node, enabling a very fast UX as well as maximum trust. We'll need this functionality to do this.

Perhaps relevant to Stacks Connect?

@markmhendrickson markmhendrickson transferred this issue from leather-wallet/extension Oct 1, 2021
@markmhendrickson
Copy link
Contributor

Thanks, I think is indeed most relevant to Connect so I've transferred the issue there.

@sub100ms do you have a general ETA for when you may be looking to release Earth? To help us with prioritizing this functionality on our end.

Is the idea here that the user would configure an alternative node manually in the wallet then the app would react by using it, assuming the app has no particular preference for Earth or a different network / API type?

Or should we be thinking of this the other way around, in that the app / app developer does have a preference for the user to "confirm" for usage with their wallet, and the app can use it independently without having to rely on the wallet's settings at all?

@617a7aa
Copy link
Author

617a7aa commented Oct 1, 2021

The former. We want to honour the user's decision and to encourage decentralisation.

We're aiming to have a sort of MVP for Earth out in maybe 6 months, I believe. We're working on an NFT API first, then this will be next I believe.

@kyranjamie
Copy link
Contributor

Is there a precedent for this feature? Metamask doesn't do it afaik.

This would introduce privacy concerns. What right does an app have to know what networks I have added? What if I have a personal development server added with an IP I'd rather keep private?

@617a7aa
Copy link
Author

617a7aa commented Oct 1, 2021

@kyranjamie the app would only be able to retrieve networks it knows about (eg, mainnet, testnet, regret). we could add a simple limit so it can only request 5 unique networks per app.

this means I could have a node with the key '9jjj64bs' that I use for private development and the app wouldn't be able to access it because it doesn't know the key and the extension limits the number of networks it knows about to 5.

ultimately, I think apps should use the user’s chosen node, rather than some hosted one.

@aulneau
Copy link
Contributor

aulneau commented Oct 1, 2021

I think this makes a lot of sense and is something I've brought up before, and if I remember correctly it is actually very common in Ethereum. It's unique in stacks that an app could be on a different network than what the user is in their extension.

@kyranjamie
Copy link
Contributor

Somewhat related: we want to ensure users give explicit permission before an app can change the actively selected network leather-wallet/extension#1281

@aviculturist
Copy link
Contributor

IMO, the whole idea of a wallet is that it keeps your keys safe and handles transactions with your chosen node. The notion that an app can silently bypass a user's node choice breaks with conventions and user expectations.

For example, an app that uses Metamask, as far as I know, cannot choose a different network than the user's currently selected one.

What is the argument for apps being able to select networks in the first place?

@617a7aa
Copy link
Author

617a7aa commented Oct 20, 2021

If we want to hide the node's real location, could we add a proxy to the wallet so that the app can call functions without needing to know the node's address?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 📋 Backlog
Development

No branches or pull requests

7 participants