@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,11 +1,14 @@
1
- import { DocumentBytes, KeyBytes, PatchOperation } from '@did-btcr2/common';
2
- import type { DidResolutionResult } from '@web5/dids';
3
- import { DidMethod } from '@web5/dids';
4
- import { DidResolutionOptions } from './interfaces/crud.js';
5
- import { DidDocument, DidVerificationMethod } from './utils/did-document.js';
6
- import { SignalsMetadata } from './utils/types.js';
1
+ import { BitcoinNetworkConnection } from '@did-btcr2/bitcoin';
2
+ import { Canonicalization, DocumentBytes, HexString, KeyBytes, PatchOperation } from '@did-btcr2/common';
3
+ import { SignedBTCR2Update } from '@did-btcr2/cryptosuite';
4
+ import { DidMethod, DidResolutionResult } from '@web5/dids';
5
+ import { ResolutionOptions } from './core/interfaces.js';
6
+ import { Btcr2DidDocument, DidVerificationMethod } from './utils/did-document.js';
7
+ export declare const canonicalization: Canonicalization;
7
8
  export type Btcr2Identifier = string;
8
9
  export interface DidCreateOptions {
10
+ /** Type of identifier to create (key or external) */
11
+ idType: 'KEY' | 'EXTERNAL';
9
12
  /** DID BTCR2 Version Number */
10
13
  version?: number;
11
14
  /** Bitcoin Network */
@@ -13,116 +16,94 @@ export interface DidCreateOptions {
13
16
  }
14
17
  /**
15
18
  * Implements {@link https://dcdpr.github.io/did-btcr2 | did:btcr2 DID Method Specification}.
16
- * did:btcr2 is a censorship resistant DID Method using the Bitcoin blockchain as a Verifiable Data Registry to announce
17
- * changes to the DID document. It improves on prior work by allowing: zero-cost off-chain DID creation; aggregated
18
- * updates for scalable on-chain update costs; long-term identifiers that can support frequent updates; private
19
- * communication of the DID document; private DID resolution; and non-repudiation appropriate for serious contracts.
19
+ * did:btcr2 is a censorship-resistant Decentralized Identifier (DID) method using
20
+ * the Bitcoin blockchain as a Verifiable Data Registry to announce changes to the
21
+ * DID document. It supports zero-cost off-chain DID creation; aggregated updates
22
+ * for scalable on-chain update costs; long-term identifiers that can support
23
+ * frequent updates; private communication of the DID document; private DID resolution;
24
+ * and non-repudiation.
20
25
  *
21
26
  * @class DidBtcr2
22
27
  * @type {DidBtcr2}
23
28
  * @implements {DidMethod}
24
29
  */
25
30
  export declare class DidBtcr2 implements DidMethod {
26
- /** @type {string} Name of the DID method, as defined in the DID BTCR2 specification */
31
+ /**
32
+ * Name of the DID method, as defined in the DID BTCR2 specification
33
+ */
27
34
  static methodName: string;
28
35
  /**
29
- * Entry point for section {@link https://dcdpr.github.io/did-btcr2/#create | 4.1 Create}.
30
- * See {@link Create} for implementation details.
31
- *
32
- * A did:btcr2 identifier and associated DID document can either be created deterministically from a cryptographic
33
- * seed, or it can be created from an arbitrary genesis intermediate DID document representation. In both cases,
34
- * DID creation can be undertaken in an offline manner, i.e., the DID controller does not need to interact with the
35
- * Bitcoin network to create their DID.
36
- * @param {CreateParams} params See {@link CreateParams} for details.
37
- * @param {IdType} params.idType Type of identifier to create (key or external).
38
- * @param {KeyBytes} params.pubKeyBytes Public key byte array used to create a btcr2 "key" identifier.
39
- * @param {IntermediateDocument} params.intermediateDocument DID Document used to create a btcr2 "external" identifier.
40
- * @param {DidCreateOptions} params.options See {@link DidCreateOptions} for create options.
41
- * @param {number} params.options.version Version number of the btcr2 method.
42
- * @param {string} params.options.network Bitcoin network name (mainnet, testnet, signet, regtest).
43
- * @returns {Promise<CreateResponse>} Promise resolving to a CreateResponse object.
44
- * @throws {DidBtcr2Error} if any of the checks fail
36
+ * Implements section {@link https://dcdpr.github.io/did-btcr2/operations/create.html | 7.1 Create}.
37
+ * @param {KeyBytes | DocumentBytes} genesisBytes The bytes used to create the genesis document for a did:btcr2 identifier.
38
+ * This can be either the bytes of the genesis document itself or the bytes of a key that will be used to create the genesis document.
39
+ * @param {DidCreateOptions} options Options for creating the identifier, including the idType (key or external), version, and network.
40
+ * @param {string} options.idType The type of identifier to create, either 'KEY' or 'EXTERNAL'. Defaults to 'KEY'.
41
+ * @param {number} options.version The version number of the did:btcr2 specification to use for creating the identifier. Defaults to 1.
42
+ * @param {string} options.network The Bitcoin network to use for the identifier, e.g. 'bitcoin', 'testnet', etc. Defaults to 'bitcoin'.
43
+ * @returns {Promise<Btcr2Identifier>} Promise resolving to a Btcr2Identifier string.
44
+ * @throws {MethodError} if any of the checks fail
45
45
  */
46
- static create(params: {
47
- idType: 'KEY' | 'EXTERNAL';
48
- genesisBytes: KeyBytes | DocumentBytes;
49
- options?: DidCreateOptions;
50
- }): Promise<Btcr2Identifier>;
46
+ static create(genesisBytes: KeyBytes | DocumentBytes, options?: DidCreateOptions): Promise<Btcr2Identifier>;
51
47
  /**
52
- * Entry point for section {@link https://dcdpr.github.io/did-btcr2/#read | 7.2 Read}.
53
- * See {@link Resolve} for implementation details.
48
+ * Entry point for section {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html | 7.2 Resolve}.
49
+ * See specification for the {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#process | Resolve Process}.
50
+ * See {@link Resolve | Resolve (class)} for class implementation.
54
51
  *
55
- * The Read operation is an algorithm consisting of a series of subroutine algorithms executed by a resolver after a
56
- * resolution request identifying a specific did:btcr2 identifier is received from a client at Resolution Time. The
57
- * request MUST always contain the resolutionOptions object containing additional information to be used in resolution.
58
- * This object MAY be empty. See the DID Resolution specification for further details about the DID Resolution Options
59
- * object. The resolver then attempts to resolve the DID document of the identifier at a specific Target Time. The
60
- * Target Time is either provided in resolutionOptions or is set to the Resolution Time of the request.
52
+ * Resolving a did:btcr2 identifier iteratively builds a DID document by applying
53
+ * BTCR2 Updates to an Initial DID Document that have been committed to the Bitcoin
54
+ * blockchain by Authorized Beacon Signals. The Initial DID Document is either
55
+ * deterministically created from the DID or provided by Sidecar Data.
61
56
  *
62
- * @param {string} identifier a valid did:btcr2 identifier to be resolved
63
- * @param {DidResolutionOptions} [resolutionsOptions] see {@link https://www.w3.org/TR/did-1.0/#did-resolution-options | DidResolutionOptions}
64
- * @param {number} options.versionId the version of the identifier and/or DID document
65
- * @param {number} options.versionTime a timestamp used during resolution as a bound for when to stop resolving
66
- * @param {DidDocument} options.sidecarData data necessary for resolving a DID
67
- * @param {string} options.network Bitcoin network name (mainnet, testnet, signet, regtest).
68
- * @returns {DidResolutionResult} Promise resolving to a DID Resolution Result containing the `targetDocument`
69
- * @throws {Error} if the resolution fails for any reason
70
- * @throws {DidError} InvalidDid if the identifier is invalid
57
+ * @param {string} did The did:btcr2 identifier to be resolved.
58
+ * @param {ResolutionOptions} resolutionOptions Options used during the resolution process.
59
+ * @returns {Promise<DidResolutionResult>} Promise resolving to a DID Resolution Result containing the `targetDocument`
60
+ * @throws {ResolveError} If the resolution process fails at any step.
71
61
  * @example
72
62
  * ```ts
73
- * const resolution = await DidBtcr2.resolve('did:btcr2:k1q0dygyp3gz969tp46dychzy4q78c2k3js68kvyr0shanzg67jnuez2cfplh')
63
+ * const resolution = await DidBtcr2.resolve(
64
+ * 'did:btcr2:k1q0dygyp3gz969tp46dychzy4q78c2k3js68kvyr0shanzg67jnuez2cfplh'
65
+ * )
74
66
  * ```
75
67
  */
76
- static resolve(identifier: string, resolutionsOptions?: DidResolutionOptions): Promise<DidResolutionResult>;
68
+ static resolve(did: string, resolutionOptions?: ResolutionOptions): Promise<DidResolutionResult>;
77
69
  /**
78
- * Entry point for section {@link https://dcdpr.github.io/did-btcr2/#update | 4.3 Update}.
79
- * See {@link Update} for implementation details.
70
+ * Entry point for section {@link https://dcdpr.github.io/did-btcr2/#read | 7.3 Update}.
71
+ * See specification for the {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#process | Resolve Process}.
72
+ * See {@link Update | Update (class)} for class implementation.
80
73
  *
81
- * An update to a did:btcr2 document is an invoked capability using the ZCAP-LD data format, signed by a
82
- * verificationMethod that has the authority to make the update as specified in the previous DID document. Capability
83
- * invocations for updates MUST be authorized using Data Integrity following the bip340-jcs-2025
84
- * cryptosuite with a proofPurpose of capabilityInvocation.
85
- *
86
- * The Update algorithm takes as inputs a Identifier, sourceDocument, sourceVersionId, documentPatch, a
87
- * verificationMethodId and an array of beaconIds. The sourceDocument is the DID document being updated. The
88
- * documentPatch is a JSON Patch object containing a set of transformations to be applied to the sourceDocument.
89
- * The result of these transformations MUST produce a DID document conformant to the DID Core specification. The
90
- * verificationMethodId is an identifier for a verificationMethod within the sourceDocument. The verificationMethod
91
- * identified MUST be a BIP340 Multikey. The beaconIds MUST identify service endpoints with one of the three Beacon
92
- * Types SingletonBeacon, CIDAggregateBeacon, and SMTAggregateBeacon.
93
- *
94
- * @param {UpdateParams} params Required parameters for the update operation.
95
- * @param {string} params.identifier The btcr2 identifier to be updated.
96
- * @param {DidDocument} params.sourceDocument The DID document being updated.
97
- * @param {string} params.sourceVersionId The versionId of the source document.
98
- * @param {PatchOperation} params.documentPatch The JSON patch to be applied to the source document.
99
- * @param {string} params.verificationMethodId The verificationMethod ID to sign the update
100
- * @param {string[]} params.beaconIds The beacon IDs to announce the update
101
- * @returns {Promise<void>} Promise resolving to void
102
- * @throws {MethodError} if the verificationMethod type is not `Multikey` or the publicKeyMultibase header is not `zQ3s`
74
+ * BTCR2 DID documents can be updated by anchoring BTCR2 Updates to Bitcoin transactions. These transactions MAY be
75
+ * published to the Bitcoin network. Any property in the DID document may be updated except the id. Doing so would
76
+ * invalidate the DID document.
77
+ * @param params An object containing the parameters for the update operation.
78
+ * @param {Btcr2DidDocument} params.sourceDocument The DID document being updated.
79
+ * @param {PatchOperation[]} params.patches The array of JSON Patch operations to apply to the sourceDocument.
80
+ * @param {string} params.sourceVersionId The version ID before applying the update.
81
+ * @param {string} params.verificationMethodId The verificationMethod ID to sign the update with.
82
+ * @param {string} params.beaconId The beacon ID associated with the update.
83
+ * @param {KeyBytes | HexString} [params.signingMaterial] Optional signing material (key bytes or hex string).
84
+ * @param {BitcoinNetworkConnection} [params.bitcoin] Optional Bitcoin network connection for announcing the update. If not provided, a default connection will be initialized.
85
+ * @return {Promise<SignedBTCR2Update>} Promise resolving to the signed BTCR2 update.
86
+ * @throws {UpdateError} if no verificationMethod, verificationMethod type is not `Multikey` or the publicKeyMultibase
87
+ * header is not `zQ3s`
103
88
  */
104
- static update(params: {
105
- identifier: string;
106
- sourceDocument: DidDocument;
89
+ static update({ sourceDocument, patches, sourceVersionId, verificationMethodId, beaconId, signingMaterial, bitcoin, }: {
90
+ sourceDocument: Btcr2DidDocument;
91
+ patches: PatchOperation[];
107
92
  sourceVersionId: number;
108
- patch: PatchOperation[];
109
93
  verificationMethodId: string;
110
- beaconIds: string[];
111
- }): Promise<SignalsMetadata>;
94
+ beaconId: string;
95
+ signingMaterial?: KeyBytes | HexString;
96
+ bitcoin?: BitcoinNetworkConnection;
97
+ }): Promise<SignedBTCR2Update>;
112
98
  /**
113
99
  * Given the W3C DID Document of a `did:btcr2` identifier, return the signing verification method that will be used
114
100
  * for signing messages and credentials. If given, the `methodId` parameter is used to select the
115
101
  * verification method. If not given, the Identity Key's verification method with an ID fragment
116
102
  * of '#initialKey' is used.
117
- *
118
- * @param {{ didDocument: DidDocument; methodId?: string; }} params Parameters for the `getSigningMethod` method.
119
- * @param {DidDocument} params.didDocument DID Document to get the verification method from.
120
- * @param {string} params.methodId Optional ID of the verification method to use for signing.
103
+ * @param {Btcr2DidDocument} didDocument The DID Document of the `did:btcr2` identifier.
104
+ * @param {string} [methodId] Optional verification method ID to be used for signing.
121
105
  * @returns {DidVerificationMethod} Promise resolving to the {@link DidVerificationMethod} object used for signing.
122
106
  * @throws {DidError} if the parsed did method does not match `btcr2` or signing method could not be determined.
123
107
  */
124
- static getSigningMethod({ didDocument, methodId }: {
125
- didDocument: DidDocument;
126
- methodId?: string;
127
- }): DidVerificationMethod;
108
+ static getSigningMethod(didDocument: Btcr2DidDocument, methodId?: string): DidVerificationMethod;
128
109
  }
@@ -1 +1 @@
1
- {"version":3,"file":"did-btcr2.d.ts","sourceRoot":"","sources":["../../src/did-btcr2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,QAAQ,EAGR,cAAc,EAEf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAIL,SAAS,EAEV,MAAM,YAAY,CAAC;AAKpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAInD,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AAErC,MAAM,WAAW,gBAAgB;IAC/B,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAKD;;;;;;;;;;GAUG;AACH,qBAAa,QAAS,YAAW,SAAS;IACxC,uFAAuF;IACvF,OAAc,UAAU,EAAE,MAAM,CAAW;IAE3C;;;;;;;;;;;;;;;;;OAiBG;WACiB,MAAM,CAAC,MAAM,EAAE;QACjC,MAAM,EAAE,KAAK,GAAG,UAAU,CAAC;QAC3B,YAAY,EAAE,QAAQ,GAAG,aAAa,CAAC;QACvC,OAAO,CAAC,EAAE,gBAAg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export * from './core/beacon/aggregation/cohort/messages/base.js';
4
+ export * from './core/beacon/aggregation/cohort/messages/constants.js';
5
+ export * from './core/beacon/aggregation/cohort/messages/index.js';
6
+ export * from './core/beacon/aggregation/cohort/messages/keygen//subscribe.js';
1
7
  export * from './core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js';
2
8
  export * from './core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js';
3
9
  export * from './core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js';
4
10
  export * from './core/beacon/aggregation/cohort/messages/keygen/opt-in.js';
5
- export * from './core/beacon/aggregation/cohort/messages/keygen//subscribe.js';
6
11
  export * from './core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js';
7
12
  export * from './core/beacon/aggregation/cohort/messages/sign/authorization-request.js';
8
13
  export * from './core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js';
9
14
  export * from './core/beacon/aggregation/cohort/messages/sign/request-signature.js';
10
15
  export * from './core/beacon/aggregation/cohort/messages/sign/signature-authorization.js';
11
- export * from './core/beacon/aggregation/cohort/messages/base.js';
12
- export * from './core/beacon/aggregation/cohort/messages/constants.js';
13
- export * from './core/beacon/aggregation/cohort/messages/index.js';
14
- export * from './core/beacon/aggregation/cohort/index.js';
15
- export * from './core/beacon/aggregation/cohort/status.js';
16
16
  export * from './core/beacon/aggregation/communication/adapter/did-comm.js';
17
17
  export * from './core/beacon/aggregation/communication/adapter/nostr.js';
18
18
  export * from './core/beacon/aggregation/communication/error.js';
19
19
  export * from './core/beacon/aggregation/communication/factory.js';
20
20
  export * from './core/beacon/aggregation/communication/service.js';
21
- export * from './core/beacon/aggregation/session/index.js';
22
- export * from './core/beacon/aggregation/session/status.js';
23
21
  export * from './core/beacon/aggregation/coordinator.js';
24
22
  export * from './core/beacon/aggregation/participant.js';
25
- export * from './core/beacon/cid-aggregate.js';
23
+ export * from './core/beacon/aggregation/session/index.js';
24
+ export * from './core/beacon/aggregation/session/status.js';
25
+ export * from './core/beacon/beacon.js';
26
+ export * from './core/beacon/cas-beacon.js';
26
27
  export * from './core/beacon/error.js';
27
28
  export * from './core/beacon/factory.js';
29
+ export * from './core/beacon/interfaces.js';
30
+ export * from './core/beacon/signal-discovery.js';
28
31
  export * from './core/beacon/singleton.js';
29
- export * from './core/beacon/smt-aggregate.js';
32
+ export * from './core/beacon/smt-beacon.js';
30
33
  export * from './core/beacon/utils.js';
31
- export * from './core/crud/deactivate.js';
32
- export * from './core/crud/read.js';
33
- export * from './core/crud/update.js';
34
34
  export * from './core/identifier.js';
35
- export * from './interfaces/beacon.js';
36
- export * from './interfaces/crud.js';
35
+ export * from './core/interfaces.js';
36
+ export * from './core/resolve.js';
37
+ export * from './core/types.js';
38
+ export * from './core/update.js';
37
39
  export * from './utils/appendix.js';
38
40
  export * from './utils/did-document-builder.js';
39
41
  export * from './utils/did-document.js';
40
42
  export * from './utils/general.js';
41
- export * from './utils/types.js';
42
43
  export * from './did-btcr2.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mEAAmE,CAAC;AAClF,cAAc,kEAAkE,CAAC;AACjF,cAAc,mEAAmE,CAAC;AAClF,cAAc,4DAA4D,CAAC;AAC3E,cAAc,gEAAgE,CAAC;AAE/E,cAAc,oEAAoE,CAAC;AACnF,cAAc,yEAAyE,CAAC;AACxF,cAAc,sEAAsE,CAAC;AACrF,cAAc,qEAAqE,CAAC;AACpF,cAAc,2EAA2E,CAAC;AAE1F,cAAc,mDAAmD,CAAC;AAClE,cAAc,wDAAwD,CAAC;AACvE,cAAc,oDAAoD,CAAC;AAEnE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAE3D,cAAc,6DAA6D,CAAC;AAC5E,cAAc,0DAA0D,CAAC;AACzE,cAAc,kDAAkD,CAAC;AACjE,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AAEnE,cAAc,4CAA4C,CA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AACzD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6CAA6C,CAAC;AAE5D,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AAEvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,gBAAgB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { HashBytes } from '@did-btcr2/common';
2
2
  import { DidDocument, DidService, DidVerificationMethod } from '@web5/dids';
3
- import { RootCapability } from '../interfaces/crud.js';
3
+ import { RootCapability } from '../core/interfaces.js';
4
4
  /**
5
5
  * Implements {@link https://dcdpr.github.io/did-btcr2/#appendix | 9. Appendix} methods.
6
6
  *
@@ -95,16 +95,11 @@ export declare class Appendix {
95
95
  * }
96
96
  * }
97
97
  */
98
- static derefernceRootCapabilityIdentifier(capabilityId: string): RootCapability;
98
+ static dereferenceZcapId(capabilityId: string): RootCapability;
99
99
  /**
100
- * Implements {@link https://dcdpr.github.io/did-btcr2/#fetch-content-from-addressable-storage | 9.3. Fetch Content from Addressable Storage}.
101
- *
102
- * The Fetch Content from Addressable Storage function takes in SHA256 hash of some content, hashBytes, converts these
103
- * bytes to a IPFS v1 Content Identifier and attempts to retrieve the identified content from Content Addressable
104
- * Storage (CAS). It returns the retrieved content or null.
105
- *
106
- * @param {HashBytes} hashBytes The SHA256 hash of the content to be fetched.
107
- * @returns {string} The fetched content or null if not found.
100
+ * Implements CAS Lookup Step from {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#process-beacon-signals | 7.2.e Process Beacon Signals }.
101
+ * @param {HashBytes} hashBytes The hash bytes to look up in the CAS system.
102
+ * @returns {Promise<string | undefined>} The content fetched from the CAS system, or undefined if not found.
108
103
  */
109
104
  static fetchFromCas(hashBytes: HashBytes): Promise<string | undefined>;
110
105
  }
@@ -1 +1 @@
1
- {"version":3,"file":"appendix.d.ts","sourceRoot":"","sources":["../../../src/utils/appendix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAe,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EACL,WAAW,EAGX,UAAU,EACV,qBAAqB,EAEtB,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;;GAKG;AACH,qBAAa,QAAQ;IACnB;;;;OAIG;WACW,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;IAMpE;;;;OAIG;WACW,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,qBAAqB;IAcjF;;;;OAIG;WACW,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,UAAU;IAW3D;;;;;OAKG;WACW,sBAAsB,CAAC,WAAW,EAAE,WAAW,GAAG,qBAAqB,EAAE;IAgBvF;;;;;;;;;;;;;;;;;;;;OAoBG;WACW,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc;IAwBtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;WACW,kCAAkC,CAAC,YAAY,EAAE,MAAM,GAAG,cAAc;IA+CtF;;;;;;;;;OASG;WACiB,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAepF"}
1
+ {"version":3,"file":"appendix.d.ts","sourceRoot":"","sources":["../../../src/utils/appendix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EACL,WAAW,EAGX,UAAU,EACV,qBAAqB,EAEtB,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;;GAKG;AACH,qBAAa,QAAQ;IACnB;;;;OAIG;WACW,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;IAMpE;;;;OAIG;WACW,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,qBAAqB;IAcjF;;;;OAIG;WACW,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,UAAU;IAW3D;;;;;OAKG;WACW,sBAAsB,CAAC,WAAW,EAAE,WAAW,GAAG,qBAAqB,EAAE;IAgBvF;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc;IAU/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;WACW,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,cAAc;IA+CrE;;;;OAIG;WACU,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAW7E"}
@@ -1,5 +1,10 @@
1
- import { BeaconService } from '../interfaces/beacon.js';
1
+ import { BeaconService } from '../core/beacon/interfaces.js';
2
2
  import { DidDocument, DidVerificationMethod } from './did-document.js';
3
+ /**
4
+ * A builder class for constructing DID Documents.
5
+ * @type {DidDocumentBuilder}
6
+ * @class DidDocumentBuilder
7
+ */
3
8
  export declare class DidDocumentBuilder {
4
9
  private document;
5
10
  constructor(initialDocument: Partial<DidDocument>);
@@ -1 +1 @@
1
- {"version":3,"file":"did-document-builder.d.ts","sourceRoot":"","sources":["../../../src/utils/did-document-builder.ts"],"names":[],"mapp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Ae,EAAE,KAAK,CAAC,MAAM,GAAG,qBAAqB,CAAC,GAAG,IAAI;IAOjF,wBAAwB,CAAC,oBAAoB,EAAE,KAAK,CAAC,MAAM,GAAG,qBAAqB,CAAC,GAAG,IAAI;IAO3F,wBAAwB,CAAC,oBAAoB,EAAE,KAAK,CAAC,MAAM,GAAG,qBAAqB,CAAC,GAAG,IAAI;IAO3F,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,IAAI;IAOhD,KAAK,IAAI,WAAW;CAWrB"}
@@ -1,6 +1,7 @@
1
1
  import { JSONObject, KeyBytes } from '@did-btcr2/common';
2
- import { DidDocument as IIDidDocument, DidVerificationMethod as IIDidVerificationMethod } from '@web5/dids';
3
- import { BeaconService } from '../interfaces/beacon.js';
2
+ import { DidDocument as W3CDidDocument, DidVerificationMethod as W3CDidVerificationMethod } from '@web5/dids';
3
+ import { BeaconService } from '../core/beacon/interfaces.js';
4
+ export declare const ID_PLACEHOLDER_VALUE = "did:btcr2:_";
4
5
  export declare const BECH32M_CHARS = "";
5
6
  export declare const DID_REGEX: RegExp;
6
7
  export type ExternalData = {
@@ -18,7 +19,9 @@ export type VerificationRelationships = {
18
19
  capabilityInvocation?: Array<string | DidVerificationMethod>;
19
20
  capabilityDelegation?: Array<string | DidVerificationMethod>;
20
21
  };
21
- export interface IDidVerificationMethod extends IIDidVerificationMethod {
22
+ /** Loose type for unvalidated DID document-like input objects. */
23
+ export type DidDocumentLike = Partial<Btcr2DidDocument>;
24
+ export interface Btcr2VerificationMethod extends W3CDidVerificationMethod {
22
25
  id: string;
23
26
  type: string;
24
27
  controller: string;
@@ -31,19 +34,19 @@ export interface IDidVerificationMethod extends IIDidVerificationMethod {
31
34
  * @type {DidVerificationMethod}
32
35
  *
33
36
  */
34
- export declare class DidVerificationMethod implements IDidVerificationMethod {
37
+ export declare class DidVerificationMethod implements Btcr2VerificationMethod {
35
38
  id: string;
36
39
  type: string;
37
40
  controller: string;
38
41
  publicKeyMultibase: string;
39
42
  secretKeyMultibase?: string | undefined;
40
- constructor({ id, type, controller, publicKeyMultibase, secretKeyMultibase }: IDidVerificationMethod);
43
+ constructor({ id, type, controller, publicKeyMultibase, secretKeyMultibase }: Btcr2VerificationMethod);
41
44
  }
42
45
  /**
43
46
  * BTCR2 DID Document Interface
44
- * @interface IDidDocument
45
- * @type {IDidDocument}
46
- * @extends {IIDidDocument}
47
+ * @interface Btcr2DidDocument
48
+ * @type {Btcr2DidDocument}
49
+ * @extends {W3CDidDocument}
47
50
  * @property {string} id - The identifier of the DID Document.
48
51
  * @property {Array<string>} [controller] - The controller of the DID Document.
49
52
  * @property {Array<string | JSONObject>} ['@context'] - The context of the DID Document.
@@ -54,7 +57,7 @@ export declare class DidVerificationMethod implements IDidVerificationMethod {
54
57
  * @property {Array<string | DidVerificationMethod>} [capabilityDelegation] - The capability delegation methods of the DID Document.
55
58
  * @property {Array<BeaconService>} service - The services of the DID Document.
56
59
  */
57
- export interface IDidDocument extends IIDidDocument {
60
+ export interface Btcr2DidDocument extends W3CDidDocument {
58
61
  id: string;
59
62
  controller?: Array<string>;
60
63
  '@context'?: Array<string | JSONObject>;
@@ -69,7 +72,7 @@ export interface IDidDocument extends IIDidDocument {
69
72
  * BTCR2 DID Document extends the DidDocument class adding helper methods and properties
70
73
  * @class DidDocument
71
74
  * @type {DidDocument}
72
- * @implements {IDidDocument}
75
+ * @implements {Btcr2DidDocument}
73
76
  * @property {string} id - The identifier of the DID Document.
74
77
  * @property {Array<string>} [controller] - The controller of the DID Document.
75
78
  * @property {Array<string | JSONObject>} ['@context'] - The context of the DID Document.
@@ -80,7 +83,7 @@ export interface IDidDocument extends IIDidDocument {
80
83
  * @property {Array<string | DidVerificationMethod>} [capabilityDelegation] - The capability delegation methods of the DID Document.
81
84
  * @property {Array<BeaconService>} service - The services of the DID Document.
82
85
  */
83
- export declare class DidDocument implements IDidDocument {
86
+ export declare class DidDocument implements Btcr2DidDocument {
84
87
  id: string;
85
88
  controller?: Array<string>;
86
89
  '@context'?: Array<string | JSONObject>;
@@ -90,12 +93,13 @@ export declare class DidDocument implements IDidDocument {
90
93
  capabilityInvocation?: Array<string | DidVerificationMethod>;
91
94
  capabilityDelegation?: Array<string | DidVerificationMethod>;
92
95
  service: Array<BeaconService>;
93
- constructor(document: IDidDocument);
96
+ deactivated?: boolean;
97
+ constructor(document: Btcr2DidDocument);
94
98
  /**
95
99
  * Convert the DidDocument to a JSON object.
96
- * @returns {JSONObject} The JSON representation of the DidDocument.
100
+ * @returns {DidDocument} The JSON representation of the DidDocument.
97
101
  */
98
- json(): JSONObject;
102
+ json(): DidDocument;
99
103
  /**
100
104
  * Create a minimal DidDocument from "k1" btcr2 identifier.
101
105
  * @param {string} publicKeyMultibase The public key in multibase format.
@@ -120,7 +124,7 @@ export declare class DidDocument implements IDidDocument {
120
124
  * @returns {boolean} True if the DID document is valid.
121
125
  * @throws {DidDocumentError} If any validation check fails.
122
126
  */
123
- static isValid(didDocument: DidDocument): boolean;
127
+ static isValid(didDocument: DidDocumentLike): boolean;
124
128
  /**
125
129
  * Validates that "@context" exists and includes correct values.
126
130
  * @private
@@ -161,66 +165,66 @@ export declare class DidDocument implements IDidDocument {
161
165
  * @param {DidDocument} didDocument The DID Document to validate.
162
166
  * @returns {boolean} True if the verification relationships are valid.
163
167
  */
164
- static isValidVerificationRelationships(didDocument: DidDocument): boolean;
168
+ static isValidVerificationRelationships(didDocument: DidDocumentLike): boolean;
165
169
  /**
166
170
  * Validate the DID Document
167
171
  * @returns {DidDocument} Validated DID Document.
168
172
  * @throws {DidDocumentError} If the DID Document is invalid.
169
173
  */
170
- static validate(didDocument: DidDocument | IntermediateDidDocument): DidDocument;
174
+ static validate(didDocument: any): DidDocument;
171
175
  /**
172
- * Validate the IntermediateDidDocument.
173
- * @returns {boolean} True if the IntermediateDidDocument is valid.
176
+ * Validate the GenesisDocument.
177
+ * @returns {boolean} True if the GenesisDocument is valid.
174
178
  */
175
- validateIntermediate(): boolean;
179
+ validateGenesis(): boolean;
176
180
  /**
177
- * Convert the DidDocument to an IntermediateDidDocument.
178
- * @returns {IntermediateDidDocument} The IntermediateDidDocument representation of the DidDocument.
181
+ * Convert the DidDocument to an GenesisDocument.
182
+ * @returns {GenesisDocument} The GenesisDocument representation of the DidDocument.
179
183
  */
180
- toIntermediate(): IntermediateDidDocument;
184
+ toIntermediate(): GenesisDocument;
185
+ }
186
+ export declare class Document {
187
+ static isValid(didDocument: DidDocument | GenesisDocument): boolean;
181
188
  }
182
189
  /**
183
- * IntermediateDidDocument extends the DidDocument class for creating and managing intermediate DID documents.
190
+ * GenesisDocument extends the DidDocument class for creating and managing intermediate DID documents.
184
191
  * This class is used to create a minimal DID document with a placeholder ID.
185
192
  * It is used in the process of creating a new DID document.
186
- * @class IntermediateDidDocument
193
+ * @class GenesisDocument
187
194
  * @extends {DidDocument}
188
195
  */
189
- export declare class IntermediateDidDocument extends DidDocument {
190
- constructor(document: JSONObject);
196
+ export declare class GenesisDocument extends DidDocument {
197
+ constructor(document: object | DidDocument);
191
198
  /**
192
- * Convert the IntermediateDidDocument to a DidDocument by replacing the placeholder value with the provided DID.
199
+ * Convert the GenesisDocument to a DidDocument by replacing the placeholder value with the provided DID.
193
200
  * @param did The DID to replace the placeholder value in the document.
194
201
  * @returns {DidDocument} A new DidDocument with the placeholder value replaced by the provided DID.
195
202
  */
196
203
  toDidDocument(did: string): DidDocument;
197
204
  /**
198
- * Create an IntermediateDidDocument from a DidDocument by replacing the DID with a placeholder value.
205
+ * Create an GenesisDocument from a DidDocument by replacing the DID with a placeholder value.
199
206
  * @param {DidDocument} didDocument The DidDocument to convert.
200
- * @returns {IntermediateDidDocument} The IntermediateDidDocument representation of the DidDocument.
207
+ * @returns {GenesisDocument} The GenesisDocument representation of the DidDocument.
201
208
  */
202
- static fromDidDocument(didDocument: DidDocument): IntermediateDidDocument;
209
+ static fromDidDocument(didDocument: DidDocument): GenesisDocument;
203
210
  /**
204
- * Create a minimal IntermediateDidDocument with a placeholder ID.
211
+ * Create a minimal GenesisDocument with a placeholder ID.
205
212
  * @param {Array<DidVerificationMethod>} verificationMethod The public key in multibase format.
206
213
  * @param {VerificationRelationships} relationships The public key in multibase format.
207
214
  * @param {Array<BeaconService>} service The service to be included in the document.
208
- * @returns {IntermediateDidDocument} A new IntermediateDidDocument with the placeholder ID.
215
+ * @returns {GenesisDocument} A new GenesisDocument with the placeholder ID.
209
216
  */
210
- static create(verificationMethod: Array<DidVerificationMethod>, relationships: VerificationRelationships, service: Array<BeaconService>): IntermediateDidDocument;
217
+ static create(verificationMethod: Array<DidVerificationMethod>, relationships: VerificationRelationships, service: Array<BeaconService>): GenesisDocument;
211
218
  /**
212
- * Create a minimal IntermediateDidDocument from a public key.
219
+ * Create a minimal GenesisDocument from a public key.
213
220
  * @param {KeyBytes} publicKey The public key in bytes format.
214
- * @returns {IntermediateDidDocument} A new IntermediateDidDocument with the placeholder ID.
221
+ * @returns {GenesisDocument} A new GenesisDocument with the placeholder ID.
215
222
  */
216
- static fromPublicKey(publicKey: KeyBytes, network: string): IntermediateDidDocument;
223
+ static fromPublicKey(publicKey: KeyBytes, network: string): GenesisDocument;
217
224
  /**
218
225
  * Taken an object, convert it to an IntermediateDocuemnt and then to a DidDocument.
219
- * @param {JSONObject} object The JSON object to convert.
226
+ * @param {object | DidDocument} object The JSON object to convert.
220
227
  * @returns {DidDocument} The created DidDocument.
221
228
  */
222
- static fromJSON(object: JSONObject): IntermediateDidDocument;
223
- }
224
- export declare class Document {
225
- static isValid(didDocument: DidDocument | IntermediateDidDocument): boolean;
229
+ static fromJSON(object: object | DidDocument): GenesisDocument;
226
230
  }
@@ -1 +1 @@
1
- {"version":3,"file":"did-document.d.ts","sourceRoot":"","sources":["../../../src/utils/did-document.ts"],"names":[],"mappings":"AACA,OAAO,EAML,UAAU,EACV,QAAQ,EACT,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAc,WAAW,IAAI,aAAa,EAAE,qBAAqB,IAAI,uBAAuB,EAAE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,EAAE,OAAO,EAAE,MAAM,GAAG,eAAe;IA4BlF;;;;OAIG;WACW,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,eAAe;CAGtE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@did-btcr2/method",
3
- "version": "0.18.1",
3
+ "version": "0.20.0",
4
4
  "type": "module",
5
5
  "description": "Javascript/TypeScript reference implementation of did:btcr2 method, a censorship resistant DID Method using the Bitcoin blockchain as a Verifiable Data Registry to announce changes to the DID document. Core package of the did-btcr2-js monorepo.",
6
6
  "main": "./dist/cjs/index.js",
@@ -83,11 +83,11 @@
83
83
  "multiformats": "^13.3.1",
84
84
  "nostr-tools": "^2.15.0",
85
85
  "tiny-secp256k1": "^2.2.3",
86
- "@did-btcr2/bitcoin": "0.3.2",
87
- "@did-btcr2/common": "2.2.2",
88
- "@did-btcr2/keypair": "0.7.2",
89
- "@did-btcr2/cryptosuite": "3.2.1",
90
- "@did-btcr2/kms": "0.1.1"
86
+ "@did-btcr2/cryptosuite": "5.0.0",
87
+ "@did-btcr2/bitcoin": "0.3.4",
88
+ "@did-btcr2/kms": "0.2.0",
89
+ "@did-btcr2/common": "3.1.0",
90
+ "@did-btcr2/keypair": "0.9.0"
91
91
  },
92
92
  "devDependencies": {
93
93
  "@eslint/js": "^9.22.0",