@did-btcr2/method 0.18.0 → 0.19.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 (262) hide show
  1. package/dist/browser.js +5240 -6079
  2. package/dist/browser.mjs +5240 -6079
  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/cas-beacon.js +55 -0
  36. package/dist/cjs/core/beacon/cas-beacon.js.map +1 -0
  37. package/dist/cjs/core/beacon/factory.js +11 -10
  38. package/dist/cjs/core/beacon/factory.js.map +1 -1
  39. package/dist/cjs/core/beacon/interfaces.js +32 -0
  40. package/dist/cjs/core/beacon/interfaces.js.map +1 -0
  41. package/dist/cjs/core/beacon/singleton.js +59 -135
  42. package/dist/cjs/core/beacon/singleton.js.map +1 -1
  43. package/dist/cjs/core/beacon/smt-beacon.js +56 -0
  44. package/dist/cjs/core/beacon/smt-beacon.js.map +1 -0
  45. package/dist/cjs/core/beacon/utils.js +67 -105
  46. package/dist/cjs/core/beacon/utils.js.map +1 -1
  47. package/dist/cjs/core/identifier.js +18 -21
  48. package/dist/cjs/core/identifier.js.map +1 -1
  49. package/dist/cjs/core/interfaces.js +2 -0
  50. package/dist/cjs/core/interfaces.js.map +1 -0
  51. package/dist/cjs/core/resolve.js +511 -0
  52. package/dist/cjs/core/resolve.js.map +1 -0
  53. package/dist/cjs/{utils → core}/types.js.map +1 -1
  54. package/dist/cjs/core/{crud/update.js → update.js} +62 -52
  55. package/dist/cjs/core/update.js.map +1 -0
  56. package/dist/cjs/did-btcr2.js +109 -75
  57. package/dist/cjs/did-btcr2.js.map +1 -1
  58. package/dist/cjs/index.js +14 -15
  59. package/dist/cjs/index.js.map +1 -1
  60. package/dist/cjs/utils/appendix.js +10 -18
  61. package/dist/cjs/utils/appendix.js.map +1 -1
  62. package/dist/cjs/utils/did-document.js +51 -58
  63. package/dist/cjs/utils/did-document.js.map +1 -1
  64. package/dist/cjs/utils/general.js +1 -1
  65. package/dist/cjs/utils/general.js.map +1 -1
  66. package/dist/esm/core/beacon/aggregation/cohort/index.js +3 -3
  67. package/dist/esm/core/beacon/aggregation/cohort/index.js.map +1 -1
  68. package/dist/esm/core/beacon/aggregation/cohort/messages/base.js +1 -9
  69. package/dist/esm/core/beacon/aggregation/cohort/messages/base.js.map +1 -1
  70. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js +2 -1
  71. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js.map +1 -1
  72. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js +2 -1
  73. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js.map +1 -1
  74. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js +2 -1
  75. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js.map +1 -1
  76. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in.js +2 -1
  77. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in.js.map +1 -1
  78. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/subscribe.js +2 -1
  79. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/subscribe.js.map +1 -1
  80. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js +2 -1
  81. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js.map +1 -1
  82. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/authorization-request.js +2 -1
  83. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/authorization-request.js.map +1 -1
  84. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js +2 -1
  85. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js.map +1 -1
  86. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/request-signature.js +2 -1
  87. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/request-signature.js.map +1 -1
  88. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js +2 -1
  89. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js.map +1 -1
  90. package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js +36 -18
  91. package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js.map +1 -1
  92. package/dist/esm/core/beacon/aggregation/coordinator.js +14 -14
  93. package/dist/esm/core/beacon/aggregation/coordinator.js.map +1 -1
  94. package/dist/esm/core/beacon/aggregation/participant.js +4 -3
  95. package/dist/esm/core/beacon/aggregation/participant.js.map +1 -1
  96. package/dist/esm/core/beacon/aggregation/session/index.js +1 -1
  97. package/dist/esm/core/beacon/aggregation/session/index.js.map +1 -1
  98. package/dist/esm/core/beacon/cas-beacon.js +55 -0
  99. package/dist/esm/core/beacon/cas-beacon.js.map +1 -0
  100. package/dist/esm/core/beacon/factory.js +11 -10
  101. package/dist/esm/core/beacon/factory.js.map +1 -1
  102. package/dist/esm/core/beacon/interfaces.js +32 -0
  103. package/dist/esm/core/beacon/interfaces.js.map +1 -0
  104. package/dist/esm/core/beacon/singleton.js +59 -135
  105. package/dist/esm/core/beacon/singleton.js.map +1 -1
  106. package/dist/esm/core/beacon/smt-beacon.js +56 -0
  107. package/dist/esm/core/beacon/smt-beacon.js.map +1 -0
  108. package/dist/esm/core/beacon/utils.js +67 -105
  109. package/dist/esm/core/beacon/utils.js.map +1 -1
  110. package/dist/esm/core/identifier.js +18 -21
  111. package/dist/esm/core/identifier.js.map +1 -1
  112. package/dist/esm/core/interfaces.js +2 -0
  113. package/dist/esm/core/interfaces.js.map +1 -0
  114. package/dist/esm/core/resolve.js +511 -0
  115. package/dist/esm/core/resolve.js.map +1 -0
  116. package/dist/esm/{utils → core}/types.js.map +1 -1
  117. package/dist/esm/core/{crud/update.js → update.js} +62 -52
  118. package/dist/esm/core/update.js.map +1 -0
  119. package/dist/esm/did-btcr2.js +109 -75
  120. package/dist/esm/did-btcr2.js.map +1 -1
  121. package/dist/esm/index.js +14 -15
  122. package/dist/esm/index.js.map +1 -1
  123. package/dist/esm/utils/appendix.js +10 -18
  124. package/dist/esm/utils/appendix.js.map +1 -1
  125. package/dist/esm/utils/did-document.js +51 -58
  126. package/dist/esm/utils/did-document.js.map +1 -1
  127. package/dist/esm/utils/general.js +1 -1
  128. package/dist/esm/utils/general.js.map +1 -1
  129. package/dist/types/core/beacon/aggregation/cohort/index.d.ts +1 -1
  130. package/dist/types/core/beacon/aggregation/cohort/messages/base.d.ts +0 -7
  131. package/dist/types/core/beacon/aggregation/cohort/messages/base.d.ts.map +1 -1
  132. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts.map +1 -1
  133. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts.map +1 -1
  134. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.d.ts.map +1 -1
  135. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts.map +1 -1
  136. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts.map +1 -1
  137. package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts.map +1 -1
  138. package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts.map +1 -1
  139. package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts.map +1 -1
  140. package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts.map +1 -1
  141. package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts.map +1 -1
  142. package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts +13 -5
  143. package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts.map +1 -1
  144. package/dist/types/core/beacon/aggregation/coordinator.d.ts +17 -29
  145. package/dist/types/core/beacon/aggregation/coordinator.d.ts.map +1 -1
  146. package/dist/types/core/beacon/aggregation/participant.d.ts.map +1 -1
  147. package/dist/types/core/beacon/cas-beacon.d.ts +47 -0
  148. package/dist/types/core/beacon/cas-beacon.d.ts.map +1 -0
  149. package/dist/types/core/beacon/factory.d.ts +5 -4
  150. package/dist/types/core/beacon/factory.d.ts.map +1 -1
  151. package/dist/types/core/beacon/interfaces.d.ts +98 -0
  152. package/dist/types/core/beacon/interfaces.d.ts.map +1 -0
  153. package/dist/types/core/beacon/singleton.d.ts +22 -65
  154. package/dist/types/core/beacon/singleton.d.ts.map +1 -1
  155. package/dist/types/core/beacon/smt-beacon.d.ts +48 -0
  156. package/dist/types/core/beacon/smt-beacon.d.ts.map +1 -0
  157. package/dist/types/core/beacon/utils.d.ts +19 -97
  158. package/dist/types/core/beacon/utils.d.ts.map +1 -1
  159. package/dist/types/core/identifier.d.ts.map +1 -1
  160. package/dist/types/core/interfaces.d.ts +94 -0
  161. package/dist/types/core/interfaces.d.ts.map +1 -0
  162. package/dist/types/core/resolve.d.ts +105 -0
  163. package/dist/types/core/resolve.d.ts.map +1 -0
  164. package/dist/types/core/types.d.ts +71 -0
  165. package/dist/types/core/types.d.ts.map +1 -0
  166. package/dist/types/core/{crud/update.d.ts → update.d.ts} +21 -20
  167. package/dist/types/core/update.d.ts.map +1 -0
  168. package/dist/types/did-btcr2.d.ts +45 -57
  169. package/dist/types/did-btcr2.d.ts.map +1 -1
  170. package/dist/types/index.d.ts +14 -15
  171. package/dist/types/index.d.ts.map +1 -1
  172. package/dist/types/utils/appendix.d.ts +5 -10
  173. package/dist/types/utils/appendix.d.ts.map +1 -1
  174. package/dist/types/utils/did-document-builder.d.ts +1 -1
  175. package/dist/types/utils/did-document-builder.d.ts.map +1 -1
  176. package/dist/types/utils/did-document.d.ts +31 -29
  177. package/dist/types/utils/did-document.d.ts.map +1 -1
  178. package/package.json +5 -5
  179. package/src/core/beacon/aggregation/cohort/index.ts +3 -3
  180. package/src/core/beacon/aggregation/cohort/messages/base.ts +1 -12
  181. package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.ts +2 -2
  182. package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.ts +2 -2
  183. package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.ts +2 -2
  184. package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in.ts +2 -2
  185. package/src/core/beacon/aggregation/cohort/messages/keygen/subscribe.ts +2 -2
  186. package/src/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.ts +2 -2
  187. package/src/core/beacon/aggregation/cohort/messages/sign/authorization-request.ts +2 -2
  188. package/src/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.ts +2 -2
  189. package/src/core/beacon/aggregation/cohort/messages/sign/request-signature.ts +2 -2
  190. package/src/core/beacon/aggregation/cohort/messages/sign/signature-authorization.ts +2 -2
  191. package/src/core/beacon/aggregation/communication/adapter/nostr.ts +43 -21
  192. package/src/core/beacon/aggregation/coordinator.ts +41 -29
  193. package/src/core/beacon/aggregation/participant.ts +4 -3
  194. package/src/core/beacon/aggregation/session/index.ts +1 -1
  195. package/src/core/beacon/cas-beacon.ts +67 -0
  196. package/src/core/beacon/factory.ts +13 -15
  197. package/src/core/beacon/interfaces.ts +124 -0
  198. package/src/core/beacon/singleton.ts +75 -145
  199. package/src/core/beacon/smt-beacon.ts +70 -0
  200. package/src/core/beacon/utils.ts +80 -170
  201. package/src/core/identifier.ts +21 -24
  202. package/src/core/interfaces.ts +101 -0
  203. package/src/core/resolve.ts +707 -0
  204. package/src/core/types.ts +78 -0
  205. package/src/core/{crud/update.ts → update.ts} +75 -68
  206. package/src/did-btcr2.ts +152 -92
  207. package/src/index.ts +14 -24
  208. package/src/utils/appendix.ts +18 -22
  209. package/src/utils/did-document-builder.ts +1 -1
  210. package/src/utils/did-document.ts +67 -71
  211. package/src/utils/general.ts +1 -1
  212. package/dist/cjs/core/beacon/cid-aggregate.js +0 -116
  213. package/dist/cjs/core/beacon/cid-aggregate.js.map +0 -1
  214. package/dist/cjs/core/beacon/smt-aggregate.js +0 -126
  215. package/dist/cjs/core/beacon/smt-aggregate.js.map +0 -1
  216. package/dist/cjs/core/crud/deactivate.js +0 -14
  217. package/dist/cjs/core/crud/deactivate.js.map +0 -1
  218. package/dist/cjs/core/crud/read.js +0 -679
  219. package/dist/cjs/core/crud/read.js.map +0 -1
  220. package/dist/cjs/core/crud/update.js.map +0 -1
  221. package/dist/cjs/interfaces/beacon.js +0 -41
  222. package/dist/cjs/interfaces/beacon.js.map +0 -1
  223. package/dist/cjs/interfaces/crud.js +0 -2
  224. package/dist/cjs/interfaces/crud.js.map +0 -1
  225. package/dist/esm/core/beacon/cid-aggregate.js +0 -116
  226. package/dist/esm/core/beacon/cid-aggregate.js.map +0 -1
  227. package/dist/esm/core/beacon/smt-aggregate.js +0 -126
  228. package/dist/esm/core/beacon/smt-aggregate.js.map +0 -1
  229. package/dist/esm/core/crud/deactivate.js +0 -14
  230. package/dist/esm/core/crud/deactivate.js.map +0 -1
  231. package/dist/esm/core/crud/read.js +0 -679
  232. package/dist/esm/core/crud/read.js.map +0 -1
  233. package/dist/esm/core/crud/update.js.map +0 -1
  234. package/dist/esm/interfaces/beacon.js +0 -41
  235. package/dist/esm/interfaces/beacon.js.map +0 -1
  236. package/dist/esm/interfaces/crud.js +0 -2
  237. package/dist/esm/interfaces/crud.js.map +0 -1
  238. package/dist/types/core/beacon/cid-aggregate.d.ts +0 -102
  239. package/dist/types/core/beacon/cid-aggregate.d.ts.map +0 -1
  240. package/dist/types/core/beacon/smt-aggregate.d.ts +0 -111
  241. package/dist/types/core/beacon/smt-aggregate.d.ts.map +0 -1
  242. package/dist/types/core/crud/deactivate.d.ts +0 -13
  243. package/dist/types/core/crud/deactivate.d.ts.map +0 -1
  244. package/dist/types/core/crud/read.d.ts +0 -334
  245. package/dist/types/core/crud/read.d.ts.map +0 -1
  246. package/dist/types/core/crud/update.d.ts.map +0 -1
  247. package/dist/types/interfaces/beacon.d.ts +0 -116
  248. package/dist/types/interfaces/beacon.d.ts.map +0 -1
  249. package/dist/types/interfaces/crud.d.ts +0 -32
  250. package/dist/types/interfaces/crud.d.ts.map +0 -1
  251. package/dist/types/utils/types.d.ts +0 -38
  252. package/dist/types/utils/types.d.ts.map +0 -1
  253. package/src/canonicalize.d.ts +0 -6
  254. package/src/core/beacon/cid-aggregate.ts +0 -153
  255. package/src/core/beacon/smt-aggregate.ts +0 -135
  256. package/src/core/crud/deactivate.ts +0 -13
  257. package/src/core/crud/read.ts +0 -948
  258. package/src/interfaces/beacon.ts +0 -137
  259. package/src/interfaces/crud.ts +0 -33
  260. package/src/utils/types.ts +0 -41
  261. /package/dist/cjs/{utils → core}/types.js +0 -0
  262. /package/dist/esm/{utils → core}/types.js +0 -0
package/src/did-btcr2.ts CHANGED
@@ -1,48 +1,61 @@
1
+ import { BitcoinNetworkConnection } from '@did-btcr2/bitcoin';
1
2
  import {
3
+ Canonicalization,
2
4
  DocumentBytes,
5
+ IdentifierHrp,
3
6
  INVALID_DID_DOCUMENT,
4
7
  KeyBytes,
5
8
  METHOD_NOT_SUPPORTED,
6
9
  MethodError,
10
+ MISSING_UPDATE_DATA,
7
11
  PatchOperation,
8
- W3C_DID_RESOLUTION_V1,
12
+ ResolveError
9
13
  } from '@did-btcr2/common';
10
- import type { DidResolutionResult } from '@web5/dids';
11
14
  import {
12
15
  Did,
13
16
  DidError,
14
17
  DidErrorCode,
15
18
  DidMethod,
19
+ DidResolutionResult,
16
20
  EMPTY_DID_RESOLUTION_RESULT
17
21
  } from '@web5/dids';
18
22
  import { initEccLib } from 'bitcoinjs-lib';
19
23
  import * as tinysecp from 'tiny-secp256k1';
20
- import { Resolve } from './core/crud/read.js';
21
- import { Update } from './core/crud/update.js';
22
- import { DidResolutionOptions } from './interfaces/crud.js';
23
- import { DidDocument, DidVerificationMethod } from './utils/did-document.js';
24
- import { SignalsMetadata } from './utils/types.js';
24
+ import { BeaconUtils } from './core/beacon/utils.js';
25
25
  import { Identifier } from './core/identifier.js';
26
+ import { ResolutionOptions } from './core/interfaces.js';
27
+ import { Resolve } from './core/resolve.js';
28
+ import { SidecarData } from './core/types.js';
29
+ import { Update } from './core/update.js';
26
30
  import { Appendix } from './utils/appendix.js';
31
+ import { DidDocument, DidVerificationMethod } from './utils/did-document.js';
32
+
33
+ // TODO: convert to API driver
34
+ export const canonicalization = new Canonicalization();
27
35
 
28
36
  export type Btcr2Identifier = string;
29
37
 
30
38
  export interface DidCreateOptions {
39
+ /** Type of identifier to create (key or external) */
40
+ idType: 'KEY' | 'EXTERNAL';
31
41
  /** DID BTCR2 Version Number */
32
42
  version?: number;
33
43
  /** Bitcoin Network */
34
44
  network?: string;
35
45
  }
36
46
 
47
+ // TODO: convert to API driver
37
48
  /** Initialize tiny secp256k1 */
38
49
  initEccLib(tinysecp);
39
50
 
40
51
  /**
41
52
  * Implements {@link https://dcdpr.github.io/did-btcr2 | did:btcr2 DID Method Specification}.
42
- * did:btcr2 is a censorship resistant DID Method using the Bitcoin blockchain as a Verifiable Data Registry to announce
43
- * changes to the DID document. It improves on prior work by allowing: zero-cost off-chain DID creation; aggregated
44
- * updates for scalable on-chain update costs; long-term identifiers that can support frequent updates; private
45
- * communication of the DID document; private DID resolution; and non-repudiation appropriate for serious contracts.
53
+ * did:btcr2 is a censorship-resistant Decentralized Identifier (DID) method using
54
+ * the Bitcoin blockchain as a Verifiable Data Registry to announce changes to the
55
+ * DID document. It supports zero-cost off-chain DID creation; aggregated updates
56
+ * for scalable on-chain update costs; long-term identifiers that can support
57
+ * frequent updates; private communication of the DID document; private DID resolution;
58
+ * and non-repudiation.
46
59
  *
47
60
  * @class DidBtcr2
48
61
  * @type {DidBtcr2}
@@ -50,105 +63,157 @@ initEccLib(tinysecp);
50
63
  */
51
64
  export class DidBtcr2 implements DidMethod {
52
65
  /** @type {string} Name of the DID method, as defined in the DID BTCR2 specification */
53
- public static methodName: string = 'btcr2';
66
+ static methodName: string = 'btcr2';
54
67
 
55
68
  /**
56
- * Entry point for section {@link https://dcdpr.github.io/did-btcr2/#create | 4.1 Create}.
57
- * See {@link Create} for implementation details.
58
- *
59
- * A did:btcr2 identifier and associated DID document can either be created deterministically from a cryptographic
60
- * seed, or it can be created from an arbitrary genesis intermediate DID document representation. In both cases,
61
- * DID creation can be undertaken in an offline manner, i.e., the DID controller does not need to interact with the
62
- * Bitcoin network to create their DID.
63
- * @param {CreateParams} params See {@link CreateParams} for details.
64
- * @param {IdType} params.idType Type of identifier to create (key or external).
65
- * @param {KeyBytes} params.pubKeyBytes Public key byte array used to create a btcr2 "key" identifier.
66
- * @param {IntermediateDocument} params.intermediateDocument DID Document used to create a btcr2 "external" identifier.
67
- * @param {DidCreateOptions} params.options See {@link DidCreateOptions} for create options.
68
- * @param {number} params.options.version Version number of the btcr2 method.
69
- * @param {string} params.options.network Bitcoin network name (mainnet, testnet, signet, regtest).
70
- * @returns {Promise<CreateResponse>} Promise resolving to a CreateResponse object.
71
- * @throws {DidBtcr2Error} if any of the checks fail
69
+ * Implements section {@link https://dcdpr.github.io/did-btcr2/operations/create.html | 7.1 Create}.
70
+ * @param {KeyBytes | DocumentBytes} genesisBytes The bytes used to create the genesis document for a did:btcr2 identifier.
71
+ * 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.
72
+ * @param {DidCreateOptions} options Options for creating the identifier, including the idType (key or external), version, and network.
73
+ * @param {string} options.idType The type of identifier to create, either 'KEY' or 'EXTERNAL'. Defaults to 'KEY'.
74
+ * @param {number} options.version The version number of the did:btcr2 specification to use for creating the identifier. Defaults to 1.
75
+ * @param {string} options.network The Bitcoin network to use for the identifier, e.g. 'bitcoin', 'testnet', etc. Defaults to 'bitcoin'.
76
+ * @returns {Promise<Btcr2Identifier>} Promise resolving to a Btcr2Identifier string.
77
+ * @throws {MethodError} if any of the checks fail
72
78
  */
73
- public static async create(params: {
74
- idType: 'KEY' | 'EXTERNAL';
75
- genesisBytes: KeyBytes | DocumentBytes;
76
- options?: DidCreateOptions;
77
- }): Promise<Btcr2Identifier> {
78
- // Deconstruct the idType and options from the params
79
- const { idType, options = {} } = params;
79
+ static async create(
80
+ genesisBytes: KeyBytes | DocumentBytes,
81
+ options?: DidCreateOptions
82
+ ): Promise<Btcr2Identifier> {
83
+ // Deconstruct the idType, version and network from the options, setting defaults if not given
84
+ const { idType, version = 1, network = 'bitcoin' } = options || {};
80
85
 
81
- // Deconstruct the version and network from the options, setting defaults if not given
82
- const { version = 1, network = 'bitcoin' } = options;
83
-
84
- // Set the genesisBytes from the params
85
- const genesisBytes = params.genesisBytes;
86
+ if(!idType) {
87
+ throw new MethodError(
88
+ 'idType is required for creating a did:btcr2 identifier',
89
+ INVALID_DID_DOCUMENT, options
90
+ );
91
+ }
86
92
 
93
+ // Call identifier encoding algorithm
87
94
  return Identifier.encode({ idType, genesisBytes, version, network });
88
95
  }
89
96
 
90
97
  /**
91
- * Entry point for section {@link https://dcdpr.github.io/did-btcr2/#read | 7.2 Read}.
92
- * See {@link Resolve} for implementation details.
98
+ * Entry point for section {@link https://dcdpr.github.io/did-btcr2/#read | 7.2 Resolve}.
99
+ * See specification for the {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#process | Resolve Process}.
100
+ * See {@link Resolve | Resolve (class)} for class implementation.
93
101
  *
94
- * The Read operation is an algorithm consisting of a series of subroutine algorithms executed by a resolver after a
95
- * resolution request identifying a specific did:btcr2 identifier is received from a client at Resolution Time. The
96
- * request MUST always contain the resolutionOptions object containing additional information to be used in resolution.
97
- * This object MAY be empty. See the DID Resolution specification for further details about the DID Resolution Options
98
- * object. The resolver then attempts to resolve the DID document of the identifier at a specific Target Time. The
99
- * Target Time is either provided in resolutionOptions or is set to the Resolution Time of the request.
102
+ * Resolving a did:btcr2 identifier iteratively builds a DID document by applying
103
+ * BTCR2 Updates to an Initial DID Document that have been committed to the Bitcoin
104
+ * blockchain by Authorized Beacon Signals. The Initial DID Document is either
105
+ * deterministically created from the DID or provided by Sidecar Data.
100
106
  *
101
- * @param {string} identifier a valid did:btcr2 identifier to be resolved
102
- * @param {DidResolutionOptions} [resolutionsOptions] see {@link https://www.w3.org/TR/did-1.0/#did-resolution-options | DidResolutionOptions}
103
- * @param {number} options.versionId the version of the identifier and/or DID document
104
- * @param {number} options.versionTime a timestamp used during resolution as a bound for when to stop resolving
105
- * @param {DidDocument} options.sidecarData data necessary for resolving a DID
106
- * @param {string} options.network Bitcoin network name (mainnet, testnet, signet, regtest).
107
- * @returns {DidResolutionResult} Promise resolving to a DID Resolution Result containing the `targetDocument`
107
+ * @param {string} did a valid did:btcr2 identifier to be resolved
108
+ * @param {ResolutionOptions} resolutionOptions see {@link https://www.w3.org/TR/did-1.0/#did-resolution-options | ResolutionOptions}
109
+ * @param {number} resolutionOptions.versionId optional version of the identifier and/or DID document
110
+ * @param {number} resolutionOptions.versionTime optional timestamp used during resolution as a bound for when to stop resolving
111
+ * @param {DidDocument} resolutionOptions.sidecar optional data necessary for resolving a DID
112
+ * @returns {Promise<DidResolutionResult>} Promise resolving to a DID Resolution Result containing the `targetDocument`
108
113
  * @throws {Error} if the resolution fails for any reason
109
114
  * @throws {DidError} InvalidDid if the identifier is invalid
110
115
  * @example
111
116
  * ```ts
112
- * const resolution = await DidBtcr2.resolve('did:btcr2:k1q0dygyp3gz969tp46dychzy4q78c2k3js68kvyr0shanzg67jnuez2cfplh')
117
+ * const resolution = await DidBtcr2.resolve(
118
+ * 'did:btcr2:k1q0dygyp3gz969tp46dychzy4q78c2k3js68kvyr0shanzg67jnuez2cfplh'
119
+ * )
113
120
  * ```
114
121
  */
115
- public static async resolve(identifier: string, resolutionsOptions: DidResolutionOptions = {}): Promise<DidResolutionResult> {
122
+ static async resolve(did: string, resolutionOptions: ResolutionOptions = {drivers: {}}): Promise<DidResolutionResult> {
116
123
  try {
117
- // 1. Pass identifier to the did:btcr2 Identifier Decoding algorithm, retrieving idType, version, network, and genesisBytes.
118
- // 2. Set identifierComponents to a map of idType, version, network, and genesisBytes.
119
- const identifierComponents = Identifier.decode(identifier);
120
124
 
121
- // Set the network based on the decoded identifier
122
- resolutionsOptions.network ??= identifierComponents.network;
123
-
124
- // 3. Set initialDocument to the result of running the algorithm in Resolve Initial Document passing in the
125
- // identifier, identifierComponents and resolutionOptions.
126
- const initialDocument = await Resolve.initialDocument({ identifier, identifierComponents, resolutionsOptions });
127
-
128
- // 4. Set targetDocument to the result of running the algorithm in Resolve Target Document passing in
129
- // initialDocument and resolutionOptions.
130
- const targetDocument = await Resolve.targetDocument({ initialDocument, resolutionsOptions });
131
-
132
- // 5. Return targetDocument.
125
+ // Initialize an empty DID Resolution Result
133
126
  const didResolutionResult: DidResolutionResult = {
134
- '@context' : W3C_DID_RESOLUTION_V1,
127
+ '@context' : 'https://w3id.org/did-resolution/v1',
135
128
  didResolutionMetadata : { contentType: 'application/ld+json' },
136
- didDocumentMetadata : { created: new Date().getUTCDateTime() },
137
- didDocument : targetDocument,
129
+ didDocumentMetadata : {
130
+ deactivated : false,
131
+ updated : undefined,
132
+ versionId : resolutionOptions.versionId,
133
+ confirmations : undefined,
134
+ },
135
+ didDocument : null,
138
136
  };
139
137
 
138
+ // Decode the did to be resolved
139
+ const didComponents = Identifier.decode(did);
140
+
141
+ // Process sidecar if provided
142
+ const sidecarData = Resolve.processSidecarData(resolutionOptions.sidecar);
143
+
144
+ // Establish a connection to a bitcoin network
145
+ if(!resolutionOptions.drivers.bitcoin) {
146
+ resolutionOptions.drivers.bitcoin = new BitcoinNetworkConnection();
147
+ // Set the network based on the decoded identifier
148
+ resolutionOptions.drivers.bitcoin.setActiveNetwork(didComponents.network);
149
+ }
150
+
151
+ // Parse the genesis document from the resolution options if provided
152
+ const genesisDocument = resolutionOptions.sidecar?.genesisDocument;
153
+ // Since genesisDocument is optional, check if it exists
154
+ if(!genesisDocument) {
155
+ // If no genesisDocument and x HRP, throw MISSING_UPDATE_DATA error
156
+ if(didComponents.hrp === IdentifierHrp.x)
157
+ throw new ResolveError(
158
+ 'External resolution requires genesisDocument',
159
+ MISSING_UPDATE_DATA, { resolutionOptions }
160
+ );
161
+ }
162
+
163
+ // Establish the current document
164
+ const currentDocument = await Resolve.establishCurrentDocument(didComponents, genesisDocument);
165
+
166
+ // Extract all Beacon services from the current DID Document
167
+ const beaconServices = currentDocument.service
168
+ .filter(BeaconUtils.isBeaconService)
169
+ .map(BeaconUtils.parseBeaconServiceEndpoint);
170
+
171
+ // Process the Beacon Signals to get the required updates
172
+ const unsortedUpdates = await Resolve.processBeaconSignals(
173
+ beaconServices,
174
+ sidecarData,
175
+ resolutionOptions.drivers.bitcoin,
176
+ resolutionOptions.fullBlockchainTraversal
177
+ );
178
+
179
+ // If no updates found, return the current document
180
+ if(!unsortedUpdates.length) {
181
+ // Set the current document in the didResolutionResult
182
+ didResolutionResult.didDocument = currentDocument;
183
+
184
+ // Set the deactivated status in the didDocumentMetadata
185
+ didResolutionResult.didDocumentMetadata.deactivated = !!currentDocument.deactivated;
186
+
187
+ // Return the didResolutionResult early
188
+ return didResolutionResult;
189
+ }
190
+
191
+ // Process the updates to apply updates to bring the current DID Document to its more current state
192
+ const result = await Resolve.processUpdatesArray(
193
+ currentDocument,
194
+ unsortedUpdates,
195
+ resolutionOptions.versionTime,
196
+ resolutionOptions.versionId
197
+ );
198
+
199
+ // Set all of the required fields in the didResolutionResult
200
+ didResolutionResult.didDocument = result.currentDocument;
201
+ didResolutionResult.didDocumentMetadata.confirmations = result.confirmations;
202
+ didResolutionResult.didDocumentMetadata.versionId = result.versionId;
203
+ didResolutionResult.didDocumentMetadata.deactivated = !!result.currentDocument.deactivated;
204
+
140
205
  // Return didResolutionResult;
141
206
  return didResolutionResult;
142
207
  } catch (error: any) {
143
208
  console.error(error);
144
- // Rethrow any unexpected errors that are not a `DidError`.
145
- if (!(error instanceof DidError)) throw new Error(error);
209
+ // Rethrow any unexpected errors that are not a `ResolveError`.
210
+ if (!(error instanceof ResolveError)) throw new Error(error);
146
211
 
147
212
  // Return a DID Resolution Result with the appropriate error code.
148
213
  return {
149
214
  ...EMPTY_DID_RESOLUTION_RESULT,
150
215
  didResolutionMetadata : {
151
- error : error.code,
216
+ error : error.type,
152
217
  ...error.message && { errorMessage: error.message }
153
218
  }
154
219
  };
@@ -170,7 +235,7 @@ export class DidBtcr2 implements DidMethod {
170
235
  * The result of these transformations MUST produce a DID document conformant to the DID Core specification. The
171
236
  * verificationMethodId is an identifier for a verificationMethod within the sourceDocument. The verificationMethod
172
237
  * identified MUST be a BIP340 Multikey. The beaconIds MUST identify service endpoints with one of the three Beacon
173
- * Types SingletonBeacon, CIDAggregateBeacon, and SMTAggregateBeacon.
238
+ * Types SingletonBeacon, CASBeacon, and SMTBeacon.
174
239
  *
175
240
  * @param {UpdateParams} params Required parameters for the update operation.
176
241
  * @param {string} params.identifier The btcr2 identifier to be updated.
@@ -189,7 +254,7 @@ export class DidBtcr2 implements DidMethod {
189
254
  patch: PatchOperation[];
190
255
  verificationMethodId: string;
191
256
  beaconIds: string[];
192
- }): Promise<SignalsMetadata> {
257
+ }): Promise<SidecarData> {
193
258
  // Deconstruct the params
194
259
  const {
195
260
  identifier,
@@ -203,7 +268,7 @@ export class DidBtcr2 implements DidMethod {
203
268
  // 1. Set unsignedUpdate to the result of passing Identifier, sourceDocument,
204
269
  // sourceVersionId, and documentPatch into the Construct DID Update
205
270
  // Payload algorithm.
206
- const didUpdatePayload = await Update.construct({
271
+ const unsignedUpdate = await Update.construct({
207
272
  identifier,
208
273
  sourceDocument,
209
274
  sourceVersionId,
@@ -212,7 +277,7 @@ export class DidBtcr2 implements DidMethod {
212
277
 
213
278
  // 2. Set verificationMethod to the result of retrieving the verificationMethod
214
279
  // from sourceDocument using the verificationMethodId.
215
- const verificationMethod = this.getSigningMethod({ didDocument: sourceDocument, methodId, });
280
+ const verificationMethod = this.getSigningMethod(sourceDocument, methodId);
216
281
 
217
282
  // Validate the verificationMethod exists in the sourceDocument
218
283
  if (!verificationMethod) {
@@ -233,11 +298,11 @@ export class DidBtcr2 implements DidMethod {
233
298
 
234
299
  // 4. Set didUpdateInvocation to the result of passing Identifier, unsignedUpdate as didUpdatePayload, and
235
300
  // verificationMethod to the Invoke DID Update Payload algorithm.
236
- const didUpdateInvocation = await Update.invoke({ identifier, verificationMethod, didUpdatePayload, });
301
+ const signedUpdate = await Update.invoke({ identifier, verificationMethod, unsignedUpdate });
237
302
 
238
303
  // 5. Set signalsMetadata to the result of passing Identifier, sourceDocument, beaconIds and didUpdateInvocation
239
304
  // to the Announce DID Update algorithm.
240
- const signalsMetadata = await Update.announce({ sourceDocument, beaconIds, didUpdateInvocation, });
305
+ const signalsMetadata = await Update.announce({ sourceDocument, beaconIds, signedUpdate });
241
306
 
242
307
  // 6. Return signalsMetadata. It is up to implementations to ensure that the signalsMetadata is persisted.
243
308
  return signalsMetadata;
@@ -249,17 +314,12 @@ export class DidBtcr2 implements DidMethod {
249
314
  * for signing messages and credentials. If given, the `methodId` parameter is used to select the
250
315
  * verification method. If not given, the Identity Key's verification method with an ID fragment
251
316
  * of '#initialKey' is used.
252
- *
253
- * @param {{ didDocument: DidDocument; methodId?: string; }} params Parameters for the `getSigningMethod` method.
254
- * @param {DidDocument} params.didDocument DID Document to get the verification method from.
255
- * @param {string} params.methodId Optional ID of the verification method to use for signing.
317
+ * @param {DidDocument} didDocument The DID Document of the `did:btcr2` identifier.
318
+ * @param {string} [methodId] Optional verification method ID to be used for signing.
256
319
  * @returns {DidVerificationMethod} Promise resolving to the {@link DidVerificationMethod} object used for signing.
257
320
  * @throws {DidError} if the parsed did method does not match `btcr2` or signing method could not be determined.
258
321
  */
259
- public static getSigningMethod({ didDocument, methodId }: {
260
- didDocument: DidDocument;
261
- methodId?: string;
262
- }): DidVerificationMethod {
322
+ public static getSigningMethod(didDocument: DidDocument, methodId?: string): DidVerificationMethod {
263
323
  // Set the default methodId to the first assertionMethod if not given
264
324
  methodId ??= '#initialKey';
265
325
 
package/src/index.ts CHANGED
@@ -1,54 +1,44 @@
1
+ export * from './core/beacon/aggregation/cohort/index.js';
2
+ export * from './core/beacon/aggregation/cohort/messages/base.js';
3
+ export * from './core/beacon/aggregation/cohort/messages/constants.js';
4
+ export * from './core/beacon/aggregation/cohort/messages/index.js';
5
+ export * from './core/beacon/aggregation/cohort/messages/keygen//subscribe.js';
1
6
  export * from './core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js';
2
7
  export * from './core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js';
3
8
  export * from './core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js';
4
9
  export * from './core/beacon/aggregation/cohort/messages/keygen/opt-in.js';
5
- export * from './core/beacon/aggregation/cohort/messages/keygen//subscribe.js';
6
-
7
10
  export * from './core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js';
8
11
  export * from './core/beacon/aggregation/cohort/messages/sign/authorization-request.js';
9
12
  export * from './core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js';
10
13
  export * from './core/beacon/aggregation/cohort/messages/sign/request-signature.js';
11
14
  export * from './core/beacon/aggregation/cohort/messages/sign/signature-authorization.js';
12
-
13
- export * from './core/beacon/aggregation/cohort/messages/base.js';
14
- export * from './core/beacon/aggregation/cohort/messages/constants.js';
15
- export * from './core/beacon/aggregation/cohort/messages/index.js';
16
-
17
- export * from './core/beacon/aggregation/cohort/index.js';
18
15
  export * from './core/beacon/aggregation/cohort/status.js';
19
-
20
16
  export * from './core/beacon/aggregation/communication/adapter/did-comm.js';
21
17
  export * from './core/beacon/aggregation/communication/adapter/nostr.js';
22
18
  export * from './core/beacon/aggregation/communication/error.js';
23
19
  export * from './core/beacon/aggregation/communication/factory.js';
24
20
  export * from './core/beacon/aggregation/communication/service.js';
25
-
26
- export * from './core/beacon/aggregation/session/index.js';
27
- export * from './core/beacon/aggregation/session/status.js';
28
-
29
21
  export * from './core/beacon/aggregation/coordinator.js';
30
22
  export * from './core/beacon/aggregation/participant.js';
31
-
32
- 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/cas-beacon.js';
33
26
  export * from './core/beacon/error.js';
34
27
  export * from './core/beacon/factory.js';
28
+ export * from './core/beacon/interfaces.js';
35
29
  export * from './core/beacon/singleton.js';
36
- export * from './core/beacon/smt-aggregate.js';
30
+ export * from './core/beacon/smt-beacon.js';
37
31
  export * from './core/beacon/utils.js';
38
32
 
39
- export * from './core/crud/deactivate.js';
40
- export * from './core/crud/read.js';
41
- export * from './core/crud/update.js';
42
-
43
33
  export * from './core/identifier.js';
44
-
45
- export * from './interfaces/beacon.js';
46
- export * from './interfaces/crud.js';
34
+ export * from './core/interfaces.js';
35
+ export * from './core/resolve.js';
36
+ export * from './core/types.js';
37
+ export * from './core/update.js';
47
38
 
48
39
  export * from './utils/appendix.js';
49
40
  export * from './utils/did-document-builder.js';
50
41
  export * from './utils/did-document.js';
51
42
  export * from './utils/general.js';
52
- export * from './utils/types.js';
53
43
 
54
44
  export * from './did-btcr2.js';
@@ -11,7 +11,7 @@ import {
11
11
  import { createHelia } from 'helia';
12
12
  import { CID } from 'multiformats';
13
13
  import { create as createDigest } from 'multiformats/hashes/digest';
14
- import { RootCapability } from '../interfaces/crud.js';
14
+ import { RootCapability } from '../core/interfaces.js';
15
15
 
16
16
  /**
17
17
  * Implements {@link https://dcdpr.github.io/did-btcr2/#appendix | 9. Appendix} methods.
@@ -173,7 +173,7 @@ export class Appendix {
173
173
  * }
174
174
  * }
175
175
  */
176
- public static derefernceRootCapabilityIdentifier(capabilityId: string): RootCapability {
176
+ public static dereferenceZcapId(capabilityId: string): RootCapability {
177
177
  // 1. Set rootCapability to an empty object.
178
178
  const rootCapability = {} as RootCapability;
179
179
 
@@ -221,28 +221,24 @@ export class Appendix {
221
221
  }
222
222
 
223
223
  /**
224
- * Implements {@link https://dcdpr.github.io/did-btcr2/#fetch-content-from-addressable-storage | 9.3. Fetch Content from Addressable Storage}.
225
- *
226
- * The Fetch Content from Addressable Storage function takes in SHA256 hash of some content, hashBytes, converts these
227
- * bytes to a IPFS v1 Content Identifier and attempts to retrieve the identified content from Content Addressable
228
- * Storage (CAS). It returns the retrieved content or null.
229
- *
230
- * @param {HashBytes} hashBytes The SHA256 hash of the content to be fetched.
231
- * @returns {string} The fetched content or null if not found.
224
+ * Implements CAS Lookup Step from {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#process-beacon-signals | 7.2.e Process Beacon Signals }.
225
+ * @param {HashBytes} hashBytes The hash bytes to look up in the CAS system.
226
+ * @returns {Promise<string | undefined>} The content fetched from the CAS system, or undefined if not found.
232
227
  */
233
- public static async fetchFromCas(hashBytes: HashBytes): Promise<string | undefined> {
234
- // 1. Set cid to the result of converting hashBytes to an IPFS v1 CID.
228
+ static async fetchFromCas(hashBytes: HashBytes): Promise<string | undefined> {
229
+ // Construct CID from hash bytes
235
230
  const cid = CID.create(1, 1, createDigest(1, hashBytes));
236
231
 
237
- // Create a Helia node connection to IPFS
238
- const helia = strings(await createHelia());
232
+ // Connect to IPFS/Helia node
233
+ const helia = await createHelia();
234
+ const node = strings(helia);
239
235
 
240
- // 2. Set content to the result of fetching the cid from a CAS system. Which CAS systems checked is up to implementation.
241
- // TODO: Is this right? Are implementations just supposed to check all CAS they trust?'
242
- const content = await helia.get(cid, {});
243
-
244
- // 3. If content for cid cannot be found, set content to null.
245
- // 4. Return content.
246
- return content;
236
+ // Return the IPFS get result
237
+ return await node.get(cid, {});
247
238
  }
248
- }
239
+ }
240
+
241
+
242
+
243
+
244
+
@@ -1,5 +1,5 @@
1
1
  import { DidDocumentError, INVALID_DID_DOCUMENT } from '@did-btcr2/common';
2
- import { BeaconService } from '../interfaces/beacon.js';
2
+ import { BeaconService } from '../core/beacon/interfaces.js';
3
3
  import { DidDocument, DidVerificationMethod } from './did-document.js';
4
4
 
5
5
  export class DidDocumentBuilder {