feat(sdk-coin-near): support MPCv2 consolidation recovery - #9560
Closed
Marzooqa wants to merge 1 commit into
Closed
Conversation
Add MPCv2 signed hot recovery support to recoverConsolidations(), following the same precomputedMaterial pattern used by IOTA/DOT/SUI: - recover() accepts an optional precomputedMaterial param and threads it through recoverNearToken()/signRecoveryTransaction() instead of re-detecting the keycard version per call - signRecoveryTransaction() reuses precomputedMaterial when supplied, otherwise detects the keycard version once via getEddsaSigningMaterial() - recoverConsolidations() detects signing material once before the scan loop and passes it into each recover() call, avoiding re-decryption per index; base address (index 0) is derived once via the shared EDDSAMethods.getInitializedMpcInstance() derivation used elsewhere - Add MPCv2 consolidation test coverage (signed sweep across two funded indexes, unsigned cold sweep, detection called exactly once) plus an MPCv1 regression test This covers the SDK hot signed path only, per ticket scope; WRW always strips walletPassphrase so WRW consolidation is unaffected. TICKET: WCI-1233
Contributor
Contributor
Author
|
Closing: this ticket assumes |
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.
What
precomputedMaterialpattern used by IOTA/DOT/SUI (WCI-1235, WCI-1236, WCI-1234).recover()andrecoverNearToken()accept an optionalprecomputedMaterialand thread it intosignRecoveryTransaction(), which reuses it instead of re-detecting the keycard version when supplied.recoverConsolidations()detects signing material once before the scan loop and passes it into eachrecover()call.Why
walletPassphrase), per ticket scope. WRW always stripswalletPassphrase, so WRW consolidation is unaffected.Near.recover()MPCv2 support itself is already in place (WCI-1223).Test plan
getEddsaSigningMaterialcalled exactly once regardless of scan range (spy assertion)yarn unit-test(171 passing),tsc --noEmit,eslintall cleanTICKET: WCI-1233
🤖 Generated with Claude Code