@did-btcr2/method 0.18.1 → 0.20.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 (291) hide show
  1. package/dist/browser.js +4917 -6487
  2. package/dist/browser.mjs +4917 -6487
  3. package/dist/cjs/core/beacon/aggregation/cohort/index.js +3 -3
  4. package/dist/cjs/core/beacon/aggregation/cohort/index.js.map +1 -1
  5. package/dist/cjs/core/beacon/aggregation/cohort/messages/base.js +1 -9
  6. package/dist/cjs/core/beacon/aggregation/cohort/messages/base.js.map +1 -1
  7. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js +2 -1
  8. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js.map +1 -1
  9. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js +2 -1
  10. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js.map +1 -1
  11. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js +2 -1
  12. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js.map +1 -1
  13. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in.js +2 -1
  14. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in.js.map +1 -1
  15. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/subscribe.js +2 -1
  16. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/subscribe.js.map +1 -1
  17. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js +2 -1
  18. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js.map +1 -1
  19. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/authorization-request.js +2 -1
  20. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/authorization-request.js.map +1 -1
  21. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js +2 -1
  22. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js.map +1 -1
  23. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/request-signature.js +2 -1
  24. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/request-signature.js.map +1 -1
  25. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js +2 -1
  26. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js.map +1 -1
  27. package/dist/cjs/core/beacon/aggregation/communication/adapter/nostr.js +36 -18
  28. package/dist/cjs/core/beacon/aggregation/communication/adapter/nostr.js.map +1 -1
  29. package/dist/cjs/core/beacon/aggregation/coordinator.js +14 -14
  30. package/dist/cjs/core/beacon/aggregation/coordinator.js.map +1 -1
  31. package/dist/cjs/core/beacon/aggregation/participant.js +4 -3
  32. package/dist/cjs/core/beacon/aggregation/participant.js.map +1 -1
  33. package/dist/cjs/core/beacon/aggregation/session/index.js +1 -1
  34. package/dist/cjs/core/beacon/aggregation/session/index.js.map +1 -1
  35. package/dist/cjs/core/beacon/beacon.js +25 -0
  36. package/dist/cjs/core/beacon/beacon.js.map +1 -0
  37. package/dist/cjs/core/beacon/cas-beacon.js +39 -0
  38. package/dist/cjs/core/beacon/cas-beacon.js.map +1 -0
  39. package/dist/cjs/core/beacon/error.js +4 -4
  40. package/dist/cjs/core/beacon/error.js.map +1 -1
  41. package/dist/cjs/core/beacon/factory.js +10 -11
  42. package/dist/cjs/core/beacon/factory.js.map +1 -1
  43. package/dist/cjs/core/beacon/interfaces.js +2 -0
  44. package/dist/cjs/core/beacon/interfaces.js.map +1 -0
  45. package/dist/cjs/core/beacon/signal-discovery.js +183 -0
  46. package/dist/cjs/core/beacon/signal-discovery.js.map +1 -0
  47. package/dist/cjs/core/beacon/singleton.js +75 -178
  48. package/dist/cjs/core/beacon/singleton.js.map +1 -1
  49. package/dist/cjs/core/beacon/smt-beacon.js +39 -0
  50. package/dist/cjs/core/beacon/smt-beacon.js.map +1 -0
  51. package/dist/cjs/core/beacon/utils.js +71 -114
  52. package/dist/cjs/core/beacon/utils.js.map +1 -1
  53. package/dist/cjs/core/identifier.js +18 -21
  54. package/dist/cjs/core/identifier.js.map +1 -1
  55. package/dist/cjs/core/interfaces.js +2 -0
  56. package/dist/cjs/core/interfaces.js.map +1 -0
  57. package/dist/cjs/core/resolve.js +321 -0
  58. package/dist/cjs/core/resolve.js.map +1 -0
  59. package/dist/cjs/{utils → core}/types.js.map +1 -1
  60. package/dist/cjs/core/update.js +113 -0
  61. package/dist/cjs/core/update.js.map +1 -0
  62. package/dist/cjs/did-btcr2.js +168 -129
  63. package/dist/cjs/did-btcr2.js.map +1 -1
  64. package/dist/cjs/index.js +17 -16
  65. package/dist/cjs/index.js.map +1 -1
  66. package/dist/cjs/utils/appendix.js +16 -33
  67. package/dist/cjs/utils/appendix.js.map +1 -1
  68. package/dist/cjs/utils/did-document-builder.js +5 -0
  69. package/dist/cjs/utils/did-document-builder.js.map +1 -1
  70. package/dist/cjs/utils/did-document.js +62 -72
  71. package/dist/cjs/utils/did-document.js.map +1 -1
  72. package/dist/cjs/utils/general.js +1 -1
  73. package/dist/cjs/utils/general.js.map +1 -1
  74. package/dist/esm/core/beacon/aggregation/cohort/index.js +3 -3
  75. package/dist/esm/core/beacon/aggregation/cohort/index.js.map +1 -1
  76. package/dist/esm/core/beacon/aggregation/cohort/messages/base.js +1 -9
  77. package/dist/esm/core/beacon/aggregation/cohort/messages/base.js.map +1 -1
  78. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js +2 -1
  79. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js.map +1 -1
  80. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js +2 -1
  81. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js.map +1 -1
  82. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js +2 -1
  83. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js.map +1 -1
  84. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in.js +2 -1
  85. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in.js.map +1 -1
  86. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/subscribe.js +2 -1
  87. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/subscribe.js.map +1 -1
  88. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js +2 -1
  89. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js.map +1 -1
  90. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/authorization-request.js +2 -1
  91. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/authorization-request.js.map +1 -1
  92. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js +2 -1
  93. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js.map +1 -1
  94. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/request-signature.js +2 -1
  95. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/request-signature.js.map +1 -1
  96. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js +2 -1
  97. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js.map +1 -1
  98. package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js +36 -18
  99. package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js.map +1 -1
  100. package/dist/esm/core/beacon/aggregation/coordinator.js +14 -14
  101. package/dist/esm/core/beacon/aggregation/coordinator.js.map +1 -1
  102. package/dist/esm/core/beacon/aggregation/participant.js +4 -3
  103. package/dist/esm/core/beacon/aggregation/participant.js.map +1 -1
  104. package/dist/esm/core/beacon/aggregation/session/index.js +1 -1
  105. package/dist/esm/core/beacon/aggregation/session/index.js.map +1 -1
  106. package/dist/esm/core/beacon/beacon.js +25 -0
  107. package/dist/esm/core/beacon/beacon.js.map +1 -0
  108. package/dist/esm/core/beacon/cas-beacon.js +39 -0
  109. package/dist/esm/core/beacon/cas-beacon.js.map +1 -0
  110. package/dist/esm/core/beacon/error.js +4 -4
  111. package/dist/esm/core/beacon/error.js.map +1 -1
  112. package/dist/esm/core/beacon/factory.js +10 -11
  113. package/dist/esm/core/beacon/factory.js.map +1 -1
  114. package/dist/esm/core/beacon/interfaces.js +2 -0
  115. package/dist/esm/core/beacon/interfaces.js.map +1 -0
  116. package/dist/esm/core/beacon/signal-discovery.js +183 -0
  117. package/dist/esm/core/beacon/signal-discovery.js.map +1 -0
  118. package/dist/esm/core/beacon/singleton.js +75 -178
  119. package/dist/esm/core/beacon/singleton.js.map +1 -1
  120. package/dist/esm/core/beacon/smt-beacon.js +39 -0
  121. package/dist/esm/core/beacon/smt-beacon.js.map +1 -0
  122. package/dist/esm/core/beacon/utils.js +71 -114
  123. package/dist/esm/core/beacon/utils.js.map +1 -1
  124. package/dist/esm/core/identifier.js +18 -21
  125. package/dist/esm/core/identifier.js.map +1 -1
  126. package/dist/esm/core/interfaces.js +2 -0
  127. package/dist/esm/core/interfaces.js.map +1 -0
  128. package/dist/esm/core/resolve.js +321 -0
  129. package/dist/esm/core/resolve.js.map +1 -0
  130. package/dist/esm/{utils → core}/types.js.map +1 -1
  131. package/dist/esm/core/update.js +113 -0
  132. package/dist/esm/core/update.js.map +1 -0
  133. package/dist/esm/did-btcr2.js +168 -129
  134. package/dist/esm/did-btcr2.js.map +1 -1
  135. package/dist/esm/index.js +17 -16
  136. package/dist/esm/index.js.map +1 -1
  137. package/dist/esm/utils/appendix.js +16 -33
  138. package/dist/esm/utils/appendix.js.map +1 -1
  139. package/dist/esm/utils/did-document-builder.js +5 -0
  140. package/dist/esm/utils/did-document-builder.js.map +1 -1
  141. package/dist/esm/utils/did-document.js +62 -72
  142. package/dist/esm/utils/did-document.js.map +1 -1
  143. package/dist/esm/utils/general.js +1 -1
  144. package/dist/esm/utils/general.js.map +1 -1
  145. package/dist/types/core/beacon/aggregation/cohort/index.d.ts +1 -1
  146. package/dist/types/core/beacon/aggregation/cohort/messages/base.d.ts +0 -7
  147. package/dist/types/core/beacon/aggregation/cohort/messages/base.d.ts.map +1 -1
  148. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts.map +1 -1
  149. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts.map +1 -1
  150. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.d.ts.map +1 -1
  151. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts.map +1 -1
  152. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts.map +1 -1
  153. package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts.map +1 -1
  154. package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts.map +1 -1
  155. package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts.map +1 -1
  156. package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts.map +1 -1
  157. package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts.map +1 -1
  158. package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts +13 -5
  159. package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts.map +1 -1
  160. package/dist/types/core/beacon/aggregation/coordinator.d.ts +17 -29
  161. package/dist/types/core/beacon/aggregation/coordinator.d.ts.map +1 -1
  162. package/dist/types/core/beacon/aggregation/participant.d.ts.map +1 -1
  163. package/dist/types/core/beacon/beacon.d.ts +44 -0
  164. package/dist/types/core/beacon/beacon.d.ts.map +1 -0
  165. package/dist/types/core/beacon/cas-beacon.d.ts +36 -0
  166. package/dist/types/core/beacon/cas-beacon.d.ts.map +1 -0
  167. package/dist/types/core/beacon/error.d.ts +2 -2
  168. package/dist/types/core/beacon/error.d.ts.map +1 -1
  169. package/dist/types/core/beacon/factory.d.ts +4 -5
  170. package/dist/types/core/beacon/factory.d.ts.map +1 -1
  171. package/dist/types/core/beacon/interfaces.d.ts +59 -0
  172. package/dist/types/core/beacon/interfaces.d.ts.map +1 -0
  173. package/dist/types/core/beacon/signal-discovery.d.ts +25 -0
  174. package/dist/types/core/beacon/signal-discovery.d.ts.map +1 -0
  175. package/dist/types/core/beacon/singleton.d.ts +20 -76
  176. package/dist/types/core/beacon/singleton.d.ts.map +1 -1
  177. package/dist/types/core/beacon/smt-beacon.d.ts +36 -0
  178. package/dist/types/core/beacon/smt-beacon.d.ts.map +1 -0
  179. package/dist/types/core/beacon/utils.d.ts +19 -97
  180. package/dist/types/core/beacon/utils.d.ts.map +1 -1
  181. package/dist/types/core/identifier.d.ts.map +1 -1
  182. package/dist/types/core/interfaces.d.ts +87 -0
  183. package/dist/types/core/interfaces.d.ts.map +1 -0
  184. package/dist/types/core/resolve.d.ts +89 -0
  185. package/dist/types/core/resolve.d.ts.map +1 -0
  186. package/dist/types/core/types.d.ts +84 -0
  187. package/dist/types/core/types.d.ts.map +1 -0
  188. package/dist/types/core/update.d.ts +51 -0
  189. package/dist/types/core/update.d.ts.map +1 -0
  190. package/dist/types/did-btcr2.d.ts +70 -89
  191. package/dist/types/did-btcr2.d.ts.map +1 -1
  192. package/dist/types/index.d.ts +17 -16
  193. package/dist/types/index.d.ts.map +1 -1
  194. package/dist/types/utils/appendix.d.ts +5 -10
  195. package/dist/types/utils/appendix.d.ts.map +1 -1
  196. package/dist/types/utils/did-document-builder.d.ts +6 -1
  197. package/dist/types/utils/did-document-builder.d.ts.map +1 -1
  198. package/dist/types/utils/did-document.d.ts +46 -42
  199. package/dist/types/utils/did-document.d.ts.map +1 -1
  200. package/package.json +6 -6
  201. package/src/core/beacon/aggregation/cohort/index.ts +3 -3
  202. package/src/core/beacon/aggregation/cohort/messages/base.ts +1 -12
  203. package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.ts +2 -2
  204. package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.ts +2 -2
  205. package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.ts +2 -2
  206. package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in.ts +2 -2
  207. package/src/core/beacon/aggregation/cohort/messages/keygen/subscribe.ts +2 -2
  208. package/src/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.ts +2 -2
  209. package/src/core/beacon/aggregation/cohort/messages/sign/authorization-request.ts +2 -2
  210. package/src/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.ts +2 -2
  211. package/src/core/beacon/aggregation/cohort/messages/sign/request-signature.ts +2 -2
  212. package/src/core/beacon/aggregation/cohort/messages/sign/signature-authorization.ts +2 -2
  213. package/src/core/beacon/aggregation/communication/adapter/nostr.ts +43 -21
  214. package/src/core/beacon/aggregation/coordinator.ts +41 -29
  215. package/src/core/beacon/aggregation/participant.ts +4 -3
  216. package/src/core/beacon/aggregation/session/index.ts +1 -1
  217. package/src/core/beacon/beacon.ts +58 -0
  218. package/src/core/beacon/cas-beacon.ts +53 -0
  219. package/src/core/beacon/error.ts +5 -6
  220. package/src/core/beacon/factory.ts +12 -16
  221. package/src/core/beacon/interfaces.ts +67 -0
  222. package/src/core/beacon/signal-discovery.ts +237 -0
  223. package/src/core/beacon/singleton.ts +107 -197
  224. package/src/core/beacon/smt-beacon.ts +53 -0
  225. package/src/core/beacon/utils.ts +95 -182
  226. package/src/core/identifier.ts +21 -24
  227. package/src/core/interfaces.ts +93 -0
  228. package/src/core/resolve.ts +463 -0
  229. package/src/core/types.ts +95 -0
  230. package/src/core/update.ts +154 -0
  231. package/src/did-btcr2.ts +255 -159
  232. package/src/index.ts +19 -22
  233. package/src/utils/appendix.ts +26 -44
  234. package/src/utils/did-document-builder.ts +6 -1
  235. package/src/utils/did-document.ts +105 -113
  236. package/src/utils/general.ts +1 -1
  237. package/dist/cjs/core/beacon/cid-aggregate.js +0 -116
  238. package/dist/cjs/core/beacon/cid-aggregate.js.map +0 -1
  239. package/dist/cjs/core/beacon/smt-aggregate.js +0 -126
  240. package/dist/cjs/core/beacon/smt-aggregate.js.map +0 -1
  241. package/dist/cjs/core/crud/deactivate.js +0 -14
  242. package/dist/cjs/core/crud/deactivate.js.map +0 -1
  243. package/dist/cjs/core/crud/read.js +0 -679
  244. package/dist/cjs/core/crud/read.js.map +0 -1
  245. package/dist/cjs/core/crud/update.js +0 -194
  246. package/dist/cjs/core/crud/update.js.map +0 -1
  247. package/dist/cjs/interfaces/beacon.js +0 -41
  248. package/dist/cjs/interfaces/beacon.js.map +0 -1
  249. package/dist/cjs/interfaces/crud.js +0 -2
  250. package/dist/cjs/interfaces/crud.js.map +0 -1
  251. package/dist/esm/core/beacon/cid-aggregate.js +0 -116
  252. package/dist/esm/core/beacon/cid-aggregate.js.map +0 -1
  253. package/dist/esm/core/beacon/smt-aggregate.js +0 -126
  254. package/dist/esm/core/beacon/smt-aggregate.js.map +0 -1
  255. package/dist/esm/core/crud/deactivate.js +0 -14
  256. package/dist/esm/core/crud/deactivate.js.map +0 -1
  257. package/dist/esm/core/crud/read.js +0 -679
  258. package/dist/esm/core/crud/read.js.map +0 -1
  259. package/dist/esm/core/crud/update.js +0 -194
  260. package/dist/esm/core/crud/update.js.map +0 -1
  261. package/dist/esm/interfaces/beacon.js +0 -41
  262. package/dist/esm/interfaces/beacon.js.map +0 -1
  263. package/dist/esm/interfaces/crud.js +0 -2
  264. package/dist/esm/interfaces/crud.js.map +0 -1
  265. package/dist/types/core/beacon/cid-aggregate.d.ts +0 -102
  266. package/dist/types/core/beacon/cid-aggregate.d.ts.map +0 -1
  267. package/dist/types/core/beacon/smt-aggregate.d.ts +0 -111
  268. package/dist/types/core/beacon/smt-aggregate.d.ts.map +0 -1
  269. package/dist/types/core/crud/deactivate.d.ts +0 -13
  270. package/dist/types/core/crud/deactivate.d.ts.map +0 -1
  271. package/dist/types/core/crud/read.d.ts +0 -334
  272. package/dist/types/core/crud/read.d.ts.map +0 -1
  273. package/dist/types/core/crud/update.d.ts +0 -93
  274. package/dist/types/core/crud/update.d.ts.map +0 -1
  275. package/dist/types/interfaces/beacon.d.ts +0 -116
  276. package/dist/types/interfaces/beacon.d.ts.map +0 -1
  277. package/dist/types/interfaces/crud.d.ts +0 -32
  278. package/dist/types/interfaces/crud.d.ts.map +0 -1
  279. package/dist/types/utils/types.d.ts +0 -38
  280. package/dist/types/utils/types.d.ts.map +0 -1
  281. package/src/canonicalize.d.ts +0 -6
  282. package/src/core/beacon/cid-aggregate.ts +0 -153
  283. package/src/core/beacon/smt-aggregate.ts +0 -135
  284. package/src/core/crud/deactivate.ts +0 -13
  285. package/src/core/crud/read.ts +0 -948
  286. package/src/core/crud/update.ts +0 -292
  287. package/src/interfaces/beacon.ts +0 -137
  288. package/src/interfaces/crud.ts +0 -33
  289. package/src/utils/types.ts +0 -41
  290. /package/dist/cjs/{utils → core}/types.js +0 -0
  291. /package/dist/esm/{utils → core}/types.js +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"read.js","sourceRoot":"","sources":["../../../../src/core/crud/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,wBAAwB,EAGxB,aAAa,EACb,UAAU,EAGV,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,oBAAoB,EACpB,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,MAAM,EACN,WAAW,EACX,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,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AC;CACF"}
@@ -1,194 +0,0 @@
1
- import { BTCR2_DID_UPDATE_PAYLOAD_CONTEXT, INVALID_DID_DOCUMENT, INVALID_DID_UPDATE, INVALID_PUBLIC_KEY_TYPE, Logger, MethodError, NOT_FOUND } from '@did-btcr2/common';
2
- import { SchnorrMultikey } from '@did-btcr2/cryptosuite';
3
- import { CompressedSecp256k1PublicKey, SchnorrKeyPair, Secp256k1SecretKey } from '@did-btcr2/keypair';
4
- import { Kms } from '@did-btcr2/kms';
5
- import { Appendix } from '../../utils/appendix.js';
6
- import { DidDocument } from '../../utils/did-document.js';
7
- import { BeaconFactory } from '../beacon/factory.js';
8
- import { Identifier } from '../identifier.js';
9
- /**
10
- * Implements {@link https://dcdpr.github.io/did-btcr2/#update | 4.3 Update}.
11
- *
12
- * An update to a did:btcr2 document is an invoked capability using the ZCAP-LD
13
- * data format, signed by a verificationMethod that has the authority to make
14
- * the update as specified in the previous DID document. Capability invocations
15
- * for updates MUST be authorized using Data Integrity following the
16
- * bip340-jcs-2025 cryptosuite with a proofPurpose of capabilityInvocation.
17
- *
18
- * @class Update
19
- * @type {Update}
20
- */
21
- export class Update {
22
- /**
23
- * Implements {@link https://dcdpr.github.io/did-btcr2/#construct-did-update-payload | 4.3.1 Construct DID Update Payload}.
24
- *
25
- * The Construct DID Update Payload algorithm applies the documentPatch to the sourceDocument and verifies the
26
- * resulting targetDocument is a conformant DID document. It takes in a Identifier, sourceDocument,
27
- * sourceVersionId, and documentPatch objects. It returns an unsigned DID Update Payload.
28
- *
29
- * @param {ConstructPayloadParams} params See {@link ConstructPayloadParams} for more details.
30
- * @param {string} params.identifier The did-btcr2 identifier to use for verification.
31
- * @param {DidDocument} params.sourceDocument The source document to be updated.
32
- * @param {string} params.sourceVersionId The versionId of the source document.
33
- * @param {DidDocumentPatch} params.patch The JSON patch to be applied to the source document.
34
- * @returns {Promise<DidUpdatePayload>} The constructed DidUpdatePayload object.
35
- * @throws {MethodError} InvalidDid if sourceDocument.id does not match identifier.
36
- */
37
- static async construct({ identifier, sourceDocument, sourceVersionId, patch, }) {
38
- // 1. Check that sourceDocument.id equals identifier else MUST raise invalidDIDUpdate error.
39
- if (sourceDocument.id !== identifier) {
40
- throw new MethodError(INVALID_DID_UPDATE, 'Source document id does not match identifier', { sourceDocument, identifier });
41
- }
42
- // 2. Initialize didUpdatePayload to an empty object.
43
- const didUpdatePayload = {
44
- // 3. Set didUpdatePayload.@context to the following list
45
- '@context': BTCR2_DID_UPDATE_PAYLOAD_CONTEXT,
46
- // 4. Set didUpdatePayload.patch to documentPatch.
47
- patch,
48
- targetHash: '',
49
- targetVersionId: 0,
50
- sourceHash: '',
51
- };
52
- // TODO: Need to add btcr2 context. ["https://w3id.org/zcap/v1", "https://w3id.org/security/data-integrity/v2", "https://w3id.org/json-ld-patch/v1"]
53
- // 5. Set targetDocument to the result of applying the documentPatch to the sourceDocument, following the JSON Patch
54
- // specification.
55
- const targetDocument = JSON.patch.apply(sourceDocument, patch);
56
- // 6. Validate targetDocument is a conformant DID document, else MUST raise invalidDIDUpdate error.
57
- DidDocument.validate(targetDocument);
58
- // 7. Set sourceHashBytes to the result of passing sourceDocument into the JSON Canonicalization and Hash algorithm.
59
- // 8. Set didUpdatePayload.sourceHash to the base58-btc Multibase encoding of sourceHashBytes.
60
- didUpdatePayload.sourceHash = (await JSON.canonicalization.process(sourceDocument, 'base58')).slice(1);
61
- // TODO: Question - is base58btc the correct encoding scheme?
62
- // 9. Set targetHashBytes to the result of passing targetDocument into the JSON Canonicalization and Hash algorithm.
63
- // 10. Set didUpdatePayload.targetHash to the base58-btc Multibase encoding of targetHashBytes.
64
- didUpdatePayload.targetHash = (await JSON.canonicalization.process(targetDocument, 'base58')).slice(1);
65
- // 11. Set didUpdatePayload.targetVersionId to sourceVersionId + 1.
66
- didUpdatePayload.targetVersionId = sourceVersionId + 1;
67
- // 12. Return updatePayload.
68
- return didUpdatePayload;
69
- }
70
- /**
71
- * {@link https://dcdpr.github.io/did-btcr2/#invoke-did-update-payload | 4.3.2 Invoke DID Update Payload}.
72
- *
73
- * The Invoke DID Update Payload algorithm takes in a Identifier, an unsigned didUpdatePayload, and a
74
- * verificationMethod. It retrieves the privateKeyBytes for the verificationMethod and adds a capability invocation in
75
- * the form of a Data Integrity proof following the Authorization Capabilities (ZCAP-LD) and VC Data Integrity
76
- * specifications. It returns the invoked DID Update Payload.
77
- *
78
- * @param {InvokePayloadParams} params Required params for calling the invokePayload method
79
- * @param {string} params.identifier The did-btcr2 identifier to derive the root capability from
80
- * @param {DidUpdatePayload} params.didUpdatePayload The updatePayload object to be signed
81
- * @param {DidVerificationMethod} params.verificationMethod The verificationMethod object to be used for signing
82
- * @returns {DidUpdateInvocation} Did update payload secured with a proof => DidUpdateInvocation
83
- * @throws {MethodError} if the privateKeyBytes are invalid
84
- */
85
- static async invoke({ identifier, didUpdatePayload, verificationMethod }) {
86
- // Deconstruct the verificationMethod
87
- const { id: fullId, controller, publicKeyMultibase, secretKeyMultibase } = verificationMethod;
88
- // Validate the verificationMethod
89
- if (!publicKeyMultibase) {
90
- throw new MethodError('Invalid publicKeyMultibase: cannot be undefined', INVALID_PUBLIC_KEY_TYPE, verificationMethod);
91
- }
92
- // 1. Set privateKeyBytes to the result of retrieving the private key bytes
93
- // associated with the verificationMethod value.
94
- // 1.1 Let id be the fragment portion of verificationMethod.id.
95
- const id = fullId.slice(fullId.indexOf('#'));
96
- // 1.2 Retrieve the key pair from the KMS or from the secretKeyMultibase
97
- const components = Identifier.decode(id);
98
- const keyUri = new CompressedSecp256k1PublicKey(components.genesisBytes).hex;
99
- const keys = secretKeyMultibase
100
- ? new SchnorrKeyPair({ secretKey: Secp256k1SecretKey.decode(secretKeyMultibase) })
101
- : await Kms.getKey(keyUri);
102
- if (!keys) {
103
- throw new MethodError('No privateKey found in kms or vm', NOT_FOUND, verificationMethod);
104
- }
105
- // 1.3 Set multikey to the result of passing verificationMethod and privateKeyBytes into the Multikey Creation algorithm.
106
- const multikey = SchnorrMultikey.create({ id, controller, keys });
107
- // 1.4 If the privateKey is not found, throw an error
108
- if (!multikey) {
109
- throw new MethodError('Failed to create multikey from verification method', 'MULTKEY_CREATE_FAILED', verificationMethod);
110
- }
111
- // 2. Set rootCapability to the result of passing Identifier into the Derive Root Capability from did:btcr2
112
- // Identifier algorithm.
113
- const rootCapability = Appendix.deriveRootCapability(identifier);
114
- const cryptosuite = 'bip340-jcs-2025';
115
- // 3. Initialize proofOptions to an empty object.
116
- // 4. Set proofOptions.type to DataIntegrityProof.
117
- // 5. Set proofOptions.cryptosuite to schnorr-secp256k1-jcs-2025.
118
- // 6. Set proofOptions.verificationMethod to verificationMethod.id.
119
- // 7. Set proofOptions.proofPurpose to capabilityInvocation.
120
- // 8. Set proofOptions.capability to rootCapability.id.
121
- // 9. Set proofOptions.capabilityAction to Write.
122
- const options = {
123
- cryptosuite,
124
- type: 'DataIntegrityProof',
125
- verificationMethod: fullId,
126
- proofPurpose: 'capabilityInvocation',
127
- capability: rootCapability.id,
128
- capabilityAction: 'Write',
129
- };
130
- // 10. Set cryptosuite to the result of executing the Cryptosuite Instantiation algorithm from the BIP340 Data
131
- // Integrity specification passing in proofOptions.
132
- const diproof = multikey.toCryptosuite(cryptosuite).toDataIntegrityProof();
133
- // 12. Set didUpdateInvocation to the result of executing the Add Proof algorithm from VC Data Integrity passing
134
- // didUpdatePayload as the input document, cryptosuite, and the set of proofOptions.
135
- // 13. Return didUpdateInvocation.
136
- return await diproof.addProof({ document: didUpdatePayload, options });
137
- }
138
- /**
139
- * Implements {@link https://dcdpr.github.io/did-btcr2/#announce-did-update | 4.3.3 Announce DID Update}.
140
- *
141
- * The Announce DID Update algorithm retrieves beaconServices from the sourceDocument and calls the Broadcast DID
142
- * Update algorithm corresponding to the type of the Beacon. It takes in a Identifier, sourceDocument, an array of
143
- * beaconIds, and a didUpdateInvocation. It returns an array of signalsMetadata, containing the necessary
144
- * data to validate the Beacon Signal against the didUpdateInvocation.
145
- *
146
- * @param {AnnounceUpdatePayloadParams} params Required params for calling the announcePayload method
147
- * @param {DidDocument} params.sourceDocument The did-btcr2 did document to derive the root capability from
148
- * @param {string[]} params.beaconIds The didUpdatePayload object to be signed
149
- * @param {DidUpdateInvocation} params.didUpdatePayload The verificationMethod object to be used for signing
150
- * @returns {SignalsMetadata} The signalsMetadata object containing data to validate the Beacon Signal
151
- * @throws {MethodError} if the beaconService type is invalid
152
- */
153
- static async announce({ sourceDocument, beaconIds, didUpdateInvocation }) {
154
- // 1. Set beaconServices to an empty array.
155
- const beaconServices = [];
156
- // 2. signalMetadata to an empty array.
157
- let signalsMetadata;
158
- // 3. For beaconId in beaconIds:
159
- for (const beaconId of beaconIds) {
160
- // 3.1 Find the beacon services in the sourceDocument
161
- const beaconService = sourceDocument.service.find((s) => s.id === beaconId);
162
- // 3.2 If no beaconService MUST throw beaconNotFound error.
163
- if (!beaconService) {
164
- throw new MethodError('Not found: sourceDocument does not contain beaconId', INVALID_DID_DOCUMENT, { beaconId });
165
- }
166
- // 3.3 Push beaconService to beaconServices.
167
- beaconServices.push(beaconService);
168
- }
169
- // 4. For beaconService in beaconServices:
170
- for (const beaconService of beaconServices) {
171
- // 4.1 Set signalMetadata to null.
172
- // 4.2 If beaconService.type == SingletonBeacon:
173
- // 4.2.1 Set signalMetadata to the result of passing beaconService and didUpdateInvocation to the Broadcast
174
- // Singleton Beacon Signal algorithm.
175
- // 4.3 Else If beaconService.type == CIDAggregateBeacon:
176
- // 4.3.1 Set signalMetadata to the result of passing Identifier, beaconService and didUpdateInvocation to
177
- // the Broadcast CIDAggregate Beacon Signal algorithm.
178
- // 4.4 Else If beaconService.type == SMTAggregateBeacon:
179
- // 4.4.1 Set signalMetadata to the result of passing Identifier, beaconService and didUpdateInvocation to
180
- // the Broadcast SMTAggregate Beacon Signal algorithm.
181
- // 4.5 Else:
182
- // 4.5.1 MUST throw invalidBeacon error.
183
- const beacon = BeaconFactory.establish(beaconService);
184
- signalsMetadata = await beacon.broadcastSignal(didUpdateInvocation);
185
- }
186
- if (!signalsMetadata) {
187
- throw new MethodError('Invalid beacon: no signalsMetadata found', INVALID_DID_DOCUMENT, { beaconServices });
188
- }
189
- Logger.debug('signalsMetadata', signalsMetadata);
190
- // Return the signalsMetadata
191
- return signalsMetadata;
192
- }
193
- }
194
- //# sourceMappingURL=update.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/core/crud/update.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAGhC,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,MAAM,EACN,WAAW,EACX,SAAS,EAGV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,4BAA4B,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACtG,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAGrC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAyB,MAAM,6BAA6B,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAoB9C;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,MAAM;IACjB;;;;;;;;;;;;;;OAcG;IACI,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,EAC5B,UAAU,EACV,cAAc,EACd,eAAe,EACf,KAAK,GAMN;QAEC,4FAA4F;QAC5F,IAAI,cAAc,CAAC,EAAE,KAAK,UAAU,EAAE,CAAC;YACrC,MAAM,IAAI,WAAW,CACnB,kBAAkB,EAClB,8CAA8C,EAC9C,EAAE,cAAc,EAAE,UAAU,EAAC,CAC9B,CAAC;QACJ,CAAC;QAED,qDAAqD;QACrD,MAAM,gBAAgB,GAAqB;YAC3C,yDAAyD;YACvD,UAAU,EAAQ,gCAA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,2CAA2C;YAC3C,MAAM,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;YACtD,eAAe,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC;QACtE,CAAC;QACD,IAAG,CAAC,eAAe,EAAE,CAAC;YACpB,MAAM,IAAI,WAAW,CACnB,0CAA0C,EAC1C,oBAAoB,EAAE,EAAE,cAAc,EAAE,CACzC,CAAC;QACJ,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC;QACjD,6BAA6B;QAC7B,OAAO,eAAe,CAAC;IACzB,CAAC;CACF"}
@@ -1,41 +0,0 @@
1
- /**
2
- * Implements {@link https://dcdpr.github.io/did-btcr2/#update-beacons | 5. Beacons}.
3
- * Beacons are the mechanism by which a DID controller announces an update to their DID document by broadcasting an
4
- * attestation to this update onto the public Bitcoin network. Beacons are identified by a Bitcoin address and emit
5
- * Beacon Signals by broadcasting a valid Bitcoin transaction that spends from this Beacon address. These transactions
6
- * include attestations to a set of didUpdatePayloads, either in the form of Content Identifiers (CIDs) or Sparse Merkle
7
- * Tree (SMT) roots. Beacons are included as a service in DID documents, with the Service Endpoint identifying a Bitcoin
8
- * address to watch for Beacon Signals. All Beacon Signals broadcast from this Beacon MUST be processed as part of
9
- * resolution (see Read). The type of the Beacon service in the DID document defines how Beacon Signals SHOULD be
10
- * processed.
11
- * did:btcr2 supports different Beacon Types, with each type defining a set of algorithms for:
12
- * 1. How a Beacon can be established and added as a service to a DID document.
13
- * 2. How attestations to DID updates are broadcast within Beacon Signals.
14
- * 3. How a resolver processes a Beacon Signal, identifying, verifying, and applying the authorized mutations to a
15
- * DID document for a specific DID.
16
- * This is an extendable mechanism, such that in the future new Beacon Types could be added. It would be up to the
17
- * resolver to determine if the Beacon Type is a mechanism they support and are willing to trust. If they are unable to
18
- * support a Beacon Type and a DID they are resolving uses that type then the DID MUST be treated as invalid.
19
- * The current, active Beacons of a DID document are specified in the document’s service property. By updating the DID
20
- * document, a DID controller can change the set of Beacons they can use to broadcast updates to their DID document over
21
- * time. Resolution of a DID MUST process signals from all Beacons identified in the latest DID document and apply them
22
- * in order determined by the version specified by the didUpdatePayload.
23
- * All resolvers of did:btcr2 DIDs MUST support the core Beacon Types defined in this specification.
24
- *
25
- * @abstract
26
- * @class Beacon
27
- * @type {Beacon}
28
- */
29
- export class Beacon {
30
- id;
31
- type;
32
- serviceEndpoint;
33
- sidecar;
34
- constructor({ id, type, serviceEndpoint }, sidecar) {
35
- this.id = id;
36
- this.type = type;
37
- this.serviceEndpoint = serviceEndpoint;
38
- this.sidecar = sidecar;
39
- }
40
- }
41
- //# sourceMappingURL=beacon.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"beacon.js","sourceRoot":"","sources":["../../../src/interfaces/beacon.ts"],"names":[],"mappings":"AA4EA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,OAAgB,MAAM;IACnB,EAAE,CAAS;IACX,IAAI,CAAS;IACb,eAAe,CAAqB;IACpC,OAAO,CAAe;IAE7B,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,eAAe,EAAiB,EAAE,OAAqB;QAC7E,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CAqBF"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=crud.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"crud.js","sourceRoot":"","sources":["../../../src/interfaces/crud.ts"],"names":[],"mappings":""}
@@ -1,102 +0,0 @@
1
- import { RawTransactionV2 } from '@did-btcr2/bitcoin';
2
- import { DidUpdateInvocation, DidUpdatePayload } from '@did-btcr2/common';
3
- import { DidServiceEndpoint } from '@web5/dids';
4
- import { Beacon, BeaconService, BeaconSignal } from '../../interfaces/beacon.js';
5
- import { BeaconSidecarData, CIDAggregateSidecar, SignalsMetadata } from '../../utils/types.js';
6
- /**
7
- * Implements {@link https://dcdpr.github.io/did-btcr2/#cidaggregate-beacon | 5.2 CIDAggregate Beacon}.
8
- *
9
- * A Beacon of the type CIDAggregatoBeacon is a Beacon that publishes Bitcoin transactions containing a Content
10
- * Identifier (CID) announcing an Aggregated DID Update Bundle. An Aggregated DID Update Bundle is a JSON object that
11
- * maps did:btcr2 identifiers to CID values for the individual DID Update Payloads. The Aggregated DID Update Bundle CID
12
- * (bundleCID) SHOULD be resolvable against a Content Addressable Storage (CAS) system such as IPFS, while the CID for
13
- * the DID Update Payload (payloadCID) MAY be resolvable against a CAS or provided through a Sidecar mechanism. It is
14
- * RECOMMENDED that this type of Beacon is only included in a DID document if the DID controller is REQUIRED to
15
- * participate in authorizing Bitcoin transactions from this Beacon. In other words, this Beacon SHOULD identify an
16
- * n-of-n P2TR Bitcoin address where n is the number of unique DID controllers submitting updates through the Beacon.
17
- *
18
- * @class CIDAggregateBeacon
19
- * @type {CIDAggregateBeacon}
20
- * @extends {Beacon}
21
- */
22
- export declare class CIDAggregateBeacon extends Beacon {
23
- /**
24
- * Creates an instance of CIDAggregateBeacon.
25
- * @param {BeaconService} service The service of the Beacon.
26
- * @param {?BeaconSidecarData} [sidecar] The sidecar data of the Beacon.
27
- */
28
- constructor(service: BeaconService, sidecar?: BeaconSidecarData<CIDAggregateSidecar>);
29
- get service(): BeaconService;
30
- /**
31
- * TODO: Finish implementation
32
- *
33
- * Implements {@link https://dcdpr.github.io/did-btcr2/#establish-cidaggregate-beacon | 5.2.1 Establish CIDAggregate Beacon}.
34
- *
35
- * To establish a CIDAggregatorBeacon, a cohort of cooperating parties SHOULD generate an n-of-n P2TR Bitcoin address
36
- * where each party contributes a public key. Furthermore, each party SHOULD verify that their key is part of the
37
- * address and all other keys that are part of the address are keys with controllers able to produce valid signatures.
38
- * To establish a Beacon there are two roles. One is the cohort participant, they want to join a Beacon cohort and
39
- * submit a request to do so with a key and proof of control over that key. The other is the Beacon coordinator, they
40
- * advertise and curate Beacon cohorts by combining Beacon participants into cohorts, verifying proofs of control, and
41
- * producing Beacon addresses.
42
- *
43
- * @param {string} id The identifier of the Beacon.
44
- * @param {string} type The type of the Beacon.
45
- * @param {DidServiceEndpoint} serviceEndpoint The service endpoint of the Beacon.
46
- * @returns {CIDAggregateBeacon} The established CIDAggregate Beacon.
47
- */
48
- static establish(id: string, type: string, serviceEndpoint: DidServiceEndpoint): CIDAggregateBeacon;
49
- /**
50
- * TODO: Figure out if this is necessary or not.
51
- * @param {string} didUpdatePayload The DID Update Payload to generate the signal for.
52
- * @returns {BeaconSignal} The generated signal.
53
- * @throws {MethodError} if the signal is invalid.
54
- */
55
- generateSignal(didUpdatePayload: string): BeaconSignal;
56
- /**
57
- * TODO: Finish implementation
58
- *
59
- * Implements {@link https://dcdpr.github.io/did-btcr2/#process-cidaggregate-beacon-signal | 5.2.3 Process CIDAggregate Beacon Signal}.
60
- *
61
- * A Beacon Signal from a CIDAggregate Beacon is a Bitcoin transaction that contains the hashBytes of a DID Update
62
- * Bundle in its first transaction output. The corresponding DID Update Bundle MUST either be provided through Sidecar
63
- * Data or by converting hashBytes into a IPFS v1 Content Identifier and attempting to retrieve it from Content
64
- * Addressable Storage. The DID Update Bundle maps from did:btcr2 identifiers to hashes of DID Update payloads
65
- * applicable for that identifier. Again this algorithm attempts to retrieve and validate the DID Update Payload
66
- * identified for the identifier being resolved. If successful, the DID Update Payload is returned.
67
- *
68
- * The Process CIDAggregate Beacon Signal algorithm is called by the Process Beacon Signals algorithm as part of the
69
- * Read operation.
70
- *
71
- * It takes as inputs a did:btcr2 identifier, Identifier, a Beacon Signal, tx, and a optional
72
- * object, signalSidecarData, containing any sidecar data provided to the resolver for the Beacon Signal identified by
73
- * the Bitcoin transaction identifier.
74
- *
75
- * It returns the DID Update payload announced by the Beacon Signal for the
76
- * did:btcr2 identifier being resolved or throws an error.
77
- *
78
- * @param {RawTransactionV2} signal Bitcoin transaction representing a Beacon Signal.
79
- * @param {SignalsMetadata} signalsMetadata Optional sidecar data for the Beacon Signal.
80
- * @returns {Promise<DidUpdatePayload | undefined>} The DID Update payload announced by the Beacon Signal.
81
- * @throws {DidError} if the signalTx is invalid or the signalsMetadata is invalid.
82
- */
83
- processSignal(signal: RawTransactionV2, signalsMetadata: SignalsMetadata): Promise<DidUpdateInvocation | undefined>;
84
- /**
85
- * TODO: Finish implementation
86
- *
87
- * Implements {@link https://dcdpr.github.io/did-btcr2/#broadcast-cidaggregate-beacon-signal | 5.2.2 Broadcast CIDAggregate Beacon Signal}.
88
- *
89
- * The Broadcast CIDAggregate Beacon Signal algorithm involving two roles: a set of cohort participants and a Beacon
90
- * coordinator. The Beacon coordinator collects individual DID Update Payload Content Identifiers (CIDs) for specific
91
- * did:btcr2 idntifiers and aggregates them into a DID Update Bundle, which is then published to a Content Addressable
92
- * Storage (CAS). The CID for the DID Update Bundle is included in a Partially Signed Bitcoin Transaction (PSBT) transaction
93
- * output spent from the Beacon’s n-of-n address. Each of the n cohort participants in the Beacon MUST sign the
94
- * transaction before it can be broadcast to the network. It is RECOMMENDED that cohort participants keep a copy of
95
- * the DID Update Bundle and separately pin it to the CAS.
96
- *
97
- * @param {DidUpdatePayload} didUpdatePayload The verificationMethod object to be used for signing.
98
- * @returns {SignalsMetadata} Successful output of a bitcoin transaction.
99
- * @throws {SingletonBeaconError} if the bitcoin address is invalid or unfunded.
100
- */
101
- broadcastSignal(didUpdatePayload: DidUpdatePayload): Promise<SignalsMetadata>;
102
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"cid-aggregate.d.ts","sourceRoot":"","sources":["../../../../src/core/beacon/cid-aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAe,MAAM,mBAAmB,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE/F;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,kBAAmB,SAAQ,MAAM;IAC5C;;;;OAIG;gBACS,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,iBAAiB,CAAC,mBAAmB,CAAC;IAGpF,IAAI,OAAO,IAAI,aAAa,CAM3B;IAGD;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,kBAAkB,GAAG,kBAAkB;IAKnG;;;;;OAKG;IACH,cAAc,CAAC,gBAAgB,EAAE,MAAM,GAAG,YAAY;IAKtD;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,aAAa,CAAC,MAAM,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;IAInH;;;;;;;;;;;;;;;;OAgBG;IACH,eAAe,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;CA8B9E"}
@@ -1,111 +0,0 @@
1
- import { RawTransactionV2 } from '@did-btcr2/bitcoin';
2
- import { DidUpdatePayload } from '@did-btcr2/common';
3
- import { DidServiceEndpoint } from '@web5/dids';
4
- import { Beacon, BeaconService, BeaconSignal } from '../../interfaces/beacon.js';
5
- import { BeaconSidecarData, SignalsMetadata, SMTAggregateSidecar } from '../../utils/types.js';
6
- /**
7
- * TODO: Finish implementation
8
- *
9
- * Implements {@link https://dcdpr.github.io/did-btcr2/#smtaggregate-beacon | 5.3 SMTAggregate Beacon}.
10
- *
11
- * A SMTAggregate Beacon is a Beacon whose Beacon Signals are Bitcoin transactions containing the root of a Sparse
12
- * Merkle Tree (SMT). The SMT root attests to a set of DID Update Payloads, however, the updates themselves MUST be
13
- * provided along with a proof of inclusion against the SMT root through a Sidecar mechanism during resolution. Using
14
- * the SMT root a resolver can then verify the inclusion proof for the given DID Update Payload. If a DID document
15
- * includes a SMTAggregator Beacon in their set of Beacon services, then they MUST provide proofs for each signal that
16
- * the Beacon broadcasts. If they did not submit an update to their DID in a signal, then they MUST provide a proof of
17
- * non-inclusion for that signal.
18
- *
19
- * @class SMTAggregateBeacon
20
- * @type {SMTAggregateBeacon}
21
- * @extends {Beacon}
22
- */
23
- export declare class SMTAggregateBeacon extends Beacon {
24
- /**
25
- * Creates an instance of SMTAggregateBeacon.
26
- * @param {BeaconService} service The Beacon service.
27
- * @param {?BeaconSidecarData} [sidecar] Optional sidecar data.
28
- */
29
- constructor(service: BeaconService, sidecar?: BeaconSidecarData<SMTAggregateSidecar>);
30
- /**
31
- * Get the Beacon service.
32
- * @readonly
33
- * @type {BeaconService} The Beacon service.
34
- */
35
- get service(): BeaconService;
36
- /**
37
- * TODO: Figure out if this is necessary or not.
38
- * @param {string} didUpdatePayload The DID Update Payload to generate the signal for.
39
- * @returns {BeaconSignal} The generated signal.
40
- * @throws {MethodError} if the signal is invalid.
41
- */
42
- generateSignal(didUpdatePayload: string): BeaconSignal;
43
- /**
44
- * Implements {@link https://dcdpr.github.io/did-btcr2/#establish-beacon | 5.3.1 Establish Beacon}.
45
- *
46
- * The Establish Beacon algorithm is essentially the same as for the CIDAggregate Beacon in Establish CIDAggregate
47
- * Beacon. A cohort of DID controllers need to coordinate to produce a Bitcoin address that will act as the Beacon.
48
- * It is RECOMMENDED this is an n-of-n P2TR address, with n being the set of DID controllers in the cohort. Once the
49
- * address has been created, and all parties in the cohort acknowledge their intention to participate in that Beacon,
50
- * each DID controller SHOULD add the Beacon as a service to their DID document.
51
- *
52
- * Additionally, the SMTAggregate Beacon cohort participants MUST register the did:btcr2 identifiers they intend use
53
- * this Beacon with. This is so the Beacon coordinator can generate the necessary proofs of both inclusion and
54
- * non-inclusion for each DID.
55
- *
56
- * Static, convenience method for establishing a Beacon object.
57
- *
58
- * @param {string} id The Beacon ID.
59
- * @param {string} type The Beacon type.
60
- * @param {DidServiceEndpoint} serviceEndpoint The service endpoint.
61
- * @returns {Beacon} The Beacon.
62
- */
63
- static establish(id: string, type: string, serviceEndpoint: DidServiceEndpoint): SMTAggregateBeacon;
64
- /**
65
- *
66
- * Implements {@link https://dcdpr.github.io/did-btcr2/#broadcast-smtaggregate-beacon-signal | 5.3.2 Broadcast SMTAggregate Beacon Signal}.
67
- *
68
- * See {@link Beacon.broadcastSignal | Beacon Interface Method broadcastSignal} for more information.
69
- *
70
- * To publish a DID Update Payload, the DID controller MUST get a hash of the DID Update Payload included at the leaf
71
- * of the Sparse Merkle Tree (SMT) identified by their did:btcr2 identifier and receive an inclusion proof for this
72
- * data. If a member of the Beacon cohort does not wish to announce an update in a Beacon Signal, they MUST receive
73
- * and verify a proof of non-inclusion for their DID. Upon verifying the non-inclusion proof against the SMT root
74
- * contained in the Beacon Signal, they SHOULD accept and authorize the signal following the MuSig2 protocol. Once all
75
- * members of the cohort have authorized the signal, it can be broadcast as a transaction to the Bitcoin network. DID
76
- * controllers are responsible for persisting their DID updates and proofs, these will need to be provided through a
77
- * Sidecar mechanism during a resolution process.
78
- *
79
- * @param {DidUpdatePayload} didUpdatePayload The DID Update Payload to broadcast.
80
- * @returns {Promise<SignalMetadata>} The signal metadata.
81
- * @throws {MethodError} if the signal is invalid.
82
- */
83
- broadcastSignal(didUpdatePayload: DidUpdatePayload): Promise<SignalsMetadata>;
84
- /**
85
- * Implements {@link https://dcdpr.github.io/did-btcr2/#process-smtaggregate-beacon-signal | 5.3.3 Process SMTAggregate Beacon Signal}.
86
- *
87
- * See {@link Beacon.processSignal | Beacon Interface Method processSignal} for more information.
88
- *
89
- * A Beacon Signal from a SMTAggregate Beacon is a Bitcoin transaction with the first transaction output of the format
90
- * [OP_RETURN, OP_PUSH32, <32bytes>]. The 32 bytes of data contained within this transaction output represent the root
91
- * of a Sparse Merkle Tree (SMT). This SMT aggregates a set of hashes of DID Update payloads. In order to process
92
- * these Beacon Signals, the resolver MUST have been passed Sidecar data for this signal containing either the DID
93
- * Update payload object and a SMT proof that the hash of this object is in the SMT at the leaf indexed by the
94
- * did:Identifier being resolved. Or theSidecar data:: MUST contain a proof that the leaf indexed by the
95
- * did:Identifier is empty, thereby proving that theSMT:: does not contain an update for their identifier.
96
- *
97
- * The Process SMTAggregate Beacon Signal is called by the Process Beacon Signals algorithm as part of the Read
98
- * operation. It takes as inputs a did:btcr2 identifier, Identifier, a Beacon Signal, tx, and a optional object,
99
- * signalSidecarData, containing any sidecar data provided to the resolver for the Beacon Signal identified by the
100
- * Bitcoin transaction identifier.
101
- *
102
- * It returns the DID Update payload announced by the Beacon Signal for the did:btcr2 identifier being resolved or
103
- * throws an error.
104
- *
105
- * @param {RawTransactionV2} signal The raw transaction signal.
106
- * @param {SignalsMetadata} signalsMetadata The signals metadata.
107
- * @returns {Promise<DidUpdatePayload | undefined>} The updated DID document.
108
- * @throws {MethodError} if the signal is invalid.
109
- */
110
- processSignal(signal: RawTransactionV2, signalsMetadata: SignalsMetadata): Promise<DidUpdatePayload | undefined>;
111
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"smt-aggregate.d.ts","sourceRoot":"","sources":["../../../../src/core/beacon/smt-aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAe,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE/F;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,kBAAmB,SAAQ,MAAM;IAC5C;;;;OAIG;gBACS,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,iBAAiB,CAAC,mBAAmB,CAAC;IAIpF;;;;OAIG;IACH,IAAI,OAAO,IAAI,aAAa,CAO3B;IAED;;;;;OAKG;IACI,cAAc,CAAC,gBAAgB,EAAE,MAAM,GAAG,YAAY;IAI7D;;;;;;;;;;;;;;;;;;;OAmBG;WACW,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,kBAAkB,GAAG,kBAAkB;IAI1G;;;;;;;;;;;;;;;;;;OAkBG;IACI,eAAe,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAKpF;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACI,aAAa,CAAC,MAAM,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;CAGxH"}
@@ -1,13 +0,0 @@
1
- import { DidBtcr2 } from '../../did-btcr2.js';
2
- /**
3
- * Implements {@link https://dcdpr.github.io/did-btcr2/#deactivate | 4.4 Deactivate}
4
- * To deactivate a did:btcr2, the DID controller MUST add the property deactivated with the value true on the DID
5
- * document. To do this, the DID controller constructs a valid DID Update Payload with a JSON patch that adds this
6
- * property and announces the payload through a Beacon in their current DID document following the algorithm in Update.
7
- * Once a did:btcr2 has been deactivated this state is considered permanent and resolution MUST terminate.
8
- * @class Deactivate
9
- * @type {Deactivate}
10
- * @extends {DidBtcr2}
11
- */
12
- export declare class Deactivate extends DidBtcr2 {
13
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"deactivate.d.ts","sourceRoot":"","sources":["../../../../src/core/crud/deactivate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;;;;;GASG;AACH,qBAAa,UAAW,SAAQ,QAAQ;CAAG"}