@bcts/frost-hubert 1.0.0-alpha.21 → 1.0.0-alpha.23

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.
Files changed (75) hide show
  1. package/dist/bin/frost.cjs +3 -5
  2. package/dist/bin/frost.cjs.map +1 -1
  3. package/dist/bin/frost.mjs +3 -5
  4. package/dist/bin/frost.mjs.map +1 -1
  5. package/dist/{chunk-uaV2rQ02.cjs → chunk-CZWwpsFl.cjs} +22 -32
  6. package/dist/{chunk-ClPoSABd.mjs → chunk-CjcI7cDX.mjs} +6 -12
  7. package/dist/cmd/index.cjs +40 -43
  8. package/dist/cmd/index.d.cts +1 -3
  9. package/dist/cmd/index.d.mts +1 -3
  10. package/dist/cmd/index.mjs +3 -6
  11. package/dist/{sign-D8C3HJ4B.mjs → cmd-5yLeC_QL.mjs} +16 -44
  12. package/dist/cmd-5yLeC_QL.mjs.map +1 -0
  13. package/dist/{sign-2bOp18Fs.cjs → cmd-BfZjC3Uh.cjs} +182 -210
  14. package/dist/cmd-BfZjC3Uh.cjs.map +1 -0
  15. package/dist/dkg/index.cjs +341 -7
  16. package/dist/dkg/index.cjs.map +1 -0
  17. package/dist/dkg/index.d.cts +1 -1
  18. package/dist/dkg/index.d.mts +1 -1
  19. package/dist/dkg/index.mjs +335 -2
  20. package/dist/dkg/index.mjs.map +1 -0
  21. package/dist/frost/index.cjs +8 -9
  22. package/dist/frost/index.cjs.map +1 -1
  23. package/dist/frost/index.mjs +2 -3
  24. package/dist/frost/index.mjs.map +1 -1
  25. package/dist/{index-CcvTi5EA.d.cts → index-BJlwbPYu.d.cts} +3 -3
  26. package/dist/{index-CcvTi5EA.d.cts.map → index-BJlwbPYu.d.cts.map} +1 -1
  27. package/dist/{registry-impl-CE76sTXQ.d.cts → index-BMbPgH0W.d.cts} +1 -1
  28. package/dist/index-BMbPgH0W.d.cts.map +1 -0
  29. package/dist/{group-invite-Dz1Jmiky.d.cts → index-BkqLimZT.d.mts} +2 -2
  30. package/dist/index-BkqLimZT.d.mts.map +1 -0
  31. package/dist/{group-invite-Wk9CIbHL.d.mts → index-DmxfT59Y.d.cts} +2 -2
  32. package/dist/index-DmxfT59Y.d.cts.map +1 -0
  33. package/dist/{registry-impl-BETn_lEO.d.mts → index-DoV5HFvV.d.mts} +1 -1
  34. package/dist/index-DoV5HFvV.d.mts.map +1 -0
  35. package/dist/{index-DNCPeLNM.d.mts → index-Dzm1v4_4.d.mts} +3 -3
  36. package/dist/{index-DNCPeLNM.d.mts.map → index-Dzm1v4_4.d.mts.map} +1 -1
  37. package/dist/index.cjs +64 -68
  38. package/dist/index.cjs.map +1 -1
  39. package/dist/index.d.cts +3 -6
  40. package/dist/index.d.cts.map +1 -1
  41. package/dist/index.d.mts +3 -6
  42. package/dist/index.d.mts.map +1 -1
  43. package/dist/index.mjs +5 -9
  44. package/dist/index.mjs.map +1 -1
  45. package/dist/registry/index.cjs +806 -13
  46. package/dist/registry/index.cjs.map +1 -0
  47. package/dist/registry/index.d.cts +1 -1
  48. package/dist/registry/index.d.mts +1 -1
  49. package/dist/registry/index.mjs +792 -2
  50. package/dist/registry/index.mjs.map +1 -0
  51. package/dist/{registry-BDnNV1Rk.mjs → registry-CgrCZ4En.mjs} +7 -10
  52. package/dist/{registry-BDnNV1Rk.mjs.map → registry-CgrCZ4En.mjs.map} +1 -1
  53. package/dist/{registry-FMU-ec5K.cjs → registry-loI1_Mh1.cjs} +28 -31
  54. package/dist/registry-loI1_Mh1.cjs.map +1 -0
  55. package/package.json +17 -17
  56. package/src/cmd/dkg/participant/finalize.ts +1 -1
  57. package/src/dkg/proposed-participant.ts +1 -2
  58. package/src/frost/index.ts +1 -1
  59. package/src/registry/owner-record.ts +1 -2
  60. package/src/registry/participant-record.ts +1 -2
  61. package/dist/group-invite-CrbOabFL.cjs +0 -368
  62. package/dist/group-invite-CrbOabFL.cjs.map +0 -1
  63. package/dist/group-invite-Dz1Jmiky.d.cts.map +0 -1
  64. package/dist/group-invite-RPElq-fm.mjs +0 -338
  65. package/dist/group-invite-RPElq-fm.mjs.map +0 -1
  66. package/dist/group-invite-Wk9CIbHL.d.mts.map +0 -1
  67. package/dist/registry-FMU-ec5K.cjs.map +0 -1
  68. package/dist/registry-impl-BETn_lEO.d.mts.map +0 -1
  69. package/dist/registry-impl-C7w4awTv.cjs +0 -865
  70. package/dist/registry-impl-C7w4awTv.cjs.map +0 -1
  71. package/dist/registry-impl-CE76sTXQ.d.cts.map +0 -1
  72. package/dist/registry-impl-eYXVSPwM.mjs +0 -797
  73. package/dist/registry-impl-eYXVSPwM.mjs.map +0 -1
  74. package/dist/sign-2bOp18Fs.cjs.map +0 -1
  75. package/dist/sign-D8C3HJ4B.mjs.map +0 -1
@@ -1,7 +1,8 @@
1
- import { n as __require, t as __exportAll } from "./chunk-ClPoSABd.mjs";
2
- import { n as DkgInvite, t as DkgInvitation } from "./group-invite-RPElq-fm.mjs";
3
- import { a as resolveRegistryPath, c as ContributionPaths, d as PendingRequests, i as Registry, l as GroupParticipant, u as GroupRecord } from "./registry-impl-eYXVSPwM.mjs";
1
+ import { n as __require, t as __exportAll } from "./chunk-CjcI7cDX.mjs";
2
+ import { DkgInvitation, DkgInvite } from "./dkg/index.mjs";
3
+ import { ContributionPaths, GroupParticipant, GroupRecord, PendingRequests, Registry, resolveRegistryPath } from "./registry/index.mjs";
4
4
  import { aggregateSignatures, bytesToHex, createRng, createSigningPackage, deserializeKeyPackage, deserializePublicKeyPackage, deserializeSignatureShare, deserializeSigningCommitments, dkgPart1, dkgPart2, dkgPart3, hexToBytes as hexToBytes$1, identifierFromU16, identifierToHex, serializeDkgRound2Package, serializeKeyPackage, serializePublicKeyPackage, serializeSignature, serializeSignatureShare, serializeSigningCommitments, serializeSigningNonces, signingRound1, signingRound2 } from "./frost/index.mjs";
5
+ import "./registry-CgrCZ4En.mjs";
5
6
  import { ARID, JSON as JSON$1, Signature, XID } from "@bcts/components";
6
7
  import { CborDate } from "@bcts/dcbor";
7
8
  import { Envelope, Function } from "@bcts/envelope";
@@ -12,7 +13,6 @@ import * as fs from "node:fs";
12
13
  import * as path from "node:path";
13
14
  import { Ed25519Sha512, serde } from "@frosts/ed25519";
14
15
  import { CoefficientCommitment, Nonce, SigningNonces, VerifiableSecretSharingCommitment, round1, round2 } from "@frosts/core";
15
-
16
16
  //#region src/cmd/common.ts
17
17
  /**
18
18
  * Copyright © 2023-2026 Blockchain Commons, LLC
@@ -52,7 +52,6 @@ function setVerbose(value) {
52
52
  function isVerbose() {
53
53
  return verboseFlag;
54
54
  }
55
-
56
55
  //#endregion
57
56
  //#region src/cmd/busy.ts
58
57
  /**
@@ -77,7 +76,6 @@ async function getWithIndicator(client, arid, message, timeoutSeconds, verbose)
77
76
  else console.log(`${message}... not found`);
78
77
  return envelope;
79
78
  }
80
-
81
79
  //#endregion
82
80
  //#region src/cmd/parallel.ts
83
81
  /**
@@ -138,8 +136,8 @@ let Direction = /* @__PURE__ */ function(Direction) {
138
136
  */
139
137
  function directionEmoji(direction) {
140
138
  switch (direction) {
141
- case Direction.Get: return "⬇️";
142
- case Direction.Put: return "⬆️";
139
+ case "Get": return "⬇️";
140
+ case "Put": return "⬆️";
143
141
  }
144
142
  }
145
143
  /**
@@ -244,32 +242,32 @@ function logProgress(direction, name, status, message) {
244
242
  */
245
243
  async function parallelFetch(client, requests, validate, config) {
246
244
  const result = new CollectionResult();
247
- const timeoutSeconds = config.timeoutSeconds ?? DEFAULT_TIMEOUT_SECONDS;
245
+ const timeoutSeconds = config.timeoutSeconds ?? 600;
248
246
  if (config.verbose === true) console.error(`Waiting for ${requests.length} responses...`);
249
247
  const promises = requests.map(async ([xid, arid, name]) => {
250
248
  try {
251
249
  const envelope = await client.get(arid, timeoutSeconds);
252
250
  if (!envelope) {
253
251
  result.timeouts.push(xid);
254
- if (config.verbose === true) logProgress(Direction.Get, name, "timeout");
252
+ if (config.verbose === true) logProgress("Get", name, "timeout");
255
253
  return;
256
254
  }
257
255
  const parsed = validate(envelope, xid);
258
256
  if (parsed !== null && typeof parsed === "object" && "rejected" in parsed) {
259
257
  result.rejections.push([xid, parsed.rejected]);
260
- if (config.verbose === true) logProgress(Direction.Get, name, "error", parsed.rejected);
258
+ if (config.verbose === true) logProgress("Get", name, "error", parsed.rejected);
261
259
  } else {
262
260
  result.successes.push([xid, parsed]);
263
- if (config.verbose === true) logProgress(Direction.Get, name, "success");
261
+ if (config.verbose === true) logProgress("Get", name, "success");
264
262
  }
265
263
  } catch (error) {
266
264
  const errorMessage = error instanceof Error ? error.message : String(error);
267
265
  if (errorMessage.includes("Timeout") || errorMessage.includes("timeout")) {
268
266
  result.timeouts.push(xid);
269
- if (config.verbose === true) logProgress(Direction.Get, name, "timeout");
267
+ if (config.verbose === true) logProgress("Get", name, "timeout");
270
268
  } else {
271
269
  result.errors.push([xid, `${name}: ${errorMessage}`]);
272
- if (config.verbose === true) logProgress(Direction.Get, name, "error", errorMessage);
270
+ if (config.verbose === true) logProgress("Get", name, "error", errorMessage);
273
271
  }
274
272
  }
275
273
  });
@@ -294,11 +292,11 @@ async function parallelSend(client, messages, verbose) {
294
292
  try {
295
293
  await client.put(arid, envelope);
296
294
  results.push([xid, null]);
297
- if (verbose === true) logProgress(Direction.Put, name, "success");
295
+ if (verbose === true) logProgress("Put", name, "success");
298
296
  } catch (error) {
299
297
  const err = error instanceof Error ? error : new Error(String(error));
300
298
  results.push([xid, err]);
301
- if (verbose === true) logProgress(Direction.Put, name, "error", err.message);
299
+ if (verbose === true) logProgress("Put", name, "error", err.message);
302
300
  }
303
301
  });
304
302
  await Promise.all(promises);
@@ -310,7 +308,6 @@ async function parallelSend(client, messages, verbose) {
310
308
  }
311
309
  return results;
312
310
  }
313
-
314
311
  //#endregion
315
312
  //#region src/cmd/storage.ts
316
313
  /**
@@ -382,7 +379,6 @@ async function createStorageClient(selection, serverUrl) {
382
379
  }
383
380
  }
384
381
  }
385
-
386
382
  //#endregion
387
383
  //#region src/cmd/check.ts
388
384
  /**
@@ -393,7 +389,6 @@ async function createStorageClient(selection, serverUrl) {
393
389
  async function checkAridExists(client, arid) {
394
390
  return client.exists(arid);
395
391
  }
396
-
397
392
  //#endregion
398
393
  //#region src/cmd/dkg/common.ts
399
394
  /**
@@ -549,7 +544,6 @@ function signingKeyFromVerifying(verifyingKeyBytes) {
549
544
  const { SigningPublicKey: SigningPublicKeyClass } = __require("@bcts/components");
550
545
  return SigningPublicKeyClass.fromBytes(verifyingKeyBytes);
551
546
  }
552
-
553
547
  //#endregion
554
548
  //#region src/cmd/dkg/coordinator/invite.ts
555
549
  /**
@@ -634,7 +628,6 @@ async function invite$1(client, options, cwd) {
634
628
  envelopeUr: envelope.urString()
635
629
  };
636
630
  }
637
-
638
631
  //#endregion
639
632
  //#region src/cmd/dkg/coordinator/round1.ts
640
633
  /**
@@ -1071,7 +1064,6 @@ async function round1$4(client, options, cwd) {
1071
1064
  };
1072
1065
  }
1073
1066
  }
1074
-
1075
1067
  //#endregion
1076
1068
  //#region src/cmd/dkg/coordinator/round2.ts
1077
1069
  /**
@@ -1500,7 +1492,6 @@ async function round2$4(client, options, cwd) {
1500
1492
  };
1501
1493
  }
1502
1494
  }
1503
-
1504
1495
  //#endregion
1505
1496
  //#region src/cmd/dkg/coordinator/finalize.ts
1506
1497
  /**
@@ -1779,7 +1770,6 @@ async function finalize$2(client, options, cwd) {
1779
1770
  timeouts
1780
1771
  };
1781
1772
  }
1782
-
1783
1773
  //#endregion
1784
1774
  //#region src/cmd/dkg/coordinator/index.ts
1785
1775
  var coordinator_exports$1 = /* @__PURE__ */ __exportAll({
@@ -1794,7 +1784,6 @@ var coordinator_exports$1 = /* @__PURE__ */ __exportAll({
1794
1784
  updatePendingForFinalizeFromCollection: () => updatePendingForFinalizeFromCollection,
1795
1785
  validateAndExtractRound2Response: () => validateAndExtractRound2Response
1796
1786
  });
1797
-
1798
1787
  //#endregion
1799
1788
  //#region src/cmd/dkg/participant/receive.ts
1800
1789
  /**
@@ -1962,7 +1951,6 @@ async function receive$1(_client, options, cwd) {
1962
1951
  participantNames
1963
1952
  };
1964
1953
  }
1965
-
1966
1954
  //#endregion
1967
1955
  //#region src/cmd/dkg/participant/round1.ts
1968
1956
  /**
@@ -2162,7 +2150,6 @@ function resolveSenderXidDocument(registry, raw) {
2162
2150
  throw new Error(`Sender '${raw}' not found in registry`);
2163
2151
  }
2164
2152
  }
2165
-
2166
2153
  //#endregion
2167
2154
  //#region src/cmd/dkg/participant/round2.ts
2168
2155
  /**
@@ -2400,7 +2387,6 @@ async function round2$3(_client, options, cwd) {
2400
2387
  if (isVerbose() || options.verbose === true) console.error(`Posted Round 2 response to ${responseArid.urString()}`);
2401
2388
  return { listeningArid: nextResponseArid.urString() };
2402
2389
  }
2403
-
2404
2390
  //#endregion
2405
2391
  //#region src/cmd/dkg/participant/finalize.ts
2406
2392
  /**
@@ -2630,7 +2616,6 @@ async function finalize$1(_client, options, cwd) {
2630
2616
  publicKeyPackagePath
2631
2617
  };
2632
2618
  }
2633
-
2634
2619
  //#endregion
2635
2620
  //#region src/cmd/dkg/participant/index.ts
2636
2621
  var participant_exports$1 = /* @__PURE__ */ __exportAll({
@@ -2641,7 +2626,6 @@ var participant_exports$1 = /* @__PURE__ */ __exportAll({
2641
2626
  round1: () => round1$3,
2642
2627
  round2: () => round2$3
2643
2628
  });
2644
-
2645
2629
  //#endregion
2646
2630
  //#region src/cmd/dkg/index.ts
2647
2631
  var dkg_exports = /* @__PURE__ */ __exportAll({
@@ -2660,7 +2644,6 @@ var dkg_exports = /* @__PURE__ */ __exportAll({
2660
2644
  resolveSenderName: () => resolveSenderName$1,
2661
2645
  signingKeyFromVerifying: () => signingKeyFromVerifying
2662
2646
  });
2663
-
2664
2647
  //#endregion
2665
2648
  //#region src/cmd/sign/common.ts
2666
2649
  /**
@@ -2752,7 +2735,6 @@ var SignFinalizeContent = class SignFinalizeContent {
2752
2735
  return this._envelope;
2753
2736
  }
2754
2737
  };
2755
-
2756
2738
  //#endregion
2757
2739
  //#region src/cmd/sign/coordinator/invite.ts
2758
2740
  /**
@@ -2948,7 +2930,6 @@ async function invite(client, options, cwd) {
2948
2930
  startArid: sessionArids.startArid.urString()
2949
2931
  };
2950
2932
  }
2951
-
2952
2933
  //#endregion
2953
2934
  //#region src/cmd/sign/coordinator/round1.ts
2954
2935
  /**
@@ -3216,7 +3197,6 @@ async function round1$2(client, options, cwd) {
3216
3197
  for (const [xid, error] of failures) if (error !== null) console.error(`Failed to send to ${xid.urString()}: ${error.message}`);
3217
3198
  throw new Error(`Failed to send signRound2 requests to ${failures.length} participants`);
3218
3199
  }
3219
- /* @__PURE__ */ updatePendingForShare(registry, collection, startState);
3220
3200
  const displayPath = path.relative(cwd, commitmentsPath) || commitmentsPath;
3221
3201
  if (isVerbose() || options.verbose === true) {
3222
3202
  console.error();
@@ -3301,7 +3281,6 @@ async function round1$2(client, options, cwd) {
3301
3281
  };
3302
3282
  }
3303
3283
  }
3304
-
3305
3284
  //#endregion
3306
3285
  //#region src/cmd/sign/coordinator/round2.ts
3307
3286
  /**
@@ -3683,7 +3662,6 @@ async function round2$2(client, options, cwd) {
3683
3662
  timeouts: 0
3684
3663
  };
3685
3664
  }
3686
-
3687
3665
  //#endregion
3688
3666
  //#region src/cmd/sign/coordinator/index.ts
3689
3667
  var coordinator_exports = /* @__PURE__ */ __exportAll({
@@ -3704,7 +3682,6 @@ var coordinator_exports = /* @__PURE__ */ __exportAll({
3704
3682
  validateAndExtractCommitResponse: () => validateAndExtractCommitResponse,
3705
3683
  validateCoordinator: () => validateCoordinator
3706
3684
  });
3707
-
3708
3685
  //#endregion
3709
3686
  //#region src/cmd/sign/participant/receive.ts
3710
3687
  /**
@@ -3869,7 +3846,6 @@ async function receive(client, selection, options, cwd) {
3869
3846
  participantNames
3870
3847
  };
3871
3848
  }
3872
-
3873
3849
  //#endregion
3874
3850
  //#region src/cmd/sign/participant/round1.ts
3875
3851
  /**
@@ -4061,7 +4037,6 @@ async function round1$1(_client, options, cwd) {
4061
4037
  if (nextShareArid !== void 0) result.listeningArid = nextShareArid.urString();
4062
4038
  return result;
4063
4039
  }
4064
-
4065
4040
  //#endregion
4066
4041
  //#region src/cmd/sign/participant/round2.ts
4067
4042
  /**
@@ -4337,7 +4312,6 @@ async function round2$1(client, options, cwd) {
4337
4312
  if (options.verbose === true) console.error(`Posted signature share to ${responseArid.urString()}`);
4338
4313
  return { listeningArid: finalizeArid.urString() };
4339
4314
  }
4340
-
4341
4315
  //#endregion
4342
4316
  //#region src/cmd/sign/participant/finalize.ts
4343
4317
  /**
@@ -4711,7 +4685,6 @@ async function finalize(client, options, cwd) {
4711
4685
  signedEnvelope: signedEnvelopeStr
4712
4686
  };
4713
4687
  }
4714
-
4715
4688
  //#endregion
4716
4689
  //#region src/cmd/sign/participant/index.ts
4717
4690
  var participant_exports = /* @__PURE__ */ __exportAll({
@@ -4720,7 +4693,6 @@ var participant_exports = /* @__PURE__ */ __exportAll({
4720
4693
  round1: () => round1$1,
4721
4694
  round2: () => round2$1
4722
4695
  });
4723
-
4724
4696
  //#endregion
4725
4697
  //#region src/cmd/sign/index.ts
4726
4698
  var sign_exports = /* @__PURE__ */ __exportAll({
@@ -4730,7 +4702,7 @@ var sign_exports = /* @__PURE__ */ __exportAll({
4730
4702
  signingStateDir: () => signingStateDir,
4731
4703
  signingStateDirForGroup: () => signingStateDirForGroup
4732
4704
  });
4733
-
4734
4705
  //#endregion
4735
4706
  export { setVerbose as C, isVerbose as S, parallelFetchConfigWithTimeout as _, CollectionResult as a, putWithIndicator as b, buildFetchRequests as c, fetchStatusError as d, fetchStatusPending as f, parallelFetch as g, fetchStatusTimeout as h, createStorageClient as i, directionEmoji as l, fetchStatusSuccess as m, dkg_exports as n, DEFAULT_TIMEOUT_SECONDS as o, fetchStatusRejected as p, checkAridExists as r, Direction as s, sign_exports as t, emptyCollectionResult as u, parallelSend as v, groupStateDir as x, getWithIndicator as y };
4736
- //# sourceMappingURL=sign-D8C3HJ4B.mjs.map
4707
+
4708
+ //# sourceMappingURL=cmd-5yLeC_QL.mjs.map