@did-btcr2/method 0.24.1 → 0.25.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 (72) hide show
  1. package/dist/browser.js +697 -554
  2. package/dist/browser.mjs +697 -554
  3. package/dist/cjs/core/beacon/beacon.js.map +1 -1
  4. package/dist/cjs/core/beacon/cas-beacon.js +119 -7
  5. package/dist/cjs/core/beacon/cas-beacon.js.map +1 -1
  6. package/dist/cjs/core/beacon/factory.js +1 -1
  7. package/dist/cjs/core/beacon/factory.js.map +1 -1
  8. package/dist/cjs/core/beacon/{singleton.js → singleton-beacon.js} +18 -26
  9. package/dist/cjs/core/beacon/singleton-beacon.js.map +1 -0
  10. package/dist/cjs/core/beacon/smt-beacon.js +1 -1
  11. package/dist/cjs/core/beacon/smt-beacon.js.map +1 -1
  12. package/dist/{esm/core/resolve.js → cjs/core/resolver.js} +241 -93
  13. package/dist/cjs/core/resolver.js.map +1 -0
  14. package/dist/cjs/core/update.js +5 -5
  15. package/dist/cjs/core/update.js.map +1 -1
  16. package/dist/cjs/did-btcr2.js +34 -92
  17. package/dist/cjs/did-btcr2.js.map +1 -1
  18. package/dist/cjs/index.js +2 -2
  19. package/dist/cjs/index.js.map +1 -1
  20. package/dist/esm/core/beacon/beacon.js.map +1 -1
  21. package/dist/esm/core/beacon/cas-beacon.js +119 -7
  22. package/dist/esm/core/beacon/cas-beacon.js.map +1 -1
  23. package/dist/esm/core/beacon/factory.js +1 -1
  24. package/dist/esm/core/beacon/factory.js.map +1 -1
  25. package/dist/esm/core/beacon/{singleton.js → singleton-beacon.js} +18 -26
  26. package/dist/esm/core/beacon/singleton-beacon.js.map +1 -0
  27. package/dist/esm/core/beacon/smt-beacon.js +1 -1
  28. package/dist/esm/core/beacon/smt-beacon.js.map +1 -1
  29. package/dist/{cjs/core/resolve.js → esm/core/resolver.js} +241 -93
  30. package/dist/esm/core/resolver.js.map +1 -0
  31. package/dist/esm/core/update.js +5 -5
  32. package/dist/esm/core/update.js.map +1 -1
  33. package/dist/esm/did-btcr2.js +34 -92
  34. package/dist/esm/did-btcr2.js.map +1 -1
  35. package/dist/esm/index.js +2 -2
  36. package/dist/esm/index.js.map +1 -1
  37. package/dist/types/core/beacon/beacon.d.ts +9 -4
  38. package/dist/types/core/beacon/beacon.d.ts.map +1 -1
  39. package/dist/types/core/beacon/cas-beacon.d.ts +26 -7
  40. package/dist/types/core/beacon/cas-beacon.d.ts.map +1 -1
  41. package/dist/types/core/beacon/{singleton.d.ts → singleton-beacon.d.ts} +7 -5
  42. package/dist/types/core/beacon/singleton-beacon.d.ts.map +1 -0
  43. package/dist/types/core/beacon/smt-beacon.d.ts +4 -3
  44. package/dist/types/core/beacon/smt-beacon.d.ts.map +1 -1
  45. package/dist/types/core/interfaces.d.ts +5 -15
  46. package/dist/types/core/interfaces.d.ts.map +1 -1
  47. package/dist/types/core/resolver.d.ts +167 -0
  48. package/dist/types/core/resolver.d.ts.map +1 -0
  49. package/dist/types/core/update.d.ts +3 -3
  50. package/dist/types/core/update.d.ts.map +1 -1
  51. package/dist/types/did-btcr2.d.ts +16 -16
  52. package/dist/types/did-btcr2.d.ts.map +1 -1
  53. package/dist/types/index.d.ts +2 -2
  54. package/dist/types/index.d.ts.map +1 -1
  55. package/package.json +4 -4
  56. package/src/core/beacon/beacon.ts +9 -5
  57. package/src/core/beacon/cas-beacon.ts +156 -10
  58. package/src/core/beacon/factory.ts +1 -1
  59. package/src/core/beacon/{singleton.ts → singleton-beacon.ts} +19 -35
  60. package/src/core/beacon/smt-beacon.ts +4 -3
  61. package/src/core/interfaces.ts +5 -16
  62. package/src/core/{resolve.ts → resolver.ts} +355 -130
  63. package/src/core/update.ts +7 -7
  64. package/src/did-btcr2.ts +37 -128
  65. package/src/index.ts +2 -2
  66. package/dist/cjs/core/beacon/singleton.js.map +0 -1
  67. package/dist/cjs/core/resolve.js.map +0 -1
  68. package/dist/esm/core/beacon/singleton.js.map +0 -1
  69. package/dist/esm/core/resolve.js.map +0 -1
  70. package/dist/types/core/beacon/singleton.d.ts.map +0 -1
  71. package/dist/types/core/resolve.d.ts +0 -93
  72. package/dist/types/core/resolve.d.ts.map +0 -1
@@ -23,10 +23,10 @@ export declare class Update {
23
23
  * @param {Btcr2DidDocument} sourceDocument The source DID document to be updated.
24
24
  * @param {PatchOperation[]} patches The array of JSON Patch operations to apply to the sourceDocument.
25
25
  * @param {number} sourceVersionId The version ID of the source document.
26
- * @returns {Promise<SignedBTCR2Update>} The constructed SignedBTCR2Update object.
26
+ * @returns {UnsignedBTCR2Update} The constructed UnsignedBTCR2Update object.
27
27
  * @throws {UpdateError} InvalidDid if sourceDocument.id does not match identifier.
28
28
  */
29
- static construct(sourceDocument: Btcr2DidDocument, patches: PatchOperation[], sourceVersionId: number): Promise<UnsignedBTCR2Update>;
29
+ static construct(sourceDocument: Btcr2DidDocument, patches: PatchOperation[], sourceVersionId: number): UnsignedBTCR2Update;
30
30
  /**
31
31
  * Implements subsection {@link http://dcdpr.github.io/did-btcr2/operations/update.html#construct-btcr2-signed-update | 7.3.c Construct BTCR2 Signed Update }.
32
32
  * This process constructs a BTCR2 Signed Update from a BTCR2 Unsigned Update.
@@ -37,7 +37,7 @@ export declare class Update {
37
37
  * @returns {SignedBTCR2Update} Did update payload secured with a proof => SignedBTCR2Update
38
38
  * @throws {UpdateError} if the privateKeyBytes are invalid
39
39
  */
40
- static sign(did: string, unsignedUpdate: UnsignedBTCR2Update, verificationMethod: DidVerificationMethod, secretKey: KeyBytes): Promise<SignedBTCR2Update>;
40
+ static sign(did: string, unsignedUpdate: UnsignedBTCR2Update, verificationMethod: DidVerificationMethod, secretKey: KeyBytes): SignedBTCR2Update;
41
41
  /**
42
42
  * Implements subsection {@link https://dcdpr.github.io/did-btcr2/operations/update.html#announce-did-update | 7.3.d Announce DID Update}.
43
43
  * BTCR2 Signed Updates are announced to the Bitcoin blockchain depending on the Beacon Type.
@@ -1 +1 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/core/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,QAAQ,EACR,cAAc,EAEf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAGL,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAe,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEhG,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,qBAAa,MAAM;IACjB;;;;;;;;;OASG;WACU,SAAS,CACpB,cAAc,EAAE,gBAAgB,EAChC,OAAO,EAAE,cAAc,EAAE,EACzB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,mBAAmB,CAAC;IAoC/B;;;;;;;;;OASG;WACU,IAAI,CACf,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,mBAAmB,EACnC,kBAAkB,EAAE,qBAAqB,EACzC,SAAS,EAAE,QAAQ,GAClB,OAAO,CAAC,iBAAiB,CAAC;IAgC7B;;;;;;;;OAQG;WACU,QAAQ,CACnB,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,iBAAiB,CAAC;CAU9B"}
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/core/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,QAAQ,EACR,cAAc,EAEf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAGL,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAe,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEhG,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,qBAAa,MAAM;IACjB;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAS,CACd,cAAc,EAAE,gBAAgB,EAChC,OAAO,EAAE,cAAc,EAAE,EACzB,eAAe,EAAE,MAAM,GACtB,mBAAmB;IAoCtB;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAI,CACT,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,mBAAmB,EACnC,kBAAkB,EAAE,qBAAqB,EACzC,SAAS,EAAE,QAAQ,GAClB,iBAAiB;IAgCpB;;;;;;;;OAQG;WACU,QAAQ,CACnB,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,iBAAiB,CAAC;CAU9B"}
@@ -1,10 +1,10 @@
1
1
  import { BitcoinConnection } from '@did-btcr2/bitcoin';
2
2
  import { DocumentBytes, HexString, KeyBytes, PatchOperation } from '@did-btcr2/common';
3
3
  import { SignedBTCR2Update } from '@did-btcr2/cryptosuite';
4
- import { DidMethod, DidResolutionResult } from '@web5/dids';
4
+ import { DidMethod } from '@web5/dids';
5
5
  import { ResolutionOptions } from './core/interfaces.js';
6
+ import { Resolver } from './core/resolver.js';
6
7
  import { Btcr2DidDocument, DidVerificationMethod } from './utils/did-document.js';
7
- export type Btcr2Identifier = string;
8
8
  export interface DidCreateOptions {
9
9
  /** Type of identifier to create (key or external) */
10
10
  idType: string;
@@ -39,7 +39,7 @@ export declare class DidBtcr2 implements DidMethod {
39
39
  * @param {string} options.idType The type of identifier to create, either 'KEY' or 'EXTERNAL'. Defaults to 'KEY'.
40
40
  * @param {number} options.version The version number of the did:btcr2 specification to use for creating the identifier. Defaults to 1.
41
41
  * @param {string} options.network The Bitcoin network to use for the identifier, e.g. 'bitcoin', 'testnet', etc. Defaults to 'bitcoin'.
42
- * @returns {Promise<Btcr2Identifier>} Promise resolving to a Btcr2Identifier string.
42
+ * @returns {Promise<string>} Promise resolving to an identifier string.
43
43
  * @throws {MethodError} if any of the checks fail
44
44
  * @example
45
45
  * ```ts
@@ -47,29 +47,29 @@ export declare class DidBtcr2 implements DidMethod {
47
47
  * const did = DidBtcr2.create(genesisBytes, { idType: 'KEY', network: 'regtest' });
48
48
  * ```
49
49
  */
50
- static create(genesisBytes: KeyBytes | DocumentBytes, options?: DidCreateOptions): Btcr2Identifier;
50
+ static create(genesisBytes: KeyBytes | DocumentBytes, options?: DidCreateOptions): string;
51
51
  /**
52
52
  * Entry point for section {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html | 7.2 Resolve}.
53
- * See specification for the {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#process | Resolve Process}.
54
- * See {@link Resolve | Resolve (class)} for class implementation.
55
53
  *
56
- * Resolving a did:btcr2 identifier iteratively builds a DID document by applying
57
- * BTCR2 Updates to an Initial DID Document that have been committed to the Bitcoin
58
- * blockchain by Authorized Beacon Signals. The Initial DID Document is either
59
- * deterministically created from the DID or provided by Sidecar Data.
54
+ * Factory method that performs pure setup and returns a {@link Resolver} state machine.
55
+ * The caller drives resolution by calling `resolver.resolve()` and `resolver.provide()`.
56
+ * Analogous to Rust's `Document::read()`.
60
57
  *
61
58
  * @param {string} did The did:btcr2 identifier to be resolved.
62
59
  * @param {ResolutionOptions} resolutionOptions Options used during the resolution process.
63
- * @returns {Promise<DidResolutionResult>} Promise resolving to a DID Resolution Result containing the `targetDocument`
64
- * @throws {ResolveError} If the resolution process fails at any step.
60
+ * @returns {Resolver} A sans-I/O state machine the caller drives to completion.
65
61
  * @example
66
62
  * ```ts
67
- * const resolution = await DidBtcr2.resolve(
68
- * 'did:btcr2:k1qgpr45cheptyjekl3cex80xfnkwhxnlclecwwf92gvdjrszm2uwhzlcxu5xte'
69
- * )
63
+ * const resolver = DidBtcr2.resolve(did, { sidecar });
64
+ * let state = resolver.resolve();
65
+ * while (state.status === 'action-required') {
66
+ * for (const need of state.needs) { ... provide data ... }
67
+ * state = resolver.resolve();
68
+ * }
69
+ * const { didDocument, metadata } = state.result;
70
70
  * ```
71
71
  */
72
- static resolve(did: string, resolutionOptions?: ResolutionOptions): Promise<DidResolutionResult>;
72
+ static resolve(did: string, resolutionOptions?: ResolutionOptions): Resolver;
73
73
  /**
74
74
  * Entry point for section {@link https://dcdpr.github.io/did-btcr2/#read | 7.3 Update}.
75
75
  * See specification for the {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#process | Resolve Process}.
@@ -1 +1 @@
1
- {"version":3,"file":"did-btcr2.d.ts","sourceRoot":"","sources":["../../src/did-btcr2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACL,aAAa,EACb,SAAS,EAIT,QAAQ,EAKR,cAAc,EAGf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAIL,SAAS,EACT,mBAAmB,EAEpB,MAAM,YAAY,CAAC;AAMpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIzD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAElF,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AAErC,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAKD;;;;;;;;;;;;GAYG;AACH,qBAAa,QAAS,YAAW,SAAS;IACxC;;OAEG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,CAAW;IAEpC;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,QAAQ,GAAG,aAAa,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,eAAe;IAelG;;;;;;;;;;;;;;;;;;;;OAoBG;WACU,OAAO,CAClB,GAAG,EAAE,MAAM,EACX,iBAAiB,GAAE,iBAAsB,GACxC,OAAO,CAAC,mBAAmB,CAAC;IAyG/B;;;;;;;;;;;;;;;;;;;OAmBG;WACU,MAAM,CAAC,EAClB,cAAc,EACd,OAAO,EACP,eAAe,EACf,oBAAoB,EACpB,QAAQ,EACR,eAAe,EACf,OAAO,GACR,EAAE;QACD,cAAc,EAAE,gBAAgB,CAAC;QACjC,OAAO,EAAE,cAAc,EAAE,CAAC;QAC1B,eAAe,EAAE,MAAM,CAAC;QACxB,oBAAoB,EAAE,MAAM,CAAC;QAC7B,QAAQ,EAAE,MAAM,CAAC;QACjB,eAAe,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;QACvC,OAAO,CAAC,EAAE,iBAAiB,CAAC;KAC7B,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAoF9B;;;;;;;;;OASG;IACH,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,gBAAgB,EAAG,QAAQ,CAAC,EAAE,MAAM,GAAG,qBAAqB;CA0BlG"}
1
+ {"version":3,"file":"did-btcr2.d.ts","sourceRoot":"","sources":["../../src/did-btcr2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACL,aAAa,EACb,SAAS,EAIT,QAAQ,EAGR,cAAc,EAEf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAIL,SAAS,EACV,MAAM,YAAY,CAAC;AAKpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAElF,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAKD;;;;;;;;;;;;GAYG;AACH,qBAAa,QAAS,YAAW,SAAS;IACxC;;OAEG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,CAAW;IAEpC;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,QAAQ,GAAG,aAAa,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,MAAM;IAezF;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,OAAO,CACZ,GAAG,EAAE,MAAM,EACX,iBAAiB,GAAE,iBAAsB,GACxC,QAAQ;IAsBX;;;;;;;;;;;;;;;;;;;OAmBG;WACU,MAAM,CAAC,EAClB,cAAc,EACd,OAAO,EACP,eAAe,EACf,oBAAoB,EACpB,QAAQ,EACR,eAAe,EACf,OAAO,GACR,EAAE;QACD,cAAc,EAAE,gBAAgB,CAAC;QACjC,OAAO,EAAE,cAAc,EAAE,CAAC;QAC1B,eAAe,EAAE,MAAM,CAAC;QACxB,oBAAoB,EAAE,MAAM,CAAC;QAC7B,QAAQ,EAAE,MAAM,CAAC;QACjB,eAAe,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;QACvC,OAAO,CAAC,EAAE,iBAAiB,CAAC;KAC7B,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAoF9B;;;;;;;;;OASG;IACH,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,gBAAgB,EAAG,QAAQ,CAAC,EAAE,MAAM,GAAG,qBAAqB;CA0BlG"}
@@ -28,12 +28,12 @@ export * from './core/beacon/error.js';
28
28
  export * from './core/beacon/factory.js';
29
29
  export * from './core/beacon/interfaces.js';
30
30
  export * from './core/beacon/signal-discovery.js';
31
- export * from './core/beacon/singleton.js';
31
+ export * from './core/beacon/singleton-beacon.js';
32
32
  export * from './core/beacon/smt-beacon.js';
33
33
  export * from './core/beacon/utils.js';
34
34
  export * from './core/identifier.js';
35
35
  export * from './core/interfaces.js';
36
- export * from './core/resolve.js';
36
+ export * from './core/resolver.js';
37
37
  export * from './core/types.js';
38
38
  export * from './core/update.js';
39
39
  export * from './utils/appendix.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAE3D,cAAc,mDAAmD,CAAC;AAClE,cAAc,wDAAwD,CAAC;AACvE,cAAc,oDAAoD,CAAC;AACnE,cAAc,gEAAgE,CAAC;AAC/E,cAAc,mEAAmE,CAAC;AAClF,cAAc,kEAAkE,CAAC;AACjF,cAAc,mEAAmE,CAAC;AAClF,cAAc,4DAA4D,CAAC;AAC3E,cAAc,oEAAoE,CAAC;AACnF,cAAc,yEAAyE,CAAC;AACxF,cAAc,sEAAsE,CAAC;AACrF,cAAc,qEAAqE,CAAC;AACpF,cAAc,2EAA2E,CAAC;AAE1F,cAAc,6DAA6D,CAAC;AAC5E,cAAc,0DAA0D,CAAC;AAEzE,cAAc,kDAAkD,CAAC;AACjE,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AAEnE,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;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;AAExC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAE3D,cAAc,mDAAmD,CAAC;AAClE,cAAc,wDAAwD,CAAC;AACvE,cAAc,oDAAoD,CAAC;AACnE,cAAc,gEAAgE,CAAC;AAC/E,cAAc,mEAAmE,CAAC;AAClF,cAAc,kEAAkE,CAAC;AACjF,cAAc,mEAAmE,CAAC;AAClF,cAAc,4DAA4D,CAAC;AAC3E,cAAc,oEAAoE,CAAC;AACnF,cAAc,yEAAyE,CAAC;AACxF,cAAc,sEAAsE,CAAC;AACrF,cAAc,qEAAqE,CAAC;AACpF,cAAc,2EAA2E,CAAC;AAE1F,cAAc,6DAA6D,CAAC;AAC5E,cAAc,0DAA0D,CAAC;AAEzE,cAAc,kDAAkD,CAAC;AACjE,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AAEnE,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;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,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AAEvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AAExC,cAAc,gBAAgB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@did-btcr2/method",
3
- "version": "0.24.1",
3
+ "version": "0.25.0",
4
4
  "type": "module",
5
5
  "description": "Reference implementation for the did:btcr2 DID method written in TypeScript and JavaScript. did:btcr2 is a censorship resistant DID Method using the Bitcoin blockchain as a Verifiable Data Registry to announce changes to the DID document. This is the core method implementation for the did-btcr2-js monorepo.",
6
6
  "main": "./dist/cjs/index.js",
@@ -83,10 +83,10 @@
83
83
  "multiformats": "^13.3.1",
84
84
  "nostr-tools": "^2.15.0",
85
85
  "tiny-secp256k1": "^2.2.3",
86
- "@did-btcr2/common": "7.0.0",
87
- "@did-btcr2/cryptosuite": "6.0.2",
86
+ "@did-btcr2/bitcoin": "0.5.0",
87
+ "@did-btcr2/common": "8.0.0",
88
88
  "@did-btcr2/keypair": "0.11.0",
89
- "@did-btcr2/bitcoin": "0.5.0"
89
+ "@did-btcr2/cryptosuite": "6.0.2"
90
90
  },
91
91
  "devDependencies": {
92
92
  "@eslint/js": "^9.22.0",
@@ -1,8 +1,9 @@
1
1
  import { KeyBytes } from '@did-btcr2/common';
2
2
  import { BitcoinConnection } from '@did-btcr2/bitcoin';
3
- import { SignedBTCR2Update } from '../../../../cryptosuite/dist/types/data-integrity-proof/interface.js';
3
+ import { SignedBTCR2Update } from '@did-btcr2/cryptosuite';
4
+ import type { BeaconProcessResult } from '../resolver.js';
4
5
  import { SidecarData } from '../types.js';
5
- import { BeaconService, BeaconSignal, BlockMetadata } from './interfaces.js';
6
+ import { BeaconService, BeaconSignal } from './interfaces.js';
6
7
 
7
8
  /**
8
9
  * Abstract base class for all BTCR2 Beacon types.
@@ -32,15 +33,18 @@ export abstract class Beacon {
32
33
  /**
33
34
  * Processes an array of Beacon Signals to extract BTCR2 Signed Updates.
34
35
  * Used during the resolve path.
36
+ *
37
+ * Returns successfully resolved updates and any data needs that must be
38
+ * satisfied before remaining signals can be processed.
39
+ *
35
40
  * @param {Array<BeaconSignal>} signals The beacon signals discovered on-chain.
36
41
  * @param {SidecarData} sidecar The processed sidecar data containing update/CAS/SMT maps.
37
- * @returns {Promise<Array<[SignedBTCR2Update, BlockMetadata]>>} The updates announced by the signals.
42
+ * @returns {BeaconProcessResult} The updates and any data needs.
38
43
  */
39
44
  abstract processSignals(
40
45
  signals: Array<BeaconSignal>,
41
46
  sidecar: SidecarData,
42
- ): Promise<Array<[SignedBTCR2Update, BlockMetadata]>>;
43
-
47
+ ): BeaconProcessResult;
44
48
 
45
49
  /**
46
50
  * Broadcasts a signed update as a Beacon Signal to the Bitcoin network.
@@ -1,6 +1,9 @@
1
- import { BitcoinConnection } from '@did-btcr2/bitcoin';
2
- import { KeyBytes } from '@did-btcr2/common';
1
+ import { AddressUtxo, BitcoinConnection } from '@did-btcr2/bitcoin';
2
+ import { canonicalHash, canonicalize, decode, encode, hash, KeyBytes } from '@did-btcr2/common';
3
3
  import { SignedBTCR2Update } from '@did-btcr2/cryptosuite';
4
+ import { SchnorrKeyPair } from '@did-btcr2/keypair';
5
+ import { opcodes, Psbt, script } from 'bitcoinjs-lib';
6
+ import type { BeaconProcessResult, DataNeed } from '../resolver.js';
4
7
  import { SidecarData } from '../types.js';
5
8
  import { Beacon } from './beacon.js';
6
9
  import { CASBeaconError } from './error.js';
@@ -8,6 +11,13 @@ import { BeaconService, BeaconSignal, BlockMetadata } from './interfaces.js';
8
11
 
9
12
  /**
10
13
  * Implements {@link https://dcdpr.github.io/did-btcr2/terminology.html#cas-beacon | CAS Beacon}.
14
+ *
15
+ * A CAS (Content-Addressed Store) Beacon aggregates updates for multiple DIDs
16
+ * into a single CAS Announcement — a mapping of DIDs to their update hashes.
17
+ * The hash of the CAS Announcement is broadcast on-chain via OP_RETURN.
18
+ * During resolution, the CAS Announcement is retrieved from the sidecar (or CAS)
19
+ * and used to look up the individual signed update for the DID being resolved.
20
+ *
11
21
  * @class CASBeacon
12
22
  * @type {CASBeacon}
13
23
  * @extends {Beacon}
@@ -23,31 +33,167 @@ export class CASBeacon extends Beacon {
23
33
 
24
34
  /**
25
35
  * Implements {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#process-cas-beacon | 7.2.e.1 Process CAS Beacon}.
36
+ *
37
+ * For each signal, the signalBytes contain the hex-encoded hash of a CAS Announcement.
38
+ * The CAS Announcement maps DIDs to their base64url-encoded update hashes.
39
+ * This method looks up the CAS Announcement from the sidecar, extracts the update
40
+ * hash for the DID being resolved, and retrieves the corresponding signed update.
41
+ *
26
42
  * @param {Array<BeaconSignal>} signals The array of Beacon Signals to process.
27
43
  * @param {SidecarData} sidecar The sidecar data associated with the CAS Beacon.
28
- * @returns {Promise<Array<[SignedBTCR2Update, BlockMetadata]>>} The processed signals.
29
- * @throws {CASBeaconError} if processing fails.
44
+ * @returns {BeaconProcessResult} Successfully resolved updates and any data needs.
45
+ * @throws {CASBeaconError} if hash verification fails (validation errors only).
30
46
  */
31
47
  processSignals(
32
48
  signals: Array<BeaconSignal>,
33
49
  sidecar: SidecarData
34
- ): Promise<Array<[SignedBTCR2Update, BlockMetadata]>> {
35
- throw new CASBeaconError('Method not implemented.', `METHOD_NOT_IMPLEMENTED`, { signals, sidecar });
50
+ ): BeaconProcessResult {
51
+ const updates = new Array<[SignedBTCR2Update, BlockMetadata]>();
52
+ const needs = new Array<DataNeed>();
53
+
54
+ // Extract the DID from the beacon service id (strip the #fragment)
55
+ const did = this.service.id.split('#')[0];
56
+
57
+ for(const signal of signals) {
58
+ // Decode signal bytes from hex and re-encode to base64url for sidecar lookup
59
+ const announcementHash = encode(decode(signal.signalBytes, 'hex'));
60
+
61
+ // Look up the CAS Announcement in sidecar casMap
62
+ const casAnnouncement = sidecar.casMap.get(announcementHash);
63
+
64
+ if(!casAnnouncement) {
65
+ // CAS Announcement not available — emit a need
66
+ needs.push({
67
+ kind : 'NeedCASAnnouncement',
68
+ announcementHash,
69
+ beaconServiceId : this.service.id
70
+ });
71
+ continue;
72
+ }
73
+
74
+ // Look up this DID's update hash in the CAS Announcement
75
+ const updateHash = casAnnouncement[did];
76
+
77
+ // If no entry for this DID, this announcement doesn't contain an update for us — skip
78
+ if(!updateHash) {
79
+ continue;
80
+ }
81
+
82
+ // Look up the signed update in sidecar updateMap
83
+ const signedUpdate = sidecar.updateMap.get(updateHash);
84
+
85
+ if(!signedUpdate) {
86
+ // Signed update not available — emit a need
87
+ needs.push({
88
+ kind : 'NeedSignedUpdate',
89
+ updateHash,
90
+ beaconServiceId : this.service.id
91
+ });
92
+ continue;
93
+ }
94
+
95
+ updates.push([signedUpdate, signal.blockMetadata]);
96
+ }
97
+
98
+ return { updates, needs };
36
99
  }
37
100
 
38
101
  /**
39
- * Broadcast CAS Beacon signal to the Bitcoin network.
102
+ * Broadcasts a CAS Beacon signal to the Bitcoin network.
103
+ *
104
+ * Creates a CAS Announcement mapping the DID to the update hash, then broadcasts
105
+ * the hash of the announcement via OP_RETURN. The CAS Announcement is distributed
106
+ * to resolvers via sidecar data.
107
+ *
40
108
  * @param {SignedBTCR2Update} signedUpdate The signed BTCR2 update to broadcast.
41
109
  * @param {KeyBytes} secretKey The secret key for signing the Bitcoin transaction.
42
110
  * @param {BitcoinConnection} bitcoin The Bitcoin network connection.
43
- * @return {Promise<SignedBTCR2Update>} The signed update that was broadcasted.
44
- * @throws {CASBeaconError} if broadcasting fails.
111
+ * @returns {Promise<SignedBTCR2Update>} The signed update that was broadcast.
112
+ * @throws {CASBeaconError} if the bitcoin address is invalid or unfunded.
45
113
  */
46
114
  async broadcastSignal(
47
115
  signedUpdate: SignedBTCR2Update,
48
116
  secretKey: KeyBytes,
49
117
  bitcoin: BitcoinConnection
50
118
  ): Promise<SignedBTCR2Update> {
51
- throw new CASBeaconError('Method not implemented.', `METHOD_NOT_IMPLEMENTED`, {signedUpdate, secretKey, bitcoin});
119
+ // Extract the DID from the beacon service id (strip the #fragment)
120
+ const did = this.service.id.split('#')[0];
121
+
122
+ // Hash the signed update (base64url for the CAS Announcement entry)
123
+ const updateHash = canonicalHash(signedUpdate);
124
+
125
+ // Create the CAS Announcement mapping this DID to its update hash
126
+ const casAnnouncement = { [did]: updateHash };
127
+
128
+ // TODO: Publish CAS Announcement to content-addressed store (e.g., IPFS via Helia)
129
+
130
+ // Canonicalize and hash the CAS Announcement for the OP_RETURN output
131
+ const announcementHash = hash(canonicalize(casAnnouncement));
132
+
133
+ // Convert the serviceEndpoint to a bitcoin address by removing the 'bitcoin:' prefix
134
+ const bitcoinAddress = this.service.serviceEndpoint.replace('bitcoin:', '');
135
+
136
+ // Query the Bitcoin network for UTXOs associated with the bitcoinAddress
137
+ const utxos = await bitcoin.rest.address.getUtxos(bitcoinAddress);
138
+
139
+ // If no utxos are found, throw an error indicating the address is unfunded.
140
+ if(!utxos.length) {
141
+ throw new CASBeaconError(
142
+ 'No UTXOs found, please fund address!',
143
+ 'UNFUNDED_BEACON_ADDRESS', { bitcoinAddress }
144
+ );
145
+ }
146
+
147
+ // Sort utxos by block height and take the most recent one
148
+ const utxo: AddressUtxo | undefined = utxos.sort(
149
+ (a, b) => b.status.block_height - a.status.block_height
150
+ ).shift();
151
+
152
+ // If no utxos are found, throw an error.
153
+ if(!utxo) {
154
+ throw new CASBeaconError(
155
+ 'Beacon bitcoin address unfunded or utxos unconfirmed.',
156
+ 'UNFUNDED_BEACON_ADDRESS', { bitcoinAddress }
157
+ );
158
+ }
159
+
160
+ // Get the previous tx to the utxo being spent
161
+ const prevTx = await bitcoin.rest.transaction.getHex(utxo.txid);
162
+
163
+ // Construct a spend transaction
164
+ const spendTx = new Psbt({ network: bitcoin.data })
165
+ // Spend tx contains the utxo as its input
166
+ .addInput({
167
+ hash : utxo.txid,
168
+ index : utxo.vout,
169
+ nonWitnessUtxo : Buffer.from(prevTx, 'hex')
170
+ })
171
+ // Add a change output minus a fee of 500 sats
172
+ // TODO: calculate fee based on transaction vsize and current fee rates
173
+ .addOutput({ address: bitcoinAddress, value: BigInt(utxo.value) - BigInt(500) })
174
+ // Add an OP_RETURN output containing the CAS Announcement hash
175
+ .addOutput({ script: script.compile([opcodes.OP_RETURN, announcementHash]), value: 0n });
176
+
177
+ // Construct a key pair and PSBT signer from the secret key
178
+ const keyPair = SchnorrKeyPair.fromSecret(secretKey);
179
+ const signer = {
180
+ publicKey : keyPair.publicKey.compressed,
181
+ sign : (hash: Uint8Array) => keyPair.secretKey.sign(hash, { scheme: 'ecdsa' }),
182
+ };
183
+
184
+ // Sign 0th input, finalize extract to hex in prep for broadcast
185
+ const signedTx = spendTx.signInput(0, signer)
186
+ .finalizeAllInputs()
187
+ .extractTransaction()
188
+ .toHex();
189
+
190
+ // Broadcast spendTx to the Bitcoin network.
191
+ const txid = await bitcoin.rest.transaction.send(signedTx);
192
+
193
+ // Log the txid of the broadcasted transaction
194
+ console.info(`CAS Beacon Signal Broadcasted with txid: ${txid}`);
195
+
196
+ // Return the signed update
197
+ return signedUpdate;
52
198
  }
53
199
  }
@@ -2,7 +2,7 @@ import { MethodError } from '@did-btcr2/common';
2
2
  import { Beacon } from './beacon.js';
3
3
  import { CASBeacon } from './cas-beacon.js';
4
4
  import { BeaconService } from './interfaces.js';
5
- import { SingletonBeacon } from './singleton.js';
5
+ import { SingletonBeacon } from './singleton-beacon.js';
6
6
  import { SMTBeacon } from './smt-beacon.js';
7
7
 
8
8
  /**
@@ -1,9 +1,9 @@
1
1
  import { AddressUtxo, BitcoinConnection } from '@did-btcr2/bitcoin';
2
- import { canonicalHash, canonicalize, hash, INVALID_SIDECAR_DATA, KeyBytes, MISSING_UPDATE_DATA } from '@did-btcr2/common';
2
+ import { canonicalize, decode, encode, hash, KeyBytes } from '@did-btcr2/common';
3
3
  import { SignedBTCR2Update } from '@did-btcr2/cryptosuite';
4
4
  import { SchnorrKeyPair } from '@did-btcr2/keypair';
5
- import { base64urlnopad } from '@scure/base';
6
5
  import { opcodes, Psbt, script } from 'bitcoinjs-lib';
6
+ import type { BeaconProcessResult, DataNeed } from '../resolver.js';
7
7
  import { SidecarData } from '../types.js';
8
8
  import { Beacon } from './beacon.js';
9
9
  import { SingletonBeaconError } from './error.js';
@@ -27,54 +27,38 @@ export class SingletonBeacon extends Beacon {
27
27
 
28
28
  /**
29
29
  * Processes an array of Beacon Signals associated with a Singleton Beacon Service.
30
- * @returns {Promise<SignedBTCR2Update | undefined>} The DID Update payload announced by the Beacon Signal.
31
- * @throws {SingletonBeaconError} if the signalTx is invalid or the signalSidecarData is invalid.
30
+ * @param {Array<BeaconSignal>} signals The beacon signals discovered on-chain.
31
+ * @param {SidecarData} sidecar The processed sidecar data.
32
+ * @returns {BeaconProcessResult} Successfully resolved updates and any data needs.
32
33
  */
33
- async processSignals(
34
+ processSignals(
34
35
  signals: Array<BeaconSignal>,
35
36
  sidecar: SidecarData
36
- ): Promise<Array<[SignedBTCR2Update, BlockMetadata]>> {
37
- // Initialize an empty array to hold the BTCR2 signed updates
37
+ ): BeaconProcessResult {
38
38
  const updates = new Array<[SignedBTCR2Update, BlockMetadata]>();
39
+ const needs = new Array<DataNeed>();
39
40
 
40
- // Loop through each signal in signals
41
41
  for(const signal of signals) {
42
- // Grab the beacon signal bytes hash from the signal
43
- const updateHash = signal.signalBytes;
42
+ // Decode signal bytes from hex and re-encode to base64url for sidecar lookup
43
+ const updateHash = encode(decode(signal.signalBytes, 'hex'));
44
44
 
45
- // Use the updateHash as the sidecar data lookup key to retrieve the btcr2 update
45
+ // Look up the signed update in sidecar updateMap
46
46
  const signedUpdate = sidecar.updateMap.get(updateHash);
47
47
 
48
- // If no btcr2 update is found in sidecar data maps, throw missingUpdateData error.
49
48
  if(!signedUpdate) {
50
- throw new SingletonBeaconError(
51
- `BTCR2 Signed Update not found for update hash ${updateHash}.`,
52
- MISSING_UPDATE_DATA, signal
53
- );
49
+ // Data not available — emit a need instead of throwing
50
+ needs.push({
51
+ kind : 'NeedSignedUpdate',
52
+ updateHash,
53
+ beaconServiceId : this.service.id
54
+ });
55
+ continue;
54
56
  }
55
57
 
56
- // TODO: Review for simplification how we are encoding and comparing
57
- // Canonicalize, hash and encode to base64url the signed update object found in sidecar or CAS
58
- const encodedUpdate = canonicalHash(signedUpdate, { encoding: 'base64url' });
59
-
60
- // Encode the signal bytes hex string to base64url
61
- const signalBytes = base64urlnopad.encode(Buffer.from(updateHash, 'hex'));
62
-
63
- // Check for mismatch between found sidecar/cas update hash and onchain beacon signal hash
64
- if (encodedUpdate !== signalBytes) {
65
- // If mismatch, throw invalidSidecarData error.
66
- throw new SingletonBeaconError(
67
- `Hash mismatch: sidecar update ${encodedUpdate} !== signal bytes ${signalBytes}.`,
68
- INVALID_SIDECAR_DATA, { encodedUpdate, signalBytes }
69
- );
70
- }
71
-
72
- // Push signedUpdate to updates array
73
58
  updates.push([signedUpdate, signal.blockMetadata]);
74
59
  }
75
60
 
76
- // Return the array of signed updates
77
- return updates;
61
+ return { updates, needs };
78
62
  }
79
63
  /**
80
64
  * Broadcasts a SingletonBeacon signal to the Bitcoin network.
@@ -1,10 +1,11 @@
1
1
  import { BitcoinConnection } from '@did-btcr2/bitcoin';
2
2
  import { KeyBytes } from '@did-btcr2/common';
3
3
  import { SignedBTCR2Update } from '@did-btcr2/cryptosuite';
4
+ import type { BeaconProcessResult } from '../resolver.js';
4
5
  import { SidecarData } from '../types.js';
5
6
  import { Beacon } from './beacon.js';
6
7
  import { SMTBeaconError } from './error.js';
7
- import { BeaconService, BeaconSignal, BlockMetadata } from './interfaces.js';
8
+ import { BeaconService, BeaconSignal } from './interfaces.js';
8
9
 
9
10
  /**
10
11
  * Implements {@link https://dcdpr.github.io/did-btcr2/terminology.html#smt-beacon | SMTBeacon}.
@@ -25,13 +26,13 @@ export class SMTBeacon extends Beacon {
25
26
  * Implements {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#process-smt-beacon | 7.2.e.1 Process SMT Beacon}.
26
27
  * @param {Array<BeaconSignal>} signals The array of Beacon Signals to process.
27
28
  * @param {SidecarData} sidecar The sidecar data associated with the SMT Beacon.
28
- * @returns {Promise<Array<[SignedBTCR2Update, BlockMetadata]>>} The processed signals.
29
+ * @returns {BeaconProcessResult} The processed signals.
29
30
  * @throws {SMTBeaconError} if processing fails.
30
31
  */
31
32
  processSignals(
32
33
  signals: Array<BeaconSignal>,
33
34
  sidecar: SidecarData
34
- ): Promise<Array<[SignedBTCR2Update, BlockMetadata]>> {
35
+ ): BeaconProcessResult {
35
36
  throw new SMTBeaconError('Method not implemented.', `METHOD_NOT_IMPLEMENTED`, {signals, sidecar});
36
37
  }
37
38
 
@@ -1,4 +1,3 @@
1
- import { BitcoinConnection } from '@did-btcr2/bitcoin';
2
1
  import { DidResolutionOptions } from '@web5/dids';
3
2
  import { Sidecar } from './types.js';
4
3
 
@@ -12,8 +11,12 @@ export interface RootCapability {
12
11
  /**
13
12
  * See {@link https://dcdpr.github.io/did-btcr2/data-structures.html#resolution-options-example-panel-show | Resolution Options}
14
13
  * for data structure details.
14
+ *
15
+ * Resolution is now fully sans-I/O via the {@link Resolver} state machine.
16
+ * External data (Bitcoin signals, CAS data) is provided through the
17
+ * `resolver.resolve()` / `resolver.provide()` protocol.
15
18
  */
16
- export interface ResolutionOptionsCore extends DidResolutionOptions {
19
+ export interface ResolutionOptions extends DidResolutionOptions {
17
20
  /**
18
21
  * Optional ASCII string representation of the specific version of a DID document
19
22
  * to be resolved.
@@ -34,20 +37,6 @@ export interface ResolutionOptionsCore extends DidResolutionOptions {
34
37
  sidecar?: Sidecar;
35
38
  }
36
39
 
37
- /**
38
- * Full set of resolution options for the did:btcr2 method. See {@link ResolutionOptionsCore}
39
- * for the resolution options defined by the specification.
40
- * @extends ResolutionOptionsCore
41
- */
42
- export interface ResolutionOptions extends ResolutionOptionsCore {
43
- /**
44
- * Drivers for interacting with external systems, such as the Bitcoin network.
45
- */
46
- drivers?: {
47
- bitcoin?: BitcoinConnection;
48
- };
49
- }
50
-
51
40
  /**
52
41
  * {@link https://dcdpr.github.io/did-btcr2/terminology.html#smt-proof | SMT Proof}
53
42
  * a set of SHA-256 hashes for nodes in a Sparse Merkle Tree that together form