Skip to content

feat: add resolveAccountAddress method to KeyringHandler for dApp connectivity routing#590

Open
Battambang wants to merge 9 commits intomainfrom
feat/account-address-resolution
Open

feat: add resolveAccountAddress method to KeyringHandler for dApp connectivity routing#590
Battambang wants to merge 9 commits intomainfrom
feat/account-address-resolution

Conversation

@Battambang
Copy link
Copy Markdown
Contributor

@Battambang Battambang commented Mar 12, 2026

Explanation

This PR contributes to supporting the Bitcoin dApp connectivity.
It's adding the resolve account address Keyring method.

It is part from the initial PR #564 feat: enable account address resolution to support dApps connectivity to split the work into 3 smaller PRs:
#589 refactor: move validation structs and add account field
#590 feat: add resolveAccountAddress method to KeyringHandler for dApp connectivity routing
#591 feat: add confirmation dialog before sendTransfer and before signing a PSBT from the keyring handler

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Adds a new Keyring RPC method used for dapp request routing and tightens request validation shapes (including a required account.address field), which could affect compatibility with existing callers if they don’t send the new params.

Overview
Adds Keyring API support for keyring_resolveAccountAddress by implementing KeyringHandler.resolveAccountAddress, which validates the incoming Bitcoin request, filters accounts by scope, and returns a CAIP-10 style scope:address (or null on failure) to enable MetaMask dapp signing request routing.

Updates Bitcoin request validation by centralizing the Superstruct schemas in validation.ts (and reusing them from KeyringRequestHandler), requiring an explicit params.account.address across signing/PSBT/transfer/UTXO/message requests; tests and integration fixtures are adjusted accordingly. Changelog and snap manifest shasum are updated.

Reviewed by Cursor Bugbot for commit 6e614c7. Bugbot is set up for automated code reviews on this repo. Configure here.

@Battambang Battambang requested a review from a team as a code owner March 12, 2026 23:11
Comment thread packages/snap/src/handlers/KeyringHandler.ts Outdated
@Battambang
Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Copy Markdown
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/bitcoin-wallet-snap": "1.10.0-preview-4a5f56f"
}

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 626306b. Configure here.

Comment thread packages/snap/src/handlers/validation.ts
@Battambang
Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/bitcoin-wallet-snap": "1.10.1-preview-6e614c7"
}

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.

1 participant