@dynamic-labs-wallet/browser 0.0.11 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -182,34 +182,24 @@ const downloadFileFromGoogleDrive = async ({ accessToken, name })=>{
182
182
  const BACKUP_FILENAME = 'dynamicWalletSecretBackup.json';
183
183
 
184
184
  class DynamicWalletClient {
185
- async serverInitializeKeyGen({ chainName, clientPrimaryKeygenId, clientSecondaryKeygenId, thresholdSignatureScheme }) {
185
+ async serverInitializeKeyGen({ chainName, clientKeygenIds, thresholdSignatureScheme }) {
186
186
  // Initilize keygen, create room, and create the wallet account on the server
187
187
  const data = await this.apiClient.createWalletAccount({
188
188
  chainName,
189
- clientKeygenIds: [
190
- clientPrimaryKeygenId,
191
- clientSecondaryKeygenId
192
- ],
189
+ clientKeygenIds,
193
190
  thresholdSignatureScheme
194
191
  });
195
192
  return data;
196
193
  }
197
- async clientInitializeKeyGen({ chainName }) {
194
+ async clientInitializeKeyGen({ chainName, thresholdSignatureScheme }) {
198
195
  // Get the mpc signer
199
196
  const mpcSigner = getMPCSigner({
200
197
  chainName,
201
198
  baseRelayUrl: this.baseMPCRelayApiUrl
202
199
  });
203
- // Initialize the keygen for the primary client and the secondary client shares
204
- const keygenInitResults = await Promise.all([
205
- mpcSigner.initKeygen(),
206
- mpcSigner.initKeygen()
207
- ]);
208
- const [clientPrimaryKeygenInitResult, clientSecondaryKeygenInitResult] = keygenInitResults;
209
- return {
210
- clientPrimaryKeygenInitResult,
211
- clientSecondaryKeygenInitResult
212
- };
200
+ const clientThreshold = core.getClientThreshold(thresholdSignatureScheme);
201
+ const keygenInitResults = await Promise.all(Array(clientThreshold).fill(null).map(()=>mpcSigner.initKeygen()));
202
+ return keygenInitResults;
213
203
  }
214
204
  async derivePublicKey({ chainName, keyShare }) {
215
205
  const mpcSigner = getMPCSigner({
@@ -225,72 +215,58 @@ class DynamicWalletClient {
225
215
  }
226
216
  return publicKey;
227
217
  }
228
- async clientKeyGen({ chainName, roomId, serverKeygenIds, clientPrimaryKeygenInitResult, clientSecondaryKeygenInitResult, thresholdSignatureScheme }) {
218
+ async clientKeyGen({ chainName, roomId, serverKeygenIds, clientKeygenInitResults, thresholdSignatureScheme }) {
229
219
  // Get the chain config and the mpc signer
230
- const chainConfig = core.getMPCChainConfig(chainName);
231
220
  const mpcSigner = getMPCSigner({
232
221
  chainName,
233
222
  baseRelayUrl: this.baseMPCRelayApiUrl
234
223
  });
235
- // All parties receive the keygenIds from all OTHER parties
236
- const clientPrimaryKeygenId = clientPrimaryKeygenInitResult.keygenId;
237
- const clientSecondaryKeygenId = clientSecondaryKeygenInitResult.keygenId;
238
- const clientPrimaryKeygenIds = [
239
- ...serverKeygenIds,
240
- clientSecondaryKeygenId
241
- ];
242
- const clientSecondaryKeygenIds = [
243
- ...serverKeygenIds,
244
- clientPrimaryKeygenId
245
- ];
246
224
  // Get the MPC config for the threshold signature scheme
247
225
  const mpcConfig = core.MPC_CONFIG[thresholdSignatureScheme];
248
- // All parties join the keygen room
249
- const keygenResults = await Promise.all([
250
- mpcSigner.keygen(roomId, mpcConfig.numberOfParties, mpcConfig.threshold, clientPrimaryKeygenInitResult, clientPrimaryKeygenIds),
251
- mpcSigner.keygen(roomId, mpcConfig.numberOfParties, mpcConfig.threshold, clientSecondaryKeygenInitResult, clientSecondaryKeygenIds)
252
- ]);
253
- const [clientPrimaryKeygenResult, clientSecondaryKeygenResult] = keygenResults;
254
- // Pick the derivation path of the public key you want to sign for
255
- const derivationPath = new Uint32Array(chainConfig.derivationPath);
256
- // Get the public key for the derivation path
257
- let rawPublicKey;
258
- if (mpcSigner instanceof libMpcWeb.Ecdsa) {
259
- rawPublicKey = await mpcSigner.derivePubkey(clientPrimaryKeygenResult, derivationPath);
260
- } else if (mpcSigner instanceof libMpcWeb.Ed25519) {
261
- rawPublicKey = await mpcSigner.derivePubkey(clientPrimaryKeygenResult, derivationPath);
262
- } else if (mpcSigner instanceof libMpcWeb.BIP340) {
263
- rawPublicKey = await mpcSigner.deriveTweakPubkey(clientPrimaryKeygenResult, derivationPath);
264
- }
226
+ // For each client keygen init result, create an array of other parties' keygenIds
227
+ const clientKeygenResults = await Promise.all(clientKeygenInitResults.map((currentInit)=>{
228
+ // Get all other client keygenIds (excluding current one)
229
+ const otherClientKeygenIds = clientKeygenInitResults.filter((init)=>init.keygenId !== currentInit.keygenId).map((init)=>init.keygenId);
230
+ // Combine server keygenIds with other client keygenIds
231
+ const allOtherKeygenIds = [
232
+ ...serverKeygenIds,
233
+ ...otherClientKeygenIds
234
+ ];
235
+ return mpcSigner.keygen(roomId, mpcConfig.numberOfParties, mpcConfig.threshold, currentInit, allOtherKeygenIds);
236
+ }));
237
+ // only need one client keygen result to derive the public key
238
+ const [clientKeygenResult] = clientKeygenResults;
239
+ const rawPublicKey = await this.derivePublicKey({
240
+ chainName,
241
+ keyShare: clientKeygenResult
242
+ });
265
243
  return {
266
244
  rawPublicKey,
267
- primaryKeygenResult: clientPrimaryKeygenResult,
268
- secondaryKeygenResult: clientSecondaryKeygenResult
245
+ clientKeygenResults
269
246
  };
270
247
  }
271
248
  async keyGen({ chainName, thresholdSignatureScheme }) {
272
249
  try {
273
- const { clientPrimaryKeygenInitResult, clientSecondaryKeygenInitResult } = await this.clientInitializeKeyGen({
274
- chainName
250
+ const clientKeygenInitResults = await this.clientInitializeKeyGen({
251
+ chainName,
252
+ thresholdSignatureScheme
275
253
  });
276
- const data = await this.serverInitializeKeyGen({
254
+ const clientKeygenIds = clientKeygenInitResults.map((result)=>result.keygenId);
255
+ const { roomId, serverKeygenIds } = await this.serverInitializeKeyGen({
277
256
  chainName,
278
- clientPrimaryKeygenId: clientPrimaryKeygenInitResult.keygenId,
279
- clientSecondaryKeygenId: clientSecondaryKeygenInitResult.keygenId,
257
+ clientKeygenIds,
280
258
  thresholdSignatureScheme
281
259
  });
282
- const { rawPublicKey, primaryKeygenResult, secondaryKeygenResult } = await this.clientKeyGen({
260
+ const { rawPublicKey, clientKeygenResults: clientKeyShares } = await this.clientKeyGen({
283
261
  chainName,
284
- roomId: data.roomId,
285
- serverKeygenIds: data.serverKeygenIds,
286
- clientPrimaryKeygenInitResult,
287
- clientSecondaryKeygenInitResult,
262
+ roomId,
263
+ serverKeygenIds,
264
+ clientKeygenInitResults,
288
265
  thresholdSignatureScheme
289
266
  });
290
267
  return {
291
268
  rawPublicKey,
292
- primaryKeygenResult,
293
- secondaryKeygenResult
269
+ clientKeyShares
294
270
  };
295
271
  } catch (error) {
296
272
  console.error('Error creating wallet account', error);
@@ -466,8 +442,8 @@ class DynamicWalletClient {
466
442
  }
467
443
  async offlineExportKey({ chainName, keyShares }) {
468
444
  try {
469
- if (!keyShares || keyShares.length !== 2) {
470
- throw new Error('Must provide 2 key shares');
445
+ if (!keyShares || keyShares.length < 2) {
446
+ throw new Error(`Must provide at least min threshold of key shares`);
471
447
  }
472
448
  const mpcSigner = getMPCSigner({
473
449
  chainName,
@@ -598,66 +574,50 @@ class DynamicWalletClient {
598
574
  return decryptedKeyShare;
599
575
  }
600
576
  async importRawPrivateKey({ chainName, privateKey, thresholdSignatureScheme }) {
601
- const chainConfig = core.getMPCChainConfig(chainName);
602
577
  const mpcSigner = getMPCSigner({
603
578
  chainName,
604
579
  baseRelayUrl: this.baseMPCRelayApiUrl
605
580
  });
606
- // 1. 2 parties on the client side create keygenInit
607
- const { clientPrimaryKeygenInitResult, clientSecondaryKeygenInitResult } = await this.clientInitializeKeyGen({
608
- chainName
609
- });
610
- const clientSecondaryKeygenId = clientSecondaryKeygenInitResult.keygenId;
611
- const clientPrimaryKeygenId = clientPrimaryKeygenInitResult.keygenId;
612
- // 2. server to create a room for importing the private key
613
- // server will do 3 things:
614
- // --- 1. init keygen for the server as a party
615
- // --- 2. open a room and return the roomId for the ceremony
616
- // --- 3. join the room as a party for the 2/3 ceremony
581
+ const clientKeygenInitResults = await this.clientInitializeKeyGen({
582
+ chainName,
583
+ thresholdSignatureScheme
584
+ });
585
+ const clientKeygenIds = clientKeygenInitResults.map((result)=>result.keygenId);
617
586
  const { roomId, serverKeygenIds } = await this.apiClient.importPrivateKey({
618
587
  chainName,
619
- clientKeygenIds: [
620
- clientPrimaryKeygenId,
621
- clientSecondaryKeygenId
622
- ],
588
+ clientKeygenIds,
623
589
  thresholdSignatureScheme
624
590
  });
625
591
  const { threshold } = core.getTSSConfig(thresholdSignatureScheme);
626
- // prep
627
- const importerKeygenIds = [
628
- ...serverKeygenIds,
629
- clientSecondaryKeygenId
630
- ];
631
- const recipientKeygenIds = [
632
- ...serverKeygenIds,
633
- clientPrimaryKeygenId
634
- ];
635
- // 3. Join the keygen room for the ceremony
636
- const [clientPrimaryKeygenResult, clientSecondaryKeygenResult] = await Promise.all([
637
- mpcSigner.importPrivateKeyImporter(roomId, threshold, privateKey, clientPrimaryKeygenInitResult, importerKeygenIds),
638
- mpcSigner.importPrivateKeyRecipient(roomId, threshold, clientSecondaryKeygenInitResult, recipientKeygenIds)
639
- ]);
640
- const derivationPath = new Uint32Array(chainConfig.derivationPath);
641
- // Get the public key for the derivation path
642
- let rawPublicKey;
643
- if (mpcSigner instanceof libMpcWeb.Ecdsa) {
644
- rawPublicKey = await mpcSigner.derivePubkey(clientPrimaryKeygenResult, derivationPath);
645
- } else if (mpcSigner instanceof libMpcWeb.Ed25519) {
646
- rawPublicKey = await mpcSigner.derivePubkey(clientPrimaryKeygenResult, derivationPath);
647
- } else if (mpcSigner instanceof libMpcWeb.BIP340) {
648
- rawPublicKey = await mpcSigner.deriveTweakPubkey(clientPrimaryKeygenResult, derivationPath);
649
- }
592
+ const clientKeygenResults = await Promise.all(clientKeygenInitResults.map((currentInit, index)=>{
593
+ const otherClientKeygenIds = clientKeygenInitResults.filter((init)=>init.keygenId !== currentInit.keygenId).map((init)=>init.keygenId);
594
+ if (index === 0) {
595
+ return mpcSigner.importPrivateKeyImporter(roomId, threshold, privateKey, currentInit, [
596
+ ...serverKeygenIds,
597
+ ...otherClientKeygenIds
598
+ ]);
599
+ } else {
600
+ return mpcSigner.importPrivateKeyRecipient(roomId, threshold, currentInit, [
601
+ ...serverKeygenIds,
602
+ ...otherClientKeygenIds
603
+ ]);
604
+ }
605
+ }));
606
+ const [clientKeygenResult] = clientKeygenResults;
607
+ const rawPublicKey = await this.derivePublicKey({
608
+ chainName,
609
+ keyShare: clientKeygenResult
610
+ });
650
611
  return {
651
612
  rawPublicKey,
652
- primaryKeygenResult: clientPrimaryKeygenResult,
653
- secondaryKeygenResult: clientSecondaryKeygenResult
613
+ clientKeyShares: clientKeygenResults
654
614
  };
655
615
  }
656
616
  async exportClientKeyshares({ accountAddress }) {
657
- const clientKeyshares = await this.getClientKeyshares({
617
+ const clientKeyShares = await this.getClientKeyShares({
658
618
  accountAddress
659
619
  });
660
- const text = JSON.stringify(clientKeyshares);
620
+ const text = JSON.stringify(clientKeyShares);
661
621
  const blob = new Blob([
662
622
  text
663
623
  ], {
@@ -669,7 +629,7 @@ class DynamicWalletClient {
669
629
  a.download = 'clientKeyshare.txt';
670
630
  a.click();
671
631
  }
672
- async getClientKeyshares({ accountAddress }) {
632
+ async getClientKeyShares({ accountAddress }) {
673
633
  const wallet = await this.getWallet({
674
634
  accountAddress
675
635
  });
package/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { SigningAlgorithm, MPC_RELAY_PROD_API_URL, getMPCChainConfig, MPC_CONFIG, getTSSConfig, DynamicApiClient } from '@dynamic-labs-wallet/core';
1
+ import { SigningAlgorithm, MPC_RELAY_PROD_API_URL, getMPCChainConfig, getClientThreshold, MPC_CONFIG, getTSSConfig, DynamicApiClient } from '@dynamic-labs-wallet/core';
2
2
  export * from '@dynamic-labs-wallet/core';
3
3
  import { BIP340, Ed25519, Ecdsa, MessageHash, EcdsaKeygenResult, Ed25519KeygenResult, BIP340KeygenResult } from '@dynamic-labs-wallet/lib-mpc-web';
4
4
  export { BIP340, BIP340InitKeygenResult, BIP340KeygenResult, Ecdsa, EcdsaInitKeygenResult, EcdsaKeygenResult, EcdsaPublicKey, EcdsaSignature, Ed25519, Ed25519InitKeygenResult, Ed25519KeygenResult, MessageHash } from '@dynamic-labs-wallet/lib-mpc-web';
@@ -182,34 +182,24 @@ const downloadFileFromGoogleDrive = async ({ accessToken, name })=>{
182
182
  const BACKUP_FILENAME = 'dynamicWalletSecretBackup.json';
183
183
 
184
184
  class DynamicWalletClient {
185
- async serverInitializeKeyGen({ chainName, clientPrimaryKeygenId, clientSecondaryKeygenId, thresholdSignatureScheme }) {
185
+ async serverInitializeKeyGen({ chainName, clientKeygenIds, thresholdSignatureScheme }) {
186
186
  // Initilize keygen, create room, and create the wallet account on the server
187
187
  const data = await this.apiClient.createWalletAccount({
188
188
  chainName,
189
- clientKeygenIds: [
190
- clientPrimaryKeygenId,
191
- clientSecondaryKeygenId
192
- ],
189
+ clientKeygenIds,
193
190
  thresholdSignatureScheme
194
191
  });
195
192
  return data;
196
193
  }
197
- async clientInitializeKeyGen({ chainName }) {
194
+ async clientInitializeKeyGen({ chainName, thresholdSignatureScheme }) {
198
195
  // Get the mpc signer
199
196
  const mpcSigner = getMPCSigner({
200
197
  chainName,
201
198
  baseRelayUrl: this.baseMPCRelayApiUrl
202
199
  });
203
- // Initialize the keygen for the primary client and the secondary client shares
204
- const keygenInitResults = await Promise.all([
205
- mpcSigner.initKeygen(),
206
- mpcSigner.initKeygen()
207
- ]);
208
- const [clientPrimaryKeygenInitResult, clientSecondaryKeygenInitResult] = keygenInitResults;
209
- return {
210
- clientPrimaryKeygenInitResult,
211
- clientSecondaryKeygenInitResult
212
- };
200
+ const clientThreshold = getClientThreshold(thresholdSignatureScheme);
201
+ const keygenInitResults = await Promise.all(Array(clientThreshold).fill(null).map(()=>mpcSigner.initKeygen()));
202
+ return keygenInitResults;
213
203
  }
214
204
  async derivePublicKey({ chainName, keyShare }) {
215
205
  const mpcSigner = getMPCSigner({
@@ -225,72 +215,58 @@ class DynamicWalletClient {
225
215
  }
226
216
  return publicKey;
227
217
  }
228
- async clientKeyGen({ chainName, roomId, serverKeygenIds, clientPrimaryKeygenInitResult, clientSecondaryKeygenInitResult, thresholdSignatureScheme }) {
218
+ async clientKeyGen({ chainName, roomId, serverKeygenIds, clientKeygenInitResults, thresholdSignatureScheme }) {
229
219
  // Get the chain config and the mpc signer
230
- const chainConfig = getMPCChainConfig(chainName);
231
220
  const mpcSigner = getMPCSigner({
232
221
  chainName,
233
222
  baseRelayUrl: this.baseMPCRelayApiUrl
234
223
  });
235
- // All parties receive the keygenIds from all OTHER parties
236
- const clientPrimaryKeygenId = clientPrimaryKeygenInitResult.keygenId;
237
- const clientSecondaryKeygenId = clientSecondaryKeygenInitResult.keygenId;
238
- const clientPrimaryKeygenIds = [
239
- ...serverKeygenIds,
240
- clientSecondaryKeygenId
241
- ];
242
- const clientSecondaryKeygenIds = [
243
- ...serverKeygenIds,
244
- clientPrimaryKeygenId
245
- ];
246
224
  // Get the MPC config for the threshold signature scheme
247
225
  const mpcConfig = MPC_CONFIG[thresholdSignatureScheme];
248
- // All parties join the keygen room
249
- const keygenResults = await Promise.all([
250
- mpcSigner.keygen(roomId, mpcConfig.numberOfParties, mpcConfig.threshold, clientPrimaryKeygenInitResult, clientPrimaryKeygenIds),
251
- mpcSigner.keygen(roomId, mpcConfig.numberOfParties, mpcConfig.threshold, clientSecondaryKeygenInitResult, clientSecondaryKeygenIds)
252
- ]);
253
- const [clientPrimaryKeygenResult, clientSecondaryKeygenResult] = keygenResults;
254
- // Pick the derivation path of the public key you want to sign for
255
- const derivationPath = new Uint32Array(chainConfig.derivationPath);
256
- // Get the public key for the derivation path
257
- let rawPublicKey;
258
- if (mpcSigner instanceof Ecdsa) {
259
- rawPublicKey = await mpcSigner.derivePubkey(clientPrimaryKeygenResult, derivationPath);
260
- } else if (mpcSigner instanceof Ed25519) {
261
- rawPublicKey = await mpcSigner.derivePubkey(clientPrimaryKeygenResult, derivationPath);
262
- } else if (mpcSigner instanceof BIP340) {
263
- rawPublicKey = await mpcSigner.deriveTweakPubkey(clientPrimaryKeygenResult, derivationPath);
264
- }
226
+ // For each client keygen init result, create an array of other parties' keygenIds
227
+ const clientKeygenResults = await Promise.all(clientKeygenInitResults.map((currentInit)=>{
228
+ // Get all other client keygenIds (excluding current one)
229
+ const otherClientKeygenIds = clientKeygenInitResults.filter((init)=>init.keygenId !== currentInit.keygenId).map((init)=>init.keygenId);
230
+ // Combine server keygenIds with other client keygenIds
231
+ const allOtherKeygenIds = [
232
+ ...serverKeygenIds,
233
+ ...otherClientKeygenIds
234
+ ];
235
+ return mpcSigner.keygen(roomId, mpcConfig.numberOfParties, mpcConfig.threshold, currentInit, allOtherKeygenIds);
236
+ }));
237
+ // only need one client keygen result to derive the public key
238
+ const [clientKeygenResult] = clientKeygenResults;
239
+ const rawPublicKey = await this.derivePublicKey({
240
+ chainName,
241
+ keyShare: clientKeygenResult
242
+ });
265
243
  return {
266
244
  rawPublicKey,
267
- primaryKeygenResult: clientPrimaryKeygenResult,
268
- secondaryKeygenResult: clientSecondaryKeygenResult
245
+ clientKeygenResults
269
246
  };
270
247
  }
271
248
  async keyGen({ chainName, thresholdSignatureScheme }) {
272
249
  try {
273
- const { clientPrimaryKeygenInitResult, clientSecondaryKeygenInitResult } = await this.clientInitializeKeyGen({
274
- chainName
250
+ const clientKeygenInitResults = await this.clientInitializeKeyGen({
251
+ chainName,
252
+ thresholdSignatureScheme
275
253
  });
276
- const data = await this.serverInitializeKeyGen({
254
+ const clientKeygenIds = clientKeygenInitResults.map((result)=>result.keygenId);
255
+ const { roomId, serverKeygenIds } = await this.serverInitializeKeyGen({
277
256
  chainName,
278
- clientPrimaryKeygenId: clientPrimaryKeygenInitResult.keygenId,
279
- clientSecondaryKeygenId: clientSecondaryKeygenInitResult.keygenId,
257
+ clientKeygenIds,
280
258
  thresholdSignatureScheme
281
259
  });
282
- const { rawPublicKey, primaryKeygenResult, secondaryKeygenResult } = await this.clientKeyGen({
260
+ const { rawPublicKey, clientKeygenResults: clientKeyShares } = await this.clientKeyGen({
283
261
  chainName,
284
- roomId: data.roomId,
285
- serverKeygenIds: data.serverKeygenIds,
286
- clientPrimaryKeygenInitResult,
287
- clientSecondaryKeygenInitResult,
262
+ roomId,
263
+ serverKeygenIds,
264
+ clientKeygenInitResults,
288
265
  thresholdSignatureScheme
289
266
  });
290
267
  return {
291
268
  rawPublicKey,
292
- primaryKeygenResult,
293
- secondaryKeygenResult
269
+ clientKeyShares
294
270
  };
295
271
  } catch (error) {
296
272
  console.error('Error creating wallet account', error);
@@ -466,8 +442,8 @@ class DynamicWalletClient {
466
442
  }
467
443
  async offlineExportKey({ chainName, keyShares }) {
468
444
  try {
469
- if (!keyShares || keyShares.length !== 2) {
470
- throw new Error('Must provide 2 key shares');
445
+ if (!keyShares || keyShares.length < 2) {
446
+ throw new Error(`Must provide at least min threshold of key shares`);
471
447
  }
472
448
  const mpcSigner = getMPCSigner({
473
449
  chainName,
@@ -598,66 +574,50 @@ class DynamicWalletClient {
598
574
  return decryptedKeyShare;
599
575
  }
600
576
  async importRawPrivateKey({ chainName, privateKey, thresholdSignatureScheme }) {
601
- const chainConfig = getMPCChainConfig(chainName);
602
577
  const mpcSigner = getMPCSigner({
603
578
  chainName,
604
579
  baseRelayUrl: this.baseMPCRelayApiUrl
605
580
  });
606
- // 1. 2 parties on the client side create keygenInit
607
- const { clientPrimaryKeygenInitResult, clientSecondaryKeygenInitResult } = await this.clientInitializeKeyGen({
608
- chainName
609
- });
610
- const clientSecondaryKeygenId = clientSecondaryKeygenInitResult.keygenId;
611
- const clientPrimaryKeygenId = clientPrimaryKeygenInitResult.keygenId;
612
- // 2. server to create a room for importing the private key
613
- // server will do 3 things:
614
- // --- 1. init keygen for the server as a party
615
- // --- 2. open a room and return the roomId for the ceremony
616
- // --- 3. join the room as a party for the 2/3 ceremony
581
+ const clientKeygenInitResults = await this.clientInitializeKeyGen({
582
+ chainName,
583
+ thresholdSignatureScheme
584
+ });
585
+ const clientKeygenIds = clientKeygenInitResults.map((result)=>result.keygenId);
617
586
  const { roomId, serverKeygenIds } = await this.apiClient.importPrivateKey({
618
587
  chainName,
619
- clientKeygenIds: [
620
- clientPrimaryKeygenId,
621
- clientSecondaryKeygenId
622
- ],
588
+ clientKeygenIds,
623
589
  thresholdSignatureScheme
624
590
  });
625
591
  const { threshold } = getTSSConfig(thresholdSignatureScheme);
626
- // prep
627
- const importerKeygenIds = [
628
- ...serverKeygenIds,
629
- clientSecondaryKeygenId
630
- ];
631
- const recipientKeygenIds = [
632
- ...serverKeygenIds,
633
- clientPrimaryKeygenId
634
- ];
635
- // 3. Join the keygen room for the ceremony
636
- const [clientPrimaryKeygenResult, clientSecondaryKeygenResult] = await Promise.all([
637
- mpcSigner.importPrivateKeyImporter(roomId, threshold, privateKey, clientPrimaryKeygenInitResult, importerKeygenIds),
638
- mpcSigner.importPrivateKeyRecipient(roomId, threshold, clientSecondaryKeygenInitResult, recipientKeygenIds)
639
- ]);
640
- const derivationPath = new Uint32Array(chainConfig.derivationPath);
641
- // Get the public key for the derivation path
642
- let rawPublicKey;
643
- if (mpcSigner instanceof Ecdsa) {
644
- rawPublicKey = await mpcSigner.derivePubkey(clientPrimaryKeygenResult, derivationPath);
645
- } else if (mpcSigner instanceof Ed25519) {
646
- rawPublicKey = await mpcSigner.derivePubkey(clientPrimaryKeygenResult, derivationPath);
647
- } else if (mpcSigner instanceof BIP340) {
648
- rawPublicKey = await mpcSigner.deriveTweakPubkey(clientPrimaryKeygenResult, derivationPath);
649
- }
592
+ const clientKeygenResults = await Promise.all(clientKeygenInitResults.map((currentInit, index)=>{
593
+ const otherClientKeygenIds = clientKeygenInitResults.filter((init)=>init.keygenId !== currentInit.keygenId).map((init)=>init.keygenId);
594
+ if (index === 0) {
595
+ return mpcSigner.importPrivateKeyImporter(roomId, threshold, privateKey, currentInit, [
596
+ ...serverKeygenIds,
597
+ ...otherClientKeygenIds
598
+ ]);
599
+ } else {
600
+ return mpcSigner.importPrivateKeyRecipient(roomId, threshold, currentInit, [
601
+ ...serverKeygenIds,
602
+ ...otherClientKeygenIds
603
+ ]);
604
+ }
605
+ }));
606
+ const [clientKeygenResult] = clientKeygenResults;
607
+ const rawPublicKey = await this.derivePublicKey({
608
+ chainName,
609
+ keyShare: clientKeygenResult
610
+ });
650
611
  return {
651
612
  rawPublicKey,
652
- primaryKeygenResult: clientPrimaryKeygenResult,
653
- secondaryKeygenResult: clientSecondaryKeygenResult
613
+ clientKeyShares: clientKeygenResults
654
614
  };
655
615
  }
656
616
  async exportClientKeyshares({ accountAddress }) {
657
- const clientKeyshares = await this.getClientKeyshares({
617
+ const clientKeyShares = await this.getClientKeyShares({
658
618
  accountAddress
659
619
  });
660
- const text = JSON.stringify(clientKeyshares);
620
+ const text = JSON.stringify(clientKeyShares);
661
621
  const blob = new Blob([
662
622
  text
663
623
  ], {
@@ -669,7 +629,7 @@ class DynamicWalletClient {
669
629
  a.download = 'clientKeyshare.txt';
670
630
  a.click();
671
631
  }
672
- async getClientKeyshares({ accountAddress }) {
632
+ async getClientKeyShares({ accountAddress }) {
673
633
  const wallet = await this.getWallet({
674
634
  accountAddress
675
635
  });
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/browser",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "dependencies": {
5
- "@dynamic-labs-wallet/core": "0.0.11",
6
- "@dynamic-labs-wallet/lib-mpc-web": "0.0.11"
5
+ "@dynamic-labs-wallet/core": "0.0.13",
6
+ "@dynamic-labs-wallet/lib-mpc-web": "0.0.13"
7
7
  },
8
8
  "publishConfig": {
9
9
  "access": "restricted"
package/src/client.d.ts CHANGED
@@ -19,41 +19,35 @@ export declare class DynamicWalletClient {
19
19
  baseApiUrl?: string;
20
20
  baseMPCRelayApiUrl?: string;
21
21
  });
22
- serverInitializeKeyGen({ chainName, clientPrimaryKeygenId, clientSecondaryKeygenId, thresholdSignatureScheme, }: {
22
+ serverInitializeKeyGen({ chainName, clientKeygenIds, thresholdSignatureScheme, }: {
23
23
  chainName: string;
24
- clientPrimaryKeygenId: string;
25
- clientSecondaryKeygenId: string;
24
+ clientKeygenIds: string[];
26
25
  thresholdSignatureScheme: ThresholdSignatureScheme;
27
26
  }): Promise<any>;
28
- clientInitializeKeyGen({ chainName }: {
27
+ clientInitializeKeyGen({ chainName, thresholdSignatureScheme, }: {
29
28
  chainName: string;
30
- }): Promise<{
31
- clientPrimaryKeygenInitResult: import("@dynamic-labs-wallet/lib-mpc-internal").BIP340InitKeygenResult;
32
- clientSecondaryKeygenInitResult: import("@dynamic-labs-wallet/lib-mpc-internal").BIP340InitKeygenResult;
33
- }>;
29
+ thresholdSignatureScheme: ThresholdSignatureScheme;
30
+ }): Promise<ClientInitKeygenResult[]>;
34
31
  derivePublicKey({ chainName, keyShare, }: {
35
32
  chainName: string;
36
33
  keyShare: ClientKeyShare;
37
34
  }): Promise<EcdsaPublicKey | Uint8Array | undefined>;
38
- clientKeyGen({ chainName, roomId, serverKeygenIds, clientPrimaryKeygenInitResult, clientSecondaryKeygenInitResult, thresholdSignatureScheme, }: {
35
+ clientKeyGen({ chainName, roomId, serverKeygenIds, clientKeygenInitResults, thresholdSignatureScheme, }: {
39
36
  chainName: string;
40
37
  roomId: string;
41
38
  serverKeygenIds: string[];
42
- clientPrimaryKeygenInitResult: ClientInitKeygenResult;
43
- clientSecondaryKeygenInitResult: ClientInitKeygenResult;
39
+ clientKeygenInitResults: ClientInitKeygenResult[];
44
40
  thresholdSignatureScheme: ThresholdSignatureScheme;
45
41
  }): Promise<{
46
42
  rawPublicKey: EcdsaPublicKey | Uint8Array | undefined;
47
- primaryKeygenResult: EcdsaKeygenResult | BIP340KeygenResult;
48
- secondaryKeygenResult: EcdsaKeygenResult | BIP340KeygenResult;
43
+ clientKeygenResults: ClientKeyShare[];
49
44
  }>;
50
45
  keyGen({ chainName, thresholdSignatureScheme, }: {
51
46
  chainName: string;
52
47
  thresholdSignatureScheme: ThresholdSignatureScheme;
53
48
  }): Promise<{
54
49
  rawPublicKey: EcdsaPublicKey | Uint8Array | undefined;
55
- primaryKeygenResult: EcdsaKeygenResult | BIP340KeygenResult;
56
- secondaryKeygenResult: EcdsaKeygenResult | BIP340KeygenResult;
50
+ clientKeyShares: ClientKeyShare[];
57
51
  }>;
58
52
  serverSign({ walletId, message, }: {
59
53
  walletId: string;
@@ -138,13 +132,12 @@ export declare class DynamicWalletClient {
138
132
  thresholdSignatureScheme: ThresholdSignatureScheme;
139
133
  }): Promise<{
140
134
  rawPublicKey: EcdsaPublicKey | Uint8Array | undefined;
141
- primaryKeygenResult: ClientKeyShare;
142
- secondaryKeygenResult: ClientKeyShare;
135
+ clientKeyShares: ClientKeyShare[];
143
136
  }>;
144
137
  exportClientKeyshares({ accountAddress }: {
145
138
  accountAddress?: string;
146
139
  }): Promise<void>;
147
- getClientKeyshares({ accountAddress }: {
140
+ getClientKeyShares({ accountAddress }: {
148
141
  accountAddress?: string;
149
142
  }): Promise<ClientKeyShare[]>;
150
143
  getWallet({ accountAddress }: {
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../packages/src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,wBAAwB,EACxB,gBAAgB,EAEjB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAIL,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAElB,cAAc,EACf,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAOrE,UAAU,gBAAgB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;CACrD;AAED,qBAAa,mBAAmB;IACvB,aAAa,EAAE,MAAM,CAAC;IAE7B,SAAS,CAAC,SAAS,EAAE,gBAAg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