Skip to content

Enhance InputRequest and permission model in docs#84

Open
iamalwaysuncomfortable wants to merge 6 commits into
masterfrom
design/wallet-specified-inputs
Open

Enhance InputRequest and permission model in docs#84
iamalwaysuncomfortable wants to merge 6 commits into
masterfrom
design/wallet-specified-inputs

Conversation

@iamalwaysuncomfortable

Copy link
Copy Markdown
Member

Description

This is a feature proposal for the wallet adapter that enables dapps to specify conditions for records or account info they want to use as inputs to functions. Currently for dapps to use Records, wallets must expose ALL records from a program, allowing the dapp to see all private state a user has. Also if the dapp wants to use the user's address, it has access to do so exposing the user's address to the dapp.

This proposed change would modify the behavior of the adapter to allow dapps to ask wallets and/or wallet users to specify:

  • Private inputs for fields marked .private
  • The currently active address as input
  • Records matching certain conditions that the wallet can attempt to find and use as input with user authorization.

The doc also proposes an extended permissions model for dapps to use to request access to record and address data from the wallet.

Type of Change

  • ✨ New feature proposal (non-breaking change which adds functionality)

Packages Changed

  • Documentation

Update InputRequest type to include new request kinds and clarify wallet behavior. Revise permission model and fulfillment flow for better user input handling.

Signed-off-by: Mike Turner <mike@provable.com>
@vercel

vercel Bot commented Apr 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aleo-dev-toolkit-documentation Ready Ready Preview, Comment May 6, 2026 6:20pm
aleo-dev-toolkit-react-app Ready Ready Preview, Comment May 6, 2026 6:20pm

Request Review

Signed-off-by: Mike Turner <mike@provable.com>
Rename `kind` to `type` and `RecordMatcher` to `RecordFieldFilter`. Reframe
the permission model as additive: `programs` and `decryptPermission` are
preserved exactly, with `recordAccess` and `viewKeyExposure` as new opt-in
fields. Drop `anyProgram` level. Document backward-compatibility guarantees,
interaction rules, and validation failure modes.
Make readAddress optional with default true. Add an Address exposure
subsection covering all four address-leakage surfaces (connect return,
_publicKey getter, init handler, plaintext-bearing methods) and their
behavior under readAddress: false. Document the decryptPermission:
NoDecrypt-only constraint and the deliberate signMessage leak.
Adds the dapp-facing types and signature changes from
docs/adapter-privacy-extension.md.

aleo-types: new InputRequest, RecordFilters, RecordFieldFilter,
TransactionInput types with isLiteralInput / hasInputRequest helpers.
TransactionOptions.inputs widens from string[] to TransactionInput[].

aleo-wallet-standard: new ConnectOptions, RecordAccessGrant, ProgramGrant,
RecordGrant, FieldGrant (with readAccess), ViewKeyExposure, plus a
hasUnsupportedConnectOptions helper. ConnectFeature.connect and
WalletAdapterProps.connect accept an optional fourth options argument.

aleo-wallet-adaptor/core: BaseAleoWalletAdapter.connect accepts options,
enforces the readAddress: false / decryptPermission: NoDecrypt precondition,
tracks _readAddress, and short-circuits decrypt, requestRecords,
transitionViewKeys, requestTransactionHistory under address withholding.
New error classes: WalletInputRequestNotSupportedError,
WalletConnectOptionsNotSupportedError, WalletAddressWithheldError. The new
types are re-exported from core for dapp ergonomics.

Wallet adapters: leo, fox, soter, puzzle widen connect with options? and
throw WalletConnectOptionsNotSupportedError when any of the new options are
set; their executeTransaction throws WalletInputRequestNotSupportedError
when any input is an InputRequest. Shield forwards options to the
extension and tolerates an empty address under readAddress: false.

react: AleoWalletProvider accepts new optional props recordAccess,
viewKeyExposure, readAddress and forwards them on every adapter.connect
call. Dependency arrays updated.

Doc: clarified that Account.address returns "" (empty string) under
readAddress: false rather than null, and that FieldGrant.readAccess
controls plaintext exposure independently of filterability.

@marshacb marshacb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Awesome proposal. The permission model is clearly thought through. My main question/concern is around the viewKey input type and making sure we nail down the substitution semantics before wallets start implementing it. The feature detection question is smaller but worth a one-liner so dapp authors have a clear upgrade path. Happy to dig deeper on either if helpful.

Comment thread docs/adapter-privacy-extension.md
Comment thread docs/adapter-privacy-extension.md
Implement wallet-specified record inputs and address permission grants

@dms120 dms120 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great to me 🙏 Aleo is a complex chain - with complex requirements that we can't go around but still the proposal is clear to me.

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.

4 participants