@did-btcr2/method 0.25.2 → 0.26.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.
- package/dist/.tsbuildinfo +1 -0
- package/dist/browser.js +125307 -122227
- package/dist/browser.mjs +125266 -122186
- package/dist/cjs/index.js +5043 -43
- package/dist/esm/core/beacon/aggregation/cohort/index.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/subscribe.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/authorization-request.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/request-signature.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/communication/adapter/did-comm.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js +1 -2
- package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/coordinator.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/participant.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/session/index.js.map +1 -1
- package/dist/esm/core/beacon/cas-beacon.js +6 -4
- package/dist/esm/core/beacon/cas-beacon.js.map +1 -1
- package/dist/esm/core/beacon/signal-discovery.js +1 -1
- package/dist/esm/core/beacon/signal-discovery.js.map +1 -1
- package/dist/esm/core/beacon/singleton-beacon.js +3 -3
- package/dist/esm/core/beacon/singleton-beacon.js.map +1 -1
- package/dist/esm/core/beacon/utils.js.map +1 -1
- package/dist/esm/core/identifier.js.map +1 -1
- package/dist/esm/core/resolver.js +41 -35
- package/dist/esm/core/resolver.js.map +1 -1
- package/dist/esm/core/update.js.map +1 -1
- package/dist/esm/did-btcr2.js +1 -1
- package/dist/esm/did-btcr2.js.map +1 -1
- package/dist/esm/utils/appendix.js +7 -6
- package/dist/esm/utils/appendix.js.map +1 -1
- package/dist/esm/utils/did-document-builder.js.map +1 -1
- package/dist/esm/utils/did-document.js +2 -2
- package/dist/esm/utils/did-document.js.map +1 -1
- package/dist/types/core/beacon/aggregation/cohort/index.d.ts +2 -2
- package/dist/types/core/beacon/aggregation/cohort/index.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/index.d.ts +10 -10
- package/dist/types/core/beacon/aggregation/cohort/messages/index.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.d.ts +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts +1 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/communication/adapter/did-comm.d.ts +4 -4
- package/dist/types/core/beacon/aggregation/communication/adapter/did-comm.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts +6 -6
- package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/communication/factory.d.ts +1 -1
- package/dist/types/core/beacon/aggregation/communication/factory.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/communication/service.d.ts +3 -3
- package/dist/types/core/beacon/aggregation/communication/service.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/coordinator.d.ts +3 -3
- package/dist/types/core/beacon/aggregation/coordinator.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/participant.d.ts +6 -6
- package/dist/types/core/beacon/aggregation/participant.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/session/index.d.ts +2 -2
- package/dist/types/core/beacon/aggregation/session/index.d.ts.map +1 -1
- package/dist/types/core/beacon/beacon.d.ts +5 -5
- package/dist/types/core/beacon/beacon.d.ts.map +1 -1
- package/dist/types/core/beacon/cas-beacon.d.ts +5 -5
- package/dist/types/core/beacon/cas-beacon.d.ts.map +1 -1
- package/dist/types/core/beacon/factory.d.ts +2 -2
- package/dist/types/core/beacon/factory.d.ts.map +1 -1
- package/dist/types/core/beacon/interfaces.d.ts +3 -3
- package/dist/types/core/beacon/interfaces.d.ts.map +1 -1
- package/dist/types/core/beacon/signal-discovery.d.ts +3 -3
- package/dist/types/core/beacon/signal-discovery.d.ts.map +1 -1
- package/dist/types/core/beacon/singleton-beacon.d.ts +5 -5
- package/dist/types/core/beacon/singleton-beacon.d.ts.map +1 -1
- package/dist/types/core/beacon/smt-beacon.d.ts +5 -5
- package/dist/types/core/beacon/smt-beacon.d.ts.map +1 -1
- package/dist/types/core/beacon/utils.d.ts +4 -4
- package/dist/types/core/beacon/utils.d.ts.map +1 -1
- package/dist/types/core/identifier.d.ts +2 -2
- package/dist/types/core/identifier.d.ts.map +1 -1
- package/dist/types/core/interfaces.d.ts +2 -2
- package/dist/types/core/interfaces.d.ts.map +1 -1
- package/dist/types/core/resolver.d.ts +8 -8
- package/dist/types/core/resolver.d.ts.map +1 -1
- package/dist/types/core/types.d.ts +6 -5
- package/dist/types/core/types.d.ts.map +1 -1
- package/dist/types/core/update.d.ts +5 -5
- package/dist/types/core/update.d.ts.map +1 -1
- package/dist/types/did-btcr2.d.ts +6 -6
- package/dist/types/did-btcr2.d.ts.map +1 -1
- package/dist/types/utils/appendix.d.ts +7 -7
- package/dist/types/utils/appendix.d.ts.map +1 -1
- package/dist/types/utils/did-document-builder.d.ts +3 -2
- package/dist/types/utils/did-document-builder.d.ts.map +1 -1
- package/dist/types/utils/did-document.d.ts +3 -3
- package/dist/types/utils/did-document.d.ts.map +1 -1
- package/package.json +7 -6
- package/src/core/beacon/aggregation/cohort/index.ts +3 -2
- package/src/core/beacon/aggregation/cohort/messages/index.ts +10 -10
- package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.ts +2 -1
- package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.ts +2 -1
- package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.ts +2 -1
- package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in.ts +2 -1
- package/src/core/beacon/aggregation/cohort/messages/keygen/subscribe.ts +2 -1
- package/src/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.ts +2 -1
- package/src/core/beacon/aggregation/cohort/messages/sign/authorization-request.ts +2 -1
- package/src/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.ts +2 -1
- package/src/core/beacon/aggregation/cohort/messages/sign/request-signature.ts +2 -1
- package/src/core/beacon/aggregation/cohort/messages/sign/signature-authorization.ts +2 -1
- package/src/core/beacon/aggregation/communication/adapter/did-comm.ts +5 -4
- package/src/core/beacon/aggregation/communication/adapter/nostr.ts +9 -7
- package/src/core/beacon/aggregation/communication/factory.ts +1 -1
- package/src/core/beacon/aggregation/communication/service.ts +3 -3
- package/src/core/beacon/aggregation/coordinator.ts +12 -8
- package/src/core/beacon/aggregation/participant.ts +12 -7
- package/src/core/beacon/aggregation/session/index.ts +3 -2
- package/src/core/beacon/beacon.ts +5 -5
- package/src/core/beacon/cas-beacon.ts +13 -9
- package/src/core/beacon/factory.ts +2 -2
- package/src/core/beacon/interfaces.ts +3 -3
- package/src/core/beacon/signal-discovery.ts +5 -4
- package/src/core/beacon/singleton-beacon.ts +8 -7
- package/src/core/beacon/smt-beacon.ts +5 -5
- package/src/core/beacon/utils.ts +6 -4
- package/src/core/identifier.ts +3 -2
- package/src/core/interfaces.ts +2 -2
- package/src/core/resolver.ts +59 -51
- package/src/core/types.ts +6 -5
- package/src/core/update.ts +11 -7
- package/src/did-btcr2.ts +12 -10
- package/src/utils/appendix.ts +14 -16
- package/src/utils/did-document-builder.ts +3 -2
- package/src/utils/did-document.ts +10 -8
- package/dist/cjs/core/beacon/aggregation/cohort/index.js +0 -237
- package/dist/cjs/core/beacon/aggregation/cohort/index.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/cohort/messages/base.js +0 -26
- package/dist/cjs/core/beacon/aggregation/cohort/messages/base.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/cohort/messages/constants.js +0 -11
- package/dist/cjs/core/beacon/aggregation/cohort/messages/constants.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/cohort/messages/index.js +0 -98
- package/dist/cjs/core/beacon/aggregation/cohort/messages/index.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js +0 -31
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js +0 -29
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js +0 -27
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in.js +0 -23
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/subscribe.js +0 -28
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/subscribe.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js +0 -29
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/authorization-request.js +0 -30
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/authorization-request.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js +0 -30
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/request-signature.js +0 -30
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/request-signature.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js +0 -31
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/cohort/status.js +0 -8
- package/dist/cjs/core/beacon/aggregation/cohort/status.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/communication/adapter/did-comm.js +0 -121
- package/dist/cjs/core/beacon/aggregation/communication/adapter/did-comm.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/communication/adapter/nostr.js +0 -246
- package/dist/cjs/core/beacon/aggregation/communication/adapter/nostr.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/communication/error.js +0 -12
- package/dist/cjs/core/beacon/aggregation/communication/error.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/communication/factory.js +0 -21
- package/dist/cjs/core/beacon/aggregation/communication/factory.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/communication/service.js +0 -2
- package/dist/cjs/core/beacon/aggregation/communication/service.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/coordinator.js +0 -343
- package/dist/cjs/core/beacon/aggregation/coordinator.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/participant.js +0 -435
- package/dist/cjs/core/beacon/aggregation/participant.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/session/index.js +0 -244
- package/dist/cjs/core/beacon/aggregation/session/index.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/session/status.js +0 -11
- package/dist/cjs/core/beacon/aggregation/session/status.js.map +0 -1
- package/dist/cjs/core/beacon/beacon.js +0 -25
- package/dist/cjs/core/beacon/beacon.js.map +0 -1
- package/dist/cjs/core/beacon/cas-beacon.js +0 -152
- package/dist/cjs/core/beacon/cas-beacon.js.map +0 -1
- package/dist/cjs/core/beacon/error.js +0 -37
- package/dist/cjs/core/beacon/error.js.map +0 -1
- package/dist/cjs/core/beacon/factory.js +0 -29
- package/dist/cjs/core/beacon/factory.js.map +0 -1
- package/dist/cjs/core/beacon/interfaces.js +0 -2
- package/dist/cjs/core/beacon/interfaces.js.map +0 -1
- package/dist/cjs/core/beacon/signal-discovery.js +0 -183
- package/dist/cjs/core/beacon/signal-discovery.js.map +0 -1
- package/dist/cjs/core/beacon/singleton-beacon.js +0 -107
- package/dist/cjs/core/beacon/singleton-beacon.js.map +0 -1
- package/dist/cjs/core/beacon/smt-beacon.js +0 -39
- package/dist/cjs/core/beacon/smt-beacon.js.map +0 -1
- package/dist/cjs/core/beacon/utils.js +0 -163
- package/dist/cjs/core/beacon/utils.js.map +0 -1
- package/dist/cjs/core/identifier.js +0 -248
- package/dist/cjs/core/identifier.js.map +0 -1
- package/dist/cjs/core/interfaces.js +0 -2
- package/dist/cjs/core/interfaces.js.map +0 -1
- package/dist/cjs/core/resolver.js +0 -476
- package/dist/cjs/core/resolver.js.map +0 -1
- package/dist/cjs/core/types.js +0 -2
- package/dist/cjs/core/types.js.map +0 -1
- package/dist/cjs/core/update.js +0 -112
- package/dist/cjs/core/update.js.map +0 -1
- package/dist/cjs/did-btcr2.js +0 -193
- package/dist/cjs/did-btcr2.js.map +0 -1
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/utils/appendix.js +0 -203
- package/dist/cjs/utils/appendix.js.map +0 -1
- package/dist/cjs/utils/did-document-builder.js +0 -60
- package/dist/cjs/utils/did-document-builder.js.map +0 -1
- package/dist/cjs/utils/did-document.js +0 -424
- package/dist/cjs/utils/did-document.js.map +0 -1
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"did-btcr2.d.ts","sourceRoot":"","sources":["../../src/did-btcr2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EACT,QAAQ,E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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,6 +1,6 @@
|
|
|
1
|
-
import { HashBytes } from '@did-btcr2/common';
|
|
2
|
-
import { DidDocument, DidService, DidVerificationMethod } from '@web5/dids';
|
|
3
|
-
import { RootCapability } from '../core/interfaces.js';
|
|
1
|
+
import type { HashBytes } from '@did-btcr2/common';
|
|
2
|
+
import type { DidDocument, DidService, DidVerificationMethod } from '@web5/dids';
|
|
3
|
+
import type { RootCapability } from '../core/interfaces.js';
|
|
4
4
|
/**
|
|
5
5
|
* Implements {@link https://dcdpr.github.io/did-btcr2/#appendix | 9. Appendix} methods.
|
|
6
6
|
*
|
|
@@ -27,10 +27,10 @@ export declare class Appendix {
|
|
|
27
27
|
*/
|
|
28
28
|
static isDidService(obj: unknown): obj is DidService;
|
|
29
29
|
/**
|
|
30
|
-
* Extracts the verification methods from a given DID Document
|
|
31
|
-
* @param
|
|
32
|
-
* @returns
|
|
33
|
-
* @throws
|
|
30
|
+
* Extracts the verification methods from a given DID Document.
|
|
31
|
+
* @param didDocument The DID Document to extract the verification methods from
|
|
32
|
+
* @returns An array of DidVerificationMethod objects
|
|
33
|
+
* @throws TypeError if the didDocument is not provided
|
|
34
34
|
*/
|
|
35
35
|
static getVerificationMethods(didDocument: DidDocument): DidVerificationMethod[];
|
|
36
36
|
/**
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"appendix.d.ts","sourceRoot":"","sources":["../../../src/utils/appendix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,qBAAqB,EAAC,MAAM,YAAY,CAAC;AAQ3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;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;CAe7E"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { BeaconService } from '../core/beacon/interfaces.js';
|
|
2
|
-
import {
|
|
1
|
+
import type { BeaconService } from '../core/beacon/interfaces.js';
|
|
2
|
+
import type { DidVerificationMethod } from './did-document.js';
|
|
3
|
+
import { DidDocument } from './did-document.js';
|
|
3
4
|
/**
|
|
4
5
|
* A builder class for constructing DID Documents.
|
|
5
6
|
* @type {DidDocumentBuilder}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"did-document-builder.d.ts","sourceRoot":"","sources":["../../../src/utils/did-document-builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"did-document-builder.d.ts","sourceRoot":"","sources":["../../../src/utils/did-document-builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;GAIG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAA4B;gBAEhC,eAAe,EAAE,OAAO,CAAC,WAAW,CAAC;IAYjD,kBAAkB,CAAC,cAAc,EAAE,KAAK,CAAC,MAAM,GAAG,qBAAqB,CAAC,GAAG,IAAI;IAO/E,mBAAmB,CAAC,eAAe,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,6 @@
|
|
|
1
|
-
import { HashBytes, JSONObject, KeyBytes } from '@did-btcr2/common';
|
|
2
|
-
import { DidDocument as W3CDidDocument, DidVerificationMethod as W3CDidVerificationMethod } from '@web5/dids';
|
|
3
|
-
import { BeaconService } from '../core/beacon/interfaces.js';
|
|
1
|
+
import type { HashBytes, JSONObject, KeyBytes } from '@did-btcr2/common';
|
|
2
|
+
import type { DidDocument as W3CDidDocument, DidVerificationMethod as W3CDidVerificationMethod } from '@web5/dids';
|
|
3
|
+
import type { BeaconService } from '../core/beacon/interfaces.js';
|
|
4
4
|
export declare const BTCR2_DID_DOCUMENT_CONTEXT: string[];
|
|
5
5
|
export declare const ID_PLACEHOLDER_VALUE = "did:btcr2:_";
|
|
6
6
|
export declare const BECH32M_CHARS = "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"did-document.d.ts","sourceRoot":"","sources":["../../../src/utils/did-document.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"did-document.d.ts","sourceRoot":"","sources":["../../../src/utils/did-document.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,QAAQ,EACT,MAAM,mBAAmB,CAAC;AAU3B,OAAO,KAAK,EAAE,WAAW,IAAI,cAAc,EAAE,qBAAqB,IAAI,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAGnH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAIlE,eAAO,MAAM,0BAA0B,UAGtC,CAAC;AACF,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAClD,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,eAAO,MAAM,SAAS,QAAuD,CAAC;AAE9E,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACjD,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,qBAAqB,CAAC,CAAC;IACvD,eAAe,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,qBAAqB,CAAC,CAAC;IACxD,oBAAoB,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,qBAAqB,CAAC,CAAC;IAC7D,oBAAoB,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,qBAAqB,CAAC,CAAC;IAC7D,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA;CAC9B,CAAA;AACD,MAAM,MAAM,yBAAyB,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|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@did-btcr2/method",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.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",
|
|
@@ -82,10 +82,10 @@
|
|
|
82
82
|
"helia": "^5.2.1",
|
|
83
83
|
"multiformats": "^13.3.1",
|
|
84
84
|
"nostr-tools": "^2.15.0",
|
|
85
|
-
"@did-btcr2/
|
|
86
|
-
"@did-btcr2/
|
|
87
|
-
"@did-btcr2/
|
|
88
|
-
"@did-btcr2/
|
|
85
|
+
"@did-btcr2/bitcoin": "^0.5.3",
|
|
86
|
+
"@did-btcr2/keypair": "^0.11.4",
|
|
87
|
+
"@did-btcr2/common": "^9.0.0",
|
|
88
|
+
"@did-btcr2/cryptosuite": "^6.0.6"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
91
|
"@eslint/js": "^9.22.0",
|
|
@@ -107,6 +107,7 @@
|
|
|
107
107
|
"mocha-junit-reporter": "^2.2.1",
|
|
108
108
|
"node-stdlib-browser": "^1.3.1",
|
|
109
109
|
"rimraf": "^6.0.1",
|
|
110
|
+
"tsup": "^8.5.1",
|
|
110
111
|
"typedoc-plugin-markdown": "^4.7.0",
|
|
111
112
|
"typescript": "^5.6.2",
|
|
112
113
|
"typescript-eslint": "^8.19.1"
|
|
@@ -123,7 +124,7 @@
|
|
|
123
124
|
"reinstall": "pnpm install --force",
|
|
124
125
|
"build": "pnpm clean:build && pnpm build:esm && pnpm build:cjs && pnpm build:browser",
|
|
125
126
|
"build:esm": "rimraf dist/esm dist/types && pnpm tsc -p tsconfig.json",
|
|
126
|
-
"build:cjs": "
|
|
127
|
+
"build:cjs": "tsup && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json",
|
|
127
128
|
"build:browser": "rimraf dist/browser.mjs dist/browser.js && node build/bundles.js",
|
|
128
129
|
"build:tests": "pnpm clean:tests && pnpm tsc -p tests/tsconfig.json",
|
|
129
130
|
"build:docs": "typedoc --options typedoc.json",
|
|
@@ -4,8 +4,9 @@ import { payments, Transaction } from 'bitcoinjs-lib';
|
|
|
4
4
|
import { BeaconCoordinatorError } from '../../error.js';
|
|
5
5
|
import { BeaconCohortSigningSession } from '../session/index.js';
|
|
6
6
|
import { BeaconCohortReadyMessage } from './messages/keygen/cohort-ready.js';
|
|
7
|
-
import { BeaconCohortRequestSignatureMessage } from './messages/sign/request-signature.js';
|
|
8
|
-
import {
|
|
7
|
+
import type { BeaconCohortRequestSignatureMessage } from './messages/sign/request-signature.js';
|
|
8
|
+
import type { COHORT_STATUS_TYPE } from './status.js';
|
|
9
|
+
import { COHORT_STATUS } from './status.js';
|
|
9
10
|
|
|
10
11
|
export type Musig2CohortObject = {
|
|
11
12
|
id?: string;
|
|
@@ -9,16 +9,16 @@ import {
|
|
|
9
9
|
BEACON_COHORT_REQUEST_SIGNATURE,
|
|
10
10
|
BEACON_COHORT_SIGNATURE_AUTHORIZATION
|
|
11
11
|
} from './constants.js';
|
|
12
|
-
import { CohortAdvertMessage } from './keygen/cohort-advert.js';
|
|
13
|
-
import { CohortReadyMessage } from './keygen/cohort-ready.js';
|
|
14
|
-
import { CohortOptInAcceptMessage } from './keygen/opt-in-accept.js';
|
|
15
|
-
import { CohortOptInMessage } from './keygen/opt-in.js';
|
|
16
|
-
import { CohortSubscribeMessage } from './keygen/subscribe.js';
|
|
17
|
-
import { CohortAggregatedNonceMessage } from './sign/aggregated-nonce.js';
|
|
18
|
-
import { CohortAuthorizationRequestMessage } from './sign/authorization-request.js';
|
|
19
|
-
import { CohortNonceContributionMessage } from './sign/nonce-contribution.js';
|
|
20
|
-
import { CohortRequestSignatureMessage } from './sign/request-signature.js';
|
|
21
|
-
import { CohortSignatureAuthorizationMessage } from './sign/signature-authorization.js';
|
|
12
|
+
import type { CohortAdvertMessage } from './keygen/cohort-advert.js';
|
|
13
|
+
import type { CohortReadyMessage } from './keygen/cohort-ready.js';
|
|
14
|
+
import type { CohortOptInAcceptMessage } from './keygen/opt-in-accept.js';
|
|
15
|
+
import type { CohortOptInMessage } from './keygen/opt-in.js';
|
|
16
|
+
import type { CohortSubscribeMessage } from './keygen/subscribe.js';
|
|
17
|
+
import type { CohortAggregatedNonceMessage } from './sign/aggregated-nonce.js';
|
|
18
|
+
import type { CohortAuthorizationRequestMessage } from './sign/authorization-request.js';
|
|
19
|
+
import type { CohortNonceContributionMessage } from './sign/nonce-contribution.js';
|
|
20
|
+
import type { CohortRequestSignatureMessage } from './sign/request-signature.js';
|
|
21
|
+
import type { CohortSignatureAuthorizationMessage } from './sign/signature-authorization.js';
|
|
22
22
|
|
|
23
23
|
export type KeyGenMessageType =
|
|
24
24
|
| CohortAdvertMessage
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Maybe } from '@did-btcr2/common';
|
|
2
|
+
import { JSONUtils } from '@did-btcr2/common';
|
|
2
3
|
import { BaseMessage } from '../base.js';
|
|
3
4
|
import { BEACON_COHORT_AUTHORIZATION_REQUEST } from '../constants.js';
|
|
4
5
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Maybe } from '@did-btcr2/common';
|
|
2
|
+
import { JSONUtils } from '@did-btcr2/common';
|
|
2
3
|
import { BaseMessage } from '../base.js';
|
|
3
4
|
import { BEACON_COHORT_SIGNATURE_AUTHORIZATION } from '../constants.js';
|
|
4
5
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { NotImplementedError } from '@did-btcr2/common';
|
|
2
|
-
import { RawSchnorrKeyPair
|
|
2
|
+
import type { RawSchnorrKeyPair} from '@did-btcr2/keypair';
|
|
3
|
+
import { SchnorrKeyPair, Secp256k1SecretKey } from '@did-btcr2/keypair';
|
|
3
4
|
import { Identifier } from '../../../../identifier.js';
|
|
4
|
-
import { AggregateBeaconMessageType } from '../../cohort/messages/index.js';
|
|
5
|
-
import { BaseMessage } from '../../cohort/messages/base.js';
|
|
6
|
-
import { CommunicationService, MessageHandler, ServiceAdapterConfig, ServiceAdapterIdentity } from '../service.js';
|
|
5
|
+
import type { AggregateBeaconMessageType } from '../../cohort/messages/index.js';
|
|
6
|
+
import type { BaseMessage } from '../../cohort/messages/base.js';
|
|
7
|
+
import type { CommunicationService, MessageHandler, ServiceAdapterConfig, ServiceAdapterIdentity } from '../service.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* DidCommAdapterConfig is a configuration class for the DidCommAdapter.
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// TODO: Finish nostr adapter implementation. Rethink patterns used.
|
|
2
2
|
|
|
3
|
-
import { Did } from '@did-btcr2/common';
|
|
4
|
-
import {
|
|
3
|
+
import type { Did } from '@did-btcr2/common';
|
|
4
|
+
import type { RawSchnorrKeyPair} from '@did-btcr2/keypair';
|
|
5
|
+
import { CompressedSecp256k1PublicKey, SchnorrKeyPair, Secp256k1SecretKey } from '@did-btcr2/keypair';
|
|
5
6
|
import { bytesToHex } from '@noble/hashes/utils';
|
|
6
7
|
import { nonceGen } from '@scure/btc-signer/musig2';
|
|
7
|
-
import { Event, EventTemplate, Filter
|
|
8
|
-
import { SimplePool } from 'nostr-tools
|
|
8
|
+
import type { Event, EventTemplate, Filter} from 'nostr-tools';
|
|
9
|
+
import { finalizeEvent, nip44, SimplePool } from 'nostr-tools';
|
|
9
10
|
import { Identifier } from '../../../../identifier.js';
|
|
10
11
|
import {
|
|
11
12
|
BEACON_COHORT_ADVERT,
|
|
@@ -18,10 +19,11 @@ import {
|
|
|
18
19
|
BEACON_COHORT_REQUEST_SIGNATURE,
|
|
19
20
|
BEACON_COHORT_SIGNATURE_AUTHORIZATION
|
|
20
21
|
} from '../../cohort/messages/constants.js';
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
22
|
+
import type { AggregateBeaconMessageType } from '../../cohort/messages/index.js';
|
|
23
|
+
import { AggregateBeaconMessage } from '../../cohort/messages/index.js';
|
|
24
|
+
import type { BaseMessage } from '../../cohort/messages/base.js';
|
|
23
25
|
import { CommunicationAdapterError } from '../error.js';
|
|
24
|
-
import { CommunicationService, MessageHandler, ServiceAdapter, ServiceAdapterConfig, ServiceAdapterIdentity } from '../service.js';
|
|
26
|
+
import type { CommunicationService, MessageHandler, ServiceAdapter, ServiceAdapterConfig, ServiceAdapterIdentity } from '../service.js';
|
|
25
27
|
|
|
26
28
|
/**
|
|
27
29
|
* TODO: Determine set of default Nostr relays to use.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NotImplementedError } from '@did-btcr2/common';
|
|
2
2
|
import { NostrAdapter } from './adapter/nostr.js';
|
|
3
3
|
import { CommunicationServiceError } from './error.js';
|
|
4
|
-
import { CommunicationService, Service } from './service.js';
|
|
4
|
+
import type { CommunicationService, Service } from './service.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Communication Factory pattern to create Communication Service instances.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AggregateBeaconMessageType } from '../cohort/messages/index.js';
|
|
2
|
-
import { BaseMessage } from '../cohort/messages/base.js';
|
|
3
|
-
import { RawSchnorrKeyPair } from '@did-btcr2/keypair';
|
|
1
|
+
import type { AggregateBeaconMessageType } from '../cohort/messages/index.js';
|
|
2
|
+
import type { BaseMessage } from '../cohort/messages/base.js';
|
|
3
|
+
import type { RawSchnorrKeyPair } from '@did-btcr2/keypair';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* ServiceAdapterConfig defines the configuration structure for the Nostr communication service.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Maybe } from '@did-btcr2/common';
|
|
2
|
-
import { RawSchnorrKeyPair } from '@did-btcr2/keypair';
|
|
1
|
+
import type { Maybe } from '@did-btcr2/common';
|
|
2
|
+
import type { RawSchnorrKeyPair } from '@did-btcr2/keypair';
|
|
3
3
|
import { bytesToHex } from '@noble/hashes/utils';
|
|
4
4
|
import { BeaconCoordinatorError } from '../error.js';
|
|
5
5
|
import { AggregateBeaconCohort } from './cohort/index.js';
|
|
@@ -13,15 +13,19 @@ import {
|
|
|
13
13
|
import { BeaconCohortAdvertMessage } from './cohort/messages/keygen/cohort-advert.js';
|
|
14
14
|
import { BeaconCohortReadyMessage } from './cohort/messages/keygen/cohort-ready.js';
|
|
15
15
|
import { BeaconCohortOptInAcceptMessage } from './cohort/messages/keygen/opt-in-accept.js';
|
|
16
|
-
import {
|
|
16
|
+
import type { CohortOptInMessage } from './cohort/messages/keygen/opt-in.js';
|
|
17
|
+
import { BeaconCohortOptInMessage } from './cohort/messages/keygen/opt-in.js';
|
|
17
18
|
import { BeaconCohortAggregatedNonceMessage } from './cohort/messages/sign/aggregated-nonce.js';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
19
|
+
import type { CohortNonceContributionMessage } from './cohort/messages/sign/nonce-contribution.js';
|
|
20
|
+
import { BeaconCohortNonceContributionMessage } from './cohort/messages/sign/nonce-contribution.js';
|
|
21
|
+
import type { CohortRequestSignatureMessage } from './cohort/messages/sign/request-signature.js';
|
|
22
|
+
import { BeaconCohortRequestSignatureMessage } from './cohort/messages/sign/request-signature.js';
|
|
23
|
+
import type { CohortSignatureAuthorizationMessage } from './cohort/messages/sign/signature-authorization.js';
|
|
24
|
+
import { BeaconCohortSignatureAuthorizationMessage } from './cohort/messages/sign/signature-authorization.js';
|
|
21
25
|
import { NostrAdapter } from './communication/adapter/nostr.js';
|
|
22
26
|
import { CommunicationFactory } from './communication/factory.js';
|
|
23
|
-
import { CommunicationService, Service, ServiceAdapterIdentity } from './communication/service.js';
|
|
24
|
-
import { BeaconCohortSigningSession } from './session/index.js';
|
|
27
|
+
import type { CommunicationService, Service, ServiceAdapterIdentity } from './communication/service.js';
|
|
28
|
+
import type { BeaconCohortSigningSession } from './session/index.js';
|
|
25
29
|
import { SIGNING_SESSION_STATUS } from './session/status.js';
|
|
26
30
|
|
|
27
31
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KeyBytes, Maybe } from '@did-btcr2/common';
|
|
1
|
+
import type { KeyBytes, Maybe } from '@did-btcr2/common';
|
|
2
2
|
import { bytesToHex } from '@noble/hashes/utils';
|
|
3
3
|
import { HDKey } from '@scure/bip32';
|
|
4
4
|
import { mnemonicToSeedSync } from '@scure/bip39';
|
|
@@ -13,19 +13,24 @@ import {
|
|
|
13
13
|
BEACON_COHORT_OPT_IN_ACCEPT,
|
|
14
14
|
BEACON_COHORT_READY
|
|
15
15
|
} from './cohort/messages/constants.js';
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
16
|
+
import type { CohortAdvertMessage } from './cohort/messages/keygen/cohort-advert.js';
|
|
17
|
+
import { BeaconCohortAdvertMessage } from './cohort/messages/keygen/cohort-advert.js';
|
|
18
|
+
import type { CohortReadyMessage } from './cohort/messages/keygen/cohort-ready.js';
|
|
19
|
+
import { BeaconCohortReadyMessage } from './cohort/messages/keygen/cohort-ready.js';
|
|
20
|
+
import type { CohortOptInAcceptMessage } from './cohort/messages/keygen/opt-in-accept.js';
|
|
21
|
+
import { BeaconCohortOptInAcceptMessage } from './cohort/messages/keygen/opt-in-accept.js';
|
|
19
22
|
import { BeaconCohortOptInMessage } from './cohort/messages/keygen/opt-in.js';
|
|
20
23
|
import { BeaconCohortSubscribeMessage } from './cohort/messages/keygen/subscribe.js';
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
24
|
+
import type { CohortAggregatedNonceMessage } from './cohort/messages/sign/aggregated-nonce.js';
|
|
25
|
+
import { BeaconCohortAggregatedNonceMessage } from './cohort/messages/sign/aggregated-nonce.js';
|
|
26
|
+
import type { CohortAuthorizationRequestMessage } from './cohort/messages/sign/authorization-request.js';
|
|
27
|
+
import { BeaconCohortAuthorizationRequestMessage } from './cohort/messages/sign/authorization-request.js';
|
|
23
28
|
import { BeaconCohortNonceContributionMessage } from './cohort/messages/sign/nonce-contribution.js';
|
|
24
29
|
import { BeaconCohortRequestSignatureMessage } from './cohort/messages/sign/request-signature.js';
|
|
25
30
|
import { BeaconCohortSignatureAuthorizationMessage } from './cohort/messages/sign/signature-authorization.js';
|
|
26
31
|
import { COHORT_STATUS } from './cohort/status.js';
|
|
27
32
|
import { NostrAdapter } from './communication/adapter/nostr.js';
|
|
28
|
-
import { CommunicationService } from './communication/service.js';
|
|
33
|
+
import type { CommunicationService } from './communication/service.js';
|
|
29
34
|
import { BeaconCohortSigningSession } from './session/index.js';
|
|
30
35
|
|
|
31
36
|
type Seed = KeyBytes;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as musig2 from '@scure/btc-signer/musig2';
|
|
2
2
|
import { Transaction } from 'bitcoinjs-lib';
|
|
3
3
|
import { AggregateBeaconError } from '../../error.js';
|
|
4
|
-
import { AggregateBeaconCohort } from '../cohort/index.js';
|
|
4
|
+
import type { AggregateBeaconCohort } from '../cohort/index.js';
|
|
5
5
|
import { BeaconCohortAuthorizationRequestMessage } from '../cohort/messages/sign/authorization-request.js';
|
|
6
|
-
import {
|
|
6
|
+
import type { SIGNING_SESSION_STATUS_TYPE } from './status.js';
|
|
7
|
+
import { SIGNING_SESSION_STATUS } from './status.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Convert a big-endian byte array into a bigint.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { KeyBytes } from '@did-btcr2/common';
|
|
2
|
-
import { BitcoinConnection } from '@did-btcr2/bitcoin';
|
|
3
|
-
import { SignedBTCR2Update } from '@did-btcr2/cryptosuite';
|
|
1
|
+
import type { KeyBytes } from '@did-btcr2/common';
|
|
2
|
+
import type { BitcoinConnection } from '@did-btcr2/bitcoin';
|
|
3
|
+
import type { SignedBTCR2Update } from '@did-btcr2/cryptosuite';
|
|
4
4
|
import type { BeaconProcessResult } from '../resolver.js';
|
|
5
|
-
import { SidecarData } from '../types.js';
|
|
6
|
-
import { BeaconService, BeaconSignal } from './interfaces.js';
|
|
5
|
+
import type { SidecarData } from '../types.js';
|
|
6
|
+
import type { BeaconService, BeaconSignal } from './interfaces.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Abstract base class for all BTCR2 Beacon types.
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { AddressUtxo, BitcoinConnection } from '@did-btcr2/bitcoin';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { AddressUtxo, BitcoinConnection } from '@did-btcr2/bitcoin';
|
|
2
|
+
import type { KeyBytes } from '@did-btcr2/common';
|
|
3
|
+
import { canonicalHash, canonicalize, decode, encode, hash } from '@did-btcr2/common';
|
|
4
|
+
import type { SignedBTCR2Update } from '@did-btcr2/cryptosuite';
|
|
4
5
|
import { SchnorrKeyPair } from '@did-btcr2/keypair';
|
|
5
6
|
import { hexToBytes } from '@noble/hashes/utils';
|
|
6
7
|
import { opcodes, Psbt, script } from 'bitcoinjs-lib';
|
|
7
8
|
import type { BeaconProcessResult, DataNeed } from '../resolver.js';
|
|
8
|
-
import { SidecarData } from '../types.js';
|
|
9
|
+
import type { SidecarData } from '../types.js';
|
|
9
10
|
import { Beacon } from './beacon.js';
|
|
10
11
|
import { CASBeaconError } from './error.js';
|
|
11
|
-
import { BeaconService, BeaconSignal, BlockMetadata } from './interfaces.js';
|
|
12
|
+
import type { BeaconService, BeaconSignal, BlockMetadata } from './interfaces.js';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Implements {@link https://dcdpr.github.io/did-btcr2/terminology.html#cas-beacon | CAS Beacon}.
|
|
@@ -56,8 +57,8 @@ export class CASBeacon extends Beacon {
|
|
|
56
57
|
const did = this.service.id.split('#')[0];
|
|
57
58
|
|
|
58
59
|
for(const signal of signals) {
|
|
59
|
-
//
|
|
60
|
-
const announcementHash =
|
|
60
|
+
// Signal bytes are hex — matches hex-keyed sidecar maps directly
|
|
61
|
+
const announcementHash = signal.signalBytes;
|
|
61
62
|
|
|
62
63
|
// Look up the CAS Announcement in sidecar casMap
|
|
63
64
|
const casAnnouncement = sidecar.casMap.get(announcementHash);
|
|
@@ -73,13 +74,16 @@ export class CASBeacon extends Beacon {
|
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
// Look up this DID's update hash in the CAS Announcement
|
|
76
|
-
|
|
77
|
+
// Announcement values are base64urlnopad per spec — convert to hex for map lookup
|
|
78
|
+
const updateHashEncoded = casAnnouncement[did];
|
|
77
79
|
|
|
78
80
|
// If no entry for this DID, this announcement doesn't contain an update for us — skip
|
|
79
|
-
if(!
|
|
81
|
+
if(!updateHashEncoded) {
|
|
80
82
|
continue;
|
|
81
83
|
}
|
|
82
84
|
|
|
85
|
+
const updateHash = encode(decode(updateHashEncoded, 'base64urlnopad'), 'hex');
|
|
86
|
+
|
|
83
87
|
// Look up the signed update in sidecar updateMap
|
|
84
88
|
const signedUpdate = sidecar.updateMap.get(updateHash);
|
|
85
89
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MethodError } from '@did-btcr2/common';
|
|
2
|
-
import { Beacon } from './beacon.js';
|
|
2
|
+
import type { Beacon } from './beacon.js';
|
|
3
3
|
import { CASBeacon } from './cas-beacon.js';
|
|
4
|
-
import { BeaconService } from './interfaces.js';
|
|
4
|
+
import type { BeaconService } from './interfaces.js';
|
|
5
5
|
import { SingletonBeacon } from './singleton-beacon.js';
|
|
6
6
|
import { SMTBeacon } from './smt-beacon.js';
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { RawTransactionRest, RawTransactionV2 } from '@did-btcr2/bitcoin';
|
|
2
|
-
import { UnixTimestamp } from '@did-btcr2/common';
|
|
3
|
-
import { DidServiceEndpoint, DidService } from '@web5/dids';
|
|
1
|
+
import type { RawTransactionRest, RawTransactionV2 } from '@did-btcr2/bitcoin';
|
|
2
|
+
import type { UnixTimestamp } from '@did-btcr2/common';
|
|
3
|
+
import type { DidServiceEndpoint, DidService } from '@web5/dids';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Represents a Beacon Service, which extends a W3C DID Service by setting serviceEndpoint
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
BitcoinConnection,
|
|
3
3
|
BlockV3,
|
|
4
|
+
RawTransactionV2} from '@did-btcr2/bitcoin';
|
|
5
|
+
import {
|
|
4
6
|
GENESIS_TX_ID,
|
|
5
|
-
RawTransactionV2,
|
|
6
7
|
TXIN_WITNESS_COINBASE
|
|
7
8
|
} from '@did-btcr2/bitcoin';
|
|
8
9
|
import { ResolveError } from '@did-btcr2/common';
|
|
9
|
-
import { BeaconService, BeaconSignal } from './interfaces.js';
|
|
10
|
+
import type { BeaconService, BeaconSignal } from './interfaces.js';
|
|
10
11
|
import { BeaconUtils } from './utils.js';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Static utility class for discovering Beacon Signals on the Bitcoin blockchain.
|
|
14
|
-
* Extracted from
|
|
15
|
+
* Extracted from `Resolver` for single-responsibility and independent testability.
|
|
15
16
|
*
|
|
16
17
|
* @class BeaconSignalDiscovery
|
|
17
18
|
*/
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { AddressUtxo, BitcoinConnection } from '@did-btcr2/bitcoin';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { AddressUtxo, BitcoinConnection } from '@did-btcr2/bitcoin';
|
|
2
|
+
import type { KeyBytes } from '@did-btcr2/common';
|
|
3
|
+
import { canonicalize, hash } from '@did-btcr2/common';
|
|
4
|
+
import type { SignedBTCR2Update } from '@did-btcr2/cryptosuite';
|
|
4
5
|
import { SchnorrKeyPair } from '@did-btcr2/keypair';
|
|
5
6
|
import { hexToBytes } from '@noble/hashes/utils';
|
|
6
7
|
import { opcodes, Psbt, script } from 'bitcoinjs-lib';
|
|
7
8
|
import type { BeaconProcessResult, DataNeed } from '../resolver.js';
|
|
8
|
-
import { SidecarData } from '../types.js';
|
|
9
|
+
import type { SidecarData } from '../types.js';
|
|
9
10
|
import { Beacon } from './beacon.js';
|
|
10
11
|
import { SingletonBeaconError } from './error.js';
|
|
11
|
-
import { BeaconService, BeaconSignal, BlockMetadata } from './interfaces.js';
|
|
12
|
+
import type { BeaconService, BeaconSignal, BlockMetadata } from './interfaces.js';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Implements {@link https://dcdpr.github.io/did-btcr2/terminology.html#singleton-beacon | Singleton Beacon}.
|
|
@@ -40,8 +41,8 @@ export class SingletonBeacon extends Beacon {
|
|
|
40
41
|
const needs = new Array<DataNeed>();
|
|
41
42
|
|
|
42
43
|
for(const signal of signals) {
|
|
43
|
-
//
|
|
44
|
-
const updateHash =
|
|
44
|
+
// Signal bytes are hex — matches hex-keyed sidecar maps directly
|
|
45
|
+
const updateHash = signal.signalBytes;
|
|
45
46
|
|
|
46
47
|
// Look up the signed update in sidecar updateMap
|
|
47
48
|
const signedUpdate = sidecar.updateMap.get(updateHash);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { BitcoinConnection } from '@did-btcr2/bitcoin';
|
|
2
|
-
import { KeyBytes } from '@did-btcr2/common';
|
|
3
|
-
import { SignedBTCR2Update } from '@did-btcr2/cryptosuite';
|
|
1
|
+
import type { BitcoinConnection } from '@did-btcr2/bitcoin';
|
|
2
|
+
import type { KeyBytes } from '@did-btcr2/common';
|
|
3
|
+
import type { SignedBTCR2Update } from '@did-btcr2/cryptosuite';
|
|
4
4
|
import type { BeaconProcessResult } from '../resolver.js';
|
|
5
|
-
import { SidecarData } from '../types.js';
|
|
5
|
+
import type { SidecarData } from '../types.js';
|
|
6
6
|
import { Beacon } from './beacon.js';
|
|
7
7
|
import { SMTBeaconError } from './error.js';
|
|
8
|
-
import { BeaconService, BeaconSignal } from './interfaces.js';
|
|
8
|
+
import type { BeaconService, BeaconSignal } from './interfaces.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Implements {@link https://dcdpr.github.io/did-btcr2/terminology.html#smt-beacon | SMTBeacon}.
|
package/src/core/beacon/utils.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { getNetwork } from '@did-btcr2/bitcoin';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { KeyBytes, Maybe} from '@did-btcr2/common';
|
|
3
|
+
import { DidMethodError, MethodError } from '@did-btcr2/common';
|
|
4
|
+
import type { networks} from 'bitcoinjs-lib';
|
|
5
|
+
import { payments } from 'bitcoinjs-lib';
|
|
4
6
|
import { Appendix } from '../../utils/appendix.js';
|
|
5
|
-
import { DidDocument } from '../../utils/did-document.js';
|
|
7
|
+
import type { DidDocument } from '../../utils/did-document.js';
|
|
6
8
|
import { Identifier } from '../identifier.js';
|
|
7
|
-
import { BeaconService } from './interfaces.js';
|
|
9
|
+
import type { BeaconService } from './interfaces.js';
|
|
8
10
|
import { BeaconError } from './error.js';
|
|
9
11
|
|
|
10
12
|
/**
|