@did-btcr2/method 0.25.3 → 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 (406) hide show
  1. package/README.md +86 -233
  2. package/dist/.tsbuildinfo +1 -0
  3. package/dist/browser.js +129207 -122358
  4. package/dist/browser.mjs +129235 -122386
  5. package/dist/cjs/index.js +5332 -43
  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 +21 -60
  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/signal-discovery.js +1 -1
  59. package/dist/esm/core/beacon/signal-discovery.js.map +1 -1
  60. package/dist/esm/core/beacon/singleton-beacon.js +13 -56
  61. package/dist/esm/core/beacon/singleton-beacon.js.map +1 -1
  62. package/dist/esm/core/beacon/smt-beacon.js +85 -9
  63. package/dist/esm/core/beacon/smt-beacon.js.map +1 -1
  64. package/dist/esm/core/beacon/utils.js.map +1 -1
  65. package/dist/esm/core/identifier.js +13 -0
  66. package/dist/esm/core/identifier.js.map +1 -1
  67. package/dist/esm/core/resolver.js +50 -35
  68. package/dist/esm/core/resolver.js.map +1 -1
  69. package/dist/esm/core/update.js.map +1 -1
  70. package/dist/esm/did-btcr2.js +1 -1
  71. package/dist/esm/did-btcr2.js.map +1 -1
  72. package/dist/esm/index.js +14 -24
  73. package/dist/esm/index.js.map +1 -1
  74. package/dist/esm/utils/appendix.js +7 -6
  75. package/dist/esm/utils/appendix.js.map +1 -1
  76. package/dist/esm/utils/did-document-builder.js.map +1 -1
  77. package/dist/esm/utils/did-document.js +2 -2
  78. package/dist/esm/utils/did-document.js.map +1 -1
  79. package/dist/types/core/aggregation/cohort.d.ts +94 -0
  80. package/dist/types/core/aggregation/cohort.d.ts.map +1 -0
  81. package/dist/types/core/aggregation/errors.d.ts +14 -0
  82. package/dist/types/core/aggregation/errors.d.ts.map +1 -0
  83. package/dist/types/core/{beacon/aggregation/cohort → aggregation}/messages/base.d.ts +7 -1
  84. package/dist/types/core/aggregation/messages/base.d.ts.map +1 -0
  85. package/dist/types/core/aggregation/messages/constants.d.ts +23 -0
  86. package/dist/types/core/aggregation/messages/constants.d.ts.map +1 -0
  87. package/dist/types/core/aggregation/messages/factories.d.ts +177 -0
  88. package/dist/types/core/aggregation/messages/factories.d.ts.map +1 -0
  89. package/dist/types/core/aggregation/messages/guards.d.ts +11 -0
  90. package/dist/types/core/aggregation/messages/guards.d.ts.map +1 -0
  91. package/dist/types/core/aggregation/messages/index.d.ts +5 -0
  92. package/dist/types/core/aggregation/messages/index.d.ts.map +1 -0
  93. package/dist/types/core/aggregation/participant.d.ts +101 -0
  94. package/dist/types/core/aggregation/participant.d.ts.map +1 -0
  95. package/dist/types/core/aggregation/phases.d.ts +49 -0
  96. package/dist/types/core/aggregation/phases.d.ts.map +1 -0
  97. package/dist/types/core/aggregation/runner/events.d.ts +89 -0
  98. package/dist/types/core/aggregation/runner/events.d.ts.map +1 -0
  99. package/dist/types/core/aggregation/runner/index.d.ts +5 -0
  100. package/dist/types/core/aggregation/runner/index.d.ts.map +1 -0
  101. package/dist/types/core/aggregation/runner/participant-runner.d.ts +107 -0
  102. package/dist/types/core/aggregation/runner/participant-runner.d.ts.map +1 -0
  103. package/dist/types/core/aggregation/runner/service-runner.d.ts +102 -0
  104. package/dist/types/core/aggregation/runner/service-runner.d.ts.map +1 -0
  105. package/dist/types/core/aggregation/runner/typed-emitter.d.ts +41 -0
  106. package/dist/types/core/aggregation/runner/typed-emitter.d.ts.map +1 -0
  107. package/dist/types/core/aggregation/service.d.ts +112 -0
  108. package/dist/types/core/aggregation/service.d.ts.map +1 -0
  109. package/dist/types/core/aggregation/signing-session.d.ts +69 -0
  110. package/dist/types/core/aggregation/signing-session.d.ts.map +1 -0
  111. package/dist/types/core/aggregation/transport/didcomm.d.ts +20 -0
  112. package/dist/types/core/aggregation/transport/didcomm.d.ts.map +1 -0
  113. package/dist/types/core/{beacon/aggregation/communication → aggregation/transport}/error.d.ts +2 -2
  114. package/dist/types/core/aggregation/transport/error.d.ts.map +1 -0
  115. package/dist/types/core/aggregation/transport/factory.d.ts +13 -0
  116. package/dist/types/core/aggregation/transport/factory.d.ts.map +1 -0
  117. package/dist/types/core/aggregation/transport/index.d.ts +6 -0
  118. package/dist/types/core/aggregation/transport/index.d.ts.map +1 -0
  119. package/dist/types/core/aggregation/transport/nostr.d.ts +55 -0
  120. package/dist/types/core/aggregation/transport/nostr.d.ts.map +1 -0
  121. package/dist/types/core/aggregation/transport/transport.d.ts +37 -0
  122. package/dist/types/core/aggregation/transport/transport.d.ts.map +1 -0
  123. package/dist/types/core/beacon/beacon.d.ts +41 -6
  124. package/dist/types/core/beacon/beacon.d.ts.map +1 -1
  125. package/dist/types/core/beacon/cas-beacon.d.ts +23 -11
  126. package/dist/types/core/beacon/cas-beacon.d.ts.map +1 -1
  127. package/dist/types/core/beacon/error.d.ts +0 -6
  128. package/dist/types/core/beacon/error.d.ts.map +1 -1
  129. package/dist/types/core/beacon/factory.d.ts +2 -2
  130. package/dist/types/core/beacon/factory.d.ts.map +1 -1
  131. package/dist/types/core/beacon/fee-estimator.d.ts +40 -0
  132. package/dist/types/core/beacon/fee-estimator.d.ts.map +1 -0
  133. package/dist/types/core/beacon/interfaces.d.ts +11 -3
  134. package/dist/types/core/beacon/interfaces.d.ts.map +1 -1
  135. package/dist/types/core/beacon/signal-discovery.d.ts +3 -3
  136. package/dist/types/core/beacon/signal-discovery.d.ts.map +1 -1
  137. package/dist/types/core/beacon/singleton-beacon.d.ts +14 -7
  138. package/dist/types/core/beacon/singleton-beacon.d.ts.map +1 -1
  139. package/dist/types/core/beacon/smt-beacon.d.ts +32 -12
  140. package/dist/types/core/beacon/smt-beacon.d.ts.map +1 -1
  141. package/dist/types/core/beacon/utils.d.ts +4 -4
  142. package/dist/types/core/beacon/utils.d.ts.map +1 -1
  143. package/dist/types/core/identifier.d.ts +10 -2
  144. package/dist/types/core/identifier.d.ts.map +1 -1
  145. package/dist/types/core/interfaces.d.ts +4 -4
  146. package/dist/types/core/interfaces.d.ts.map +1 -1
  147. package/dist/types/core/resolver.d.ts +19 -9
  148. package/dist/types/core/resolver.d.ts.map +1 -1
  149. package/dist/types/core/types.d.ts +6 -5
  150. package/dist/types/core/types.d.ts.map +1 -1
  151. package/dist/types/core/update.d.ts +5 -5
  152. package/dist/types/core/update.d.ts.map +1 -1
  153. package/dist/types/did-btcr2.d.ts +6 -6
  154. package/dist/types/did-btcr2.d.ts.map +1 -1
  155. package/dist/types/index.d.ts +9 -24
  156. package/dist/types/index.d.ts.map +1 -1
  157. package/dist/types/utils/appendix.d.ts +7 -7
  158. package/dist/types/utils/appendix.d.ts.map +1 -1
  159. package/dist/types/utils/did-document-builder.d.ts +3 -2
  160. package/dist/types/utils/did-document-builder.d.ts.map +1 -1
  161. package/dist/types/utils/did-document.d.ts +3 -3
  162. package/dist/types/utils/did-document.d.ts.map +1 -1
  163. package/package.json +35 -33
  164. package/src/core/aggregation/cohort.ts +247 -0
  165. package/src/core/aggregation/errors.ts +25 -0
  166. package/src/core/{beacon/aggregation/cohort → aggregation}/messages/base.ts +8 -3
  167. package/src/core/aggregation/messages/constants.ts +28 -0
  168. package/src/core/aggregation/messages/factories.ts +240 -0
  169. package/src/core/aggregation/messages/guards.ts +55 -0
  170. package/src/core/aggregation/messages/index.ts +4 -0
  171. package/src/core/aggregation/participant.ts +510 -0
  172. package/src/core/aggregation/phases.ts +82 -0
  173. package/src/core/aggregation/runner/events.ts +77 -0
  174. package/src/core/aggregation/runner/index.ts +4 -0
  175. package/src/core/aggregation/runner/participant-runner.ts +360 -0
  176. package/src/core/aggregation/runner/service-runner.ts +365 -0
  177. package/src/core/aggregation/runner/typed-emitter.ts +87 -0
  178. package/src/core/aggregation/service.ts +547 -0
  179. package/src/core/aggregation/signing-session.ts +209 -0
  180. package/src/core/aggregation/transport/didcomm.ts +42 -0
  181. package/src/core/aggregation/transport/error.ts +13 -0
  182. package/src/core/aggregation/transport/factory.ts +29 -0
  183. package/src/core/aggregation/transport/index.ts +5 -0
  184. package/src/core/aggregation/transport/nostr.ts +333 -0
  185. package/src/core/aggregation/transport/transport.ts +46 -0
  186. package/src/core/beacon/beacon.ts +126 -6
  187. package/src/core/beacon/cas-beacon.ts +39 -83
  188. package/src/core/beacon/error.ts +0 -12
  189. package/src/core/beacon/factory.ts +2 -2
  190. package/src/core/beacon/fee-estimator.ts +52 -0
  191. package/src/core/beacon/interfaces.ts +13 -4
  192. package/src/core/beacon/signal-discovery.ts +5 -4
  193. package/src/core/beacon/singleton-beacon.ts +21 -81
  194. package/src/core/beacon/smt-beacon.ts +113 -15
  195. package/src/core/beacon/utils.ts +6 -4
  196. package/src/core/identifier.ts +20 -2
  197. package/src/core/interfaces.ts +4 -4
  198. package/src/core/resolver.ts +84 -53
  199. package/src/core/types.ts +6 -5
  200. package/src/core/update.ts +11 -7
  201. package/src/did-btcr2.ts +12 -10
  202. package/src/index.ts +15 -29
  203. package/src/utils/appendix.ts +14 -16
  204. package/src/utils/did-document-builder.ts +3 -2
  205. package/src/utils/did-document.ts +10 -8
  206. package/dist/cjs/core/beacon/aggregation/cohort/index.js +0 -237
  207. package/dist/cjs/core/beacon/aggregation/cohort/index.js.map +0 -1
  208. package/dist/cjs/core/beacon/aggregation/cohort/messages/base.js +0 -26
  209. package/dist/cjs/core/beacon/aggregation/cohort/messages/base.js.map +0 -1
  210. package/dist/cjs/core/beacon/aggregation/cohort/messages/constants.js +0 -11
  211. package/dist/cjs/core/beacon/aggregation/cohort/messages/constants.js.map +0 -1
  212. package/dist/cjs/core/beacon/aggregation/cohort/messages/index.js +0 -98
  213. package/dist/cjs/core/beacon/aggregation/cohort/messages/index.js.map +0 -1
  214. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js +0 -31
  215. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js.map +0 -1
  216. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js +0 -29
  217. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js.map +0 -1
  218. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js +0 -27
  219. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js.map +0 -1
  220. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in.js +0 -23
  221. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in.js.map +0 -1
  222. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/subscribe.js +0 -28
  223. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/subscribe.js.map +0 -1
  224. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js +0 -29
  225. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js.map +0 -1
  226. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/authorization-request.js +0 -30
  227. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/authorization-request.js.map +0 -1
  228. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js +0 -30
  229. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js.map +0 -1
  230. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/request-signature.js +0 -30
  231. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/request-signature.js.map +0 -1
  232. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js +0 -31
  233. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js.map +0 -1
  234. package/dist/cjs/core/beacon/aggregation/cohort/status.js +0 -8
  235. package/dist/cjs/core/beacon/aggregation/cohort/status.js.map +0 -1
  236. package/dist/cjs/core/beacon/aggregation/communication/adapter/did-comm.js +0 -121
  237. package/dist/cjs/core/beacon/aggregation/communication/adapter/did-comm.js.map +0 -1
  238. package/dist/cjs/core/beacon/aggregation/communication/adapter/nostr.js +0 -246
  239. package/dist/cjs/core/beacon/aggregation/communication/adapter/nostr.js.map +0 -1
  240. package/dist/cjs/core/beacon/aggregation/communication/error.js +0 -12
  241. package/dist/cjs/core/beacon/aggregation/communication/error.js.map +0 -1
  242. package/dist/cjs/core/beacon/aggregation/communication/factory.js +0 -21
  243. package/dist/cjs/core/beacon/aggregation/communication/factory.js.map +0 -1
  244. package/dist/cjs/core/beacon/aggregation/communication/service.js +0 -2
  245. package/dist/cjs/core/beacon/aggregation/communication/service.js.map +0 -1
  246. package/dist/cjs/core/beacon/aggregation/coordinator.js +0 -343
  247. package/dist/cjs/core/beacon/aggregation/coordinator.js.map +0 -1
  248. package/dist/cjs/core/beacon/aggregation/participant.js +0 -435
  249. package/dist/cjs/core/beacon/aggregation/participant.js.map +0 -1
  250. package/dist/cjs/core/beacon/aggregation/session/index.js +0 -244
  251. package/dist/cjs/core/beacon/aggregation/session/index.js.map +0 -1
  252. package/dist/cjs/core/beacon/aggregation/session/status.js +0 -11
  253. package/dist/cjs/core/beacon/aggregation/session/status.js.map +0 -1
  254. package/dist/cjs/core/beacon/beacon.js +0 -25
  255. package/dist/cjs/core/beacon/beacon.js.map +0 -1
  256. package/dist/cjs/core/beacon/cas-beacon.js +0 -152
  257. package/dist/cjs/core/beacon/cas-beacon.js.map +0 -1
  258. package/dist/cjs/core/beacon/error.js +0 -37
  259. package/dist/cjs/core/beacon/error.js.map +0 -1
  260. package/dist/cjs/core/beacon/factory.js +0 -29
  261. package/dist/cjs/core/beacon/factory.js.map +0 -1
  262. package/dist/cjs/core/beacon/interfaces.js +0 -2
  263. package/dist/cjs/core/beacon/interfaces.js.map +0 -1
  264. package/dist/cjs/core/beacon/signal-discovery.js +0 -183
  265. package/dist/cjs/core/beacon/signal-discovery.js.map +0 -1
  266. package/dist/cjs/core/beacon/singleton-beacon.js +0 -107
  267. package/dist/cjs/core/beacon/singleton-beacon.js.map +0 -1
  268. package/dist/cjs/core/beacon/smt-beacon.js +0 -39
  269. package/dist/cjs/core/beacon/smt-beacon.js.map +0 -1
  270. package/dist/cjs/core/beacon/utils.js +0 -163
  271. package/dist/cjs/core/beacon/utils.js.map +0 -1
  272. package/dist/cjs/core/identifier.js +0 -248
  273. package/dist/cjs/core/identifier.js.map +0 -1
  274. package/dist/cjs/core/interfaces.js +0 -2
  275. package/dist/cjs/core/interfaces.js.map +0 -1
  276. package/dist/cjs/core/resolver.js +0 -476
  277. package/dist/cjs/core/resolver.js.map +0 -1
  278. package/dist/cjs/core/types.js +0 -2
  279. package/dist/cjs/core/types.js.map +0 -1
  280. package/dist/cjs/core/update.js +0 -112
  281. package/dist/cjs/core/update.js.map +0 -1
  282. package/dist/cjs/did-btcr2.js +0 -193
  283. package/dist/cjs/did-btcr2.js.map +0 -1
  284. package/dist/cjs/index.js.map +0 -1
  285. package/dist/cjs/utils/appendix.js +0 -203
  286. package/dist/cjs/utils/appendix.js.map +0 -1
  287. package/dist/cjs/utils/did-document-builder.js +0 -60
  288. package/dist/cjs/utils/did-document-builder.js.map +0 -1
  289. package/dist/cjs/utils/did-document.js +0 -424
  290. package/dist/cjs/utils/did-document.js.map +0 -1
  291. package/dist/esm/core/beacon/aggregation/cohort/index.js +0 -237
  292. package/dist/esm/core/beacon/aggregation/cohort/index.js.map +0 -1
  293. package/dist/esm/core/beacon/aggregation/cohort/messages/base.js.map +0 -1
  294. package/dist/esm/core/beacon/aggregation/cohort/messages/constants.js +0 -11
  295. package/dist/esm/core/beacon/aggregation/cohort/messages/constants.js.map +0 -1
  296. package/dist/esm/core/beacon/aggregation/cohort/messages/index.js +0 -98
  297. package/dist/esm/core/beacon/aggregation/cohort/messages/index.js.map +0 -1
  298. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js +0 -31
  299. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js.map +0 -1
  300. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js +0 -29
  301. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js.map +0 -1
  302. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js +0 -27
  303. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js.map +0 -1
  304. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in.js +0 -23
  305. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in.js.map +0 -1
  306. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/subscribe.js +0 -28
  307. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/subscribe.js.map +0 -1
  308. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js +0 -29
  309. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js.map +0 -1
  310. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/authorization-request.js +0 -30
  311. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/authorization-request.js.map +0 -1
  312. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js +0 -30
  313. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js.map +0 -1
  314. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/request-signature.js +0 -30
  315. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/request-signature.js.map +0 -1
  316. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js +0 -31
  317. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js.map +0 -1
  318. package/dist/esm/core/beacon/aggregation/cohort/status.js +0 -8
  319. package/dist/esm/core/beacon/aggregation/cohort/status.js.map +0 -1
  320. package/dist/esm/core/beacon/aggregation/communication/adapter/did-comm.js +0 -121
  321. package/dist/esm/core/beacon/aggregation/communication/adapter/did-comm.js.map +0 -1
  322. package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js +0 -246
  323. package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js.map +0 -1
  324. package/dist/esm/core/beacon/aggregation/communication/error.js +0 -12
  325. package/dist/esm/core/beacon/aggregation/communication/error.js.map +0 -1
  326. package/dist/esm/core/beacon/aggregation/communication/factory.js +0 -21
  327. package/dist/esm/core/beacon/aggregation/communication/factory.js.map +0 -1
  328. package/dist/esm/core/beacon/aggregation/communication/service.js +0 -2
  329. package/dist/esm/core/beacon/aggregation/communication/service.js.map +0 -1
  330. package/dist/esm/core/beacon/aggregation/coordinator.js +0 -343
  331. package/dist/esm/core/beacon/aggregation/coordinator.js.map +0 -1
  332. package/dist/esm/core/beacon/aggregation/participant.js +0 -435
  333. package/dist/esm/core/beacon/aggregation/participant.js.map +0 -1
  334. package/dist/esm/core/beacon/aggregation/session/index.js +0 -244
  335. package/dist/esm/core/beacon/aggregation/session/index.js.map +0 -1
  336. package/dist/esm/core/beacon/aggregation/session/status.js +0 -11
  337. package/dist/esm/core/beacon/aggregation/session/status.js.map +0 -1
  338. package/dist/types/core/beacon/aggregation/cohort/index.d.ts +0 -136
  339. package/dist/types/core/beacon/aggregation/cohort/index.d.ts.map +0 -1
  340. package/dist/types/core/beacon/aggregation/cohort/messages/base.d.ts.map +0 -1
  341. package/dist/types/core/beacon/aggregation/cohort/messages/constants.d.ts +0 -11
  342. package/dist/types/core/beacon/aggregation/cohort/messages/constants.d.ts.map +0 -1
  343. package/dist/types/core/beacon/aggregation/cohort/messages/index.d.ts +0 -65
  344. package/dist/types/core/beacon/aggregation/cohort/messages/index.d.ts.map +0 -1
  345. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts +0 -29
  346. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts.map +0 -1
  347. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts +0 -26
  348. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts.map +0 -1
  349. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.d.ts +0 -24
  350. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.d.ts.map +0 -1
  351. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts +0 -20
  352. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts.map +0 -1
  353. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts +0 -25
  354. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts.map +0 -1
  355. package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts +0 -25
  356. package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts.map +0 -1
  357. package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts +0 -26
  358. package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts.map +0 -1
  359. package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts +0 -26
  360. package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts.map +0 -1
  361. package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts +0 -26
  362. package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts.map +0 -1
  363. package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts +0 -27
  364. package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts.map +0 -1
  365. package/dist/types/core/beacon/aggregation/cohort/status.d.ts +0 -8
  366. package/dist/types/core/beacon/aggregation/cohort/status.d.ts.map +0 -1
  367. package/dist/types/core/beacon/aggregation/communication/adapter/did-comm.d.ts +0 -89
  368. package/dist/types/core/beacon/aggregation/communication/adapter/did-comm.d.ts.map +0 -1
  369. package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts +0 -103
  370. package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts.map +0 -1
  371. package/dist/types/core/beacon/aggregation/communication/error.d.ts.map +0 -1
  372. package/dist/types/core/beacon/aggregation/communication/factory.d.ts +0 -10
  373. package/dist/types/core/beacon/aggregation/communication/factory.d.ts.map +0 -1
  374. package/dist/types/core/beacon/aggregation/communication/service.d.ts +0 -36
  375. package/dist/types/core/beacon/aggregation/communication/service.d.ts.map +0 -1
  376. package/dist/types/core/beacon/aggregation/coordinator.d.ts +0 -116
  377. package/dist/types/core/beacon/aggregation/coordinator.d.ts.map +0 -1
  378. package/dist/types/core/beacon/aggregation/participant.d.ts +0 -192
  379. package/dist/types/core/beacon/aggregation/participant.d.ts.map +0 -1
  380. package/dist/types/core/beacon/aggregation/session/index.d.ts +0 -156
  381. package/dist/types/core/beacon/aggregation/session/index.d.ts.map +0 -1
  382. package/dist/types/core/beacon/aggregation/session/status.d.ts +0 -11
  383. package/dist/types/core/beacon/aggregation/session/status.d.ts.map +0 -1
  384. package/src/core/beacon/aggregation/cohort/index.ts +0 -304
  385. package/src/core/beacon/aggregation/cohort/messages/constants.ts +0 -12
  386. package/src/core/beacon/aggregation/cohort/messages/index.ts +0 -143
  387. package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.ts +0 -43
  388. package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.ts +0 -39
  389. package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.ts +0 -34
  390. package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in.ts +0 -33
  391. package/src/core/beacon/aggregation/cohort/messages/keygen/subscribe.ts +0 -35
  392. package/src/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.ts +0 -38
  393. package/src/core/beacon/aggregation/cohort/messages/sign/authorization-request.ts +0 -39
  394. package/src/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.ts +0 -39
  395. package/src/core/beacon/aggregation/cohort/messages/sign/request-signature.ts +0 -39
  396. package/src/core/beacon/aggregation/cohort/messages/sign/signature-authorization.ts +0 -40
  397. package/src/core/beacon/aggregation/cohort/status.ts +0 -7
  398. package/src/core/beacon/aggregation/communication/adapter/did-comm.ts +0 -147
  399. package/src/core/beacon/aggregation/communication/adapter/nostr.ts +0 -321
  400. package/src/core/beacon/aggregation/communication/error.ts +0 -13
  401. package/src/core/beacon/aggregation/communication/factory.ts +0 -25
  402. package/src/core/beacon/aggregation/communication/service.ts +0 -42
  403. package/src/core/beacon/aggregation/coordinator.ts +0 -415
  404. package/src/core/beacon/aggregation/participant.ts +0 -512
  405. package/src/core/beacon/aggregation/session/index.ts +0 -300
  406. package/src/core/beacon/aggregation/session/status.ts +0 -18
@@ -1,27 +1,12 @@
1
- export * from './core/beacon/aggregation/cohort/index.js';
2
- export * from './core/beacon/aggregation/cohort/status.js';
3
- export * from './core/beacon/aggregation/cohort/messages/base.js';
4
- export * from './core/beacon/aggregation/cohort/messages/constants.js';
5
- export * from './core/beacon/aggregation/cohort/messages/index.js';
6
- export * from './core/beacon/aggregation/cohort/messages/keygen//subscribe.js';
7
- export * from './core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js';
8
- export * from './core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js';
9
- export * from './core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js';
10
- export * from './core/beacon/aggregation/cohort/messages/keygen/opt-in.js';
11
- export * from './core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js';
12
- export * from './core/beacon/aggregation/cohort/messages/sign/authorization-request.js';
13
- export * from './core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js';
14
- export * from './core/beacon/aggregation/cohort/messages/sign/request-signature.js';
15
- export * from './core/beacon/aggregation/cohort/messages/sign/signature-authorization.js';
16
- export * from './core/beacon/aggregation/communication/adapter/did-comm.js';
17
- export * from './core/beacon/aggregation/communication/adapter/nostr.js';
18
- export * from './core/beacon/aggregation/communication/error.js';
19
- export * from './core/beacon/aggregation/communication/factory.js';
20
- export * from './core/beacon/aggregation/communication/service.js';
21
- export * from './core/beacon/aggregation/coordinator.js';
22
- export * from './core/beacon/aggregation/participant.js';
23
- export * from './core/beacon/aggregation/session/index.js';
24
- export * from './core/beacon/aggregation/session/status.js';
1
+ export * from './core/aggregation/service.js';
2
+ export * from './core/aggregation/participant.js';
3
+ export * from './core/aggregation/cohort.js';
4
+ export * from './core/aggregation/signing-session.js';
5
+ export * from './core/aggregation/phases.js';
6
+ export * from './core/aggregation/errors.js';
7
+ export * from './core/aggregation/messages/index.js';
8
+ export * from './core/aggregation/transport/index.js';
9
+ export * from './core/aggregation/runner/index.js';
25
10
  export * from './core/beacon/beacon.js';
26
11
  export * from './core/beacon/cas-beacon.js';
27
12
  export * from './core/beacon/error.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAE3D,cAAc,mDAAmD,CAAC;AAClE,cAAc,wDAAwD,CAAC;AACvE,cAAc,oDAAoD,CAAC;AACnE,cAAc,gEAAgE,CAAC;AAC/E,cAAc,mEAAmE,CA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D,cAAc,oCAAoC,CAAC;AAGnD,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AAGvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AAGxC,cAAc,gBAAgB,CAAC"}
@@ -1,6 +1,6 @@
1
- import { HashBytes } from '@did-btcr2/common';
2
- import { DidDocument, DidService, DidVerificationMethod } from '@web5/dids';
3
- import { RootCapability } from '../core/interfaces.js';
1
+ import type { HashBytes } from '@did-btcr2/common';
2
+ import type { DidDocument, DidService, DidVerificationMethod } from '@web5/dids';
3
+ import type { RootCapability } from '../core/interfaces.js';
4
4
  /**
5
5
  * Implements {@link https://dcdpr.github.io/did-btcr2/#appendix | 9. Appendix} methods.
6
6
  *
@@ -27,10 +27,10 @@ export declare class Appendix {
27
27
  */
28
28
  static isDidService(obj: unknown): obj is DidService;
29
29
  /**
30
- * Extracts the verification methods from a given DID Document
31
- * @param {DidDocument} params.didDocument The DID Document to extract the verification methods from
32
- * @returns {DidVerificationMethod[]} An array of DidVerificationMethod objects
33
- * @throws {TypeError} if the didDocument is not provided
30
+ * Extracts the verification methods from a given DID Document.
31
+ * @param didDocument The DID Document to extract the verification methods from
32
+ * @returns An array of DidVerificationMethod objects
33
+ * @throws TypeError if the didDocument is not provided
34
34
  */
35
35
  static getVerificationMethods(didDocument: DidDocument): DidVerificationMethod[];
36
36
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"appendix.d.ts","sourceRoot":"","sources":["../../../src/utils/appendix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EACL,WAAW,EAGX,UAAU,EACV,qBAAqB,EAEtB,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;;GAKG;AACH,qBAAa,QAAQ;IACnB;;;;OAIG;WACW,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;IAMpE;;;;OAIG;WACW,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,qBAAqB;IAcjF;;;;OAIG;WACW,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,UAAU;IAW3D;;;;;OAKG;WACW,sBAAsB,CAAC,WAAW,EAAE,WAAW,GAAG,qBAAqB,EAAE;IAgBvF;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc;IAU/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;WACW,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,cAAc;IA+CrE;;;;OAIG;WACU,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAW7E"}
1
+ {"version":3,"file":"appendix.d.ts","sourceRoot":"","sources":["../../../src/utils/appendix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,qBAAqB,EAAC,MAAM,YAAY,CAAC;AAQ3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;GAKG;AACH,qBAAa,QAAQ;IACnB;;;;OAIG;WACW,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;IAMpE;;;;OAIG;WACW,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,qBAAqB;IAcjF;;;;OAIG;WACW,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,UAAU;IAW3D;;;;;OAKG;WACW,sBAAsB,CAAC,WAAW,EAAE,WAAW,GAAG,qBAAqB,EAAE;IAgBvF;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc;IAU/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;WACW,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,cAAc;IA+CrE;;;;OAIG;WACU,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAe7E"}
@@ -1,5 +1,6 @@
1
- import { BeaconService } from '../core/beacon/interfaces.js';
2
- import { DidDocument, DidVerificationMethod } from './did-document.js';
1
+ import type { BeaconService } from '../core/beacon/interfaces.js';
2
+ import type { DidVerificationMethod } from './did-document.js';
3
+ import { DidDocument } from './did-document.js';
3
4
  /**
4
5
  * A builder class for constructing DID Documents.
5
6
  * @type {DidDocumentBuilder}
@@ -1 +1 @@
1
- {"version":3,"file":"did-document-builder.d.ts","sourceRoot":"","sources":["../../../src/utils/did-document-builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAEvE;;;;GAIG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAA4B;gBAEhC,eAAe,EAAE,OAAO,CAAC,WAAW,CAAC;IAYjD,kBAAkB,CAAC,cAAc,EAAE,KAAK,CAAC,MAAM,GAAG,qBAAq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Bytes } from '@did-btcr2/common';
2
- import { DidDocument as W3CDidDocument, DidVerificationMethod as W3CDidVerificationMethod } from '@web5/dids';
3
- import { BeaconService } from '../core/beacon/interfaces.js';
1
+ import type { HashBytes, JSONObject, KeyBytes } from '@did-btcr2/common';
2
+ import type { DidDocument as W3CDidDocument, DidVerificationMethod as W3CDidVerificationMethod } from '@web5/dids';
3
+ import type { BeaconService } from '../core/beacon/interfaces.js';
4
4
  export declare const BTCR2_DID_DOCUMENT_CONTEXT: string[];
5
5
  export declare const ID_PLACEHOLDER_VALUE = "did:btcr2:_";
6
6
  export declare const BECH32M_CHARS = "";
@@ -1 +1 @@
1
- {"version":3,"file":"did-document.d.ts","sourceRoot":"","sources":["../../../src/utils/did-document.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,SAAS,EAGT,UAAU,EAEV,QAAQ,EACT,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,WAAW,IAAI,cAAc,EAAE,qBAAqB,IAAI,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE9G,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAK7D,eAAO,MAAM,0BAA0B,UAGtC,CAAC;AACF,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAClD,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,eAAO,MAAM,SAAS,QAAuD,CAAC;AAE9E,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACjD,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,qBAAqB,CAAC,CAAC;IACvD,eAAe,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,qBAAqB,CAAC,CAAC;IACxD,oBAAoB,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,qBAAqB,CAAC,CAAC;IAC7D,oBAAoB,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,qBAAqB,CAAC,C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AC,MAAM,CAAC,0BAA0B;IAIzC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAI9B;;;;;OAKG;WACW,gCAAgC,CAAC,WAAW,EAAE,eAAe,GAAG,OAAO;IAqBrF;;;;OAIG;WACW,QAAQ,CAAC,WAAW,EAAE,GAAG,GAAG,WAAW;IAWrD;;;OAGG;IACI,eAAe,IAAI,OAAO;IAqBjC;;;OAGG;IACI,cAAc,IAAI,eAAe;CAMzC;AAED,qBAAa,QAAQ;WACL,OAAO,CAAC,WAAW,EAAE,WAAW,GAAG,eAAe,GAAG,OAAO;CAG3E;AAGD;;;;;;GAMG;AACH,qBAAa,eAAgB,SAAQ,WAAW;gBAClC,QAAQ,EAAE,eAAe;IAIrC;;;;OAIG;IACI,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW;IAO9C;;;;OAIG;WACW,eAAe,CAAC,WAAW,EAAE,WAAW,GAAG,eAAe;IAKxE;;;;;;OAMG;WACW,MAAM,CAClB,kBAAkB,EAAE,KAAK,CAAC,qBAAqB,CAAC,EAChD,aAAa,EAAE,yBAAyB,EACxC,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC,GAC5B,eAAe;IAIlB;;;;OAIG;WACW,aAAa,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,eAAe;IA4BlF;;;;OAIG;WACW,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,eAAe;IAIrE;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,eAAe,EAAE,mBAAmB,GAAG,SAAS;CAGvE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@did-btcr2/method",
3
- "version": "0.25.3",
3
+ "version": "0.27.0",
4
4
  "type": "module",
5
5
  "description": "Reference implementation for the did:btcr2 DID method written in TypeScript and JavaScript. did:btcr2 is a censorship resistant DID Method using the Bitcoin blockchain as a Verifiable Data Registry to announce changes to the DID document. This is the core method implementation for the did-btcr2-js monorepo.",
6
6
  "main": "./dist/cjs/index.js",
@@ -65,51 +65,53 @@
65
65
  ],
66
66
  "dependencies": {
67
67
  "@bitcoinerlab/secp256k1": "^1.2.0",
68
- "@helia/strings": "^4.0.2",
69
- "@noble/curves": "^1.8.1",
70
- "@noble/hashes": "^1.5.0",
71
- "@noble/secp256k1": "^2.1.0",
72
- "@scure/base": "^1.1.9",
73
- "@scure/bip32": "^1.5.0",
74
- "@scure/bip39": "^1.4.0",
68
+ "@helia/strings": "^4.1.0",
69
+ "@noble/curves": "^1.9.7",
70
+ "@noble/hashes": "^1.8.0",
71
+ "@noble/secp256k1": "^2.3.0",
72
+ "@scure/base": "^1.2.6",
73
+ "@scure/bip32": "^1.7.0",
74
+ "@scure/bip39": "^1.6.0",
75
75
  "@scure/btc-signer": "^1.8.1",
76
76
  "@web5/common": "^1.1.0",
77
77
  "@web5/crypto": "^1.0.6",
78
78
  "@web5/dids": "^1.2.0",
79
79
  "bitcoinjs-lib": "7.0.0-rc.0",
80
80
  "canonicalize": "^2.1.0",
81
- "dotenv": "^16.5.0",
82
- "helia": "^5.2.1",
83
- "multiformats": "^13.3.1",
84
- "nostr-tools": "^2.15.0",
85
- "@did-btcr2/bitcoin": "^0.5.2",
86
- "@did-btcr2/common": "^8.0.1",
87
- "@did-btcr2/keypair": "^0.11.3",
88
- "@did-btcr2/cryptosuite": "^6.0.5"
81
+ "dotenv": "^16.6.1",
82
+ "helia": "^5.5.1",
83
+ "multiformats": "^13.4.2",
84
+ "nostr-tools": "^2.23.3",
85
+ "@did-btcr2/bitcoin": "^0.5.3",
86
+ "@did-btcr2/common": "^9.0.0",
87
+ "@did-btcr2/cryptosuite": "^6.0.6",
88
+ "@did-btcr2/smt": "^0.2.4",
89
+ "@did-btcr2/keypair": "^0.11.4"
89
90
  },
90
91
  "devDependencies": {
91
- "@eslint/js": "^9.22.0",
92
- "@types/chai": "^5.0.1",
93
- "@types/chai-as-promised": "^8.0.1",
92
+ "@eslint/js": "^9.39.4",
93
+ "@types/chai": "^5.2.3",
94
+ "@types/chai-as-promised": "^8.0.2",
94
95
  "@types/eslint": "^9.6.1",
95
- "@types/mocha": "^10.0.9",
96
- "@types/node": "^25.3.0",
97
- "@typescript-eslint/eslint-plugin": "^8.5.0",
98
- "@typescript-eslint/parser": "^8.5.0",
99
- "c8": "^10.1.2",
100
- "chai": "^5.1.2",
101
- "chai-as-promised": "^8.0.0",
96
+ "@types/mocha": "^10.0.10",
97
+ "@types/node": "^25.5.0",
98
+ "@typescript-eslint/eslint-plugin": "^8.58.0",
99
+ "@typescript-eslint/parser": "^8.58.0",
100
+ "c8": "^10.1.3",
101
+ "chai": "^5.3.3",
102
+ "chai-as-promised": "^8.0.2",
102
103
  "esbuild": "^0.24.2",
103
- "eslint": "^9.14.0",
104
+ "eslint": "^9.39.4",
104
105
  "eslint-plugin-mocha": "^10.5.0",
105
- "globals": "^15.11.0",
106
+ "globals": "^15.15.0",
106
107
  "mocha": "^10.8.2",
107
108
  "mocha-junit-reporter": "^2.2.1",
108
109
  "node-stdlib-browser": "^1.3.1",
109
- "rimraf": "^6.0.1",
110
- "typedoc-plugin-markdown": "^4.7.0",
111
- "typescript": "^5.6.2",
112
- "typescript-eslint": "^8.19.1"
110
+ "rimraf": "^6.1.3",
111
+ "tsup": "^8.5.1",
112
+ "typedoc-plugin-markdown": "^4.11.0",
113
+ "typescript": "^5.9.3",
114
+ "typescript-eslint": "^8.58.0"
113
115
  },
114
116
  "scripts": {
115
117
  "clean": "rimraf dist coverage tests/compiled",
@@ -123,7 +125,7 @@
123
125
  "reinstall": "pnpm install --force",
124
126
  "build": "pnpm clean:build && pnpm build:esm && pnpm build:cjs && pnpm build:browser",
125
127
  "build:esm": "rimraf dist/esm dist/types && pnpm tsc -p tsconfig.json",
126
- "build:cjs": "rimraf dist/cjs && tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json",
128
+ "build:cjs": "tsup && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json",
127
129
  "build:browser": "rimraf dist/browser.mjs dist/browser.js && node build/bundles.js",
128
130
  "build:tests": "pnpm clean:tests && pnpm tsc -p tests/tsconfig.json",
129
131
  "build:docs": "typedoc --options typedoc.json",
@@ -0,0 +1,247 @@
1
+ import { canonicalHash, canonicalize, hash } from '@did-btcr2/common';
2
+ import type { SignedBTCR2Update } from '@did-btcr2/cryptosuite';
3
+ import type { SerializedSMTProof, TreeEntry } from '@did-btcr2/smt';
4
+ import { BTCR2MerkleTree } from '@did-btcr2/smt';
5
+ import { hexToBytes, randomBytes } from '@noble/hashes/utils';
6
+ import { keyAggExport, keyAggregate, sortKeys } from '@scure/btc-signer/musig2';
7
+ import { crypto as btcCrypto, payments } from 'bitcoinjs-lib';
8
+ import type { CASAnnouncement } from '../types.js';
9
+ import { AggregationCohortError } from './errors.js';
10
+
11
+ export type AggregationCohortParams = {
12
+ id?: string;
13
+ serviceDid?: string;
14
+ minParticipants?: number;
15
+ network: string;
16
+ beaconType?: string;
17
+ };
18
+
19
+ /**
20
+ * Represents an Aggregation Cohort — a set of Aggregation Participants who
21
+ * submitted cryptographic material to an Aggregation Service to coordinate
22
+ * signing of a shared n-of-n MuSig2 Bitcoin transaction.
23
+ *
24
+ * This is a pure data class — it holds cohort state and provides computation
25
+ * helpers (key aggregation, CAS Announcement building, SMT tree building).
26
+ * It performs no I/O and emits no messages. Both AggregationService and
27
+ * AggregationParticipant create their own AggregationCohort instances to
28
+ * track their respective views of the cohort state.
29
+ *
30
+ * @class AggregationCohort
31
+ */
32
+ export class AggregationCohort {
33
+ /** Unique identifier for the cohort. */
34
+ id: string;
35
+
36
+ /** DID of the Aggregation Service managing this cohort. */
37
+ serviceDid: string;
38
+
39
+ /** Minimum number of participants required to finalize the cohort. */
40
+ minParticipants: number;
41
+
42
+ /** Network on which the cohort operates (mainnet, mutinynet, etc.). */
43
+ network: string;
44
+
45
+ /** Type of beacon used in the cohort: 'CASBeacon' or 'SMTBeacon'. */
46
+ beaconType: string;
47
+
48
+ /** List of participant DIDs that have been accepted into the cohort. */
49
+ participants: Array<string> = [];
50
+
51
+ /** Sorted list of cohort participants' compressed public keys. */
52
+ #cohortKeys: Array<Uint8Array> = [];
53
+
54
+ /** Taproot tweak (BIP-341 key-path-only). */
55
+ trMerkleRoot: Uint8Array = new Uint8Array();
56
+
57
+ /** The n-of-n MuSig2 Taproot beacon address. */
58
+ beaconAddress: string = '';
59
+
60
+ /** Pending DID updates submitted by participants, keyed by DID. */
61
+ pendingUpdates: Map<string, SignedBTCR2Update> = new Map();
62
+
63
+ /** CAS Beacon Announcement Map (DID → updateHash), set by buildCASAnnouncement(). */
64
+ casAnnouncement?: CASAnnouncement;
65
+
66
+ /** Per-participant SMT proofs, set by buildSMTTree(). */
67
+ smtProofs?: Map<string, SerializedSMTProof>;
68
+
69
+ /** Signal bytes (32 bytes) for OP_RETURN: SHA-256 of CAS announcement OR SMT root. */
70
+ signalBytes?: Uint8Array;
71
+
72
+ /** Set of participant DIDs that have approved the aggregated data. */
73
+ validationAcks: Set<string> = new Set();
74
+
75
+ /** Set of participant DIDs that have rejected the aggregated data. */
76
+ validationRejections: Set<string> = new Set();
77
+
78
+ constructor({ id, minParticipants, serviceDid, network, beaconType }: AggregationCohortParams) {
79
+ this.id = id || crypto.randomUUID();
80
+ this.minParticipants = minParticipants || 2;
81
+ this.serviceDid = serviceDid || '';
82
+ this.network = network;
83
+ this.beaconType = beaconType || 'CASBeacon';
84
+ }
85
+
86
+ /** Sorted cohort keys (sorted on assignment per BIP-327). */
87
+ get cohortKeys(): Array<Uint8Array> {
88
+ return this.#cohortKeys;
89
+ }
90
+
91
+ set cohortKeys(keys: Array<Uint8Array>) {
92
+ this.#cohortKeys = sortKeys(keys);
93
+ }
94
+
95
+ /**
96
+ * Computes the n-of-n MuSig2 Taproot beacon address from cohort keys.
97
+ * Sets `trMerkleRoot` to the BIP-341 key-path-only tweak.
98
+ */
99
+ public computeBeaconAddress(): string {
100
+ if(this.#cohortKeys.length === 0) {
101
+ throw new AggregationCohortError(
102
+ 'Cannot compute beacon address: no cohort keys.',
103
+ 'NO_COHORT_KEYS', { cohortId: this.id }
104
+ );
105
+ }
106
+ const keyAggContext = keyAggregate(this.#cohortKeys);
107
+ const aggPubkey = keyAggExport(keyAggContext);
108
+ const payment = payments.p2tr({ internalPubkey: aggPubkey });
109
+
110
+ // BIP-341: key-path-only P2TR has no script tree, so payment.hash is null.
111
+ // Compute the tweak: taggedHash("TapTweak", internalPubkey).
112
+ this.trMerkleRoot = payment.hash ?? btcCrypto.taggedHash('TapTweak', aggPubkey);
113
+
114
+ if(!payment.address) {
115
+ throw new AggregationCohortError(
116
+ 'Failed to compute Taproot address',
117
+ 'BEACON_ADDRESS_ERROR', { cohortId: this.id }
118
+ );
119
+ }
120
+ this.beaconAddress = payment.address;
121
+ return payment.address;
122
+ }
123
+
124
+ /**
125
+ * Validates that the participant's key is in the cohort and the beacon address
126
+ * matches the locally-computed one. Used by participants to verify cohort ready
127
+ * messages from the service.
128
+ */
129
+ public validateMembership(
130
+ participantPkHex: string,
131
+ cohortKeysHex: Array<string>,
132
+ expectedBeaconAddress: string
133
+ ): void {
134
+ if(!cohortKeysHex.includes(participantPkHex)) {
135
+ throw new AggregationCohortError(
136
+ `Participant key not found in cohort ${this.id}.`,
137
+ 'COHORT_VALIDATION_ERROR', { cohortId: this.id, participantPkHex }
138
+ );
139
+ }
140
+ this.cohortKeys = cohortKeysHex.map(k => hexToBytes(k));
141
+ const computed = this.computeBeaconAddress();
142
+ if(computed !== expectedBeaconAddress) {
143
+ throw new AggregationCohortError(
144
+ `Computed beacon address ${computed} does not match expected ${expectedBeaconAddress}.`,
145
+ 'BEACON_ADDRESS_MISMATCH', { cohortId: this.id, computed, expected: expectedBeaconAddress }
146
+ );
147
+ }
148
+ }
149
+
150
+ public addUpdate(participantDid: string, signedUpdate: SignedBTCR2Update): void {
151
+ if(!this.participants.includes(participantDid)) {
152
+ throw new AggregationCohortError(
153
+ `Participant ${participantDid} is not in cohort ${this.id}.`,
154
+ 'UNKNOWN_PARTICIPANT', { cohortId: this.id, participantDid }
155
+ );
156
+ }
157
+ this.pendingUpdates.set(participantDid, signedUpdate);
158
+ }
159
+
160
+ public hasAllUpdates(): boolean {
161
+ return this.pendingUpdates.size === this.participants.length;
162
+ }
163
+
164
+ /**
165
+ * Builds a CAS Announcement Map from collected updates.
166
+ * Maps each participant DID → base64url canonical hash of their signed update.
167
+ * Computes signal bytes as SHA-256 of canonicalized announcement.
168
+ */
169
+ public buildCASAnnouncement(): CASAnnouncement {
170
+ if(!this.hasAllUpdates()) {
171
+ throw new AggregationCohortError(
172
+ 'Cannot build CAS Announcement: not all updates collected.',
173
+ 'INCOMPLETE_UPDATES', { cohortId: this.id, collected: this.pendingUpdates.size, total: this.participants.length }
174
+ );
175
+ }
176
+ const announcement: CASAnnouncement = {};
177
+ for(const [did, signedUpdate] of this.pendingUpdates) {
178
+ announcement[did] = canonicalHash(signedUpdate);
179
+ }
180
+ this.casAnnouncement = announcement;
181
+ this.signalBytes = hash(canonicalize(announcement));
182
+ return announcement;
183
+ }
184
+
185
+ /**
186
+ * Builds an SMT tree from collected updates.
187
+ * Each entry uses a random 32-byte nonce + canonicalized signed update bytes.
188
+ * Stores per-participant proofs and the SMT root as signalBytes.
189
+ */
190
+ public buildSMTTree(): Map<string, SerializedSMTProof> {
191
+ if(!this.hasAllUpdates()) {
192
+ throw new AggregationCohortError(
193
+ 'Cannot build SMT tree: not all updates collected.',
194
+ 'INCOMPLETE_UPDATES', { cohortId: this.id }
195
+ );
196
+ }
197
+ const tree = new BTCR2MerkleTree();
198
+ const entries: TreeEntry[] = [];
199
+ const encoder = new TextEncoder();
200
+
201
+ for(const [did, signedUpdate] of this.pendingUpdates) {
202
+ const canonicalBytes = encoder.encode(canonicalize(signedUpdate));
203
+ const nonce = randomBytes(32);
204
+ entries.push({ did, nonce, signedUpdate: canonicalBytes });
205
+ }
206
+
207
+ tree.addEntries(entries);
208
+ tree.finalize();
209
+
210
+ this.signalBytes = tree.rootHash;
211
+ this.smtProofs = new Map();
212
+ for(const [did] of this.pendingUpdates) {
213
+ this.smtProofs.set(did, tree.proof(did));
214
+ }
215
+ return this.smtProofs;
216
+ }
217
+
218
+ public addValidation(participantDid: string, approved: boolean): void {
219
+ if(!this.participants.includes(participantDid)) {
220
+ throw new AggregationCohortError(
221
+ `Unknown participant ${participantDid} in cohort ${this.id}.`,
222
+ 'UNKNOWN_PARTICIPANT', { cohortId: this.id, participantDid }
223
+ );
224
+ }
225
+ if(approved) {
226
+ this.validationAcks.add(participantDid);
227
+ } else {
228
+ this.validationRejections.add(participantDid);
229
+ }
230
+ }
231
+
232
+ /**
233
+ * True when every participant has either approved or rejected the aggregated data.
234
+ */
235
+ public hasAllValidationResponses(): boolean {
236
+ return this.validationAcks.size + this.validationRejections.size === this.participants.length;
237
+ }
238
+
239
+ /**
240
+ * True when all participants approved. Note: differs from {@link hasAllValidationResponses} —
241
+ * this returns false if any participant rejected, even if all responses are in.
242
+ */
243
+ public isFullyValidated(): boolean {
244
+ return this.validationRejections.size === 0
245
+ && this.validationAcks.size === this.participants.length;
246
+ }
247
+ }
@@ -0,0 +1,25 @@
1
+ import { MethodError } from '@did-btcr2/common';
2
+
3
+ export class AggregationServiceError extends MethodError {
4
+ constructor(message: string, type: string = 'AggregationServiceError', data?: Record<string, any>) {
5
+ super(message, type, data);
6
+ }
7
+ }
8
+
9
+ export class AggregationParticipantError extends MethodError {
10
+ constructor(message: string, type: string = 'AggregationParticipantError', data?: Record<string, any>) {
11
+ super(message, type, data);
12
+ }
13
+ }
14
+
15
+ export class AggregationCohortError extends MethodError {
16
+ constructor(message: string, type: string = 'AggregationCohortError', data?: Record<string, any>) {
17
+ super(message, type, data);
18
+ }
19
+ }
20
+
21
+ export class SigningSessionError extends MethodError {
22
+ constructor(message: string, type: string = 'SigningSessionError', data?: Record<string, any>) {
23
+ super(message, type, data);
24
+ }
25
+ }
@@ -1,5 +1,3 @@
1
- export const MESSAGE_PREFIX = 'https://btcr2.tools/';
2
-
3
1
  export type BaseBody = {
4
2
  cohortId: string;
5
3
  cohortSize?: number;
@@ -12,8 +10,15 @@ export type BaseBody = {
12
10
  nonceContribution?: Uint8Array;
13
11
  partialSignature?: Uint8Array;
14
12
  pendingTx?: string;
13
+ prevOutValue?: string;
14
+ communicationPk?: Uint8Array;
15
15
  beaconType?: string;
16
16
  data?: string;
17
+ signedUpdate?: Record<string, unknown>;
18
+ casAnnouncement?: Record<string, string>;
19
+ smtProof?: Record<string, unknown>;
20
+ signalBytesHex?: string;
21
+ approved?: boolean;
17
22
  };
18
23
 
19
24
  export type Base = {
@@ -48,4 +53,4 @@ export class BaseMessage {
48
53
  body : this.body
49
54
  };
50
55
  }
51
- }
56
+ }
@@ -0,0 +1,28 @@
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 const AGGREGATION_MESSAGE_PREFIX = 'https://btcr2.dev/aggregation';
12
+
13
+ // Step 1: Cohort Formation
14
+ export const COHORT_ADVERT = `${AGGREGATION_MESSAGE_PREFIX}/keygen/cohort_advert`;
15
+ export const COHORT_OPT_IN = `${AGGREGATION_MESSAGE_PREFIX}/keygen/cohort_opt_in`;
16
+ export const COHORT_OPT_IN_ACCEPT = `${AGGREGATION_MESSAGE_PREFIX}/keygen/cohort_opt_in_accept`;
17
+ export const COHORT_READY = `${AGGREGATION_MESSAGE_PREFIX}/keygen/cohort_ready`;
18
+
19
+ // Step 2 + 3: Update Submission, Aggregation, Validation
20
+ export const SUBMIT_UPDATE = `${AGGREGATION_MESSAGE_PREFIX}/update/submit_update`;
21
+ export const DISTRIBUTE_AGGREGATED_DATA = `${AGGREGATION_MESSAGE_PREFIX}/update/distribute_aggregated_data`;
22
+ export const VALIDATION_ACK = `${AGGREGATION_MESSAGE_PREFIX}/update/validation_ack`;
23
+
24
+ // Step 4: Signing
25
+ export const AUTHORIZATION_REQUEST = `${AGGREGATION_MESSAGE_PREFIX}/sign/authorization_request`;
26
+ export const NONCE_CONTRIBUTION = `${AGGREGATION_MESSAGE_PREFIX}/sign/nonce_contribution`;
27
+ export const AGGREGATED_NONCE = `${AGGREGATION_MESSAGE_PREFIX}/sign/aggregated_nonce`;
28
+ export const SIGNATURE_AUTHORIZATION = `${AGGREGATION_MESSAGE_PREFIX}/sign/signature_authorization`;