Skip to content

feat(multisig-client): offline switch-guardian proposal creation (#433) - #436

Open
haseebrabbani wants to merge 1 commit into
mainfrom
433-offline-switch-proposal
Open

feat(multisig-client): offline switch-guardian proposal creation (#433)#436
haseebrabbani wants to merge 1 commit into
mainfrom
433-offline-switch-proposal

Conversation

@haseebrabbani

Copy link
Copy Markdown
Collaborator

Closes #433.

Adds createSwitchGuardianProposalOffline(newGuardianEndpoint, newGuardianPubkey, { nonce }?) to the TS client — the creation counterpart to the existing importProposal / signProposalOffline / executeProposal trio, mirroring the Rust create_proposal_offline. Nothing is pushed to the current GUARDIAN, so an account can leave an unreachable operator (the 0xMiden/wallet#782 scenario): the method syncs with the Miden node (Rust sync_network_only parity), verifies the new endpoint's /pubkey commitment, builds and signs the summary locally, caches the proposal, and returns the ExportedProposal (proposer signature included) for side-channel cosigning.

Design notes:

  • The verify/build/metadata step is extracted into a private buildSwitchGuardianSummary shared with createSwitchGuardianProposal, so the online and offline proposals for the same operation cannot drift.
  • Caching and proposer signing reuse importProposal + signProposalOffline end to end rather than re-implementing them, so the local copy carries exactly the guarantees a cosigner-imported one does.
  • computeCommitmentFromTxSummary is now exported (second ask in the issue) and returns normalized hex, directly comparable to ExportedProposal.commitment / Proposal.id.
  • Only switch-guardian proposals can be created offline — every other type needs a GUARDIAN ack at execution (same restriction as Rust, moved to compile time by the per-type method).

Add createSwitchGuardianProposalOffline: build, sign, and cache a
switch-guardian proposal without contacting the current GUARDIAN, so an
account can leave an unreachable operator (mirrors the Rust
create_proposal_offline, including its pre-build network sync). The
returned ExportedProposal carries the proposer's signature and feeds the
existing importProposal / signProposalOffline / executeProposal trio.

The build step is shared with createSwitchGuardianProposal via
buildSwitchGuardianSummary so the online and offline proposals for the
same operation cannot drift, and the offline method reuses
importProposal + signProposalOffline for caching and signing instead of
re-implementing them.

Also export computeCommitmentFromTxSummary for hand-rolled
export/import flows, now returning normalized hex directly comparable
to proposal ids.
@haseebrabbani
haseebrabbani requested a review from zeljkoX as a code owner August 27, 2026 23:32
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 26a76765-a39b-4e03-80bd-9d0d4a47eebe


Comment @coderabbitai help to get the list of available commands.

Comment thread packages/miden-multisig-client/src/multisig.test.ts Dismissed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants