feat(multisig-client): offline switch-guardian proposal creation (#433) - #436
Open
haseebrabbani wants to merge 1 commit into
Open
feat(multisig-client): offline switch-guardian proposal creation (#433)#436haseebrabbani wants to merge 1 commit into
haseebrabbani wants to merge 1 commit into
Conversation
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.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #433.
Adds
createSwitchGuardianProposalOffline(newGuardianEndpoint, newGuardianPubkey, { nonce }?)to the TS client — the creation counterpart to the existingimportProposal/signProposalOffline/executeProposaltrio, mirroring the Rustcreate_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 (Rustsync_network_onlyparity), verifies the new endpoint's/pubkeycommitment, builds and signs the summary locally, caches the proposal, and returns theExportedProposal(proposer signature included) for side-channel cosigning.Design notes:
buildSwitchGuardianSummaryshared withcreateSwitchGuardianProposal, so the online and offline proposals for the same operation cannot drift.importProposal+signProposalOfflineend to end rather than re-implementing them, so the local copy carries exactly the guarantees a cosigner-imported one does.computeCommitmentFromTxSummaryis now exported (second ask in the issue) and returns normalized hex, directly comparable toExportedProposal.commitment/Proposal.id.