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

Support multiple Limited Access Keys on BOS gateway to enable "Don't ask me again" when interacting with thirdparty contracts on BOS #148

Closed
frol opened this issue Oct 24, 2023 · 4 comments · Fixed by #156

Comments

@frol
Copy link

frol commented Oct 24, 2023

Is your feature request related to a problem? Please describe.

Here is the video recording: https://www.loom.com/share/61e95ce27c004e93a4f4ef8dd15422c9

As a user of DevHub, I don't want to be bothered with signing every single interaction (like or post on DevHub). Since DevHub uses their own contract, BOS gateway cannot sign the function call with the limited access key it has for social.near, so it falls back to signing it with a full access key and redirects to the wallet.

Describe the solution you'd like

As a user, I should be prompted with "Don't ask me again" prompt on the first interaction just like the regular experience of BOS likes and posts on social.near, and that would add a new limited access key that would be able to sign the function calls to the DevHub contract.

This will also be needed for FastAuth-created accounts (near/fast-auth-signer#97), but there is also a limitation of 4 access keys per zero-balance account, so access keys needs to be rotated somehow, I guess, but it is a different story...

@petersalomonsen
Copy link
Contributor

I believe in order to achieve this, you need to add support for adding multiple function access keys in each wallet implementation in the wallet selector. Like what I've already started working on here: https://github.com/near/wallet-selector/pull/887/files#diff-a5f9f24a017d7cfc607d1374e5cb05560b792b8f93d15e13ae6a13a9b29f36a8R177

@frol
Copy link
Author

frol commented Nov 23, 2023

@petersalomonsen Adding a function call access key is the most basic functionality of any NEAR Wallet as it was the first "login" implementation out there. I'm surprised it needs so much effort to add it to Wallet Selector

@petersalomonsen
Copy link
Contributor

Thanks for the response @frol, and you are right. I had a quick chat with @evgenykuzyakov , and he is proposing a better solution which is about managing a keystore in the VM and using near-api-js directly for the transactions that use function access keys. Obtaining these function access keys will be through a transaction with the signed in wallet. So should be no work on the wallet selector then, I will try creating an MVP for this.

evgenykuzyakov added a commit that referenced this issue Jan 8, 2024
…ccess-keys

Support multiple access keys in the VM. Allows widgets to request a function access key to a custom contract by issuing a regular transaction, the following transactions from the widgets will not require a wallet confirmation if the user approves that.

Preview URL: 

https://psalomobos.near.page/devhub.near/widget/app

Or see a demonstration video here:

https://youtu.be/CuwWv1zAKf4?si=lBUi9kXxRrhVjv-s

resolves #148 and NEAR-DevHub/neardevhub-bos#137
@frol
Copy link
Author

frol commented Jan 8, 2024

Resolved in #156

@frol frol closed this as completed Jan 8, 2024
evgenykuzyakov added a commit that referenced this issue Feb 28, 2024
## 2.6.0

- Support multiple Limited Access Keys on BOS gateway to enable "Don't ask me again" when interacting with third-party contracts on BOS. See #148

- Provide an error callback in the vm init method to allow gateways to capture handled errors

- FIX: Styled components were not possible to be extended due to an issue parsing Radix components
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants