Skip to content

fix: marinade multisig dapp requests by preserving original message bytes WPN-1035#608

Open
taran-a wants to merge 1 commit into
mainfrom
fix/marinade-multisig-messages
Open

fix: marinade multisig dapp requests by preserving original message bytes WPN-1035#608
taran-a wants to merge 1 commit into
mainfrom
fix/marinade-multisig-messages

Conversation

@taran-a

@taran-a taran-a commented Jun 5, 2026

Copy link
Copy Markdown

Fixes multisig dapp transaction signing by preserving the original transaction payload for external dapp origins.

  • Decode dapp-origin signTransaction and signAndSendTransaction requests as transactions directly, whether the payload is a full serialized transaction or a bare compiled transaction message.
  • Append only the snap account's signature, preserving existing signatures, compiled messageBytes, account ordering, and instruction account indices.
  • Keep the existing MetaMask-origin signing flow unchanged.
  • Add coverage for codec decoding, signer byte preservation, and wallet origin handling.
Screen.Recording.2026-06-04.at.19.54.59.mov

Note

Medium Risk
Changes core transaction signing for all external dapps and is documented as breaking; incorrect decoding could break signing, though origin gating and tests limit blast radius.

Overview
Fixes multisig and dapp signing (e.g. Marinade) by no longer decompiling and enriching dapp payloads before signing.

For non-MetaMask origins, signTransaction and signAndSendTransaction now decode the base64 payload as a transaction (full serialized tx or bare compiled message) and only add the wallet’s signature, keeping messageBytes, existing signatures, and account layout unchanged. MetaMask-origin requests still use the prior path that can fill fee payer, blockhash, and compute budget instructions.

New codec helpers (fromBase64StringCompiledMessageToTransaction, fromUnknowBase64StringToTransaction) and a preserveMessageBytes flag on partiallySignBase64String implement this. Changelog notes a breaking behavior change for dapp-origin signing.

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

@taran-a taran-a requested a review from a team as a code owner June 5, 2026 13:28
Comment thread packages/snap/CHANGELOG.md
@taran-a taran-a force-pushed the fix/marinade-multisig-messages branch from b0d9245 to 74941d7 Compare June 5, 2026 14:44
@taran-a taran-a requested a review from Battambang June 5, 2026 14:46
@taran-a taran-a force-pushed the fix/marinade-multisig-messages branch from 74941d7 to ffc53a2 Compare June 18, 2026 13:06
@taran-a taran-a force-pushed the fix/marinade-multisig-messages branch from ffc53a2 to 09a876d Compare June 18, 2026 13:23
@sonarqubecloud

Copy link
Copy Markdown

@taran-a

taran-a commented Jun 18, 2026

Copy link
Copy Markdown
Author

@metamaskbot publish-preview

@github-actions

Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/solana-wallet-snap@2.9.1-preview-09a876d

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.

2 participants