@did-btcr2/method 0.23.0 → 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.
- package/README.md +96 -50
- package/dist/browser.js +36332 -37280
- package/dist/browser.mjs +36331 -37279
- package/dist/cjs/core/beacon/aggregation/communication/adapter/did-comm.js +1 -1
- package/dist/cjs/core/beacon/aggregation/communication/adapter/did-comm.js.map +1 -1
- package/dist/cjs/core/beacon/aggregation/communication/adapter/nostr.js +1 -1
- package/dist/cjs/core/beacon/aggregation/communication/adapter/nostr.js.map +1 -1
- package/dist/cjs/core/beacon/aggregation/coordinator.js +40 -44
- package/dist/cjs/core/beacon/aggregation/coordinator.js.map +1 -1
- package/dist/cjs/core/beacon/aggregation/participant.js +35 -38
- package/dist/cjs/core/beacon/aggregation/participant.js.map +1 -1
- package/dist/cjs/core/beacon/aggregation/session/index.js +3 -4
- package/dist/cjs/core/beacon/aggregation/session/index.js.map +1 -1
- package/dist/cjs/core/beacon/beacon.js.map +1 -1
- package/dist/cjs/core/beacon/cas-beacon.js +119 -7
- package/dist/cjs/core/beacon/cas-beacon.js.map +1 -1
- package/dist/cjs/core/beacon/factory.js +1 -1
- package/dist/cjs/core/beacon/factory.js.map +1 -1
- package/dist/cjs/core/beacon/{singleton.js → singleton-beacon.js} +19 -27
- package/dist/cjs/core/beacon/singleton-beacon.js.map +1 -0
- package/dist/cjs/core/beacon/smt-beacon.js +1 -1
- package/dist/cjs/core/beacon/smt-beacon.js.map +1 -1
- package/dist/cjs/core/identifier.js +1 -1
- package/dist/cjs/core/identifier.js.map +1 -1
- package/dist/{esm/core/resolve.js → cjs/core/resolver.js} +244 -92
- package/dist/cjs/core/resolver.js.map +1 -0
- package/dist/cjs/core/update.js +7 -7
- package/dist/cjs/core/update.js.map +1 -1
- package/dist/cjs/did-btcr2.js +34 -94
- package/dist/cjs/did-btcr2.js.map +1 -1
- package/dist/cjs/index.js +2 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/did-document.js +9 -19
- package/dist/cjs/utils/did-document.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/communication/adapter/did-comm.js +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 -1
- package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/coordinator.js +40 -44
- package/dist/esm/core/beacon/aggregation/coordinator.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/participant.js +35 -38
- package/dist/esm/core/beacon/aggregation/participant.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/session/index.js +3 -4
- package/dist/esm/core/beacon/aggregation/session/index.js.map +1 -1
- package/dist/esm/core/beacon/beacon.js.map +1 -1
- package/dist/esm/core/beacon/cas-beacon.js +119 -7
- package/dist/esm/core/beacon/cas-beacon.js.map +1 -1
- package/dist/esm/core/beacon/factory.js +1 -1
- package/dist/esm/core/beacon/factory.js.map +1 -1
- package/dist/esm/core/beacon/{singleton.js → singleton-beacon.js} +19 -27
- package/dist/esm/core/beacon/singleton-beacon.js.map +1 -0
- package/dist/esm/core/beacon/smt-beacon.js +1 -1
- package/dist/esm/core/beacon/smt-beacon.js.map +1 -1
- package/dist/esm/core/identifier.js +1 -1
- package/dist/esm/core/identifier.js.map +1 -1
- package/dist/{cjs/core/resolve.js → esm/core/resolver.js} +244 -92
- package/dist/esm/core/resolver.js.map +1 -0
- package/dist/esm/core/update.js +7 -7
- package/dist/esm/core/update.js.map +1 -1
- package/dist/esm/did-btcr2.js +34 -94
- package/dist/esm/did-btcr2.js.map +1 -1
- package/dist/esm/index.js +2 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/did-document.js +9 -19
- package/dist/esm/utils/did-document.js.map +1 -1
- package/dist/types/core/beacon/aggregation/cohort/index.d.ts +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/base.d.ts +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/constants.d.ts +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/index.d.ts +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts +2 -2
- 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 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts +1 -0
- package/dist/types/core/beacon/aggregation/cohort/status.d.ts +1 -0
- package/dist/types/core/beacon/aggregation/communication/adapter/did-comm.d.ts +4 -3
- 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 +5 -3
- package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/communication/error.d.ts +1 -0
- package/dist/types/core/beacon/aggregation/communication/factory.d.ts +1 -0
- package/dist/types/core/beacon/aggregation/communication/service.d.ts +3 -2
- package/dist/types/core/beacon/aggregation/communication/service.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/coordinator.d.ts +1 -0
- package/dist/types/core/beacon/aggregation/coordinator.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/participant.d.ts +1 -0
- package/dist/types/core/beacon/aggregation/participant.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/session/index.d.ts +1 -0
- package/dist/types/core/beacon/aggregation/session/index.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/session/status.d.ts +1 -0
- package/dist/types/core/beacon/beacon.d.ts +10 -4
- package/dist/types/core/beacon/beacon.d.ts.map +1 -1
- package/dist/types/core/beacon/cas-beacon.d.ts +27 -7
- package/dist/types/core/beacon/cas-beacon.d.ts.map +1 -1
- package/dist/types/core/beacon/error.d.ts +1 -0
- package/dist/types/core/beacon/factory.d.ts +1 -0
- package/dist/types/core/beacon/interfaces.d.ts +1 -0
- package/dist/types/core/beacon/signal-discovery.d.ts +1 -0
- package/dist/types/core/beacon/{singleton.d.ts → singleton-beacon.d.ts} +7 -5
- package/dist/types/core/beacon/singleton-beacon.d.ts.map +1 -0
- package/dist/types/core/beacon/smt-beacon.d.ts +5 -3
- package/dist/types/core/beacon/smt-beacon.d.ts.map +1 -1
- package/dist/types/core/beacon/utils.d.ts +1 -0
- package/dist/types/core/identifier.d.ts +1 -0
- package/dist/types/core/interfaces.d.ts +6 -15
- package/dist/types/core/interfaces.d.ts.map +1 -1
- package/dist/types/core/resolver.d.ts +167 -0
- package/dist/types/core/resolver.d.ts.map +1 -0
- package/dist/types/core/types.d.ts +1 -0
- package/dist/types/core/update.d.ts +4 -3
- package/dist/types/core/update.d.ts.map +1 -1
- package/dist/types/did-btcr2.d.ts +17 -16
- package/dist/types/did-btcr2.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/utils/appendix.d.ts +1 -0
- package/dist/types/utils/did-document-builder.d.ts +1 -0
- package/dist/types/utils/did-document.d.ts +2 -6
- package/dist/types/utils/did-document.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.ts +1 -1
- package/src/core/beacon/aggregation/communication/adapter/did-comm.ts +4 -3
- package/src/core/beacon/aggregation/communication/adapter/nostr.ts +4 -3
- package/src/core/beacon/aggregation/communication/service.ts +2 -2
- package/src/core/beacon/aggregation/coordinator.ts +40 -44
- package/src/core/beacon/aggregation/participant.ts +38 -40
- package/src/core/beacon/aggregation/session/index.ts +3 -4
- package/src/core/beacon/beacon.ts +9 -5
- package/src/core/beacon/cas-beacon.ts +156 -10
- package/src/core/beacon/factory.ts +1 -1
- package/src/core/beacon/{singleton.ts → singleton-beacon.ts} +20 -36
- package/src/core/beacon/smt-beacon.ts +4 -3
- package/src/core/identifier.ts +1 -1
- package/src/core/interfaces.ts +5 -16
- package/src/core/resolver.ts +706 -0
- package/src/core/update.ts +9 -9
- package/src/did-btcr2.ts +37 -130
- package/src/index.ts +2 -3
- package/src/utils/did-document.ts +10 -18
- package/dist/cjs/core/beacon/singleton.js.map +0 -1
- package/dist/cjs/core/resolve.js.map +0 -1
- package/dist/cjs/utils/general.js +0 -195
- package/dist/cjs/utils/general.js.map +0 -1
- package/dist/esm/core/beacon/singleton.js.map +0 -1
- package/dist/esm/core/resolve.js.map +0 -1
- package/dist/esm/utils/general.js +0 -195
- package/dist/esm/utils/general.js.map +0 -1
- package/dist/types/core/beacon/singleton.d.ts.map +0 -1
- package/dist/types/core/resolve.d.ts +0 -92
- package/dist/types/core/resolve.d.ts.map +0 -1
- package/dist/types/utils/general.d.ts +0 -85
- package/dist/types/utils/general.d.ts.map +0 -1
- package/src/core/resolve.ts +0 -474
- package/src/utils/general.ts +0 -204
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"participant.d.ts","sourceRoot":"","sources":["../../../../../src/core/beacon/aggregation/participant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"participant.d.ts","sourceRoot":"","sources":["../../../../../src/core/beacon/aggregation/participant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC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AE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAoBrF;;;;;OAKG;IACI,yBAAyB,CAAC,MAAM,EAAE,qBAAqB,EAAE,OAAO,EAAE,0BAA0B,GAAG,UAAU;IAmBhH;;;;;OAKG;IACU,qBAAqB,CAChC,MAAM,EAAE,qBAAqB,EAC7B,iBAAiB,EAAE,UAAU,EAC7B,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,IAAI,CAAC;IAYhB;;;;;OAKG;IACU,oBAAoB,CAAC,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAY7G;;;;;;;OAOG;WACW,UAAU,CAAC,GAAG,EAAE,IAAI,GAAG,QAAQ,EAAE,QAAQ,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,iBAAiB;CAG9H"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/core/beacon/aggregation/session/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/core/beacon/aggregation/session/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,uCAAuC,EAAE,MAAM,kDAAkD,CAAC;AAC3G,OAAO,EAA0B,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAElF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAQ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EjD;;;OAGG;IACI,YAAY,CAAC,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACI,aAAa,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC;IAEtC;;;;;;;;OAQG;gBACS,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,EAAE,EAAE,cAAc;IAQhF;;;;;OAKG;IACI,uBAAuB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,uCAAuC;IAWjG;;;;;OAKG;IACI,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,UAAU,GAAG,IAAI;IAoB9E;;;;OAIG;IACI,uBAAuB,IAAI,UAAU;IAkB5C;;;;OAIG;IACI,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,UAAU,GAAG,IAAI;IAY5E;;;OAGG;IACU,sBAAsB,IAAI,OAAO,CAAC,UAAU,CAAC;IA0B1D;;;;OAIG;IACI,wBAAwB,CAAC,aAAa,EAAE,UAAU,GAAG,UAAU;IAYtE;;;OAGG;IACI,MAAM,IAAI,OAAO,CAAC,0BAA0B,CAAC;IAgBpD;;;OAGG;IACI,UAAU,IAAI,OAAO;IAI5B;;;OAGG;IACI,QAAQ,IAAI,OAAO;CAG3B"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { KeyBytes } from '@did-btcr2/common';
|
|
2
2
|
import { BitcoinConnection } from '@did-btcr2/bitcoin';
|
|
3
|
-
import { SignedBTCR2Update } from '
|
|
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
|
|
6
|
+
import { BeaconService, BeaconSignal } from './interfaces.js';
|
|
6
7
|
/**
|
|
7
8
|
* Abstract base class for all BTCR2 Beacon types.
|
|
8
9
|
* A Beacon is a service listed in a BTCR2 DID document that informs resolvers
|
|
@@ -27,11 +28,15 @@ export declare abstract class Beacon {
|
|
|
27
28
|
/**
|
|
28
29
|
* Processes an array of Beacon Signals to extract BTCR2 Signed Updates.
|
|
29
30
|
* Used during the resolve path.
|
|
31
|
+
*
|
|
32
|
+
* Returns successfully resolved updates and any data needs that must be
|
|
33
|
+
* satisfied before remaining signals can be processed.
|
|
34
|
+
*
|
|
30
35
|
* @param {Array<BeaconSignal>} signals The beacon signals discovered on-chain.
|
|
31
36
|
* @param {SidecarData} sidecar The processed sidecar data containing update/CAS/SMT maps.
|
|
32
|
-
* @returns {
|
|
37
|
+
* @returns {BeaconProcessResult} The updates and any data needs.
|
|
33
38
|
*/
|
|
34
|
-
abstract processSignals(signals: Array<BeaconSignal>, sidecar: SidecarData):
|
|
39
|
+
abstract processSignals(signals: Array<BeaconSignal>, sidecar: SidecarData): BeaconProcessResult;
|
|
35
40
|
/**
|
|
36
41
|
* Broadcasts a signed update as a Beacon Signal to the Bitcoin network.
|
|
37
42
|
* Used during the update path.
|
|
@@ -42,3 +47,4 @@ export declare abstract class Beacon {
|
|
|
42
47
|
*/
|
|
43
48
|
abstract broadcastSignal(signedUpdate: SignedBTCR2Update, secretKey: KeyBytes, bitcoin: BitcoinConnection): Promise<SignedBTCR2Update>;
|
|
44
49
|
}
|
|
50
|
+
//# sourceMappingURL=beacon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beacon.d.ts","sourceRoot":"","sources":["../../../../src/core/beacon/beacon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"beacon.d.ts","sourceRoot":"","sources":["../../../../src/core/beacon/beacon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE9D;;;;;;;;;;;;;;GAcG;AACH,8BAAsB,MAAM;IAC1B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;gBAEpB,OAAO,EAAE,aAAa;IAIlC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,cAAc,CACrB,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC,EAC5B,OAAO,EAAE,WAAW,GACnB,mBAAmB;IAEtB;;;;;;;OAOG;IACH,QAAQ,CAAC,eAAe,CACtB,YAAY,EAAE,iBAAiB,EAC/B,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,iBAAiB,CAAC;CAC9B"}
|
|
@@ -1,11 +1,19 @@
|
|
|
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
|
-
import { BeaconService, BeaconSignal
|
|
7
|
+
import { BeaconService, BeaconSignal } from './interfaces.js';
|
|
7
8
|
/**
|
|
8
9
|
* Implements {@link https://dcdpr.github.io/did-btcr2/terminology.html#cas-beacon | CAS Beacon}.
|
|
10
|
+
*
|
|
11
|
+
* A CAS (Content-Addressed Store) Beacon aggregates updates for multiple DIDs
|
|
12
|
+
* into a single CAS Announcement — a mapping of DIDs to their update hashes.
|
|
13
|
+
* The hash of the CAS Announcement is broadcast on-chain via OP_RETURN.
|
|
14
|
+
* During resolution, the CAS Announcement is retrieved from the sidecar (or CAS)
|
|
15
|
+
* and used to look up the individual signed update for the DID being resolved.
|
|
16
|
+
*
|
|
9
17
|
* @class CASBeacon
|
|
10
18
|
* @type {CASBeacon}
|
|
11
19
|
* @extends {Beacon}
|
|
@@ -18,19 +26,31 @@ export declare class CASBeacon extends Beacon {
|
|
|
18
26
|
constructor(service: BeaconService);
|
|
19
27
|
/**
|
|
20
28
|
* Implements {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#process-cas-beacon | 7.2.e.1 Process CAS Beacon}.
|
|
29
|
+
*
|
|
30
|
+
* For each signal, the signalBytes contain the hex-encoded hash of a CAS Announcement.
|
|
31
|
+
* The CAS Announcement maps DIDs to their base64url-encoded update hashes.
|
|
32
|
+
* This method looks up the CAS Announcement from the sidecar, extracts the update
|
|
33
|
+
* hash for the DID being resolved, and retrieves the corresponding signed update.
|
|
34
|
+
*
|
|
21
35
|
* @param {Array<BeaconSignal>} signals The array of Beacon Signals to process.
|
|
22
36
|
* @param {SidecarData} sidecar The sidecar data associated with the CAS Beacon.
|
|
23
|
-
* @returns {
|
|
24
|
-
* @throws {CASBeaconError} if
|
|
37
|
+
* @returns {BeaconProcessResult} Successfully resolved updates and any data needs.
|
|
38
|
+
* @throws {CASBeaconError} if hash verification fails (validation errors only).
|
|
25
39
|
*/
|
|
26
|
-
processSignals(signals: Array<BeaconSignal>, sidecar: SidecarData):
|
|
40
|
+
processSignals(signals: Array<BeaconSignal>, sidecar: SidecarData): BeaconProcessResult;
|
|
27
41
|
/**
|
|
28
|
-
*
|
|
42
|
+
* Broadcasts a CAS Beacon signal to the Bitcoin network.
|
|
43
|
+
*
|
|
44
|
+
* Creates a CAS Announcement mapping the DID to the update hash, then broadcasts
|
|
45
|
+
* the hash of the announcement via OP_RETURN. The CAS Announcement is distributed
|
|
46
|
+
* to resolvers via sidecar data.
|
|
47
|
+
*
|
|
29
48
|
* @param {SignedBTCR2Update} signedUpdate The signed BTCR2 update to broadcast.
|
|
30
49
|
* @param {KeyBytes} secretKey The secret key for signing the Bitcoin transaction.
|
|
31
50
|
* @param {BitcoinConnection} bitcoin The Bitcoin network connection.
|
|
32
|
-
* @
|
|
33
|
-
* @throws {CASBeaconError} if
|
|
51
|
+
* @returns {Promise<SignedBTCR2Update>} The signed update that was broadcast.
|
|
52
|
+
* @throws {CASBeaconError} if the bitcoin address is invalid or unfunded.
|
|
34
53
|
*/
|
|
35
54
|
broadcastSignal(signedUpdate: SignedBTCR2Update, secretKey: KeyBytes, bitcoin: BitcoinConnection): Promise<SignedBTCR2Update>;
|
|
36
55
|
}
|
|
56
|
+
//# sourceMappingURL=cas-beacon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cas-beacon.d.ts","sourceRoot":"","sources":["../../../../src/core/beacon/cas-beacon.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"cas-beacon.d.ts","sourceRoot":"","sources":["../../../../src/core/beacon/cas-beacon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAqD,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D,OAAO,KAAK,EAAE,mBAAmB,EAAY,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAiB,MAAM,iBAAiB,CAAC;AAE7E;;;;;;;;;;;;GAYG;AACH,qBAAa,SAAU,SAAQ,MAAM;IACnC;;;OAGG;gBACS,OAAO,EAAE,aAAa;IAIlC;;;;;;;;;;;;OAYG;IACH,cAAc,CACZ,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC,EAC5B,OAAO,EAAE,WAAW,GACnB,mBAAmB;IAmDtB;;;;;;;;;;;;OAYG;IACG,eAAe,CACnB,YAAY,EAAE,iBAAiB,EAC/B,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,iBAAiB,CAAC;CAiF9B"}
|
|
@@ -1,9 +1,10 @@
|
|
|
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
|
-
import { BeaconService, BeaconSignal
|
|
7
|
+
import { BeaconService, BeaconSignal } from './interfaces.js';
|
|
7
8
|
/**
|
|
8
9
|
* Implements {@link https://dcdpr.github.io/did-btcr2/terminology.html#singleton-beacon | Singleton Beacon}.
|
|
9
10
|
* @class SingletonBeacon
|
|
@@ -14,15 +15,15 @@ export declare class SingletonBeacon extends Beacon {
|
|
|
14
15
|
/**
|
|
15
16
|
* Creates an instance of SingletonBeacon.
|
|
16
17
|
* @param {BeaconService} service The BeaconService object representing the funded beacon to announce the update to.
|
|
17
|
-
*
|
|
18
18
|
*/
|
|
19
19
|
constructor(service: BeaconService);
|
|
20
20
|
/**
|
|
21
21
|
* Processes an array of Beacon Signals associated with a Singleton Beacon Service.
|
|
22
|
-
* @
|
|
23
|
-
* @
|
|
22
|
+
* @param {Array<BeaconSignal>} signals The beacon signals discovered on-chain.
|
|
23
|
+
* @param {SidecarData} sidecar The processed sidecar data.
|
|
24
|
+
* @returns {BeaconProcessResult} Successfully resolved updates and any data needs.
|
|
24
25
|
*/
|
|
25
|
-
processSignals(signals: Array<BeaconSignal>, sidecar: SidecarData):
|
|
26
|
+
processSignals(signals: Array<BeaconSignal>, sidecar: SidecarData): BeaconProcessResult;
|
|
26
27
|
/**
|
|
27
28
|
* Broadcasts a SingletonBeacon signal to the Bitcoin network.
|
|
28
29
|
* @param {SignedBTCR2Update} signedUpdate The signed BTCR2 update to broadcast.
|
|
@@ -33,3 +34,4 @@ export declare class SingletonBeacon extends Beacon {
|
|
|
33
34
|
*/
|
|
34
35
|
broadcastSignal(signedUpdate: SignedBTCR2Update, secretKey: KeyBytes, bitcoin: BitcoinConnection): Promise<SignedBTCR2Update>;
|
|
35
36
|
}
|
|
37
|
+
//# sourceMappingURL=singleton-beacon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singleton-beacon.d.ts","sourceRoot":"","sources":["../../../../src/core/beacon/singleton-beacon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAsC,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D,OAAO,KAAK,EAAE,mBAAmB,EAAY,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAiB,MAAM,iBAAiB,CAAC;AAE7E;;;;;GAKG;AACH,qBAAa,eAAgB,SAAQ,MAAM;IAEzC;;;OAGG;gBACS,OAAO,EAAE,aAAa;IAIlC;;;;;OAKG;IACH,cAAc,CACZ,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC,EAC5B,OAAO,EAAE,WAAW,GACnB,mBAAmB;IA0BtB;;;;;;;OAOG;IACG,eAAe,CACnB,YAAY,EAAE,iBAAiB,EAC/B,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,iBAAiB,CAAC;CAsE9B"}
|
|
@@ -1,9 +1,10 @@
|
|
|
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
|
-
import { BeaconService, BeaconSignal
|
|
7
|
+
import { BeaconService, BeaconSignal } from './interfaces.js';
|
|
7
8
|
/**
|
|
8
9
|
* Implements {@link https://dcdpr.github.io/did-btcr2/terminology.html#smt-beacon | SMTBeacon}.
|
|
9
10
|
* @class SMTBeacon
|
|
@@ -20,10 +21,10 @@ export declare class SMTBeacon extends Beacon {
|
|
|
20
21
|
* Implements {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#process-smt-beacon | 7.2.e.1 Process SMT Beacon}.
|
|
21
22
|
* @param {Array<BeaconSignal>} signals The array of Beacon Signals to process.
|
|
22
23
|
* @param {SidecarData} sidecar The sidecar data associated with the SMT Beacon.
|
|
23
|
-
* @returns {
|
|
24
|
+
* @returns {BeaconProcessResult} The processed signals.
|
|
24
25
|
* @throws {SMTBeaconError} if processing fails.
|
|
25
26
|
*/
|
|
26
|
-
processSignals(signals: Array<BeaconSignal>, sidecar: SidecarData):
|
|
27
|
+
processSignals(signals: Array<BeaconSignal>, sidecar: SidecarData): BeaconProcessResult;
|
|
27
28
|
/**
|
|
28
29
|
* Broadcast CAS Beacon signal to the Bitcoin network.
|
|
29
30
|
* @param {SignedBTCR2Update} signedUpdate The signed BTCR2 update to broadcast.
|
|
@@ -34,3 +35,4 @@ export declare class SMTBeacon extends Beacon {
|
|
|
34
35
|
*/
|
|
35
36
|
broadcastSignal(signedUpdate: SignedBTCR2Update, secretKey: KeyBytes, bitcoin: BitcoinConnection): Promise<SignedBTCR2Update>;
|
|
36
37
|
}
|
|
38
|
+
//# sourceMappingURL=smt-beacon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smt-beacon.d.ts","sourceRoot":"","sources":["../../../../src/core/beacon/smt-beacon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"smt-beacon.d.ts","sourceRoot":"","sources":["../../../../src/core/beacon/smt-beacon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE9D;;;;;GAKG;AACH,qBAAa,SAAU,SAAQ,MAAM;IACnC;;;OAGG;gBACS,OAAO,EAAE,aAAa;IAIlC;;;;;;OAMG;IACH,cAAc,CACZ,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC,EAC5B,OAAO,EAAE,WAAW,GACnB,mBAAmB;IAItB;;;;;;;OAOG;IACG,eAAe,CACnB,YAAY,EAAE,iBAAiB,EAC/B,SAAS,EAAE,QAAQ,EACnB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,iBAAiB,CAAC;CAG9B"}
|
|
@@ -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
|
export interface RootCapability {
|
|
@@ -10,8 +9,12 @@ export interface RootCapability {
|
|
|
10
9
|
/**
|
|
11
10
|
* See {@link https://dcdpr.github.io/did-btcr2/data-structures.html#resolution-options-example-panel-show | Resolution Options}
|
|
12
11
|
* for data structure details.
|
|
12
|
+
*
|
|
13
|
+
* Resolution is now fully sans-I/O via the {@link Resolver} state machine.
|
|
14
|
+
* External data (Bitcoin signals, CAS data) is provided through the
|
|
15
|
+
* `resolver.resolve()` / `resolver.provide()` protocol.
|
|
13
16
|
*/
|
|
14
|
-
export interface
|
|
17
|
+
export interface ResolutionOptions extends DidResolutionOptions {
|
|
15
18
|
/**
|
|
16
19
|
* Optional ASCII string representation of the specific version of a DID document
|
|
17
20
|
* to be resolved.
|
|
@@ -29,19 +32,6 @@ export interface ResolutionOptionsCore extends DidResolutionOptions {
|
|
|
29
32
|
*/
|
|
30
33
|
sidecar?: Sidecar;
|
|
31
34
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Full set of resolution options for the did:btcr2 method. See {@link ResolutionOptionsCore}
|
|
34
|
-
* for the resolution options defined by the specification.
|
|
35
|
-
* @extends ResolutionOptionsCore
|
|
36
|
-
*/
|
|
37
|
-
export interface ResolutionOptions extends ResolutionOptionsCore {
|
|
38
|
-
/**
|
|
39
|
-
* Drivers for interacting with external systems, such as the Bitcoin network.
|
|
40
|
-
*/
|
|
41
|
-
drivers?: {
|
|
42
|
-
bitcoin?: BitcoinConnection;
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
35
|
/**
|
|
46
36
|
* {@link https://dcdpr.github.io/did-btcr2/terminology.html#smt-proof | SMT Proof}
|
|
47
37
|
* a set of SHA-256 hashes for nodes in a Sparse Merkle Tree that together form
|
|
@@ -85,3 +75,4 @@ export interface SMTProof {
|
|
|
85
75
|
*/
|
|
86
76
|
hashes: string[];
|
|
87
77
|
}
|
|
78
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/core/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/core/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,MAAM,WAAW,cAAc;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAkB,SAAQ,oBAAoB;IAC7D;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { SignedBTCR2Update } from '@did-btcr2/cryptosuite';
|
|
2
|
+
import { DidDocument } from '../utils/did-document.js';
|
|
3
|
+
import { BeaconService, BeaconSignal, BlockMetadata } from './beacon/interfaces.js';
|
|
4
|
+
import { DidComponents } from './identifier.js';
|
|
5
|
+
import { CASAnnouncement, Sidecar, SidecarData } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* The response object for DID Resolution.
|
|
8
|
+
*/
|
|
9
|
+
export interface DidResolutionResponse {
|
|
10
|
+
didDocument: DidDocument;
|
|
11
|
+
metadata: {
|
|
12
|
+
confirmations?: number;
|
|
13
|
+
versionId: string;
|
|
14
|
+
updated?: string;
|
|
15
|
+
deactivated?: boolean;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/** The resolver needs a genesis document whose hash matches genesisHash. */
|
|
19
|
+
export interface NeedGenesisDocument {
|
|
20
|
+
readonly kind: 'NeedGenesisDocument';
|
|
21
|
+
/** Base64url-encoded SHA-256 hash from the DID identifier's genesisBytes. */
|
|
22
|
+
readonly genesisHash: string;
|
|
23
|
+
}
|
|
24
|
+
/** The resolver needs beacon signals for these beacon service addresses. */
|
|
25
|
+
export interface NeedBeaconSignals {
|
|
26
|
+
readonly kind: 'NeedBeaconSignals';
|
|
27
|
+
/** The beacon services that need signal data. Pass directly to BeaconSignalDiscovery. */
|
|
28
|
+
readonly beaconServices: ReadonlyArray<BeaconService>;
|
|
29
|
+
}
|
|
30
|
+
/** The resolver needs a CAS Announcement whose canonical hash matches announcementHash. */
|
|
31
|
+
export interface NeedCASAnnouncement {
|
|
32
|
+
readonly kind: 'NeedCASAnnouncement';
|
|
33
|
+
/** Base64url-encoded canonical hash of the CAS Announcement. */
|
|
34
|
+
readonly announcementHash: string;
|
|
35
|
+
/** The beacon service that produced this signal. */
|
|
36
|
+
readonly beaconServiceId: string;
|
|
37
|
+
}
|
|
38
|
+
/** The resolver needs a SignedBTCR2Update whose canonical hash matches updateHash. */
|
|
39
|
+
export interface NeedSignedUpdate {
|
|
40
|
+
readonly kind: 'NeedSignedUpdate';
|
|
41
|
+
/** Base64url-encoded canonical hash of the signed update. */
|
|
42
|
+
readonly updateHash: string;
|
|
43
|
+
/** The beacon service that produced this signal. */
|
|
44
|
+
readonly beaconServiceId: string;
|
|
45
|
+
}
|
|
46
|
+
/** Discriminated union of all data the resolver may request from the caller. */
|
|
47
|
+
export type DataNeed = NeedGenesisDocument | NeedBeaconSignals | NeedCASAnnouncement | NeedSignedUpdate;
|
|
48
|
+
/**
|
|
49
|
+
* Output of {@link Resolver.resolve}. Analogous to Rust's `ResolverState` enum.
|
|
50
|
+
* Either the resolver needs data from the caller, or resolution is complete.
|
|
51
|
+
*/
|
|
52
|
+
export type ResolverState = {
|
|
53
|
+
status: 'action-required';
|
|
54
|
+
needs: ReadonlyArray<DataNeed>;
|
|
55
|
+
} | {
|
|
56
|
+
status: 'resolved';
|
|
57
|
+
result: DidResolutionResponse;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Return type from {@link Beacon.processSignals}.
|
|
61
|
+
* Contains successfully resolved updates and any data needs that must be
|
|
62
|
+
* satisfied before the remaining signals can be processed.
|
|
63
|
+
*/
|
|
64
|
+
export interface BeaconProcessResult {
|
|
65
|
+
updates: Array<[SignedBTCR2Update, BlockMetadata]>;
|
|
66
|
+
needs: Array<DataNeed>;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Sans-I/O state machine for did:btcr2 resolution.
|
|
70
|
+
*
|
|
71
|
+
* Created by {@link DidBtcr2.resolve} (the factory). The caller drives resolution
|
|
72
|
+
* by repeatedly calling {@link resolve} and {@link provide}:
|
|
73
|
+
*
|
|
74
|
+
* ```typescript
|
|
75
|
+
* const resolver = DidBtcr2.resolve(did, { sidecar });
|
|
76
|
+
* let state = resolver.resolve();
|
|
77
|
+
*
|
|
78
|
+
* while (state.status === 'action-required') {
|
|
79
|
+
* for (const need of state.needs) { ... fetch & provide ... }
|
|
80
|
+
* state = resolver.resolve();
|
|
81
|
+
* }
|
|
82
|
+
* const { didDocument, metadata } = state.result;
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* The Resolver performs **zero I/O**. All external data (Bitcoin signals, CAS
|
|
86
|
+
* data, genesis documents) flows through the advance/provide protocol.
|
|
87
|
+
*
|
|
88
|
+
* @class Resolver
|
|
89
|
+
*/
|
|
90
|
+
export declare class Resolver {
|
|
91
|
+
#private;
|
|
92
|
+
/**
|
|
93
|
+
* @internal — Use {@link DidBtcr2.resolve} to create instances.
|
|
94
|
+
*/
|
|
95
|
+
constructor(didComponents: DidComponents, sidecarData: SidecarData, currentDocument: DidDocument | null, options?: {
|
|
96
|
+
versionId?: string;
|
|
97
|
+
versionTime?: string;
|
|
98
|
+
genesisDocument?: object;
|
|
99
|
+
});
|
|
100
|
+
/**
|
|
101
|
+
* Implements subsection {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#if-genesis_bytes-is-a-secp256k1-public-key | 7.2.d.1 if genesis bytes is a secp256k1 Public Key}.
|
|
102
|
+
* @param {DidComponents} didComponents The decoded components of the did.
|
|
103
|
+
* @returns {DidDocument} The resolved DID Document object.
|
|
104
|
+
*/
|
|
105
|
+
static deterministic(didComponents: DidComponents): DidDocument;
|
|
106
|
+
/**
|
|
107
|
+
* Implements subsection {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#if-genesis_bytes-is-a-sha-256-hash | 7.2.d.2 if genesis_bytes is a SHA-256 Hash}.
|
|
108
|
+
* @param {DidComponents} didComponents BTCR2 DID components used to resolve the DID Document
|
|
109
|
+
* @param {object} genesisDocument The genesis document for resolving the DID Document.
|
|
110
|
+
* @returns {DidDocument} The resolved DID Document object
|
|
111
|
+
* @throws {ResolveError} InvalidDidDocument if not conformant to DID Core v1.1
|
|
112
|
+
*/
|
|
113
|
+
static external(didComponents: DidComponents, genesisDocument: object): DidDocument;
|
|
114
|
+
/**
|
|
115
|
+
* Implements subsection {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#process-sidecar-data | Process Sidecar Data}
|
|
116
|
+
* @param {Sidecar} sidecar The sidecar data to process.
|
|
117
|
+
* @returns {SidecarData} The processed sidecar data containing maps of updates, CAS announcements, and SMT proofs.
|
|
118
|
+
*/
|
|
119
|
+
static sidecarData(sidecar?: Sidecar): SidecarData;
|
|
120
|
+
/**
|
|
121
|
+
* Implements subsection {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#process-updates | 7.2.f Process updates Array}.
|
|
122
|
+
* @param {DidDocument} currentDocument The current DID Document to apply the updates to.
|
|
123
|
+
* @param {Array<[SignedBTCR2Update, BlockMetadata]>} unsortedUpdates The unsorted array of BTCR2 Signed Updates and their associated Block Metadata.
|
|
124
|
+
* @param {string} [versionTime] The optional version time to limit updates to.
|
|
125
|
+
* @param {string} [versionId] The optional version id to limit updates to.
|
|
126
|
+
* @returns {DidResolutionResponse} The updated DID Document, number of confirmations, and version id.
|
|
127
|
+
*/
|
|
128
|
+
static updates(currentDocument: DidDocument, unsortedUpdates: Array<[SignedBTCR2Update, BlockMetadata]>, versionTime?: string, versionId?: string): DidResolutionResponse;
|
|
129
|
+
/**
|
|
130
|
+
* Implements subsection {@link https://dcdpr.github.io/did-btcr2/#confirm-duplicate-update | 7.2.f.1 Confirm Duplicate Update}.
|
|
131
|
+
* This step confirms that an update with a lower-than-expected targetVersionId is a true duplicate.
|
|
132
|
+
* @param {SignedBTCR2Update} update The BTCR2 Signed Update to confirm as a duplicate.
|
|
133
|
+
* @param {string[]} updateHashHistory The accumulated hash history for comparison.
|
|
134
|
+
* @returns {void} Does not return a value, but throws an error if the update is not a valid duplicate.
|
|
135
|
+
*/
|
|
136
|
+
private static confirmDuplicate;
|
|
137
|
+
/**
|
|
138
|
+
* Implements subsection {@link https://dcdpr.github.io/did-btcr2/operations/resolve.html#apply-update | 7.2.f.3 Apply Update}.
|
|
139
|
+
* @param {DidDocument} currentDocument The current DID Document to apply the update to.
|
|
140
|
+
* @param {SignedBTCR2Update} update The BTCR2 Signed Update to apply.
|
|
141
|
+
* @returns {DidDocument} The updated DID Document after applying the update.
|
|
142
|
+
* @throws {ResolveError} If the update is invalid or cannot be applied.
|
|
143
|
+
*/
|
|
144
|
+
private static applyUpdate;
|
|
145
|
+
/**
|
|
146
|
+
* Advance the state machine. Returns either:
|
|
147
|
+
* - `{ status: 'action-required', needs }` — caller must provide data via {@link provide}
|
|
148
|
+
* - `{ status: 'resolved', result }` — resolution complete
|
|
149
|
+
*
|
|
150
|
+
* Analogous to Rust's `Resolver::resolve()`.
|
|
151
|
+
*/
|
|
152
|
+
resolve(): ResolverState;
|
|
153
|
+
/**
|
|
154
|
+
* Provide data the resolver requested in a previous {@link resolve} call.
|
|
155
|
+
* Call once per need, then call {@link resolve} again to continue.
|
|
156
|
+
*
|
|
157
|
+
* Analogous to Rust's `Resolver::process_responses()`.
|
|
158
|
+
*
|
|
159
|
+
* @param need The DataNeed being fulfilled (from the `needs` array).
|
|
160
|
+
* @param data The data payload corresponding to the need kind.
|
|
161
|
+
*/
|
|
162
|
+
provide(need: NeedGenesisDocument, data: object): void;
|
|
163
|
+
provide(need: NeedBeaconSignals, data: Map<BeaconService, Array<BeaconSignal>>): void;
|
|
164
|
+
provide(need: NeedCASAnnouncement, data: CASAnnouncement): void;
|
|
165
|
+
provide(need: NeedSignedUpdate, data: SignedBTCR2Update): void;
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../src/core/resolver.ts"],"names":[],"mappings":"AAcA,OAAO,EAIL,iBAAiB,EAElB,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EAAE,WAAW,EAAwB,MAAM,0BAA0B,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEpF,OAAO,EAAE,aAAa,EAAc,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM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,mBAAmB,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IACtD,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,GAAG,CAAC,aAAa,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,GAAG,IAAI;IACrF,OAAO,CAAC,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,eAAe,GAAG,IAAI;IAC/D,OAAO,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,iBAAiB,GAAG,IAAI;CA6B/D"}
|
|
@@ -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 {
|
|
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):
|
|
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):
|
|
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.
|
|
@@ -49,3 +49,4 @@ export declare class Update {
|
|
|
49
49
|
*/
|
|
50
50
|
static announce(beaconService: BeaconService, update: SignedBTCR2Update, secretKey: KeyBytes, bitcoin: BitcoinConnection): Promise<SignedBTCR2Update>;
|
|
51
51
|
}
|
|
52
|
+
//# sourceMappingURL=update.d.ts.map
|
|
@@ -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;
|
|
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
|
|
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<
|
|
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):
|
|
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
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
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 {
|
|
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
|
|
68
|
-
*
|
|
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):
|
|
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}.
|
|
@@ -111,3 +111,4 @@ export declare class DidBtcr2 implements DidMethod {
|
|
|
111
111
|
*/
|
|
112
112
|
static getSigningMethod(didDocument: Btcr2DidDocument, methodId?: string): DidVerificationMethod;
|
|
113
113
|
}
|
|
114
|
+
//# sourceMappingURL=did-btcr2.d.ts.map
|
|
@@ -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,
|
|
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,iBAAi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