Skip to content

Commit c511afa

Browse files
Marzooqabitgobot
authored andcommitted
feat(sdk-core): define EdDSA MPCv2 key gen callback types
Add EddsaMPCv2KeyGenCallbacks interface and per-round callback type definitions to iWallets.ts, following the ECDSA MPCv2 pattern. Also define EddsaMPCv2SignedMessage (the PGP-signed DKG message type) and export all new types from index.ts. These types are the contract between the SDK orchestrator (createKeychainsWithExternalSigner, WCI-916) and external signer implementations (ME callback factory, WCI-895). Defining them first allows downstream tickets to reference a stable interface. Ticket: WCI-894 Session-Id: 2c2acd0f-2bbf-4fa3-a7a6-2026d16e3557 Task-Id: 9f88b5c5-449c-48b4-9f08-6de39e0c1c19
1 parent f328521 commit c511afa

2 files changed

Lines changed: 62 additions & 0 deletions

File tree

modules/sdk-core/src/bitgo/wallet/iWallets.ts

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,62 @@ export interface EddsaKeyGenCallbacks {
178178
finalizeCallback: EddsaKeyGenFinalizeCallback;
179179
}
180180

181+
/** A PGP-signed DKG message produced by a Silence Labs MPS party. */
182+
export interface EddsaMPCv2SignedMessage {
183+
message: string;
184+
signature: string;
185+
}
186+
187+
export type EddsaMPCv2KeyGenInitializeCallback = (params: {
188+
enterprise: string;
189+
bitgoPublicGpgKey: string;
190+
}) => Promise<{
191+
userGpgPublicKey: string;
192+
backupGpgPublicKey: string;
193+
userState: ExternalSignerMpcState;
194+
backupState: ExternalSignerMpcState;
195+
}>;
196+
197+
export type EddsaMPCv2KeyGenRound1Callback = (params: {
198+
bitgoPublicGpgKey: string;
199+
userGpgPublicKey: string;
200+
backupGpgPublicKey: string;
201+
userState: ExternalSignerMpcState;
202+
backupState: ExternalSignerMpcState;
203+
}) => Promise<{
204+
userSignedMsg1: EddsaMPCv2SignedMessage;
205+
backupSignedMsg1: EddsaMPCv2SignedMessage;
206+
userState: ExternalSignerMpcState;
207+
backupState: ExternalSignerMpcState;
208+
}>;
209+
210+
export type EddsaMPCv2KeyGenRound2Callback = (params: {
211+
bitgoMsg1: EddsaMPCv2SignedMessage;
212+
userSignedMsg1: EddsaMPCv2SignedMessage;
213+
backupSignedMsg1: EddsaMPCv2SignedMessage;
214+
userState: ExternalSignerMpcState;
215+
backupState: ExternalSignerMpcState;
216+
}) => Promise<{
217+
userSignedMsg2: EddsaMPCv2SignedMessage;
218+
backupSignedMsg2: EddsaMPCv2SignedMessage;
219+
userState: ExternalSignerMpcState;
220+
backupState: ExternalSignerMpcState;
221+
}>;
222+
223+
export type EddsaMPCv2KeyGenFinalizeCallback = (params: {
224+
bitgoMsg2: EddsaMPCv2SignedMessage;
225+
bitgoCommonKeychain: string;
226+
userState: ExternalSignerMpcState;
227+
backupState: ExternalSignerMpcState;
228+
}) => Promise<{ commonKeychain: string }>;
229+
230+
export interface EddsaMPCv2KeyGenCallbacks {
231+
initializeCallback: EddsaMPCv2KeyGenInitializeCallback;
232+
round1Callback: EddsaMPCv2KeyGenRound1Callback;
233+
round2Callback: EddsaMPCv2KeyGenRound2Callback;
234+
finalizeCallback: EddsaMPCv2KeyGenFinalizeCallback;
235+
}
236+
181237
export interface GenerateWalletOptions {
182238
label?: string;
183239
passphrase?: string;

modules/sdk-core/src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ export type {
1919
EddsaKeyGenFinalizeResult,
2020
ExternalSignerKeyShare,
2121
ExternalSignerMpcState,
22+
EddsaMPCv2SignedMessage,
23+
EddsaMPCv2KeyGenCallbacks,
24+
EddsaMPCv2KeyGenInitializeCallback,
25+
EddsaMPCv2KeyGenRound1Callback,
26+
EddsaMPCv2KeyGenRound2Callback,
27+
EddsaMPCv2KeyGenFinalizeCallback,
2228
} from './bitgo/wallet/iWallets';
2329
import { EcdsaUtils } from './bitgo/utils/tss/ecdsa/ecdsa';
2430
export { EcdsaUtils };

0 commit comments

Comments
 (0)