Skip to content

NEP-641: Off-chain Authorization Resolution for Wallet Contracts - #641

Open
frol wants to merge 6 commits into
masterfrom
nep-auth-resolve
Open

NEP-641: Off-chain Authorization Resolution for Wallet Contracts#641
frol wants to merge 6 commits into
masterfrom
nep-auth-resolve

Conversation

@frol

@frol frol commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Rendered NEP Markdown

It is open for discussion and we collaborate with DefuseLabs team on this.

@frol
frol requested a review from a team as a code owner June 2, 2026 07:39
Copilot AI review requested due to automatic review settings June 2, 2026 07:39
@github-project-automation github-project-automation Bot moved this to NEW in NEPs Jun 2, 2026
@github-project-automation github-project-automation Bot moved this to NEW❗ in DevRel Jun 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new standards-track NEP (NEP-641) specifying a w_auth_resolve view-function convention for on-chain verification of off-chain authorizations, including recursive resolution for composite wallets (e.g., multisigs) and a NEP-413 fallback for regular accounts.

Changes:

  • Introduces the NEP-641 specification for off-chain authorization resolution via w_auth_resolve.
  • Defines the wire types/JSON format, normative semantics (purpose/recipient binding, payload equality), and a caller-side recursive resolution algorithm.
  • Documents reference flows and security considerations for replay/downgrade/state-drift scenarios.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread neps/nep-0641.md
Comment thread neps/nep-0641.md
Comment thread neps/nep-0641.md
Comment on lines +697 to +700
Reference implementations are forthcoming:

- A minimal single-signer wallet contract gated by EIP-712 signatures: [`trezu/contracts/wallet/eip712`](https://github.com/frol-ai/intents/tree/main/contracts/wallet).
- A passkey-gated wallet contract using WebAuthn assertions: TBD.
@frol
frol marked this pull request as draft June 2, 2026 08:31
Comment thread neps/nep-0641.md Outdated
Updated NEAR account ID format in protocol flows and diagrams to reflect the use of deterministic account IDs. Adjusted references to wallet contracts and authorization processes accordingly.
@frol

frol commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator Author

The use-cases that this NEP would enable are:

  1. Sign in into a dApp with a proof of account ownership - e.g. Trezu allows to view the private address book (stored on Trezu backend) - PROVE_OWNERSHIP purpose
  2. Approve confidential swap intents with passkey/metamask/... - sign off-chain message and submit it to the confidential API - APPROVE_OFFCHAIN_ACTION purpose

frol added 2 commits June 3, 2026 21:59
There is no need to require using base64. Sometimes stringified JSON is enough.
Comment thread neps/nep-0641.md
@frol

frol commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator Author

This NEP is already implemented in the v0 of wallet contract for EIP-712 (Ethereum signMessage): near/intents#256 and on the client side it is integrated into NEAR Connect: azbang/near-connect#96, and it is live on https://trezu.org

@frol

frol commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator Author

One more consideration that I want to bring up - will w_resolve_auth be compatible with NEAR MPC? I need to model it before concluding this NEP.

…tivation for the NEP, explicitly mentioning MPC usecase
@frol
frol marked this pull request as ready for review July 24, 2026 12:26
@frol

frol commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

This NEP is already implemented for Wallet Contracts and they are live in production on Trezu:

Thus, this NEP is now ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: NEW❗
Status: NEW

Development

Successfully merging this pull request may close these issues.

3 participants