@did-btcr2/method 0.26.0 → 0.27.0

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 (282) hide show
  1. package/README.md +86 -233
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/browser.js +24111 -20342
  4. package/dist/browser.mjs +24111 -20342
  5. package/dist/cjs/index.js +2463 -2174
  6. package/dist/esm/core/aggregation/cohort.js +178 -0
  7. package/dist/esm/core/aggregation/cohort.js.map +1 -0
  8. package/dist/esm/core/aggregation/errors.js +22 -0
  9. package/dist/esm/core/aggregation/errors.js.map +1 -0
  10. package/dist/esm/core/{beacon/aggregation/cohort → aggregation}/messages/base.js +0 -1
  11. package/dist/esm/core/aggregation/messages/base.js.map +1 -0
  12. package/dist/esm/core/aggregation/messages/constants.js +26 -0
  13. package/dist/esm/core/aggregation/messages/constants.js.map +1 -0
  14. package/dist/esm/core/aggregation/messages/factories.js +113 -0
  15. package/dist/esm/core/aggregation/messages/factories.js.map +1 -0
  16. package/dist/esm/core/aggregation/messages/guards.js +37 -0
  17. package/dist/esm/core/aggregation/messages/guards.js.map +1 -0
  18. package/dist/esm/core/aggregation/messages/index.js +5 -0
  19. package/dist/esm/core/aggregation/messages/index.js.map +1 -0
  20. package/dist/esm/core/aggregation/participant.js +376 -0
  21. package/dist/esm/core/aggregation/participant.js.map +1 -0
  22. package/dist/esm/core/aggregation/phases.js +39 -0
  23. package/dist/esm/core/aggregation/phases.js.map +1 -0
  24. package/dist/esm/core/aggregation/runner/events.js +2 -0
  25. package/dist/esm/core/aggregation/runner/events.js.map +1 -0
  26. package/dist/esm/core/aggregation/runner/index.js +5 -0
  27. package/dist/esm/core/aggregation/runner/index.js.map +1 -0
  28. package/dist/esm/core/aggregation/runner/participant-runner.js +282 -0
  29. package/dist/esm/core/aggregation/runner/participant-runner.js.map +1 -0
  30. package/dist/esm/core/aggregation/runner/service-runner.js +290 -0
  31. package/dist/esm/core/aggregation/runner/service-runner.js.map +1 -0
  32. package/dist/esm/core/aggregation/runner/typed-emitter.js +80 -0
  33. package/dist/esm/core/aggregation/runner/typed-emitter.js.map +1 -0
  34. package/dist/esm/core/aggregation/service.js +416 -0
  35. package/dist/esm/core/aggregation/service.js.map +1 -0
  36. package/dist/esm/core/aggregation/signing-session.js +133 -0
  37. package/dist/esm/core/aggregation/signing-session.js.map +1 -0
  38. package/dist/esm/core/aggregation/transport/didcomm.js +32 -0
  39. package/dist/esm/core/aggregation/transport/didcomm.js.map +1 -0
  40. package/dist/esm/core/aggregation/transport/error.js +12 -0
  41. package/dist/esm/core/aggregation/transport/error.js.map +1 -0
  42. package/dist/esm/core/aggregation/transport/factory.js +20 -0
  43. package/dist/esm/core/aggregation/transport/factory.js.map +1 -0
  44. package/dist/esm/core/aggregation/transport/index.js +6 -0
  45. package/dist/esm/core/aggregation/transport/index.js.map +1 -0
  46. package/dist/esm/core/aggregation/transport/nostr.js +262 -0
  47. package/dist/esm/core/aggregation/transport/nostr.js.map +1 -0
  48. package/dist/esm/core/aggregation/transport/transport.js +2 -0
  49. package/dist/esm/core/aggregation/transport/transport.js.map +1 -0
  50. package/dist/esm/core/beacon/beacon.js +80 -0
  51. package/dist/esm/core/beacon/beacon.js.map +1 -1
  52. package/dist/esm/core/beacon/cas-beacon.js +15 -56
  53. package/dist/esm/core/beacon/cas-beacon.js.map +1 -1
  54. package/dist/esm/core/beacon/error.js +0 -10
  55. package/dist/esm/core/beacon/error.js.map +1 -1
  56. package/dist/esm/core/beacon/fee-estimator.js +30 -0
  57. package/dist/esm/core/beacon/fee-estimator.js.map +1 -0
  58. package/dist/esm/core/beacon/singleton-beacon.js +10 -53
  59. package/dist/esm/core/beacon/singleton-beacon.js.map +1 -1
  60. package/dist/esm/core/beacon/smt-beacon.js +85 -9
  61. package/dist/esm/core/beacon/smt-beacon.js.map +1 -1
  62. package/dist/esm/core/identifier.js +13 -0
  63. package/dist/esm/core/identifier.js.map +1 -1
  64. package/dist/esm/core/resolver.js +9 -0
  65. package/dist/esm/core/resolver.js.map +1 -1
  66. package/dist/esm/index.js +14 -24
  67. package/dist/esm/index.js.map +1 -1
  68. package/dist/types/core/aggregation/cohort.d.ts +94 -0
  69. package/dist/types/core/aggregation/cohort.d.ts.map +1 -0
  70. package/dist/types/core/aggregation/errors.d.ts +14 -0
  71. package/dist/types/core/aggregation/errors.d.ts.map +1 -0
  72. package/dist/types/core/{beacon/aggregation/cohort → aggregation}/messages/base.d.ts +7 -1
  73. package/dist/types/core/aggregation/messages/base.d.ts.map +1 -0
  74. package/dist/types/core/aggregation/messages/constants.d.ts +23 -0
  75. package/dist/types/core/aggregation/messages/constants.d.ts.map +1 -0
  76. package/dist/types/core/aggregation/messages/factories.d.ts +177 -0
  77. package/dist/types/core/aggregation/messages/factories.d.ts.map +1 -0
  78. package/dist/types/core/aggregation/messages/guards.d.ts +11 -0
  79. package/dist/types/core/aggregation/messages/guards.d.ts.map +1 -0
  80. package/dist/types/core/aggregation/messages/index.d.ts +5 -0
  81. package/dist/types/core/aggregation/messages/index.d.ts.map +1 -0
  82. package/dist/types/core/aggregation/participant.d.ts +101 -0
  83. package/dist/types/core/aggregation/participant.d.ts.map +1 -0
  84. package/dist/types/core/aggregation/phases.d.ts +49 -0
  85. package/dist/types/core/aggregation/phases.d.ts.map +1 -0
  86. package/dist/types/core/aggregation/runner/events.d.ts +89 -0
  87. package/dist/types/core/aggregation/runner/events.d.ts.map +1 -0
  88. package/dist/types/core/aggregation/runner/index.d.ts +5 -0
  89. package/dist/types/core/aggregation/runner/index.d.ts.map +1 -0
  90. package/dist/types/core/aggregation/runner/participant-runner.d.ts +107 -0
  91. package/dist/types/core/aggregation/runner/participant-runner.d.ts.map +1 -0
  92. package/dist/types/core/aggregation/runner/service-runner.d.ts +102 -0
  93. package/dist/types/core/aggregation/runner/service-runner.d.ts.map +1 -0
  94. package/dist/types/core/aggregation/runner/typed-emitter.d.ts +41 -0
  95. package/dist/types/core/aggregation/runner/typed-emitter.d.ts.map +1 -0
  96. package/dist/types/core/aggregation/service.d.ts +112 -0
  97. package/dist/types/core/aggregation/service.d.ts.map +1 -0
  98. package/dist/types/core/aggregation/signing-session.d.ts +69 -0
  99. package/dist/types/core/aggregation/signing-session.d.ts.map +1 -0
  100. package/dist/types/core/aggregation/transport/didcomm.d.ts +20 -0
  101. package/dist/types/core/aggregation/transport/didcomm.d.ts.map +1 -0
  102. package/dist/types/core/{beacon/aggregation/communication → aggregation/transport}/error.d.ts +2 -2
  103. package/dist/types/core/aggregation/transport/error.d.ts.map +1 -0
  104. package/dist/types/core/aggregation/transport/factory.d.ts +13 -0
  105. package/dist/types/core/aggregation/transport/factory.d.ts.map +1 -0
  106. package/dist/types/core/aggregation/transport/index.d.ts +6 -0
  107. package/dist/types/core/aggregation/transport/index.d.ts.map +1 -0
  108. package/dist/types/core/aggregation/transport/nostr.d.ts +55 -0
  109. package/dist/types/core/aggregation/transport/nostr.d.ts.map +1 -0
  110. package/dist/types/core/aggregation/transport/transport.d.ts +37 -0
  111. package/dist/types/core/aggregation/transport/transport.d.ts.map +1 -0
  112. package/dist/types/core/beacon/beacon.d.ts +37 -2
  113. package/dist/types/core/beacon/beacon.d.ts.map +1 -1
  114. package/dist/types/core/beacon/cas-beacon.d.ts +19 -7
  115. package/dist/types/core/beacon/cas-beacon.d.ts.map +1 -1
  116. package/dist/types/core/beacon/error.d.ts +0 -6
  117. package/dist/types/core/beacon/error.d.ts.map +1 -1
  118. package/dist/types/core/beacon/fee-estimator.d.ts +40 -0
  119. package/dist/types/core/beacon/fee-estimator.d.ts.map +1 -0
  120. package/dist/types/core/beacon/interfaces.d.ts +8 -0
  121. package/dist/types/core/beacon/interfaces.d.ts.map +1 -1
  122. package/dist/types/core/beacon/singleton-beacon.d.ts +9 -2
  123. package/dist/types/core/beacon/singleton-beacon.d.ts.map +1 -1
  124. package/dist/types/core/beacon/smt-beacon.d.ts +27 -7
  125. package/dist/types/core/beacon/smt-beacon.d.ts.map +1 -1
  126. package/dist/types/core/identifier.d.ts +8 -0
  127. package/dist/types/core/identifier.d.ts.map +1 -1
  128. package/dist/types/core/interfaces.d.ts +2 -2
  129. package/dist/types/core/resolver.d.ts +11 -1
  130. package/dist/types/core/resolver.d.ts.map +1 -1
  131. package/dist/types/index.d.ts +9 -24
  132. package/dist/types/index.d.ts.map +1 -1
  133. package/package.json +31 -30
  134. package/src/core/aggregation/cohort.ts +247 -0
  135. package/src/core/aggregation/errors.ts +25 -0
  136. package/src/core/{beacon/aggregation/cohort → aggregation}/messages/base.ts +8 -3
  137. package/src/core/aggregation/messages/constants.ts +28 -0
  138. package/src/core/aggregation/messages/factories.ts +240 -0
  139. package/src/core/aggregation/messages/guards.ts +55 -0
  140. package/src/core/aggregation/messages/index.ts +4 -0
  141. package/src/core/aggregation/participant.ts +510 -0
  142. package/src/core/aggregation/phases.ts +82 -0
  143. package/src/core/aggregation/runner/events.ts +77 -0
  144. package/src/core/aggregation/runner/index.ts +4 -0
  145. package/src/core/aggregation/runner/participant-runner.ts +360 -0
  146. package/src/core/aggregation/runner/service-runner.ts +365 -0
  147. package/src/core/aggregation/runner/typed-emitter.ts +87 -0
  148. package/src/core/aggregation/service.ts +547 -0
  149. package/src/core/aggregation/signing-session.ts +209 -0
  150. package/src/core/aggregation/transport/didcomm.ts +42 -0
  151. package/src/core/aggregation/transport/error.ts +13 -0
  152. package/src/core/aggregation/transport/factory.ts +29 -0
  153. package/src/core/aggregation/transport/index.ts +5 -0
  154. package/src/core/aggregation/transport/nostr.ts +333 -0
  155. package/src/core/aggregation/transport/transport.ts +46 -0
  156. package/src/core/beacon/beacon.ts +122 -2
  157. package/src/core/beacon/cas-beacon.ts +28 -76
  158. package/src/core/beacon/error.ts +0 -12
  159. package/src/core/beacon/fee-estimator.ts +52 -0
  160. package/src/core/beacon/interfaces.ts +10 -1
  161. package/src/core/beacon/singleton-beacon.ts +14 -75
  162. package/src/core/beacon/smt-beacon.ts +109 -11
  163. package/src/core/identifier.ts +17 -0
  164. package/src/core/interfaces.ts +2 -2
  165. package/src/core/resolver.ts +25 -2
  166. package/src/index.ts +15 -29
  167. package/dist/esm/core/beacon/aggregation/cohort/index.js +0 -237
  168. package/dist/esm/core/beacon/aggregation/cohort/index.js.map +0 -1
  169. package/dist/esm/core/beacon/aggregation/cohort/messages/base.js.map +0 -1
  170. package/dist/esm/core/beacon/aggregation/cohort/messages/constants.js +0 -11
  171. package/dist/esm/core/beacon/aggregation/cohort/messages/constants.js.map +0 -1
  172. package/dist/esm/core/beacon/aggregation/cohort/messages/index.js +0 -98
  173. package/dist/esm/core/beacon/aggregation/cohort/messages/index.js.map +0 -1
  174. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js +0 -31
  175. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js.map +0 -1
  176. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js +0 -29
  177. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js.map +0 -1
  178. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js +0 -27
  179. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js.map +0 -1
  180. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in.js +0 -23
  181. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in.js.map +0 -1
  182. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/subscribe.js +0 -28
  183. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/subscribe.js.map +0 -1
  184. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js +0 -29
  185. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js.map +0 -1
  186. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/authorization-request.js +0 -30
  187. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/authorization-request.js.map +0 -1
  188. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js +0 -30
  189. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js.map +0 -1
  190. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/request-signature.js +0 -30
  191. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/request-signature.js.map +0 -1
  192. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js +0 -31
  193. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js.map +0 -1
  194. package/dist/esm/core/beacon/aggregation/cohort/status.js +0 -8
  195. package/dist/esm/core/beacon/aggregation/cohort/status.js.map +0 -1
  196. package/dist/esm/core/beacon/aggregation/communication/adapter/did-comm.js +0 -121
  197. package/dist/esm/core/beacon/aggregation/communication/adapter/did-comm.js.map +0 -1
  198. package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js +0 -245
  199. package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js.map +0 -1
  200. package/dist/esm/core/beacon/aggregation/communication/error.js +0 -12
  201. package/dist/esm/core/beacon/aggregation/communication/error.js.map +0 -1
  202. package/dist/esm/core/beacon/aggregation/communication/factory.js +0 -21
  203. package/dist/esm/core/beacon/aggregation/communication/factory.js.map +0 -1
  204. package/dist/esm/core/beacon/aggregation/communication/service.js +0 -2
  205. package/dist/esm/core/beacon/aggregation/communication/service.js.map +0 -1
  206. package/dist/esm/core/beacon/aggregation/coordinator.js +0 -343
  207. package/dist/esm/core/beacon/aggregation/coordinator.js.map +0 -1
  208. package/dist/esm/core/beacon/aggregation/participant.js +0 -435
  209. package/dist/esm/core/beacon/aggregation/participant.js.map +0 -1
  210. package/dist/esm/core/beacon/aggregation/session/index.js +0 -244
  211. package/dist/esm/core/beacon/aggregation/session/index.js.map +0 -1
  212. package/dist/esm/core/beacon/aggregation/session/status.js +0 -11
  213. package/dist/esm/core/beacon/aggregation/session/status.js.map +0 -1
  214. package/dist/types/core/beacon/aggregation/cohort/index.d.ts +0 -136
  215. package/dist/types/core/beacon/aggregation/cohort/index.d.ts.map +0 -1
  216. package/dist/types/core/beacon/aggregation/cohort/messages/base.d.ts.map +0 -1
  217. package/dist/types/core/beacon/aggregation/cohort/messages/constants.d.ts +0 -11
  218. package/dist/types/core/beacon/aggregation/cohort/messages/constants.d.ts.map +0 -1
  219. package/dist/types/core/beacon/aggregation/cohort/messages/index.d.ts +0 -65
  220. package/dist/types/core/beacon/aggregation/cohort/messages/index.d.ts.map +0 -1
  221. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts +0 -29
  222. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts.map +0 -1
  223. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts +0 -26
  224. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts.map +0 -1
  225. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.d.ts +0 -24
  226. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.d.ts.map +0 -1
  227. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts +0 -20
  228. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts.map +0 -1
  229. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts +0 -25
  230. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts.map +0 -1
  231. package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts +0 -25
  232. package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts.map +0 -1
  233. package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts +0 -26
  234. package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts.map +0 -1
  235. package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts +0 -26
  236. package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts.map +0 -1
  237. package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts +0 -26
  238. package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts.map +0 -1
  239. package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts +0 -27
  240. package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts.map +0 -1
  241. package/dist/types/core/beacon/aggregation/cohort/status.d.ts +0 -8
  242. package/dist/types/core/beacon/aggregation/cohort/status.d.ts.map +0 -1
  243. package/dist/types/core/beacon/aggregation/communication/adapter/did-comm.d.ts +0 -89
  244. package/dist/types/core/beacon/aggregation/communication/adapter/did-comm.d.ts.map +0 -1
  245. package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts +0 -103
  246. package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts.map +0 -1
  247. package/dist/types/core/beacon/aggregation/communication/error.d.ts.map +0 -1
  248. package/dist/types/core/beacon/aggregation/communication/factory.d.ts +0 -10
  249. package/dist/types/core/beacon/aggregation/communication/factory.d.ts.map +0 -1
  250. package/dist/types/core/beacon/aggregation/communication/service.d.ts +0 -36
  251. package/dist/types/core/beacon/aggregation/communication/service.d.ts.map +0 -1
  252. package/dist/types/core/beacon/aggregation/coordinator.d.ts +0 -116
  253. package/dist/types/core/beacon/aggregation/coordinator.d.ts.map +0 -1
  254. package/dist/types/core/beacon/aggregation/participant.d.ts +0 -192
  255. package/dist/types/core/beacon/aggregation/participant.d.ts.map +0 -1
  256. package/dist/types/core/beacon/aggregation/session/index.d.ts +0 -156
  257. package/dist/types/core/beacon/aggregation/session/index.d.ts.map +0 -1
  258. package/dist/types/core/beacon/aggregation/session/status.d.ts +0 -11
  259. package/dist/types/core/beacon/aggregation/session/status.d.ts.map +0 -1
  260. package/src/core/beacon/aggregation/cohort/index.ts +0 -305
  261. package/src/core/beacon/aggregation/cohort/messages/constants.ts +0 -12
  262. package/src/core/beacon/aggregation/cohort/messages/index.ts +0 -143
  263. package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.ts +0 -44
  264. package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.ts +0 -40
  265. package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.ts +0 -35
  266. package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in.ts +0 -34
  267. package/src/core/beacon/aggregation/cohort/messages/keygen/subscribe.ts +0 -36
  268. package/src/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.ts +0 -39
  269. package/src/core/beacon/aggregation/cohort/messages/sign/authorization-request.ts +0 -40
  270. package/src/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.ts +0 -40
  271. package/src/core/beacon/aggregation/cohort/messages/sign/request-signature.ts +0 -40
  272. package/src/core/beacon/aggregation/cohort/messages/sign/signature-authorization.ts +0 -41
  273. package/src/core/beacon/aggregation/cohort/status.ts +0 -7
  274. package/src/core/beacon/aggregation/communication/adapter/did-comm.ts +0 -148
  275. package/src/core/beacon/aggregation/communication/adapter/nostr.ts +0 -323
  276. package/src/core/beacon/aggregation/communication/error.ts +0 -13
  277. package/src/core/beacon/aggregation/communication/factory.ts +0 -25
  278. package/src/core/beacon/aggregation/communication/service.ts +0 -42
  279. package/src/core/beacon/aggregation/coordinator.ts +0 -419
  280. package/src/core/beacon/aggregation/participant.ts +0 -517
  281. package/src/core/beacon/aggregation/session/index.ts +0 -301
  282. package/src/core/beacon/aggregation/session/status.ts +0 -18
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Message type URLs for the did:btcr2 Aggregate Beacon protocol.
3
+ *
4
+ * Naming follows the spec (https://dcdpr.github.io/did-btcr2/beacons/aggregate-beacons.html):
5
+ * - Step 1 (Cohort Formation): COHORT_ADVERT, COHORT_OPT_IN, COHORT_OPT_IN_ACCEPT, COHORT_READY
6
+ * - Step 2 (Update Submission): SUBMIT_UPDATE
7
+ * - Step 3 (Aggregate & Validate): DISTRIBUTE_AGGREGATED_DATA, VALIDATION_ACK
8
+ * - Step 4 (Sign & Broadcast): AUTHORIZATION_REQUEST, NONCE_CONTRIBUTION,
9
+ * AGGREGATED_NONCE, SIGNATURE_AUTHORIZATION
10
+ */
11
+ export declare const AGGREGATION_MESSAGE_PREFIX = "https://btcr2.dev/aggregation";
12
+ export declare const COHORT_ADVERT = "https://btcr2.dev/aggregation/keygen/cohort_advert";
13
+ export declare const COHORT_OPT_IN = "https://btcr2.dev/aggregation/keygen/cohort_opt_in";
14
+ export declare const COHORT_OPT_IN_ACCEPT = "https://btcr2.dev/aggregation/keygen/cohort_opt_in_accept";
15
+ export declare const COHORT_READY = "https://btcr2.dev/aggregation/keygen/cohort_ready";
16
+ export declare const SUBMIT_UPDATE = "https://btcr2.dev/aggregation/update/submit_update";
17
+ export declare const DISTRIBUTE_AGGREGATED_DATA = "https://btcr2.dev/aggregation/update/distribute_aggregated_data";
18
+ export declare const VALIDATION_ACK = "https://btcr2.dev/aggregation/update/validation_ack";
19
+ export declare const AUTHORIZATION_REQUEST = "https://btcr2.dev/aggregation/sign/authorization_request";
20
+ export declare const NONCE_CONTRIBUTION = "https://btcr2.dev/aggregation/sign/nonce_contribution";
21
+ export declare const AGGREGATED_NONCE = "https://btcr2.dev/aggregation/sign/aggregated_nonce";
22
+ export declare const SIGNATURE_AUTHORIZATION = "https://btcr2.dev/aggregation/sign/signature_authorization";
23
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/core/aggregation/messages/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,kCAAkC,CAAC;AAG1E,eAAO,MAAM,aAAa,uDAAuD,CAAC;AAClF,eAAO,MAAM,aAAa,uDAAuD,CAAC;AAClF,eAAO,MAAM,oBAAoB,8DAA8D,CAAC;AAChG,eAAO,MAAM,YAAY,sDAAsD,CAAC;AAGhF,eAAO,MAAM,aAAa,uDAAuD,CAAC;AAClF,eAAO,MAAM,0BAA0B,oEAAoE,CAAC;AAC5G,eAAO,MAAM,cAAc,wDAAwD,CAAC;AAGpF,eAAO,MAAM,qBAAqB,6DAA6D,CAAC;AAChG,eAAO,MAAM,kBAAkB,0DAA0D,CAAC;AAC1F,eAAO,MAAM,gBAAgB,wDAAwD,CAAC;AACtF,eAAO,MAAM,uBAAuB,+DAA+D,CAAC"}
@@ -0,0 +1,177 @@
1
+ import { BaseMessage } from './base.js';
2
+ /**
3
+ * Step 1: Cohort Formation
4
+ * Factory functions for creating messages related to the cohort formation step, where cohorts are
5
+ * formed and participants opt in to join the cohort.
6
+ */
7
+ type CohortAdvertMessage = {
8
+ from: string;
9
+ cohortId: string;
10
+ cohortSize: number;
11
+ beaconType: string;
12
+ network: string;
13
+ communicationPk: Uint8Array;
14
+ };
15
+ type CohortOptInMessage = {
16
+ from: string;
17
+ to: string;
18
+ cohortId: string;
19
+ participantPk: Uint8Array;
20
+ communicationPk: Uint8Array;
21
+ };
22
+ type CohortOptInAcceptMessage = {
23
+ from: string;
24
+ to: string;
25
+ cohortId: string;
26
+ };
27
+ type CohortReadyMessage = {
28
+ from: string;
29
+ to: string;
30
+ cohortId: string;
31
+ beaconAddress: string;
32
+ cohortKeys: Array<Uint8Array>;
33
+ };
34
+ /**
35
+ * Factory function for creating a Cohort Advert message, which is used to announce the formation of
36
+ * a new cohort and invite participants to join.
37
+ * @param {CohortAdvertMessage} fields - The fields required to create a Cohort Advert message.
38
+ * @returns {BaseMessage} The created Cohort Advert message.
39
+ */
40
+ export declare function createCohortAdvertMessage(fields: CohortAdvertMessage): BaseMessage;
41
+ /**
42
+ * Factory function for creating a Cohort Opt-In message, which is sent by a participant to express
43
+ * interest in joining a cohort.
44
+ * @param {CohortOptInMessage} fields - The fields required to create a Cohort Opt-In message, which
45
+ * is sent by a participant to express interest in joining a cohort.
46
+ * @returns {BaseMessage} The created Cohort Opt-In message.
47
+ */
48
+ export declare function createCohortOptInMessage(fields: CohortOptInMessage): BaseMessage;
49
+ export declare function createCohortOptInAcceptMessage(fields: CohortOptInAcceptMessage): BaseMessage;
50
+ export declare function createCohortReadyMessage(fields: CohortReadyMessage): BaseMessage;
51
+ /**
52
+ * Step 2: Update Submission
53
+ * Factory functions for creating messages related to the update submission step, where participants
54
+ * submit their signed updates for aggregation.
55
+ */
56
+ type SubmitUpdateMessage = {
57
+ from: string;
58
+ to: string;
59
+ cohortId: string;
60
+ signedUpdate: Record<string, unknown>;
61
+ };
62
+ /**
63
+ * Factory function for creating a Submit Update message, which is sent by a participant to submit
64
+ * their signed update for aggregation.
65
+ * @param {SubmitUpdateMessage} fields - The fields required to create a Submit Update message,
66
+ * which is sent by a participant to submit their signed update for aggregation.
67
+ * @returns {BaseMessage} The created Submit Update message.
68
+ */
69
+ export declare function createSubmitUpdateMessage(fields: SubmitUpdateMessage): BaseMessage;
70
+ /**
71
+ * Step 3: Aggregate & Validate
72
+ * Factory functions for creating messages related to the aggregate and validate step, where
73
+ * participants aggregate their updates and validate the aggregated data.
74
+ */
75
+ type DistributeAggregatedDataMessage = {
76
+ from: string;
77
+ to: string;
78
+ cohortId: string;
79
+ beaconType: string;
80
+ signalBytesHex: string;
81
+ casAnnouncement?: Record<string, string>;
82
+ smtProof?: Record<string, unknown>;
83
+ };
84
+ type ValidationAckMessage = {
85
+ from: string;
86
+ to: string;
87
+ cohortId: string;
88
+ approved: boolean;
89
+ };
90
+ /**
91
+ * Factory function for creating a Distribute Aggregated Data message, which is sent by the
92
+ * aggregator to distribute the aggregated data to participants for validation.
93
+ * @param {DistributeAggregatedDataMessage} fields - The fields required to create a Distribute
94
+ * Aggregated Data message, which is sent by the aggregator to distribute the aggregated data to
95
+ * participants for validation.
96
+ * @returns {BaseMessage} The created Distribute Aggregated Data message.
97
+ */
98
+ export declare function createDistributeAggregatedDataMessage(fields: DistributeAggregatedDataMessage): BaseMessage;
99
+ /**
100
+ * Factory function for creating a Validation Acknowledgment message, which is sent by a participant
101
+ * to acknowledge.
102
+ * @param {ValidationAckMessage} fields - The fields required to create a Validation Acknowledgment
103
+ * message, which is sent by a participant to acknowledge the validation of the aggregated data.
104
+ * @returns {BaseMessage} The created Validation Acknowledgment message.
105
+ */
106
+ export declare function createValidationAckMessage(fields: ValidationAckMessage): BaseMessage;
107
+ /**
108
+ * Step 4: Signing
109
+ * Factory functions for creating messages related to the signing step, where participants request
110
+ * signatures, contribute nonces, and authorize signatures.
111
+ */
112
+ type AuthorizationRequestMessage = {
113
+ from: string;
114
+ to: string;
115
+ cohortId: string;
116
+ sessionId: string;
117
+ pendingTx: string;
118
+ prevOutValue: string;
119
+ };
120
+ type NonceContributionMessage = {
121
+ from: string;
122
+ to: string;
123
+ cohortId: string;
124
+ sessionId: string;
125
+ nonceContribution: Uint8Array;
126
+ };
127
+ type AggregatedNonceMessage = {
128
+ from: string;
129
+ to: string;
130
+ cohortId: string;
131
+ sessionId: string;
132
+ aggregatedNonce: Uint8Array;
133
+ };
134
+ type SignatureAuthorizationMessage = {
135
+ from: string;
136
+ to: string;
137
+ cohortId: string;
138
+ sessionId: string;
139
+ partialSignature: Uint8Array;
140
+ };
141
+ /**
142
+ * Factory function for creating an Authorization Request message, which is sent by a participant to
143
+ * request authorization for their signature.
144
+ * @param {AuthorizationRequestMessage} fields - The fields required to create an Authorization
145
+ * Request message, which is sent by a participant to request authorization for their signature.
146
+ * @returns {BaseMessage} The created Authorization Request message.
147
+ */
148
+ export declare function createAuthorizationRequestMessage(fields: AuthorizationRequestMessage): BaseMessage;
149
+ /**
150
+ * Factory function for creating a Nonce Contribution message, which is sent by a participant to
151
+ * contribute their nonce for the signature aggregation process.
152
+ * @param {NonceContributionMessage} fields - The fields required to create a Nonce Contribution
153
+ * message, which is sent by a participant to contribute their nonce for the signature aggregation
154
+ * process.
155
+ * @returns {BaseMessage} The created Nonce Contribution message.
156
+ */
157
+ export declare function createNonceContributionMessage(fields: NonceContributionMessage): BaseMessage;
158
+ /**
159
+ * Factory function for creating an Aggregated Nonce message, which is sent by the aggregator to
160
+ * distribute the aggregated nonce to participants for the signature aggregation process.
161
+ * @param {AggregatedNonceMessage} fields - The fields required to create an Aggregated Nonce
162
+ * message, which is sent by the aggregator to distribute the aggregated nonce to participants for
163
+ * the signature aggregation process.
164
+ * @returns {BaseMessage} The created Aggregated Nonce message.
165
+ */
166
+ export declare function createAggregatedNonceMessage(fields: AggregatedNonceMessage): BaseMessage;
167
+ /**
168
+ * Factory function for creating a Signature Authorization message, which is sent by a participant
169
+ * to authorize their partial signature for the signature aggregation process.
170
+ * @param {SignatureAuthorizationMessage} fields - The fields required to create a Signature
171
+ * Authorization message, which is sent by a participant to authorize their partial signature for
172
+ * the signature aggregation process.
173
+ * @returns {BaseMessage} The created Signature Authorization message.
174
+ */
175
+ export declare function createSignatureAuthorizationMessage(fields: SignatureAuthorizationMessage): BaseMessage;
176
+ export {};
177
+ //# sourceMappingURL=factories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factories.d.ts","sourceRoot":"","sources":["../../../../../src/core/aggregation/messages/factories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAexC;;;;GAIG;AACH,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,UAAU,CAAC;CAC7B,CAAC;AACF,KAAK,kBAAkB,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,UAAU,CAAC;IAC1B,eAAe,EAAE,UAAU,CAAC;CAC7B,CAAC;AACF,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;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4BAA4B,CAAC,MAAM,EAAE,sBAAsB,GAAG,WAAW,CAGxF;AAED;;;;;;;GAOG;AACH,wBAAgB,mCAAmC,CAAC,MAAM,EAAE,6BAA6B,GAAG,WAAW,CAGtG"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Checks if the provided type is a valid aggregation message type.
3
+ */
4
+ export declare function isAggregationMessageType(type: string): boolean;
5
+ /** Checks if the message type belongs to the keygen phase. */
6
+ export declare function isKeygenMessageType(type: string): boolean;
7
+ /** Checks if the message type belongs to the update phase. */
8
+ export declare function isUpdateMessageType(type: string): boolean;
9
+ /** Checks if the message type belongs to the signing phase. */
10
+ export declare function isSignMessageType(type: string): boolean;
11
+ //# sourceMappingURL=guards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../../../../src/core/aggregation/messages/guards.ts"],"names":[],"mappings":"AAkCA;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED,8DAA8D;AAC9D,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,8DAA8D;AAC9D,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,+DAA+D;AAC/D,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD"}
@@ -0,0 +1,5 @@
1
+ export * from './base.js';
2
+ export * from './constants.js';
3
+ export * from './factories.js';
4
+ export * from './guards.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/aggregation/messages/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,101 @@
1
+ import type { SignedBTCR2Update } from '@did-btcr2/cryptosuite';
2
+ import type { SchnorrKeyPair } from '@did-btcr2/keypair';
3
+ import type { SerializedSMTProof } from '@did-btcr2/smt';
4
+ import type { BaseMessage } from './messages/base.js';
5
+ import type { ParticipantCohortPhaseType } from './phases.js';
6
+ /** Cohort advert as discovered by the participant (UI: list of joinable cohorts). */
7
+ export interface CohortAdvert {
8
+ cohortId: string;
9
+ serviceDid: string;
10
+ cohortSize: number;
11
+ network: string;
12
+ beaconType: string;
13
+ serviceCommunicationPk: Uint8Array;
14
+ }
15
+ /** Joined cohort info — available after the cohort is finalized. */
16
+ export interface JoinedCohortInfo {
17
+ cohortId: string;
18
+ serviceDid: string;
19
+ beaconAddress: string;
20
+ cohortKeys: Array<Uint8Array>;
21
+ }
22
+ /** Aggregated data awaiting participant validation (UI: review for approval). */
23
+ export interface PendingValidation {
24
+ cohortId: string;
25
+ beaconType: string;
26
+ signalBytesHex: string;
27
+ casAnnouncement?: Record<string, string>;
28
+ smtProof?: SerializedSMTProof;
29
+ expectedHash: string;
30
+ matches: boolean;
31
+ }
32
+ /** Pending signing request (UI: review tx for approval). */
33
+ export interface PendingSigningRequest {
34
+ cohortId: string;
35
+ sessionId: string;
36
+ pendingTxHex: string;
37
+ prevOutValue: string;
38
+ }
39
+ export interface AggregationParticipantParams {
40
+ did: string;
41
+ keys: SchnorrKeyPair;
42
+ }
43
+ /**
44
+ * Sans-I/O state machine for an Aggregation Participant.
45
+ *
46
+ * Manages multiple cohorts simultaneously. The client app drives the state
47
+ * machine via `receive()` (for incoming messages) and explicit action methods
48
+ * (for user decisions). All outgoing messages are returned for the caller to
49
+ * send via whatever transport.
50
+ *
51
+ * @class AggregationParticipant
52
+ */
53
+ export declare class AggregationParticipant {
54
+ #private;
55
+ readonly did: string;
56
+ readonly keys: SchnorrKeyPair;
57
+ constructor({ did, keys }: AggregationParticipantParams);
58
+ /**
59
+ * Process an incoming message. Updates internal state but never produces
60
+ * outgoing messages — those come exclusively from action methods.
61
+ */
62
+ receive(message: BaseMessage): void;
63
+ /** Cohorts the participant has discovered but not yet joined. */
64
+ get discoveredCohorts(): ReadonlyMap<string, CohortAdvert>;
65
+ /**
66
+ * User action: join a discovered cohort.
67
+ * Returns the opt-in message to send.
68
+ */
69
+ joinCohort(cohortId: string): BaseMessage[];
70
+ /** Cohorts that have been finalized — beacon address available. */
71
+ get joinedCohorts(): ReadonlyMap<string, JoinedCohortInfo>;
72
+ /**
73
+ * User action: submit a signed BTCR2 update for inclusion in the cohort's
74
+ * aggregated signal.
75
+ */
76
+ submitUpdate(cohortId: string, signedUpdate: SignedBTCR2Update): BaseMessage[];
77
+ /** Aggregated data awaiting user validation. */
78
+ get pendingValidations(): ReadonlyMap<string, PendingValidation>;
79
+ /**
80
+ * User action: approve aggregated data and send validation ack.
81
+ */
82
+ approveValidation(cohortId: string): BaseMessage[];
83
+ /**
84
+ * User action: reject aggregated data and send rejection ack.
85
+ */
86
+ rejectValidation(cohortId: string): BaseMessage[];
87
+ /** Signing requests awaiting user approval. */
88
+ get pendingSigningRequests(): ReadonlyMap<string, PendingSigningRequest>;
89
+ /**
90
+ * User action: approve signing and generate nonce contribution.
91
+ */
92
+ approveNonce(cohortId: string): BaseMessage[];
93
+ /**
94
+ * User action: generate and return the partial signature.
95
+ * In most UIs this is automatic after AwaitingPartialSig — but exposing it
96
+ * as an explicit action lets the client UI confirm before signing if desired.
97
+ */
98
+ generatePartialSignature(cohortId: string): BaseMessage[];
99
+ getCohortPhase(cohortId: string): ParticipantCohortPhaseType | undefined;
100
+ }
101
+ //# sourceMappingURL=participant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"participant.d.ts","sourceRoot":"","sources":["../../../../src/core/aggregation/participant.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EA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AAc,CAAC;gBAKzB,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,4BAA4B;IAMvD;;;OAGG;IACI,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IA4B1C,iEAAiE;IACjE,IAAW,iBAAiB,IAAI,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,CAQhE;IAwBD;;;OAGG;IACI,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE;IAqClD,mEAAmE;IACnE,IAAW,aAAa,IAAI,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAahE;IAqBD;;;OAGG;IACI,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,iBAAiB,GAAG,WAAW,EAAE;IAsBrF,gDAAgD;IAChD,IAAW,kBAAkB,IAAI,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAQtE;IAqDD;;OAEG;IACI,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE;IAiBzD;;OAEG;IACI,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE;IAkBxD,+CAA+C;IAC/C,IAAW,sBAAsB,IAAI,WAAW,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAQ9E;IAuBD;;OAEG;IACI,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE;IA6DpD;;;;OAIG;IACI,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE;IA4BzD,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,0BAA0B,GAAG,SAAS;CAGhF"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Phases for the did:btcr2 Aggregate Beacon protocol.
3
+ *
4
+ * The protocol has two roles (AggregationService and AggregationParticipant)
5
+ * which experience different phases for the same cohort. Each role has its own
6
+ * phase enum.
7
+ *
8
+ * The signing session has its own phase enum because MuSig2 signing is a
9
+ * sub-protocol within the larger aggregation protocol.
10
+ */
11
+ export type ServiceCohortPhaseType = 'Created' | 'Advertised' | 'CohortSet' | 'CollectingUpdates' | 'UpdatesCollected' | 'DataDistributed' | 'Validated' | 'SigningStarted' | 'NoncesCollected' | 'AwaitingPartialSigs' | 'Complete' | 'Failed';
12
+ export declare enum ServiceCohortPhase {
13
+ Created = "Created",
14
+ Advertised = "Advertised",
15
+ CohortSet = "CohortSet",
16
+ CollectingUpdates = "CollectingUpdates",
17
+ UpdatesCollected = "UpdatesCollected",
18
+ DataDistributed = "DataDistributed",
19
+ Validated = "Validated",
20
+ SigningStarted = "SigningStarted",
21
+ NoncesCollected = "NoncesCollected",
22
+ AwaitingPartialSigs = "AwaitingPartialSigs",
23
+ Complete = "Complete",
24
+ Failed = "Failed"
25
+ }
26
+ export type ParticipantCohortPhaseType = 'Discovered' | 'OptedIn' | 'CohortReady' | 'UpdateSubmitted' | 'AwaitingValidation' | 'ValidationSent' | 'AwaitingSigning' | 'NonceSent' | 'AwaitingPartialSig' | 'Complete' | 'Failed';
27
+ export declare enum ParticipantCohortPhase {
28
+ Discovered = "Discovered",
29
+ OptedIn = "OptedIn",
30
+ CohortReady = "CohortReady",
31
+ UpdateSubmitted = "UpdateSubmitted",
32
+ AwaitingValidation = "AwaitingValidation",
33
+ ValidationSent = "ValidationSent",
34
+ AwaitingSigning = "AwaitingSigning",
35
+ NonceSent = "NonceSent",
36
+ AwaitingPartialSig = "AwaitingPartialSig",
37
+ Complete = "Complete",
38
+ Failed = "Failed"
39
+ }
40
+ export type SigningSessionPhaseType = 'AwaitingNonceContributions' | 'NonceContributionsReceived' | 'AwaitingPartialSignatures' | 'PartialSignaturesReceived' | 'Complete' | 'Failed';
41
+ export declare enum SigningSessionPhase {
42
+ AwaitingNonceContributions = "AwaitingNonceContributions",
43
+ NonceContributionsReceived = "NonceContributionsReceived",
44
+ AwaitingPartialSignatures = "AwaitingPartialSignatures",
45
+ PartialSignaturesReceived = "PartialSignaturesReceived",
46
+ Complete = "Complete",
47
+ Failed = "Failed"
48
+ }
49
+ //# sourceMappingURL=phases.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phases.d.ts","sourceRoot":"","sources":["../../../../src/core/aggregation/phases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,MAAM,sBAAsB,GAC9B,SAAS,GACT,YAAY,GACZ,WAAW,GACX,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,WAAW,GACX,gBAAgB,GAChB,iBAAiB,GACjB,qBAAqB,GACrB,UAAU,GACV,QAAQ,CAAC;AAEb,oBAAY,kBAAkB;IAC5B,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,iBAAiB,sBAAsB;IACvC,gBAAgB,qBAAqB;IACrC,eAAe,oBAAoB;IACnC,SAAS,cAAc;IACvB,cAAc,mBAAmB;IACjC,eAAe,oBAAoB;IACnC,mBAAmB,wBAAwB;IAC3C,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED,MAAM,MAAM,0BAA0B,GAClC,YAAY,GACZ,SAAS,GACT,aAAa,GACb,iBAAiB,GACjB,oBAAoB,GACpB,gBAAgB,GAChB,iBAAiB,GACjB,WAAW,GACX,oBAAoB,GACpB,UAAU,GACV,QAAQ,CAAC;AAEb,oBAAY,sBAAsB;IAChC,UAAU,eAAe;IACzB,OAAO,YAAY;IACnB,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;IACnC,kBAAkB,uBAAuB;IACzC,cAAc,mBAAmB;IACjC,eAAe,oBAAoB;IACnC,SAAS,cAAc;IACvB,kBAAkB,uBAAuB;IACzC,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED,MAAM,MAAM,uBAAuB,GAC/B,4BAA4B,GAC5B,4BAA4B,GAC5B,2BAA2B,GAC3B,2BAA2B,GAC3B,UAAU,GACV,QAAQ,CAAC;AAEb,oBAAY,mBAAmB;IAC7B,0BAA0B,+BAA+B;IACzD,0BAA0B,+BAA+B;IACzD,yBAAyB,8BAA8B;IACvD,yBAAyB,8BAA8B;IACvD,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB"}
@@ -0,0 +1,89 @@
1
+ import type { CohortAdvert, PendingSigningRequest, PendingValidation } from '../participant.js';
2
+ import type { AggregationResult, PendingOptIn } from '../service.js';
3
+ /**
4
+ * AggregationServiceRunner events are emitted by the AggregationServiceRunner to signal important
5
+ * milestones and actions during the aggregation process. They can be listened to by external code
6
+ * to react to these events, such as logging, updating a UI, or triggering additional actions.
7
+ */
8
+ export type AggregationServiceEvents = {
9
+ /** A cohort has been created and the advert message broadcast. */
10
+ 'cohort-advertised': [{
11
+ cohortId: string;
12
+ }];
13
+ /** A participant has opted in. Fires before the accept decision callback. */
14
+ 'opt-in-received': [PendingOptIn];
15
+ /** A participant has been accepted into the cohort. */
16
+ 'participant-accepted': [{
17
+ participantDid: string;
18
+ }];
19
+ /** Keygen has been finalized — beacon address is now available. */
20
+ 'keygen-complete': [{
21
+ cohortId: string;
22
+ beaconAddress: string;
23
+ }];
24
+ /** A participant has submitted a signed update. */
25
+ 'update-received': [{
26
+ participantDid: string;
27
+ }];
28
+ /** Aggregated data has been distributed to all participants for validation. */
29
+ 'data-distributed': [{
30
+ cohortId: string;
31
+ }];
32
+ /** A participant has acknowledged validation (approved or rejected). */
33
+ 'validation-received': [{
34
+ participantDid: string;
35
+ approved: boolean;
36
+ }];
37
+ /** Signing has started — auth requests sent to participants. */
38
+ 'signing-started': [{
39
+ sessionId: string;
40
+ }];
41
+ /** A participant has contributed their MuSig2 nonce. */
42
+ 'nonce-received': [{
43
+ participantDid: string;
44
+ }];
45
+ /** Signing complete — final aggregated signature is ready to broadcast. */
46
+ 'signing-complete': [AggregationResult];
47
+ /** A non-fatal error occurred. Fatal errors reject the run() promise. */
48
+ 'error': [Error];
49
+ };
50
+ /**
51
+ * AggregationParticipantRunner events are emitted by the AggregationParticipantRunner to signal
52
+ * important milestones and actions during the participant's involvement in the aggregation process.
53
+ * They can be listened to by external code to react to these events, such as logging, updating a
54
+ * UI, or triggering additional actions.
55
+ */
56
+ export type AggregationParticipantEvents = {
57
+ /** A new cohort advert was discovered. Fires before the shouldJoin filter. */
58
+ 'cohort-discovered': [CohortAdvert];
59
+ /** Participant has opted in to a cohort. */
60
+ 'cohort-joined': [{
61
+ cohortId: string;
62
+ }];
63
+ /** Cohort keygen is complete — beacon address is now available. */
64
+ 'cohort-ready': [{
65
+ cohortId: string;
66
+ beaconAddress: string;
67
+ }];
68
+ /** Participant has submitted their signed update. */
69
+ 'update-submitted': [{
70
+ cohortId: string;
71
+ }];
72
+ /** Aggregated data has arrived for validation. Fires before the validate callback. */
73
+ 'validation-requested': [PendingValidation];
74
+ /** Signing request has arrived. Fires before the sign approval callback. */
75
+ 'signing-requested': [PendingSigningRequest];
76
+ /** Cohort signing is complete from this participant's perspective. */
77
+ 'cohort-complete': [{
78
+ cohortId: string;
79
+ beaconAddress: string;
80
+ }];
81
+ /** Cohort failed (rejected validation, signing error, etc.). */
82
+ 'cohort-failed': [{
83
+ cohortId: string;
84
+ reason: string;
85
+ }];
86
+ /** A non-fatal error occurred. */
87
+ 'error': [Error];
88
+ };
89
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../../src/core/aggregation/runner/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAChG,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAErE;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,kEAAkE;IAClE,mBAAmB,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAE5C,6EAA6E;IAC7E,iBAAiB,EAAE,CAAC,YAAY,CAAC,CAAC;IAElC,uDAAuD;IACvD,sBAAsB,EAAE,C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E,CAAC,iBAAiB,CAAC,CAAC;IAE5C,4EAA4E;IAC5E,mBAAmB,EAAE,CAAC,qBAAqB,CAAC,CAAC;IAE7C,sEAAsE;IACtE,iBAAiB,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEjE,gEAAgE;IAChE,eAAe,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAExD,kCAAkC;IAClC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;CAClB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './typed-emitter.js';
2
+ export * from './events.js';
3
+ export * from './service-runner.js';
4
+ export * from './participant-runner.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/aggregation/runner/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,107 @@
1
+ import type { SignedBTCR2Update } from '@did-btcr2/cryptosuite';
2
+ import type { SchnorrKeyPair } from '@did-btcr2/keypair';
3
+ import type { CohortAdvert, PendingSigningRequest, PendingValidation } from '../participant.js';
4
+ import { AggregationParticipant } from '../participant.js';
5
+ import type { Transport } from '../transport/transport.js';
6
+ import type { AggregationParticipantEvents } from './events.js';
7
+ import { TypedEventEmitter } from './typed-emitter.js';
8
+ /** Decision callback: filter discovered cohorts. Default rejects all. */
9
+ export type ShouldJoin = (advert: CohortAdvert) => Promise<boolean>;
10
+ /** Data callback: provide a signed BTCR2 update for a joined cohort. */
11
+ export type OnProvideUpdate = (info: {
12
+ cohortId: string;
13
+ beaconAddress: string;
14
+ }) => Promise<SignedBTCR2Update>;
15
+ /** Decision callback: approve or reject aggregated data. */
16
+ export type OnValidateData = (info: PendingValidation) => Promise<{
17
+ approved: boolean;
18
+ }>;
19
+ /** Decision callback: approve or reject signing. */
20
+ export type OnApproveSigning = (info: PendingSigningRequest) => Promise<{
21
+ approved: boolean;
22
+ }>;
23
+ export interface AggregationParticipantRunnerOptions {
24
+ /** Underlying transport. */
25
+ transport: Transport;
26
+ /** Participant identity. */
27
+ did: string;
28
+ keys: SchnorrKeyPair;
29
+ /**
30
+ * Filter discovered cohorts. Returns true to join, false to skip.
31
+ * Default: rejects all cohorts (caller MUST override or no cohorts will be joined).
32
+ */
33
+ shouldJoin?: ShouldJoin;
34
+ /**
35
+ * Provide a signed BTCR2 update for the cohort.
36
+ * REQUIRED — no sensible default.
37
+ */
38
+ onProvideUpdate: OnProvideUpdate;
39
+ /**
40
+ * Approve or reject aggregated data.
41
+ * Default: approve if validation matches the submitted update's hash.
42
+ */
43
+ onValidateData?: OnValidateData;
44
+ /**
45
+ * Approve or reject the signing request.
46
+ * Default: approve.
47
+ */
48
+ onApproveSigning?: OnApproveSigning;
49
+ }
50
+ /**
51
+ * High-level facade for an Aggregation Participant.
52
+ *
53
+ * Long-running listener: waits for cohort adverts, applies the `shouldJoin`
54
+ * filter, and drives each accepted cohort through the full protocol to
55
+ * completion in parallel.
56
+ *
57
+ * @example
58
+ * ```typescript
59
+ * const transport = new NostrTransport({ relays: [RELAY] });
60
+ * transport.registerActor(myDid, myKeys);
61
+ *
62
+ * const runner = new AggregationParticipantRunner({
63
+ * transport,
64
+ * did: myDid,
65
+ * keys: myKeys,
66
+ * shouldJoin: async (advert) => advert.beaconType === 'CASBeacon',
67
+ * onProvideUpdate: async ({ beaconAddress }) => {
68
+ * return Update.sign(myDid, unsigned, vm, secretKey);
69
+ * },
70
+ * });
71
+ *
72
+ * runner.on('cohort-complete', ({ beaconAddress }) => {
73
+ * console.log(`Add to DID document: bitcoin:${beaconAddress}`);
74
+ * });
75
+ *
76
+ * await runner.start();
77
+ * ```
78
+ *
79
+ * For full manual control, drop down to the underlying state machine via
80
+ * `runner.session`. The state machine has no transport coupling and exposes
81
+ * every protocol decision as an explicit method.
82
+ *
83
+ * @class AggregationParticipantRunner
84
+ * @extends TypedEventEmitter<AggregationParticipantEvents>
85
+ */
86
+ export declare class AggregationParticipantRunner extends TypedEventEmitter<AggregationParticipantEvents> {
87
+ #private;
88
+ /** Direct access to the underlying state machine for advanced use. */
89
+ readonly session: AggregationParticipant;
90
+ constructor(options: AggregationParticipantRunnerOptions);
91
+ /**
92
+ * Start listening for cohorts. The runner stays active until {@link stop}
93
+ * is called or the underlying transport disconnects.
94
+ */
95
+ start(): Promise<void>;
96
+ /** Stop the runner. Does not unregister transport handlers. */
97
+ stop(): void;
98
+ /**
99
+ * Single-shot helper: start, join the first cohort that passes `shouldJoin`,
100
+ * drive it to completion, and resolve. Convenient for tests and demos.
101
+ */
102
+ static joinFirst(options: AggregationParticipantRunnerOptions): Promise<{
103
+ cohortId: string;
104
+ beaconAddress: string;
105
+ }>;
106
+ }
107
+ //# sourceMappingURL=participant-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"participant-runner.d.ts","sourceRoot":"","sources":["../../../../../src/core/aggregation/runner/participant-runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAUzD,OAAO,KAAK,EACV,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACL,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,yEAAyE;AACzE,MAAM,MAAM,UAA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