@did-btcr2/method 0.17.2 → 0.18.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 (366) hide show
  1. package/dist/browser.js +30124 -19552
  2. package/dist/browser.mjs +30123 -19551
  3. package/dist/cjs/core/beacon/aggregation/cohort/index.js +225 -0
  4. package/dist/cjs/core/beacon/aggregation/cohort/index.js.map +1 -0
  5. package/dist/{esm/core/beacon/aggregation → cjs/core/beacon/aggregation/cohort}/messages/base.js +3 -11
  6. package/dist/cjs/core/beacon/aggregation/cohort/messages/base.js.map +1 -0
  7. package/dist/cjs/core/beacon/aggregation/cohort/messages/constants.js +11 -0
  8. package/dist/cjs/core/beacon/aggregation/cohort/messages/constants.js.map +1 -0
  9. package/dist/cjs/core/beacon/aggregation/cohort/messages/index.js +98 -0
  10. package/dist/cjs/core/beacon/aggregation/cohort/messages/index.js.map +1 -0
  11. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js +30 -0
  12. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js.map +1 -0
  13. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js +28 -0
  14. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js.map +1 -0
  15. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js +26 -0
  16. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js.map +1 -0
  17. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in.js +22 -0
  18. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in.js.map +1 -0
  19. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/subscribe.js +27 -0
  20. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/subscribe.js.map +1 -0
  21. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js +28 -0
  22. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js.map +1 -0
  23. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/authorization-request.js +29 -0
  24. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/authorization-request.js.map +1 -0
  25. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js +29 -0
  26. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js.map +1 -0
  27. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/request-signature.js +29 -0
  28. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/request-signature.js.map +1 -0
  29. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js +30 -0
  30. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js.map +1 -0
  31. package/dist/cjs/core/beacon/aggregation/cohort/status.js.map +1 -0
  32. package/dist/cjs/core/beacon/aggregation/communication/adapter/did-comm.js +126 -0
  33. package/dist/cjs/core/beacon/aggregation/communication/adapter/did-comm.js.map +1 -0
  34. package/dist/cjs/core/beacon/aggregation/communication/adapter/nostr.js +230 -0
  35. package/dist/cjs/core/beacon/aggregation/communication/adapter/nostr.js.map +1 -0
  36. package/dist/cjs/core/beacon/aggregation/communication/error.js +12 -0
  37. package/dist/cjs/core/beacon/aggregation/communication/error.js.map +1 -0
  38. package/dist/cjs/core/beacon/aggregation/communication/factory.js +21 -0
  39. package/dist/cjs/core/beacon/aggregation/communication/factory.js.map +1 -0
  40. package/dist/cjs/core/beacon/aggregation/communication/service.js.map +1 -0
  41. package/dist/cjs/core/beacon/aggregation/coordinator.js +282 -56
  42. package/dist/cjs/core/beacon/aggregation/coordinator.js.map +1 -1
  43. package/dist/cjs/core/beacon/aggregation/participant.js +435 -1
  44. package/dist/cjs/core/beacon/aggregation/participant.js.map +1 -1
  45. package/dist/cjs/core/beacon/aggregation/session/index.js +233 -0
  46. package/dist/cjs/core/beacon/aggregation/session/index.js.map +1 -0
  47. package/dist/cjs/core/beacon/aggregation/session/status.js +11 -0
  48. package/dist/cjs/core/beacon/aggregation/session/status.js.map +1 -0
  49. package/dist/cjs/core/beacon/cid-aggregate.js.map +1 -1
  50. package/dist/cjs/core/beacon/error.js +37 -0
  51. package/dist/cjs/core/beacon/error.js.map +1 -0
  52. package/dist/cjs/core/beacon/factory.js.map +1 -1
  53. package/dist/cjs/core/beacon/singleton.js +8 -5
  54. package/dist/cjs/core/beacon/singleton.js.map +1 -1
  55. package/dist/cjs/core/beacon/smt-aggregate.js.map +1 -1
  56. package/dist/cjs/{utils/beacons.js → core/beacon/utils.js} +4 -4
  57. package/dist/cjs/core/beacon/utils.js.map +1 -0
  58. package/dist/cjs/core/crud/read.js +2 -9
  59. package/dist/cjs/core/crud/read.js.map +1 -1
  60. package/dist/cjs/core/crud/update.js +18 -19
  61. package/dist/cjs/core/crud/update.js.map +1 -1
  62. package/dist/{esm/utils → cjs/core}/identifier.js +18 -3
  63. package/dist/cjs/core/identifier.js.map +1 -0
  64. package/dist/cjs/did-btcr2.js +2 -2
  65. package/dist/cjs/did-btcr2.js.map +1 -1
  66. package/dist/cjs/index.js +28 -6
  67. package/dist/cjs/index.js.map +1 -1
  68. package/dist/cjs/interfaces/beacon.js.map +1 -1
  69. package/dist/cjs/utils/appendix.js +2 -3
  70. package/dist/cjs/utils/appendix.js.map +1 -1
  71. package/dist/cjs/utils/did-document.js +4 -6
  72. package/dist/cjs/utils/did-document.js.map +1 -1
  73. package/dist/cjs/utils/types.js +2 -0
  74. package/dist/cjs/utils/types.js.map +1 -0
  75. package/dist/esm/core/beacon/aggregation/cohort/index.js +225 -0
  76. package/dist/esm/core/beacon/aggregation/cohort/index.js.map +1 -0
  77. package/dist/{cjs/core/beacon/aggregation → esm/core/beacon/aggregation/cohort}/messages/base.js +3 -11
  78. package/dist/esm/core/beacon/aggregation/cohort/messages/base.js.map +1 -0
  79. package/dist/esm/core/beacon/aggregation/cohort/messages/constants.js +11 -0
  80. package/dist/esm/core/beacon/aggregation/cohort/messages/constants.js.map +1 -0
  81. package/dist/esm/core/beacon/aggregation/cohort/messages/index.js +98 -0
  82. package/dist/esm/core/beacon/aggregation/cohort/messages/index.js.map +1 -0
  83. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js +30 -0
  84. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js.map +1 -0
  85. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js +28 -0
  86. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js.map +1 -0
  87. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js +26 -0
  88. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js.map +1 -0
  89. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in.js +22 -0
  90. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in.js.map +1 -0
  91. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/subscribe.js +27 -0
  92. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/subscribe.js.map +1 -0
  93. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js +28 -0
  94. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js.map +1 -0
  95. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/authorization-request.js +29 -0
  96. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/authorization-request.js.map +1 -0
  97. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js +29 -0
  98. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js.map +1 -0
  99. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/request-signature.js +29 -0
  100. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/request-signature.js.map +1 -0
  101. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js +30 -0
  102. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js.map +1 -0
  103. package/dist/esm/core/beacon/aggregation/cohort/status.js.map +1 -0
  104. package/dist/esm/core/beacon/aggregation/communication/adapter/did-comm.js +126 -0
  105. package/dist/esm/core/beacon/aggregation/communication/adapter/did-comm.js.map +1 -0
  106. package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js +230 -0
  107. package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js.map +1 -0
  108. package/dist/esm/core/beacon/aggregation/communication/error.js +12 -0
  109. package/dist/esm/core/beacon/aggregation/communication/error.js.map +1 -0
  110. package/dist/esm/core/beacon/aggregation/communication/factory.js +21 -0
  111. package/dist/esm/core/beacon/aggregation/communication/factory.js.map +1 -0
  112. package/dist/esm/core/beacon/aggregation/communication/service.js.map +1 -0
  113. package/dist/esm/core/beacon/aggregation/coordinator.js +282 -56
  114. package/dist/esm/core/beacon/aggregation/coordinator.js.map +1 -1
  115. package/dist/esm/core/beacon/aggregation/participant.js +435 -1
  116. package/dist/esm/core/beacon/aggregation/participant.js.map +1 -1
  117. package/dist/esm/core/beacon/aggregation/session/index.js +233 -0
  118. package/dist/esm/core/beacon/aggregation/session/index.js.map +1 -0
  119. package/dist/esm/core/beacon/aggregation/session/status.js +11 -0
  120. package/dist/esm/core/beacon/aggregation/session/status.js.map +1 -0
  121. package/dist/esm/core/beacon/cid-aggregate.js.map +1 -1
  122. package/dist/esm/core/beacon/error.js +37 -0
  123. package/dist/esm/core/beacon/error.js.map +1 -0
  124. package/dist/esm/core/beacon/factory.js.map +1 -1
  125. package/dist/esm/core/beacon/singleton.js +8 -5
  126. package/dist/esm/core/beacon/singleton.js.map +1 -1
  127. package/dist/esm/core/beacon/smt-aggregate.js.map +1 -1
  128. package/dist/esm/{utils/beacons.js → core/beacon/utils.js} +4 -4
  129. package/dist/esm/core/beacon/utils.js.map +1 -0
  130. package/dist/esm/core/crud/read.js +2 -9
  131. package/dist/esm/core/crud/read.js.map +1 -1
  132. package/dist/esm/core/crud/update.js +18 -19
  133. package/dist/esm/core/crud/update.js.map +1 -1
  134. package/dist/{cjs/utils → esm/core}/identifier.js +18 -3
  135. package/dist/esm/core/identifier.js.map +1 -0
  136. package/dist/esm/did-btcr2.js +2 -2
  137. package/dist/esm/did-btcr2.js.map +1 -1
  138. package/dist/esm/index.js +28 -6
  139. package/dist/esm/index.js.map +1 -1
  140. package/dist/esm/interfaces/beacon.js.map +1 -1
  141. package/dist/esm/utils/appendix.js +2 -3
  142. package/dist/esm/utils/appendix.js.map +1 -1
  143. package/dist/esm/utils/did-document.js +4 -6
  144. package/dist/esm/utils/did-document.js.map +1 -1
  145. package/dist/esm/utils/types.js +2 -0
  146. package/dist/esm/utils/types.js.map +1 -0
  147. package/dist/types/core/beacon/aggregation/cohort/index.d.ts +135 -0
  148. package/dist/types/core/beacon/aggregation/cohort/index.d.ts.map +1 -0
  149. package/dist/types/core/beacon/aggregation/{messages → cohort/messages}/base.d.ts +13 -8
  150. package/dist/types/core/beacon/aggregation/cohort/messages/base.d.ts.map +1 -0
  151. package/dist/types/core/beacon/aggregation/cohort/messages/constants.d.ts +10 -0
  152. package/dist/types/core/beacon/aggregation/cohort/messages/constants.d.ts.map +1 -0
  153. package/dist/types/core/beacon/aggregation/cohort/messages/index.d.ts +64 -0
  154. package/dist/types/core/beacon/aggregation/cohort/messages/index.d.ts.map +1 -0
  155. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts +28 -0
  156. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts.map +1 -0
  157. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts +26 -0
  158. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts.map +1 -0
  159. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.d.ts +23 -0
  160. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.d.ts.map +1 -0
  161. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts +19 -0
  162. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts.map +1 -0
  163. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts +24 -0
  164. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts.map +1 -0
  165. package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts +24 -0
  166. package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts.map +1 -0
  167. package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts +25 -0
  168. package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts.map +1 -0
  169. package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts +25 -0
  170. package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts.map +1 -0
  171. package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts +25 -0
  172. package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts.map +1 -0
  173. package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts +26 -0
  174. package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts.map +1 -0
  175. package/dist/types/core/beacon/aggregation/cohort/status.d.ts.map +1 -0
  176. package/dist/types/core/beacon/aggregation/communication/adapter/did-comm.d.ts +88 -0
  177. package/dist/types/core/beacon/aggregation/communication/adapter/did-comm.d.ts.map +1 -0
  178. package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts +93 -0
  179. package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts.map +1 -0
  180. package/dist/types/core/beacon/aggregation/communication/error.d.ts +7 -0
  181. package/dist/types/core/beacon/aggregation/communication/error.d.ts.map +1 -0
  182. package/dist/types/core/beacon/aggregation/communication/factory.d.ts +9 -0
  183. package/dist/types/core/beacon/aggregation/communication/factory.d.ts.map +1 -0
  184. package/dist/types/core/beacon/aggregation/communication/service.d.ts +35 -0
  185. package/dist/types/core/beacon/aggregation/communication/service.d.ts.map +1 -0
  186. package/dist/types/core/beacon/aggregation/coordinator.d.ts +79 -26
  187. package/dist/types/core/beacon/aggregation/coordinator.d.ts.map +1 -1
  188. package/dist/types/core/beacon/aggregation/participant.d.ts +190 -0
  189. package/dist/types/core/beacon/aggregation/participant.d.ts.map +1 -1
  190. package/dist/types/core/beacon/aggregation/session/index.d.ts +155 -0
  191. package/dist/types/core/beacon/aggregation/session/index.d.ts.map +1 -0
  192. package/dist/types/core/beacon/aggregation/session/status.d.ts +10 -0
  193. package/dist/types/core/beacon/aggregation/session/status.d.ts.map +1 -0
  194. package/dist/types/core/beacon/cid-aggregate.d.ts +3 -4
  195. package/dist/types/core/beacon/cid-aggregate.d.ts.map +1 -1
  196. package/dist/types/core/beacon/error.d.ts +22 -0
  197. package/dist/types/core/beacon/error.d.ts.map +1 -0
  198. package/dist/types/core/beacon/factory.d.ts +2 -3
  199. package/dist/types/core/beacon/factory.d.ts.map +1 -1
  200. package/dist/types/core/beacon/singleton.d.ts +2 -3
  201. package/dist/types/core/beacon/singleton.d.ts.map +1 -1
  202. package/dist/types/core/beacon/smt-aggregate.d.ts +3 -4
  203. package/dist/types/core/beacon/smt-aggregate.d.ts.map +1 -1
  204. package/dist/types/{utils/beacons.d.ts → core/beacon/utils.d.ts} +3 -3
  205. package/dist/types/core/beacon/utils.d.ts.map +1 -0
  206. package/dist/types/core/crud/read.d.ts +3 -3
  207. package/dist/types/core/crud/read.d.ts.map +1 -1
  208. package/dist/types/core/crud/update.d.ts +1 -1
  209. package/dist/types/core/crud/update.d.ts.map +1 -1
  210. package/dist/types/{utils → core}/identifier.d.ts +24 -3
  211. package/dist/types/core/identifier.d.ts.map +1 -0
  212. package/dist/types/did-btcr2.d.ts +1 -1
  213. package/dist/types/did-btcr2.d.ts.map +1 -1
  214. package/dist/types/index.d.ts +28 -6
  215. package/dist/types/index.d.ts.map +1 -1
  216. package/dist/types/interfaces/beacon.d.ts +65 -5
  217. package/dist/types/interfaces/beacon.d.ts.map +1 -1
  218. package/dist/types/interfaces/crud.d.ts +1 -1
  219. package/dist/types/interfaces/crud.d.ts.map +1 -1
  220. package/dist/types/utils/appendix.d.ts +2 -10
  221. package/dist/types/utils/appendix.d.ts.map +1 -1
  222. package/dist/types/utils/did-document-builder.d.ts +1 -1
  223. package/dist/types/utils/did-document-builder.d.ts.map +1 -1
  224. package/dist/types/utils/did-document.d.ts +1 -1
  225. package/dist/types/utils/did-document.d.ts.map +1 -1
  226. package/dist/types/{types/crud.d.ts → utils/types.d.ts} +2 -2
  227. package/dist/types/utils/types.d.ts.map +1 -0
  228. package/package.json +4 -3
  229. package/src/core/beacon/aggregation/cohort/index.ts +292 -0
  230. package/src/core/beacon/aggregation/{messages → cohort/messages}/base.ts +14 -16
  231. package/src/core/beacon/aggregation/cohort/messages/constants.ts +12 -0
  232. package/src/core/beacon/aggregation/cohort/messages/index.ts +143 -0
  233. package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.ts +43 -0
  234. package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.ts +39 -0
  235. package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.ts +34 -0
  236. package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in.ts +33 -0
  237. package/src/core/beacon/aggregation/cohort/messages/keygen/subscribe.ts +35 -0
  238. package/src/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.ts +38 -0
  239. package/src/core/beacon/aggregation/cohort/messages/sign/authorization-request.ts +39 -0
  240. package/src/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.ts +39 -0
  241. package/src/core/beacon/aggregation/cohort/messages/sign/request-signature.ts +39 -0
  242. package/src/core/beacon/aggregation/cohort/messages/sign/signature-authorization.ts +40 -0
  243. package/src/core/beacon/aggregation/communication/adapter/did-comm.ts +153 -0
  244. package/src/core/beacon/aggregation/communication/adapter/nostr.ts +300 -0
  245. package/src/core/beacon/aggregation/communication/error.ts +13 -0
  246. package/src/core/beacon/aggregation/communication/factory.ts +25 -0
  247. package/src/core/beacon/aggregation/communication/service.ts +42 -0
  248. package/src/core/beacon/aggregation/coordinator.ts +338 -67
  249. package/src/core/beacon/aggregation/participant.ts +512 -0
  250. package/src/core/beacon/aggregation/session/index.ts +289 -0
  251. package/src/core/beacon/aggregation/session/status.ts +18 -0
  252. package/src/core/beacon/cid-aggregate.ts +4 -5
  253. package/src/core/beacon/error.ts +44 -0
  254. package/src/core/beacon/factory.ts +2 -3
  255. package/src/core/beacon/singleton.ts +10 -8
  256. package/src/core/beacon/smt-aggregate.ts +4 -5
  257. package/src/{utils/beacons.ts → core/beacon/utils.ts} +5 -5
  258. package/src/core/crud/read.ts +7 -16
  259. package/src/core/crud/update.ts +25 -22
  260. package/src/{utils → core}/identifier.ts +35 -5
  261. package/src/did-btcr2.ts +4 -4
  262. package/src/index.ts +36 -8
  263. package/src/interfaces/beacon.ts +75 -5
  264. package/src/interfaces/crud.ts +1 -1
  265. package/src/utils/appendix.ts +3 -11
  266. package/src/utils/did-document-builder.ts +1 -1
  267. package/src/utils/did-document.ts +4 -7
  268. package/src/{types/crud.ts → utils/types.ts} +2 -2
  269. package/dist/cjs/core/beacon/aggregation/messages/advert.js +0 -24
  270. package/dist/cjs/core/beacon/aggregation/messages/advert.js.map +0 -1
  271. package/dist/cjs/core/beacon/aggregation/messages/base.js.map +0 -1
  272. package/dist/cjs/core/beacon/aggregation/messages/cohort-set.js +0 -25
  273. package/dist/cjs/core/beacon/aggregation/messages/cohort-set.js.map +0 -1
  274. package/dist/cjs/core/beacon/aggregation/messages/keygen.js +0 -8
  275. package/dist/cjs/core/beacon/aggregation/messages/keygen.js.map +0 -1
  276. package/dist/cjs/core/beacon/aggregation/messages/opt-in.js +0 -23
  277. package/dist/cjs/core/beacon/aggregation/messages/opt-in.js.map +0 -1
  278. package/dist/cjs/core/beacon/aggregation/messages/sign.js +0 -7
  279. package/dist/cjs/core/beacon/aggregation/messages/sign.js.map +0 -1
  280. package/dist/cjs/core/beacon/aggregation/models/cohort/index.js +0 -92
  281. package/dist/cjs/core/beacon/aggregation/models/cohort/index.js.map +0 -1
  282. package/dist/cjs/core/beacon/aggregation/models/cohort/status.js.map +0 -1
  283. package/dist/cjs/core/beacon/aggregation/protocol/nostr.js +0 -57
  284. package/dist/cjs/core/beacon/aggregation/protocol/nostr.js.map +0 -1
  285. package/dist/cjs/core/beacon/aggregation/protocol/service.js.map +0 -1
  286. package/dist/cjs/core/key-manager/index.js +0 -290
  287. package/dist/cjs/core/key-manager/index.js.map +0 -1
  288. package/dist/cjs/core/key-manager/interface.js +0 -2
  289. package/dist/cjs/core/key-manager/interface.js.map +0 -1
  290. package/dist/cjs/interfaces/ibeacon.js +0 -2
  291. package/dist/cjs/interfaces/ibeacon.js.map +0 -1
  292. package/dist/cjs/types/crud.js +0 -2
  293. package/dist/cjs/types/crud.js.map +0 -1
  294. package/dist/cjs/utils/beacons.js.map +0 -1
  295. package/dist/cjs/utils/identifier.js.map +0 -1
  296. package/dist/esm/core/beacon/aggregation/messages/advert.js +0 -24
  297. package/dist/esm/core/beacon/aggregation/messages/advert.js.map +0 -1
  298. package/dist/esm/core/beacon/aggregation/messages/base.js.map +0 -1
  299. package/dist/esm/core/beacon/aggregation/messages/cohort-set.js +0 -25
  300. package/dist/esm/core/beacon/aggregation/messages/cohort-set.js.map +0 -1
  301. package/dist/esm/core/beacon/aggregation/messages/keygen.js +0 -8
  302. package/dist/esm/core/beacon/aggregation/messages/keygen.js.map +0 -1
  303. package/dist/esm/core/beacon/aggregation/messages/opt-in.js +0 -23
  304. package/dist/esm/core/beacon/aggregation/messages/opt-in.js.map +0 -1
  305. package/dist/esm/core/beacon/aggregation/messages/sign.js +0 -7
  306. package/dist/esm/core/beacon/aggregation/messages/sign.js.map +0 -1
  307. package/dist/esm/core/beacon/aggregation/models/cohort/index.js +0 -92
  308. package/dist/esm/core/beacon/aggregation/models/cohort/index.js.map +0 -1
  309. package/dist/esm/core/beacon/aggregation/models/cohort/status.js.map +0 -1
  310. package/dist/esm/core/beacon/aggregation/protocol/nostr.js +0 -57
  311. package/dist/esm/core/beacon/aggregation/protocol/nostr.js.map +0 -1
  312. package/dist/esm/core/beacon/aggregation/protocol/service.js.map +0 -1
  313. package/dist/esm/core/key-manager/index.js +0 -290
  314. package/dist/esm/core/key-manager/index.js.map +0 -1
  315. package/dist/esm/core/key-manager/interface.js +0 -2
  316. package/dist/esm/core/key-manager/interface.js.map +0 -1
  317. package/dist/esm/interfaces/ibeacon.js +0 -2
  318. package/dist/esm/interfaces/ibeacon.js.map +0 -1
  319. package/dist/esm/types/crud.js +0 -2
  320. package/dist/esm/types/crud.js.map +0 -1
  321. package/dist/esm/utils/beacons.js.map +0 -1
  322. package/dist/esm/utils/identifier.js.map +0 -1
  323. package/dist/types/core/beacon/aggregation/messages/advert.d.ts +0 -22
  324. package/dist/types/core/beacon/aggregation/messages/advert.d.ts.map +0 -1
  325. package/dist/types/core/beacon/aggregation/messages/base.d.ts.map +0 -1
  326. package/dist/types/core/beacon/aggregation/messages/cohort-set.d.ts +0 -23
  327. package/dist/types/core/beacon/aggregation/messages/cohort-set.d.ts.map +0 -1
  328. package/dist/types/core/beacon/aggregation/messages/keygen.d.ts +0 -6
  329. package/dist/types/core/beacon/aggregation/messages/keygen.d.ts.map +0 -1
  330. package/dist/types/core/beacon/aggregation/messages/opt-in.d.ts +0 -22
  331. package/dist/types/core/beacon/aggregation/messages/opt-in.d.ts.map +0 -1
  332. package/dist/types/core/beacon/aggregation/messages/sign.d.ts +0 -5
  333. package/dist/types/core/beacon/aggregation/messages/sign.d.ts.map +0 -1
  334. package/dist/types/core/beacon/aggregation/models/cohort/index.d.ts +0 -77
  335. package/dist/types/core/beacon/aggregation/models/cohort/index.d.ts.map +0 -1
  336. package/dist/types/core/beacon/aggregation/models/cohort/status.d.ts.map +0 -1
  337. package/dist/types/core/beacon/aggregation/protocol/nostr.d.ts +0 -36
  338. package/dist/types/core/beacon/aggregation/protocol/nostr.d.ts.map +0 -1
  339. package/dist/types/core/beacon/aggregation/protocol/service.d.ts +0 -6
  340. package/dist/types/core/beacon/aggregation/protocol/service.d.ts.map +0 -1
  341. package/dist/types/core/key-manager/index.d.ts +0 -145
  342. package/dist/types/core/key-manager/index.d.ts.map +0 -1
  343. package/dist/types/core/key-manager/interface.d.ts +0 -113
  344. package/dist/types/core/key-manager/interface.d.ts.map +0 -1
  345. package/dist/types/interfaces/ibeacon.d.ts +0 -65
  346. package/dist/types/interfaces/ibeacon.d.ts.map +0 -1
  347. package/dist/types/types/crud.d.ts.map +0 -1
  348. package/dist/types/utils/beacons.d.ts.map +0 -1
  349. package/dist/types/utils/identifier.d.ts.map +0 -1
  350. package/src/core/beacon/aggregation/messages/advert.ts +0 -36
  351. package/src/core/beacon/aggregation/messages/cohort-set.ts +0 -37
  352. package/src/core/beacon/aggregation/messages/keygen.ts +0 -8
  353. package/src/core/beacon/aggregation/messages/opt-in.ts +0 -35
  354. package/src/core/beacon/aggregation/messages/sign.ts +0 -7
  355. package/src/core/beacon/aggregation/models/cohort/index.ts +0 -112
  356. package/src/core/beacon/aggregation/protocol/nostr.ts +0 -81
  357. package/src/core/beacon/aggregation/protocol/service.ts +0 -6
  358. package/src/core/key-manager/index.ts +0 -364
  359. package/src/core/key-manager/interface.ts +0 -129
  360. package/src/interfaces/ibeacon.ts +0 -75
  361. /package/dist/cjs/core/beacon/aggregation/{models/cohort → cohort}/status.js +0 -0
  362. /package/dist/cjs/core/beacon/aggregation/{protocol → communication}/service.js +0 -0
  363. /package/dist/esm/core/beacon/aggregation/{models/cohort → cohort}/status.js +0 -0
  364. /package/dist/esm/core/beacon/aggregation/{protocol → communication}/service.js +0 -0
  365. /package/dist/types/core/beacon/aggregation/{models/cohort → cohort}/status.d.ts +0 -0
  366. /package/src/core/beacon/aggregation/{models/cohort → cohort}/status.ts +0 -0
@@ -1,290 +0,0 @@
1
- import { KeyManagerError, Logger, MULTIBASE_URI_PREFIX } from '@did-btcr2/common';
2
- import { SchnorrMultikey } from '@did-btcr2/cryptosuite';
3
- import { CompressedSecp256k1PublicKey, SchnorrKeyPair } from '@did-btcr2/keypair';
4
- import { sha256 } from '@noble/hashes/sha2';
5
- import { MemoryStore } from '@web5/common';
6
- import { Did } from '@web5/dids';
7
- ;
8
- /**
9
- * Class for managing cryptographic keys for the B DID method.
10
- * @class KeyManager
11
- * @type {KeyManager}
12
- */
13
- export class KeyManager {
14
- /**
15
- * Singleton instance of the KeyManager.
16
- * @private
17
- * @type {KeyManager}
18
- */
19
- static #instance;
20
- /**
21
- * The `activeKeyUri` property is a string that represents the URI of the currently active key.
22
- * It is used to identify the key that will be used for signing and verifying operations.
23
- * This property is optional and can be set to a specific key URI when initializing the
24
- * `KeyManager` instance. If not set, the key manager will use the default key URI.
25
- * @type {KeyIdentifier}
26
- */
27
- activeKeyUri;
28
- /**
29
- * The `_store` private variable in `KeyManager` is a `KeyValueStore` instance used for
30
- * storing and managing cryptographic keys. It allows the `KeyManager` class to save,
31
- * retrieve, and handle keys efficiently within the local Key Management System (KMS) context.
32
- * This variable can be configured to use different storage backends, like in-memory storage or
33
- * persistent storage, providing flexibility in key management according to the application's
34
- * requirements.
35
- * @private
36
- * @readonly
37
- * @type {KeyValueStore<KeyIdentifier, SchnorrKeyPair>} The key store for managing cryptographic keys.
38
- */
39
- _store;
40
- /**
41
- * Creates an instance of KeyManager.
42
- * @param {?KeyManagerParams} params The parameters to initialize the key manager.
43
- * @param {KeyValueStore<KeyIdentifier, SchnorrMultikey>} params.store An optional property to specify a custom
44
- * `KeyValueStore` instance for key management. If not provided, {@link KeyManager} uses a default `MemoryStore`
45
- * instance. This store is responsible for managing cryptographic keys, allowing them to be retrieved, stored, and
46
- * managed during cryptographic operations.
47
- * @param {KeyIdentifier} params.keyUri An optional property to specify the active key URI for the key manager.
48
- */
49
- constructor({ store, keyUri, keys } = {}) {
50
- // Set the default key store to a MemoryStore instance
51
- this._store = store ?? new MemoryStore();
52
- // Import the keys into the key store
53
- if (keyUri && keys) {
54
- void this.importKey(keys, keyUri).then(() => {
55
- this.activeKeyUri = keyUri;
56
- });
57
- }
58
- }
59
- /**
60
- * Gets the singleton instance of the KeyManager.
61
- * @returns {KeyManager} The singleton instance of the KeyManager.
62
- */
63
- static get instance() {
64
- // Check if the KeyManager instance is initialized
65
- if (!KeyManager.#instance) {
66
- throw new KeyManagerError('KeyManager not initialized. Call initialize() first.', 'KEY_MANAGER_NOT_INITIALIZED');
67
- }
68
- // Return the singleton instance
69
- const instance = KeyManager.#instance;
70
- return instance;
71
- }
72
- /**
73
- * Signs a transaction using the key associated with the key URI.
74
- * @param {Hex} txHex The transaction hex to sign.
75
- * @param {KeyIdentifier} keyUri The URI of the key to sign the transaction with.
76
- * @returns {Promise<Hex>} A promise resolving to the signed transaction hex.
77
- */
78
- signTransaction(txHex, keyUri) {
79
- throw new Error('Method not implemented.' + txHex + keyUri);
80
- }
81
- /**
82
- * Gets the key pair from the key store and returns a CompressedSecp256k1PublicKey.
83
- * @param {KeyIdentifier} keyUri The URI of the key to get the public key for.
84
- * @returns {Promise<CompressedSecp256k1PublicKey>} The public key associated with the key URI.
85
- */
86
- async getPublicKey(keyUri) {
87
- // Use the active key URI if not provided
88
- const key = await this.getKey(keyUri);
89
- // Check if the key exists and has a public key
90
- if (!key?.publicKey) {
91
- throw new KeyManagerError(`Key not found for URI: ${keyUri}`, 'KEY_NOT_FOUND');
92
- }
93
- // Return the public key
94
- return key.publicKey;
95
- }
96
- /**
97
- * Signs the given data using the key associated with the key URI.
98
- * @param {Hex} data The data to sign.
99
- * @param {?KeyIdentifier} keyUri The URI of the key to sign the data with.
100
- * @returns {Promise<SignatureBytes>} A promise resolving to the signature of the data.
101
- */
102
- async sign(data, keyUri) {
103
- // Get the key from the store
104
- const key = await this.getKey(keyUri);
105
- // Check if the key exists
106
- if (!key) {
107
- throw new KeyManagerError(`Key URI ${keyUri} not found`, 'KEY_NOT_FOUND');
108
- }
109
- // Check if the key can sign
110
- if (!key.signer) {
111
- throw new KeyManagerError(`Key URI ${keyUri} is not a signer`, 'KEY_NOT_SIGNER');
112
- }
113
- // Sign the data using the key and return the signature
114
- return key.sign(data);
115
- }
116
- /**
117
- * Verifies a signature using the key associated with the key URI.
118
- * @param {KeyIdentifier} keyUri The URI of the key to verify the signature with.
119
- * @param {SignatureBytes} signature The signature to verify.
120
- * @param {Hex} data The data to verify the signature with.
121
- * @returns {Promise<boolean>} A promise resolving to a boolean indicating the verification result.
122
- */
123
- async verify(signature, data, keyUri) {
124
- // Get the key from the store
125
- const key = await this.getKey(keyUri);
126
- // Check if the key exists
127
- if (!key) {
128
- throw new KeyManagerError(`Key not found for URI: ${keyUri}`, 'KEY_NOT_FOUND');
129
- }
130
- // Verify the signature using the multikey
131
- return key.verify(signature, data);
132
- }
133
- /**
134
- * Gets the key pair from the key store.
135
- * @param {KeyIdentifier} keyUri The URI of the key to get.
136
- * @returns {Promise<SchnorrKeyPair>} The key pair associated with the key URI.
137
- * @throws {KeyManagerError} If the key is not found in the key store.
138
- */
139
- async getKey(keyUri) {
140
- // Use the active key URI if not provided
141
- const uri = keyUri ?? this.activeKeyUri;
142
- // Throw an error if no key URI is provided or active
143
- if (!uri) {
144
- throw new KeyManagerError('No active key uri set.', 'ACTIVE_KEY_URI_NOT_SET');
145
- }
146
- // Get the key pair from the key store
147
- return await this._store.get(uri);
148
- }
149
- /**
150
- * Exports the full multikeypair from the key store.
151
- * @returns {Promise<SchnorrKeyPair>} The key pair associated with the key URI.
152
- * @throws {KeyManagerError} If the key is not found in the key store.
153
- */
154
- async exportKey(keyUri) {
155
- // Get the key from the key store and return it
156
- return await this.getKey(keyUri);
157
- }
158
- /**
159
- * Imports a keypair to the store.
160
- * @param {SchnorrKeyPair} keys The keypair to import.
161
- * @param {KeyIdentifier} keyUri The URI of the key to import.
162
- * @param {KeyManagerOptions} options Relevant import options.
163
- * @param {boolean} options.active A flag to set the key as active (optional, default: false).
164
- * @returns {Promise<KeyIdentifier>} A promise that resolves to the key identifier of the imported key.
165
- */
166
- async importKey(keys, keyUri, options = {}) {
167
- const parts = Did.parse(keyUri);
168
- if (!parts) {
169
- throw new KeyManagerError('Invalid key URI: must be valid, parsable BTCR2 identifier', 'INVALID_KEY_URI', { keyUri, parts });
170
- }
171
- if (!parts.id) {
172
- throw new KeyManagerError('Invalid key URI: missing id part', 'INVALID_KEY_URI', { keyUri, parts });
173
- }
174
- if (!parts.fragment) {
175
- throw new KeyManagerError('Invalid key URI: missing fragment part', 'INVALID_KEY_URI', { keyUri, parts });
176
- }
177
- // Instantiate a new SchnorrMultikey with the provided keys
178
- const multikey = new SchnorrMultikey({ controller: parts.uri, id: `#${parts.fragment}`, keys });
179
- // Store the keypair in the key store
180
- await this._store.set(keyUri, multikey);
181
- // Set the key as active if required
182
- if (options.active) {
183
- this.activeKeyUri = keyUri;
184
- }
185
- // Return the key URI
186
- return keyUri;
187
- }
188
- /**
189
- * Computes the hash of the given data.
190
- * @param {Uint8Array} data The data to hash.
191
- * @returns {HashBytes} The hash of the data.
192
- */
193
- digest(data) {
194
- return sha256(data);
195
- }
196
- /**
197
- * Computes the key URI of a given keypair.
198
- * @param {string} id The fragment identifier (e.g. 'key-1').
199
- * @param {string} [controller] The DID controller (e.g. 'did:btcr2:xyz').
200
- * @returns {KeyIdentifier} A full DID fragment URI (e.g. 'did:btcr2:xyz#key-1')
201
- */
202
- static computeKeyUri(id, controller) {
203
- // Concat the id to the controller and return
204
- return `${controller}${id.startsWith('#') ? id : `#${id}`}`;
205
- }
206
- /**
207
- * Computes a multibase-compliant URI from a key.
208
- * @param key A SchnorrKeyPair, CompressedSecp256k1PublicKey, or multibase string
209
- * @returns {string} A multibase URI (e.g. 'urn:mb:zQ3s...')
210
- */
211
- static toMultibaseUri(data) {
212
- const multibase = data instanceof SchnorrKeyPair
213
- ? data.publicKey.multibase
214
- : data instanceof CompressedSecp256k1PublicKey
215
- ? data.multibase
216
- : data;
217
- return `${MULTIBASE_URI_PREFIX}${multibase}`;
218
- }
219
- /**
220
- * Initializes a singleton KeyManager instance.
221
- * @param {SchnorrKeyPair} keys The keypair used to initialize the key manager.
222
- * @returns {void}
223
- */
224
- static async initialize(keys, keyUri) {
225
- if (!(keys instanceof SchnorrKeyPair)) {
226
- keys = SchnorrKeyPair.fromJSON(keys);
227
- }
228
- // Check if the KeyManager instance is already initialized
229
- if (KeyManager.#instance) {
230
- Logger.warn('KeyManager global instance is already initialized.');
231
- return KeyManager.#instance;
232
- }
233
- // Check if the keypair is provided
234
- if (!keys) {
235
- // Log a warning message if not provided
236
- Logger.warn('keys not provided, generating ...');
237
- }
238
- // Generate a new keypair if not provided
239
- keys ??= SchnorrKeyPair.generate();
240
- // Initialize the singleton key manager with the keypair
241
- KeyManager.#instance = new KeyManager({ keys });
242
- // Import the keypair into the key store
243
- await KeyManager.#instance.importKey(keys, keyUri, { active: true });
244
- // Set the active key URI
245
- KeyManager.#instance.activeKeyUri = keyUri;
246
- // Log the active key URI
247
- Logger.info(`KeyManager initialized with Active Key URI: ${KeyManager.#instance.activeKeyUri}`);
248
- // Return the singleton instance
249
- return KeyManager.#instance;
250
- }
251
- /**
252
- * Retrieves a keypair from the key store using the provided key URI.
253
- * @public
254
- * @param {KeyIdentifier} keyUri The URI of the keypair to retrieve.
255
- * @returns {Promise<SchnorrKeyPair | undefined>} The retrieved keypair, or undefined if not found.
256
- */
257
- static async getKeyPair(keyUri) {
258
- // Use the active key URI if not provided
259
- keyUri ??= KeyManager.#instance?.activeKeyUri;
260
- // Instantiate a new KeyManager with the default key store
261
- return await KeyManager.#instance?.getKey(keyUri);
262
- }
263
- async getKeySigner(keyUri, network) {
264
- const multikey = await this.getKey(keyUri);
265
- if (!multikey) {
266
- throw new KeyManagerError(`Key not found for URI: ${keyUri}`, 'KEY_NOT_FOUND');
267
- }
268
- return new Signer({ multikey, network });
269
- }
270
- }
271
- export class Signer {
272
- multikey;
273
- network;
274
- constructor(params) {
275
- this.multikey = params.multikey;
276
- this.network = params.network;
277
- }
278
- get publicKey() {
279
- // Return the public key from the multikey
280
- return this.multikey.publicKey.compressed;
281
- }
282
- sign(hash) {
283
- return this.multikey.sign(hash, { scheme: 'ecdsa' });
284
- }
285
- ;
286
- signSchnorr(hash) {
287
- return this.multikey.sign(hash);
288
- }
289
- }
290
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/key-manager/index.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,eAAe,EACf,MAAM,EACN,oBAAoB,EAGrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,4BAA4B,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAiB,WAAW,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAOhC,CAAC;AAEF;;;;GAIG;AACH,MAAM,OAAO,UAAU;IACrB;;;;OAIG;IACH,MAAM,CAAC,SAAS,CAAc;IAE9B;;;;;;OAMG;IACI,YAAY,CAAiB;IAEpC;;;;;;;;;;OAUG;IACc,MAAM,CAAgD;IAEvE;;;;;;;;OAQG;IACH,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,KAAuB,EAAE;QACxD,sDAAsD;QACtD,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,IAAI,WAAW,EAAkC,CAAC;QAEzE,qCAAqC;QACrC,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;YACnB,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;gBAC1C,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC;YAC7B,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAA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"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ibeacon.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ibeacon.js","sourceRoot":"","sources":["../../../src/interfaces/ibeacon.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=crud.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"crud.js","sourceRoot":"","sources":["../../../src/types/crud.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"beacons.js","sourceRoot":"","sources":["../../../src/utils/beacons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAmB,MAAM,mBAAmB,CAAC;AAEjF,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA6BzC;;;;GAIG;AACH,MAAM,OAAO,WAAW;IACtB;;;;;OAKG;IACI,MAAM,CAAC,mBAAmB,CAAC,GAAW;QAC3C,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,cAAc,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;QACnF,CAAC;QACD,OAAO,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,mDAAmD;IACvG,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,eAAe,CAAC,GAAyB;QACrD,2DAA2D;QAC3D,IAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC;YAAE,OAAO,KAAK,CAAC;QAE7C,+DAA+D;QAC/D,IAAG,CAAC,CAAC,iBAAiB,EAAE,oBAAoB,EAAE,oBA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AAC;IACxE,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,QAAQ;QACpB,MAAM,IAAI,GAAG,cAAc,CAAC,QAAQ,EAAE,CAAC;QACvC,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;YACtB,MAAM,EAAS,eAAe,CAAC,GAAG;YAClC,OAAO,EAAQ,CAAC;YAChB,OAAO,EAAQ,mBAAmB,CAAC,OAAO;YAC1C,YAAY,EAAG,IAAI,CAAC,SAAS,CAAC,UAAU;SACzC,CAAC,CAAC;QAEH,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,EAAE,EAAE,aAAa,EAAC,EAAE,CAAC;IACrE,CAAC;CACF"}
@@ -1,24 +0,0 @@
1
- import { BaseMessage } from './base.js';
2
- export class AdvertMessage extends BaseMessage {
3
- cohortId;
4
- cohortSize;
5
- network = 'signet';
6
- constructor({ type = 'BEACON_ADVERT', to, from, threadId, cohortId, cohortSize, network }) {
7
- super({ type, to, from, threadId, body: { cohortId, cohortSize, network } });
8
- this.cohortId = cohortId;
9
- this.cohortSize = cohortSize;
10
- this.network = network;
11
- }
12
- /**
13
- * Initializes an AdvertMessage from a given Advert object.
14
- * @param {Advert} data - The Advert object to initialize the AdvertMessage.
15
- * @returns {object} The serialized AdvertMessage.
16
- */
17
- static initialize(data) {
18
- if (data.type != 'BEACON_ADVERT') {
19
- throw new Error(`Invalid type: ${data.type}`);
20
- }
21
- return new AdvertMessage(data);
22
- }
23
- }
24
- //# sourceMappingURL=advert.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"advert.js","sourceRoot":"","sources":["../../../../../../src/core/beacon/aggregation/messages/advert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAYxC,MAAM,OAAO,aAAc,SAAQ,WAAW;IACrC,QAAQ,CAAS;IACjB,UAAU,CAAS;IACnB,OAAO,GAAW,QAAQ,CAAC;IAElC,YAAY,EA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;IACI,MAAM,CAAC,QAAQ,CAAC,IAAiB;QACtC,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACI,IAAI;QACT,OAAO;YACL,IAAI,EAAO,IAAI,CAAC,IAAI;YACpB,EAAE,EAAS,IAAI,CAAC,EAAE;YAClB,IAAI,EAAO,IAAI,CAAC,IAAI;YACpB,QAAQ,EAAG,IAAI,CAAC,QAAQ;YACxB,IAAI,EAAO,IAAI,CAAC,IAAI,IAAI,EAAE;SAC3B,CAAC;IACJ,CAAC;CACF"}
@@ -1,25 +0,0 @@
1
- import { BaseMessage } from './base.js';
2
- import { COHORT_SET } from './keygen.js';
3
- export class CohortSetMessage extends BaseMessage {
4
- cohortId;
5
- beaconAddress;
6
- cohortKeys;
7
- constructor({ type = COHORT_SET, to, from, threadId, cohortId, beaconAddress, cohortKeys }) {
8
- super({ type, to, from, threadId, body: { cohortId, beaconAddress, cohortKeys } });
9
- this.cohortId = cohortId;
10
- this.beaconAddress = beaconAddress;
11
- this.cohortKeys = cohortKeys;
12
- }
13
- /**
14
- * Initializes an CohortSetMessage from a given OptIn object.
15
- * @param {OptIn} data - The OptIn object to initialize the CohortSetMessage.
16
- * @returns {object} The serialized CohortSetMessage.
17
- */
18
- static fromJSON(data) {
19
- if (data.type !== COHORT_SET) {
20
- throw new Error(`Invalid type: ${data.type}`);
21
- }
22
- return new CohortSetMessage(data);
23
- }
24
- }
25
- //# sourceMappingURL=cohort-set.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cohort-set.js","sourceRoot":"","sources":["../../../../../../src/core/beacon/aggregation/messages/cohort-set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAYzC,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IACxC,QAAQ,CAAS;IACjB,aAAa,CAAS;IACtB,UAAU,CAAoB;IAErC,YAAY,EAAE,IAAI,GAAG,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAa;QACnG,KAAK,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,EAAC,CAAC,CAAC;QAClF,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,QAAQ,CAAC,IAAe;QACpC,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;CACF"}
@@ -1,8 +0,0 @@
1
- import { MESSAGE_PREFIX } from './base.js';
2
- export const COHORT_ADVERT = `${MESSAGE_PREFIX}musig2/keygen/cohort_advert`;
3
- export const COHORT_INVITE = `${MESSAGE_PREFIX}musig2/keygen/cohort_invite`;
4
- export const OPT_IN = `${MESSAGE_PREFIX}musig2/keygen/opt_in`;
5
- export const COHORT_SET = `${MESSAGE_PREFIX}musig2/keygen/cohort_set`;
6
- export const SUBSCRIBE = `${MESSAGE_PREFIX}musig2/keygen/subscribe`;
7
- export const SUBSCRIBE_ACCEPT = `${MESSAGE_PREFIX}musig2/keygen/subscribe_accept`;
8
- //# sourceMappingURL=keygen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"keygen.js","sourceRoot":"","sources":["../../../../../../src/core/beacon/aggregation/messages/keygen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,cAAc,6BAA6B,CAAC;AAC5E,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,cAAc,6BAA6B,CAAC;AAC5E,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,cAAc,sBAAsB,CAAC;AAC9D,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,cAAc,0BAA0B,CAAC;AACtE,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,cAAc,yBAAyB,CAAC;AACpE,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,cAAc,gCAAgC,CAAC"}
@@ -1,23 +0,0 @@
1
- import { BaseMessage } from './base.js';
2
- import { OPT_IN } from './keygen.js';
3
- export class OptInMessage extends BaseMessage {
4
- cohortId;
5
- participantPk;
6
- constructor({ type = OPT_IN, to, from, threadId, cohortId, participantPk }) {
7
- super({ type, to, from, threadId, body: { cohortId, participantPk } });
8
- this.cohortId = cohortId;
9
- this.participantPk = participantPk;
10
- }
11
- /**
12
- * Initializes an OptInMessage from a given OptIn object.
13
- * @param {OptIn} data - The OptIn object to initialize the OptInMessage.
14
- * @returns {object} The serialized OptInMessage.
15
- */
16
- static fromJSON(data) {
17
- if (data.type != 'OPT_IN') {
18
- throw new Error(`Invalid type: ${data.type}`);
19
- }
20
- return new OptInMessage(data);
21
- }
22
- }
23
- //# sourceMappingURL=opt-in.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"opt-in.js","sourceRoot":"","sources":["../../../../../../src/core/beacon/aggregation/messages/opt-in.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAWrC,MAAM,OAAO,YAAa,SAAQ,WAAW;IACpC,QAAQ,CAAS;IACjB,aAAa,CAAa;IAEjC,YAAY,EAAE,IAAI,GAAG,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAS;QAC/E,KAAK,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAC,CAAC,CAAC;QACtE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,QAAQ,CAAC,IAAkB;QACvC,IAAI,IAAI,CAAC,IAAI,IAAI,QAAQ,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACF"}
@@ -1,7 +0,0 @@
1
- import { MESSAGE_PREFIX } from './base.js';
2
- export const REQUEST_SIGNATURE = `${MESSAGE_PREFIX}musig2/sign/request_signature`;
3
- export const AUTHORIZATION_REQUEST = `${MESSAGE_PREFIX}musig2/sign/authorization_request`;
4
- export const NONCE_CONTRIBUTION = `${MESSAGE_PREFIX}musig2/sign/nonce_contribution`;
5
- export const AGGREGATED_NONCE = `${MESSAGE_PREFIX}musig2/sign/aggregated_nonce`;
6
- export const SIGNATURE_AUTHORIZATION = `${MESSAGE_PREFIX}musig2/sign/signature_authorization`;
7
- //# sourceMappingURL=sign.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sign.js","sourceRoot":"","sources":["../../../../../../src/core/beacon/aggregation/messages/sign.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,cAAc,+BAA+B,CAAC;AAClF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,cAAc,mCAAmC,CAAC;AAC1F,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,cAAc,gCAAgC,CAAC;AACpF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,cAAc,8BAA8B,CAAC;AAChF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,cAAc,qCAAqC,CAAC"}
@@ -1,92 +0,0 @@
1
- import { TapRootMultiSig } from '@did-btcr2/bitcoin';
2
- import { COHORT_STATUS } from './status.js';
3
- export class Musig2Cohort {
4
- /**
5
- * Unique identifier for the cohort.
6
- * @type {string}
7
- */
8
- id;
9
- /**
10
- * DID of the coordinator.
11
- * @type {string}
12
- */
13
- coordinatorDid;
14
- /**
15
- * Minimum number of participants required to finalize the cohort.
16
- * @type {number}
17
- */
18
- minParticipants;
19
- /**
20
- * Status of the cohort.
21
- * @type {string}
22
- */
23
- status;
24
- /**
25
- * Network on which the cohort operates (e.g., 'mainnet', 'testnet').
26
- * @type {string}
27
- */
28
- network;
29
- /**
30
- * Pending signature requests, mapping participant DIDs to their pending signatures.
31
- * @type {Record<string, string>}
32
- */
33
- pendingSignatureRequests = {};
34
- /**
35
- * List of participant DIDs.
36
- * @type {Array<string>}
37
- */
38
- participants = new Array();
39
- /**
40
- * List of cohort keys (public keys).
41
- * @type {Array<Uint8Array>}
42
- */
43
- cohortKeys = new Array();
44
- /**
45
- * Taproot Merkle root for the cohort.
46
- * @type {Uint8Array}
47
- */
48
- trMerkleRoot;
49
- /**
50
- * Beacon address for the cohort, calculated from the Taproot multisig.
51
- * @type {string}
52
- */
53
- beaconAddress;
54
- /**
55
- * Creates a new Musig2Cohort instance.
56
- * @param {Musig2CohortParams} params Parameters for initializing the cohort.
57
- * @param {string} [params.id] Optional unique identifier for the cohort. If not provided, a random UUID will be generated.
58
- * @param {number} params.minParticipants Minimum number of participants required to finalize the cohort.
59
- * @param {string} params.coordinatorDid DID of the coordinator managing the cohort.
60
- * @param {string} params.status Initial status of the cohort (e.g., 'PENDING', 'COHORT_SET').
61
- * @param {string} params.network Network on which the cohort operates (e.g., 'mainnet', 'testnet').
62
- */
63
- constructor(params) {
64
- this.id = params.id || crypto.randomUUID();
65
- this.minParticipants = params.minParticipants;
66
- this.coordinatorDid = params.coordinatorDid;
67
- this.status = params.status || COHORT_STATUS.COHORT_ADVERTISED;
68
- this.network = params.network;
69
- }
70
- finalize() {
71
- if (this.participants.length < this.minParticipants) {
72
- throw new Error('Not enough participants to finalize the cohort');
73
- }
74
- this.status = COHORT_STATUS.COHORT_SET_STATUS;
75
- this.beaconAddress = this.calulateBeaconAddress();
76
- }
77
- /**
78
- * Calculates the beacon Taproot multisig address for the cohort using participant keys.
79
- * @returns {string} The Taproot address for the cohort.
80
- * @throws {Error} If the Taproot address cannot be calculated.
81
- */
82
- calulateBeaconAddress() {
83
- const trMultisig = new TapRootMultiSig(this.cohortKeys, this.cohortKeys.length);
84
- const branch = trMultisig.musigTree();
85
- this.trMerkleRoot = branch.hash;
86
- if (!branch.address) {
87
- throw new Error('Failed to calculate Taproot address');
88
- }
89
- return branch.address;
90
- }
91
- }
92
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/core/beacon/aggregation/models/cohort/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAsB,MAAM,aAAa,CAAC;AAUhE,MAAM,OAAO,YAAY;IACvB;;;OAGG;IACI,EAAE,CAAS;IAElB;;;OAGG;IACI,cAAc,CAAS;IAE9B;;;OAGG;IACI,eAAe,CAAS;IAE/B;;;OAGG;IACI,MAAM,CAAqB;IAElC;;;OAGG;IACI,OAAO,CAAS;IAEvB;;;OAGG;IACI,wBAAwB,GAA2B,EAAE,CAAC;IAE7D;;;OAGG;IACI,YAAY,GAAkB,IAAI,KAAK,EAAU,CAAC;IAEzD;;;OAGG;IACI,UAAU,GAAsB,IAAI,KAAK,EAAc,CAAC;IAE/D;;;OAGG;IACI,YAAY,CAAc;IAEjC;;;OAGG;IACI,aAAa,CAAU;IAE9B;;;;;;;;OAQG;IACH,YAAY,MAA0B;QACpC,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QAC3C,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;QAC9C,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QAC5C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAA4B,IAAI,aAAa,CAAC,iBAAiB,CAAC;QACrF,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAChC,CAAC;IAEM,QAAQ;QACb,IAAG,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;YACnD,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;QACpE,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,iBAAiB,CAAC;QAC9C,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACpD,CAAC;IAED;;;;OAIG;IACI,qBAAqB;QAC1B,MAAM,UAAU,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAChF,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC;QACtC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC;QAChC,IAAG,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"status.js","sourceRoot":"","sources":["../../../../../../../src/core/beacon/aggregation/models/cohort/status.ts"],"names":[],"mappings":"AACA,MAAM,CAAN,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,iDAAgC,CAAA;IAChC,6CAA4B,CAAA;IAC5B,iDAAgC,CAAA;IAChC,yCAAwB,CAAA;AAC1B,CAAC,EALW,aAAa,KAAb,aAAa,QAKxB"}
@@ -1,57 +0,0 @@
1
- import { SchnorrKeyPair, Secp256k1SecretKey } from '@did-btcr2/keypair';
2
- import { SimplePool, } from 'nostr-tools/pool';
3
- import { Identifier } from '../../../../utils/identifier.js';
4
- export class NostrAdapter {
5
- name = 'nostr';
6
- config;
7
- handlers = new Map();
8
- constructor(config = { keys: {}, components: {}, relays: ['wss://relay.damus.io'] }) {
9
- this.config = config;
10
- this.config.keys = this.config.keys || SchnorrKeyPair.generate().raw;
11
- this.config.did = config.did || Identifier.encode({
12
- idType: config.components.idType || 'KEY',
13
- version: config.components.version || 1,
14
- network: config.components.network || 'signet',
15
- genesisBytes: this.config.keys.public
16
- });
17
- }
18
- async start() {
19
- const pool = new SimplePool();
20
- pool.subscribe(this.config.relays, { pubkey: this.config.did, kinds: [1059] }, {
21
- onclose: (reasons) => console.log('Subscription closed for reasons:', reasons),
22
- onevent: async (event) => {
23
- console.log('Received event:', event);
24
- }
25
- });
26
- }
27
- registerMessageHandler(messageType, handler) {
28
- this.handlers.set(messageType, handler);
29
- }
30
- /**
31
- * Sends a message to a recipient using the Nostr protocol.
32
- * This method is a placeholder and should be implemented with actual Nostr message sending logic.
33
- * @param message
34
- * @param recipient
35
- * @param sender
36
- */
37
- async sendMessage(message, recipient, sender) {
38
- // TODO: Implement message sending logic via Nostr
39
- console.log(`Sending message to ${recipient} from ${sender}:`, message);
40
- }
41
- /**
42
- * Generates a Nostr identity using the Secp256k1SecretKey and Identifier classes.
43
- * @returns {string} A BTCR2 DID used for communication over the nostr protocol
44
- */
45
- generateIdentity() {
46
- this.config.keys.secret = Secp256k1SecretKey.random();
47
- this.config.keys.public = Secp256k1SecretKey.getPublicKey(this.config.keys.secret).compressed;
48
- this.config.did = Identifier.encode({
49
- idType: this.config.components.idType || 'KEY',
50
- version: this.config.components.version || 1,
51
- network: this.config.components.network || 'signet',
52
- genesisBytes: this.config.keys.public
53
- });
54
- return this.config.did;
55
- }
56
- }
57
- //# sourceMappingURL=nostr.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nostr.js","sourceRoot":"","sources":["../../../../../../src/core/beacon/aggregation/protocol/nostr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExE,OAAO,EAAE,UAAU,GAAG,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAkB7D,MAAM,OAAO,YAAY;IAChB,IAAI,GAAW,OAAO,CAAC;IACtB,MAAM,CAAqB;IAC3B,QAAQ,GAA6C,IAAI,GAAG,EAAE,CAAC;IAEvE,YAAY,SAA6B,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,sBAAsB,CAAC,EAAE;QACrG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,cAAc,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC;QACrE,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC;YAChD,MAAM,EAAS,MAAM,CAAC,UAAU,CAAC,MAAM,IAAI,KAAK;YAChD,OAAO,EAAQ,MAAM,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC;YAC7C,OAAO,EAAQ,MAAM,CAAC,UAAU,CAAC,OAAO,IAAI,QAAQ;YACpD,YAAY,EAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAO;SACxC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,GAAG,IAAI,UAAU,EAAE,CA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