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

feat: Add Support for verifyOwner #391

Merged
merged 6 commits into from
Aug 16, 2022

Conversation

kujtimprenkuSQA
Copy link
Contributor

@kujtimprenkuSQA kujtimprenkuSQA commented Aug 12, 2022

Description

  • Added support for verifyOwner to the API of all wallet integrations.
    • On MyNearWallet this feature is only supported on testnet
    • On Sender this feature works only when Sender is unlocked.
    • Other wallets throw a "Method not supported" error.

Note

The work for this PR initially started here: #320, there were some build issues that I was unable to solve quickly, I copied everything from there and addressed requested changes here in separate commits.

Closes #318.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Type of change. This type of change is the main reason for the PR.

  • FIX - a PR of this type patches a bug.
  • FEATURE - a PR of this type introduces a new feature.
  • BUILD - a PR of this type introduces build changes.
  • CI - a PR of this type introduces CI changes.
  • DOCS - a PR of this type introduces DOCS improvement.
  • STYLE - a PR of this type introduces style changes.
  • REFACTOR - a PR of this type introduces refactoring.
  • PERFORMANCE - a PR of this type introduces performance changes.
  • TEST - a PR of this type adds more tests.
  • CHORE - a PR introduces other changes than the specified above.

Breaking changes

  • BREAKING CHANGE - SPECIFY: _______
  • NO BREAKING CHANGE - this PR doesn't contain any breaking changes and it's backwards compatible

@kujtimprenkuSQA kujtimprenkuSQA marked this pull request as ready for review August 12, 2022 08:38
@github-actions github-actions bot changed the title Add Support for verifyOwner feat: Add Support for verifyOwner Aug 12, 2022
@AmmarHumackicSQA AmmarHumackicSQA requested review from MaximusHaximus and removed request for MaximusHaximus August 16, 2022 18:16
- Require `message`
- Remove unsupported 'signerId' and 'publicKey' arguments from caller interface
- Require `params` be passed to `verifyOwner` method in all cases.
- PublicKey and signer account ID uses active wallet account in all cases.
Copy link
Contributor

@MaximusHaximus MaximusHaximus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AmmarHumackicSQA @kujtimprenkuSQA I pushed a commit that made some tweaks to the signatures of the verifyOwner functions and types. In particular, message needed to be always required, no defaults should be passed in to avoid someone accidentally signing an 'empty' or default payload due to a coding error or other issue, and signerId and publicKey must be provided by the wallet who is signing the request (should not be provided as an argument). I think we're ready to land this unless you have any concerns about the final commit I added 👍

@lostpebble
Copy link
Contributor

Hi @kujtimprenkuSQA @MaximusHaximus ,

Is there some place where wallet developers can be notified of new APIs like this? We are only seeing this now (Meteor Wallet), and some integrators are asking us why we haven't implemented this. It would be great if there was some way to communicate these upcoming API changes that require updates from our side, as we'd really like to be ready for whatever direction the ecosystem is heading.

@AmmarHumackicSQA
Copy link
Contributor

Hi @lostpebble , right now you can track the releases, and also check the Developer tools updates (the latest one).

Maybe @janewang could give you more info about how upcoming changes like this will be communicated going forward. Thanks!

@janewang
Copy link
Contributor

@MaximusHaximus Could we please raise a NEP on this for the community, thanks! @lostpebble We will notify in the Wallet Vision Group as well as recordings of Wallet Standard Group.

@lostpebble
Copy link
Contributor

Hi @lostpebble , right now you can track the releases, and also check the Developer tools updates (the latest one).

Maybe @janewang could give you more info about how upcoming changes like this will be communicated going forward. Thanks!

Thanks, appreciate the links, but those updates are already too late- as those are releases of the Wallet Selector that we would need to have the functionality already built in from our side to be a part of.

@MaximusHaximus Could we please raise a NEP on this for the community, thanks! @lostpebble We will notify in the Wallet Vision Group as well as recordings of Wallet Standard Group.

Appreciate that. Understandably a lot of this is all new so it will take time for the processes to come into play. We are apart of the Wallet Vision Group, so will be keeping an eye out there. A project board of future functionality or something of the like might also go a long way.

@Cameron-Banyan
Copy link

As a working group member, I lean toward approving this proposal (NEP413) because it will

  • Speed up the performance of dApps by signing messages off-chain and creating flexible interactions between wallets and dApps
  • Enable authentication of any type of data through String “message”
  • Enable authentication without increasing storage costs of adding additional access keys
  • Increase room for web2 authentications like JWT tokens

frol pushed a commit to near/NEPs that referenced this pull request Feb 24, 2023
## Summary

This is a proposal for a new NEP regarding Wallet Standards. It covers
adding a new method 'verifyOwner` which signs a message and verifies
wallet ownership. The message is not sent to blockchain.

## References
This interface is now supported by Wallet Selector as shown below:

>
[near/wallet-selector#391](near/wallet-selector#391)

More developers within the ecosystem have also begun to add support for
this to their Wallets.

-
[https://github.com/near/wallet-selector/pull/436/files](https://github.com/near/wallet-selector/pull/436/files)
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 this pull request may close these issues.

6 participants