feat(sdk-core): add isEddsaMpcV1SigningMaterial format detector#8846
feat(sdk-core): add isEddsaMpcV1SigningMaterial format detector#8846bitgo-ai-agent-dev[bot] wants to merge 1 commit into
Conversation
4f1c19a to
2eec5ee
Compare
|
Needs rebase |
3e8652e to
b91c894
Compare
Export `isEddsaMpcV1SigningMaterial` from eddsaMPCv2.ts. The function decrypts an SJCL-encrypted keycard and checks for the structural shape of MPCv1 SigningMaterial (UShare.seed + at least one YShare.u). Returns false on any error so callers can safely branch to the MPCv2 path. Ticket: WCI-395 Session-Id: 5a65f0b2-1638-4b8c-b090-10d1a78ca491 Task-Id: f0c8184f-d80d-4652-af77-119a855e5029
1ffec78 to
1d396cc
Compare
|
Claude finished @rajangarg047's task —— View job PR Review: EdDSA MPCv1 Format Detector ✅Todo List:
Review SummaryThis PR adds a clean and secure format detector for EdDSA MPCv1 signing material. The implementation correctly identifies MPCv1 keycards by checking structural properties while gracefully failing back to the MPCv2 path on any error. ✅ StrengthsImplementation Quality:
Security:
Test Coverage:
📋 Code Review FindingsMethods (lines 51-63): async isEddsaMpcV1SigningMaterial(encryptedKeyShare: string, walletPassphrase: string): Promise<boolean> {
try {
const prv = await this.bitgo.decryptAsync({ input: encryptedKeyShare, password: walletPassphrase });
const signingMaterial = JSON.parse(prv);
return (
typeof signingMaterial?.uShare?.seed === 'string' &&
typeof signingMaterial?.bitgoYShare?.u === 'string' &&
(typeof signingMaterial?.backupYShare?.u === 'string' || typeof signingMaterial?.userYShare?.u === 'string')
);
} catch {
return false;
}
}Validation Logic:
Test Coverage Analysis:
🔍 Minor Observations
✅ ApprovalThis PR is ready for merge. The implementation is:
The detector function will correctly route MPCv1 material to the v1 path and safely fall back to v2 for all other cases, exactly as intended. |
Summary
isEddsaMpcV1SigningMaterialtomodules/sdk-core/src/bitgo/utils/tss/eddsa/eddsaMPCv2.tsuShare.seed+ at least oneYShare.ufieldfalseon any error (wrong passphrase, CBOR content, v2 Argon2id envelope) — both failure modes correctly route callers to the MPCv2 pathTest plan
trueuserYSharevariant → returnstruefalsefalse(forward-compat)false, does not throwundefinedpassphrase → returnsfalse, does not throwCloses WCI-395
🤖 Generated with Ralph