@did-btcr2/method 0.15.0 → 0.17.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/browser.js +314 -312
- package/dist/browser.mjs +314 -312
- package/dist/cjs/core/beacon/aggregation/protocol/nostr.js +4 -4
- package/dist/cjs/core/beacon/aggregation/protocol/nostr.js.map +1 -1
- package/dist/cjs/core/beacon/cid-aggregate.js +2 -2
- package/dist/cjs/core/beacon/singleton.js +2 -2
- package/dist/cjs/core/beacon/singleton.js.map +1 -1
- package/dist/cjs/core/crud/deactivate.js +4 -4
- package/dist/cjs/core/crud/deactivate.js.map +1 -1
- package/dist/cjs/core/crud/read.js +20 -20
- package/dist/cjs/core/crud/read.js.map +1 -1
- package/dist/cjs/core/crud/update.js +2 -2
- package/dist/cjs/core/crud/update.js.map +1 -1
- package/dist/cjs/core/key-manager/index.js +5 -5
- package/dist/cjs/core/key-manager/index.js.map +1 -1
- package/dist/cjs/did-btcr2.js +8 -20
- package/dist/cjs/did-btcr2.js.map +1 -1
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/appendix.js +4 -4
- package/dist/cjs/utils/appendix.js.map +1 -1
- package/dist/cjs/utils/did-document-builder.js +1 -1
- package/dist/cjs/utils/did-document-builder.js.map +1 -1
- package/dist/cjs/utils/did-document.js +62 -14
- package/dist/cjs/utils/did-document.js.map +1 -1
- package/dist/cjs/utils/identifier.js +5 -5
- package/dist/cjs/utils/identifier.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/protocol/nostr.js +4 -4
- package/dist/esm/core/beacon/aggregation/protocol/nostr.js.map +1 -1
- package/dist/esm/core/beacon/cid-aggregate.js +2 -2
- package/dist/esm/core/beacon/singleton.js +2 -2
- package/dist/esm/core/beacon/singleton.js.map +1 -1
- package/dist/esm/core/crud/deactivate.js +4 -4
- package/dist/esm/core/crud/deactivate.js.map +1 -1
- package/dist/esm/core/crud/read.js +20 -20
- package/dist/esm/core/crud/read.js.map +1 -1
- package/dist/esm/core/crud/update.js +2 -2
- package/dist/esm/core/crud/update.js.map +1 -1
- package/dist/esm/core/key-manager/index.js +5 -5
- package/dist/esm/core/key-manager/index.js.map +1 -1
- package/dist/esm/did-btcr2.js +8 -20
- package/dist/esm/did-btcr2.js.map +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/appendix.js +4 -4
- package/dist/esm/utils/appendix.js.map +1 -1
- package/dist/esm/utils/did-document-builder.js +1 -1
- package/dist/esm/utils/did-document-builder.js.map +1 -1
- package/dist/esm/utils/did-document.js +62 -14
- package/dist/esm/utils/did-document.js.map +1 -1
- package/dist/esm/utils/identifier.js +5 -5
- package/dist/esm/utils/identifier.js.map +1 -1
- package/dist/types/core/beacon/aggregation/protocol/nostr.d.ts +1 -1
- package/dist/types/core/beacon/cid-aggregate.d.ts +2 -2
- package/dist/types/core/crud/deactivate.d.ts +4 -4
- package/dist/types/core/crud/deactivate.d.ts.map +1 -1
- package/dist/types/core/crud/read.d.ts +4 -4
- package/dist/types/core/crud/read.d.ts.map +1 -1
- package/dist/types/core/crud/update.d.ts +10 -0
- package/dist/types/core/crud/update.d.ts.map +1 -1
- package/dist/types/core/key-manager/index.d.ts +6 -6
- package/dist/types/core/key-manager/index.d.ts.map +1 -1
- package/dist/types/core/key-manager/interface.d.ts +3 -3
- package/dist/types/core/key-manager/interface.d.ts.map +1 -1
- package/dist/types/did-btcr2.d.ts +15 -5
- package/dist/types/did-btcr2.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/interfaces/crud.d.ts +1 -4
- package/dist/types/interfaces/crud.d.ts.map +1 -1
- package/dist/types/types/crud.d.ts +5 -5
- package/dist/types/types/crud.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 +1 -1
- package/dist/types/utils/did-document-builder.d.ts.map +1 -1
- package/dist/types/utils/did-document.d.ts +26 -11
- package/dist/types/utils/did-document.d.ts.map +1 -1
- package/dist/types/utils/identifier.d.ts +2 -2
- package/dist/types/utils/identifier.d.ts.map +1 -1
- package/package.json +7 -6
- package/src/core/beacon/aggregation/protocol/nostr.ts +4 -4
- package/src/core/beacon/cid-aggregate.ts +2 -2
- package/src/core/beacon/singleton.ts +2 -2
- package/src/core/crud/deactivate.ts +4 -4
- package/src/core/crud/read.ts +21 -21
- package/src/core/crud/update.ts +14 -2
- package/src/core/key-manager/index.ts +7 -7
- package/src/core/key-manager/interface.ts +3 -3
- package/src/did-btcr2.ts +24 -25
- package/src/index.ts +0 -1
- package/src/interfaces/crud.ts +1 -4
- package/src/types/crud.ts +5 -5
- package/src/utils/appendix.ts +9 -9
- package/src/utils/did-document-builder.ts +1 -1
- package/src/utils/did-document.ts +73 -17
- package/src/utils/identifier.ts +5 -5
- package/dist/cjs/core/crud/create.js +0 -102
- package/dist/cjs/core/crud/create.js.map +0 -1
- package/dist/esm/core/crud/create.js +0 -102
- package/dist/esm/core/crud/create.js.map +0 -1
- package/dist/types/core/crud/create.d.ts +0 -92
- package/dist/types/core/crud/create.d.ts.map +0 -1
- package/src/core/crud/create.ts +0 -160
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../src/core/crud/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,mBAAmB,EACnB,gBAAgB,EAMhB,cAAc,EAEf,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAIjF,MAAM,MAAM,mBAAmB,GAAG;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,kBAAkB,EAAE,qBAA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E,cAAc,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,YAAa,SAAQ,qBAAqB;IACvD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,SAAS,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,kBAAkB,EAAE,qBAAqB,CAAC;CAC3C,CAAA;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,MAAM;IACjB;;;;;;;;;;;;;;OAcG;WACiB,SAAS,CAAC,EAC5B,UAAU,EACV,cAAc,EACd,eAAe,EACf,KAAK,GACN,EAAE;QACD,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,EAAE,WAAW,CAAC;QAC5B,eAAe,EAAE,MAAM,CAAC;QACxB,KAAK,EAAE,cAAc,EAAE,CAAC;KACzB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA8C7B;;;;;;;;;;;;;;OAcG;WACiB,MAAM,CAAC,EACzB,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EACnB,EAAE;QACD,UAAU,EAAE,MAAM,CAAC;QACnB,gBAAgB,EAAE,gBAAgB,CAAC;QACnC,kBAAkB,EAAE,qBAAqB,CAAC;KAC3C,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAqEhC;;;;;;;;;;;;;;OAcG;WACiB,QAAQ,CAAC,EAC3B,cAAc,EACd,SAAS,EACT,mBAAmB,EACpB,EAAE;QACD,cAAc,EAAE,WAAW,CAAC;QAC5B,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,mBAAmB,EAAE,mBAAmB,CAAC;KAC1C,GAAG,OAAO,CAAC,eAAe,CAAC;CAgD7B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AvailableNetworks } from '@did-btcr2/bitcoin';
|
|
2
2
|
import { HashBytes, Hex, KeyBytes, SchnorrKeyPairObject, SignatureBytes } from '@did-btcr2/common';
|
|
3
3
|
import { SchnorrMultikey } from '@did-btcr2/cryptosuite';
|
|
4
|
-
import {
|
|
4
|
+
import { CompressedSecp256k1PublicKey, SchnorrKeyPair } from '@did-btcr2/keypair';
|
|
5
5
|
import { KeyIdentifier } from '@web5/crypto';
|
|
6
6
|
import { Multibase } from 'multiformats';
|
|
7
7
|
import { BitcoinSigner, CryptoSigner, IKeyManager, KeyManagerOptions, KeyManagerParams } from './interface.js';
|
|
@@ -59,11 +59,11 @@ export declare class KeyManager implements IKeyManager, CryptoSigner, BitcoinSig
|
|
|
59
59
|
*/
|
|
60
60
|
signTransaction(txHex: Hex, keyUri?: KeyIdentifier): Promise<Hex>;
|
|
61
61
|
/**
|
|
62
|
-
* Gets the key pair from the key store and returns a
|
|
62
|
+
* Gets the key pair from the key store and returns a CompressedSecp256k1PublicKey.
|
|
63
63
|
* @param {KeyIdentifier} keyUri The URI of the key to get the public key for.
|
|
64
|
-
* @returns {Promise<
|
|
64
|
+
* @returns {Promise<CompressedSecp256k1PublicKey>} The public key associated with the key URI.
|
|
65
65
|
*/
|
|
66
|
-
getPublicKey(keyUri?: KeyIdentifier): Promise<
|
|
66
|
+
getPublicKey(keyUri?: KeyIdentifier): Promise<CompressedSecp256k1PublicKey>;
|
|
67
67
|
/**
|
|
68
68
|
* Signs the given data using the key associated with the key URI.
|
|
69
69
|
* @param {Hex} data The data to sign.
|
|
@@ -116,10 +116,10 @@ export declare class KeyManager implements IKeyManager, CryptoSigner, BitcoinSig
|
|
|
116
116
|
static computeKeyUri(id: string, controller: string): KeyIdentifier;
|
|
117
117
|
/**
|
|
118
118
|
* Computes a multibase-compliant URI from a key.
|
|
119
|
-
* @param key A SchnorrKeyPair,
|
|
119
|
+
* @param key A SchnorrKeyPair, CompressedSecp256k1PublicKey, or multibase string
|
|
120
120
|
* @returns {string} A multibase URI (e.g. 'urn:mb:zQ3s...')
|
|
121
121
|
*/
|
|
122
|
-
static toMultibaseUri(data: SchnorrKeyPair |
|
|
122
|
+
static toMultibaseUri(data: SchnorrKeyPair | CompressedSecp256k1PublicKey | Multibase<'zQ3s'>): string;
|
|
123
123
|
/**
|
|
124
124
|
* Initializes a singleton KeyManager instance.
|
|
125
125
|
* @param {SchnorrKeyPair} keys The keypair used to initialize the key manager.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/key-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACL,SAAS,EACT,GAAG,EACH,QAAQ,EAIR,oBAAoB,EACpB,cAAc,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/key-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACL,SAAS,EACT,GAAG,EACH,QAAQ,EAIR,oBAAoB,EACpB,cAAc,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,4BAA4B,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGlF,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE/G,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,eAAe,CAAC;IAC1B,OAAO,EAAE,MAAM,iBAAiB,CAAC;CAClC;AAED;;;;GAIG;AACH,qBAAa,UAAW,YAAW,WAAW,EAAE,YAAY,EAAE,aAAa;;IAQzE;;;;;;OAM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OAIG;WACiB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,oBAAoB,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAoChH;;;;;OAKG;WACiB,UAAU,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAO/E,YAAY,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;CAOpG;AAED,qBAAa,MAAM;IACV,QAAQ,EAAE,eAAe,CAAC;IAC1B,OAAO,EAAE,MAAM,iBAAiB,CAAC;gBAE5B,MAAM,EAAE,YAAY;IAKhC,IAAI,SAAS,IAAI,QAAQ,CAGxB;IAEM,IAAI,CAAC,IAAI,EAAE,GAAG,GAAG,cAAc;IAI/B,WAAW,CAAC,IAAI,EAAE,GAAG,GAAG,cAAc;CAG9C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HashBytes, Hex, SignatureBytes } from '@did-btcr2/common';
|
|
2
2
|
import { Multikey, SchnorrMultikey } from '@did-btcr2/cryptosuite';
|
|
3
|
-
import { SchnorrKeyPair,
|
|
3
|
+
import { SchnorrKeyPair, CompressedSecp256k1PublicKey } from '@did-btcr2/keypair';
|
|
4
4
|
import { KeyValueStore } from '@web5/common';
|
|
5
5
|
export type KeyManagerOptions = {
|
|
6
6
|
importKey?: boolean;
|
|
@@ -66,9 +66,9 @@ export interface IKeyManager {
|
|
|
66
66
|
/**
|
|
67
67
|
* Gets the public key of a key pair.
|
|
68
68
|
* @param {KeyIdentifier} keyUri The URI of the key to get the public key for.
|
|
69
|
-
* @returns {Promise<
|
|
69
|
+
* @returns {Promise<CompressedSecp256k1PublicKey>} The public key of the key pair.
|
|
70
70
|
*/
|
|
71
|
-
getPublicKey(keyUri: KeyIdentifier): Promise<
|
|
71
|
+
getPublicKey(keyUri: KeyIdentifier): Promise<CompressedSecp256k1PublicKey>;
|
|
72
72
|
/**
|
|
73
73
|
* Imports a key pair into the key store.
|
|
74
74
|
* @param {SchnorrKeyPair} keyPair The key pair to import.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/core/key-manager/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/core/key-manager/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC;AAEF,uCAAuC;AACvC,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC,2DAA2D;AAC3D,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;IAEtD;;;;OAIG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC;IAEvB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,iBAAiB,CAAA;CAC3B,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,WAAW;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC;IAE7B;;;;;OAKG;IACH,SAAS,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;IAEjE;;;;OAIG;IACH,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAE3E;;;;;;;OAOG;IACH,SAAS,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAC1G;AAED,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAEjE;;;;;;OAMG;IACH,MAAM,CAAC,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEvF;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;CACrC;AAED,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CACnE"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { PatchOperation } from '@did-btcr2/common';
|
|
1
|
+
import { DocumentBytes, KeyBytes, PatchOperation } from '@did-btcr2/common';
|
|
2
2
|
import type { DidResolutionResult } from '@web5/dids';
|
|
3
3
|
import { DidMethod } from '@web5/dids';
|
|
4
|
-
import { CreateParams, CreateResponse } from './core/crud/create.js';
|
|
5
4
|
import { DidResolutionOptions } from './interfaces/crud.js';
|
|
6
5
|
import { DidDocument, DidVerificationMethod } from './utils/did-document.js';
|
|
6
|
+
export type Btcr2Identifier = string;
|
|
7
|
+
export interface DidCreateOptions {
|
|
8
|
+
/** DID BTCR2 Version Number */
|
|
9
|
+
version?: number;
|
|
10
|
+
/** Bitcoin Network */
|
|
11
|
+
network?: string;
|
|
12
|
+
}
|
|
7
13
|
/**
|
|
8
14
|
* Implements {@link https://dcdpr.github.io/did-btcr2 | did:btcr2 DID Method Specification}.
|
|
9
15
|
* did:btcr2 is a censorship resistant DID Method using the Bitcoin blockchain as a Verifiable Data Registry to announce
|
|
@@ -13,7 +19,7 @@ import { DidDocument, DidVerificationMethod } from './utils/did-document.js';
|
|
|
13
19
|
*
|
|
14
20
|
* @class DidBtcr2
|
|
15
21
|
* @type {DidBtcr2}
|
|
16
|
-
*
|
|
22
|
+
* @implements {DidMethod}
|
|
17
23
|
*/
|
|
18
24
|
export declare class DidBtcr2 implements DidMethod {
|
|
19
25
|
/** @type {string} Name of the DID method, as defined in the DID BTCR2 specification */
|
|
@@ -36,7 +42,11 @@ export declare class DidBtcr2 implements DidMethod {
|
|
|
36
42
|
* @returns {Promise<CreateResponse>} Promise resolving to a CreateResponse object.
|
|
37
43
|
* @throws {DidBtcr2Error} if any of the checks fail
|
|
38
44
|
*/
|
|
39
|
-
static create(params:
|
|
45
|
+
static create(params: {
|
|
46
|
+
idType: 'KEY' | 'EXTERNAL';
|
|
47
|
+
genesisBytes: KeyBytes | DocumentBytes;
|
|
48
|
+
options?: DidCreateOptions;
|
|
49
|
+
}): Promise<Btcr2Identifier>;
|
|
40
50
|
/**
|
|
41
51
|
* Entry point for section {@link https://dcdpr.github.io/did-btcr2/#read | 7.2 Read}.
|
|
42
52
|
* See {@link Resolve} for implementation details.
|
|
@@ -84,7 +94,7 @@ export declare class DidBtcr2 implements DidMethod {
|
|
|
84
94
|
* @param {string} params.identifier The btcr2 identifier to be updated.
|
|
85
95
|
* @param {DidDocument} params.sourceDocument The DID document being updated.
|
|
86
96
|
* @param {string} params.sourceVersionId The versionId of the source document.
|
|
87
|
-
* @param {
|
|
97
|
+
* @param {PatchOperation} params.documentPatch The JSON patch to be applied to the source document.
|
|
88
98
|
* @param {string} params.verificationMethodId The verificationMethod ID to sign the update
|
|
89
99
|
* @param {string[]} params.beaconIds The beacon IDs to announce the update
|
|
90
100
|
* @returns {Promise<void>} Promise resolving to void
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"did-btcr2.d.ts","sourceRoot":"","sources":["../../src/did-btcr2.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"did-btcr2.d.ts","sourceRoot":"","sources":["../../src/did-btcr2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,QAAQ,EAGR,cAAc,EAEf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAIL,SAAS,EAEV,MAAM,YAAY,CAAC;AAKpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAG7E,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AAErC,MAAM,WAAW,gBAAgB;IAC/B,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAKD;;;;;;;;;;GAUG;AACH,qBAAa,QAAS,YAAW,SAAS;IACxC,uFAAuF;IACvF,OAAc,UAAU,EAAE,MAAM,CAAW;IAE3C;;;;;;;;;;;;;;;;;OAiBG;WACiB,MAAM,CAAC,MAAM,EAAE;QACjC,MAAM,EAAE,KAAK,GAAG,UAAU,CAAC;QAC3B,YAAY,EAAE,QAAQ,GAAG,aAAa,CAAC;QACvC,OAAO,CAAC,EAAE,gBAAgB,CAAC;KAC5B,GAAG,OAAO,CAAC,eAAe,CAAC;IAa5B;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;WACiB,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,GAAE,oBAAyB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IA2C5H;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;WACiB,MAAM,CAAC,MAAM,EAAE;QACjC,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,EAAE,WAAW,CAAC;QAC5B,eAAe,EAAE,MAAM,CAAC;QACxB,KAAK,EAAE,cAAc,EAAE,CAAC;QACxB,oBAAoB,EAAE,MAAM,CAAC;QAC7B,SAAS,EAAE,MAAM,EAAE,CAAC;KACrB,GAAG,OAAO,CAAC,GAAG,CAAC;IAuDhB;;;;;;;;;;;OAWG;WACW,gBAAgB,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE;QACxD,WAAW,EAAE,WAAW,CAAC;QACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,qBAAqB;CA0B1B"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export * from './core/beacon/cid-aggregate.js';
|
|
|
2
2
|
export * from './core/beacon/factory.js';
|
|
3
3
|
export * from './core/beacon/singleton.js';
|
|
4
4
|
export * from './core/beacon/smt-aggregate.js';
|
|
5
|
-
export * from './core/crud/create.js';
|
|
6
5
|
export * from './core/crud/deactivate.js';
|
|
7
6
|
export * from './core/crud/read.js';
|
|
8
7
|
export * from './core/crud/update.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAE/C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAE/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAEhD,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AAExC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BitcoinCoreRpcClient } from '@did-btcr2/bitcoin';
|
|
2
1
|
import { UnixTimestamp } from '@did-btcr2/common';
|
|
3
2
|
import { DidResolutionOptions as IDidResolutionOptions } from '@web5/dids';
|
|
4
3
|
import { SidecarData } from '../types/crud.js';
|
|
@@ -7,7 +6,6 @@ import { DidDocument } from '../utils/did-document.js';
|
|
|
7
6
|
* Options for resolving a DID Document
|
|
8
7
|
* @param {?number} versionId The versionId for resolving the DID Document
|
|
9
8
|
* @param {?UnixTimestamp} versionTime The versionTime for resolving the DID Document
|
|
10
|
-
* @param {?BitcoinCoreRpcClient} rpc BitcoinCoreRpcClient client connection
|
|
11
9
|
* @param {?SidecarData} sidecarData The sidecar data for resolving the DID Document
|
|
12
10
|
*/
|
|
13
11
|
export interface DidResolutionOptions extends IDidResolutionOptions {
|
|
@@ -15,9 +13,8 @@ export interface DidResolutionOptions extends IDidResolutionOptions {
|
|
|
15
13
|
versionTime?: UnixTimestamp;
|
|
16
14
|
sidecarData?: SidecarData;
|
|
17
15
|
network?: string;
|
|
18
|
-
rpc?: BitcoinCoreRpcClient;
|
|
19
16
|
}
|
|
20
|
-
export interface
|
|
17
|
+
export interface RootCapability {
|
|
21
18
|
'@context': string;
|
|
22
19
|
id: string;
|
|
23
20
|
controller: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crud.d.ts","sourceRoot":"","sources":["../../../src/interfaces/crud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"crud.d.ts","sourceRoot":"","sources":["../../../src/interfaces/crud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,oBAAoB,IAAI,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,WAAW,oBAAqB,SAAQ,qBAAqB;IACjE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,cAAc;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;CAC5B;AACD,MAAM,WAAW,oBAAoB;IACnC,uBAAuB,EAAE,WAAW,CAAC;IACrC,uBAAuB,EAAE,MAAM,GAAG,CAAC,CAAC;IACpC,gBAAgB,EAAE,MAAM,GAAG,CAAC,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC"}
|
|
@@ -7,25 +7,25 @@ export type FindNextSignals = {
|
|
|
7
7
|
beacons: BeaconService[];
|
|
8
8
|
};
|
|
9
9
|
export type Metadata = {
|
|
10
|
-
|
|
10
|
+
didUpdate: DidUpdatePayload;
|
|
11
11
|
proofs?: string;
|
|
12
12
|
};
|
|
13
13
|
export type SignalSidecarData = Metadata;
|
|
14
|
-
export interface
|
|
14
|
+
export interface Sidecar {
|
|
15
15
|
did: string;
|
|
16
16
|
}
|
|
17
17
|
export type SignalsMetadata = {
|
|
18
18
|
[signalId: string]: Metadata;
|
|
19
19
|
};
|
|
20
|
-
export interface SingletonSidecar extends
|
|
20
|
+
export interface SingletonSidecar extends Sidecar {
|
|
21
21
|
signalsMetadata: SignalsMetadata;
|
|
22
22
|
}
|
|
23
|
-
export interface CIDAggregateSidecar extends
|
|
23
|
+
export interface CIDAggregateSidecar extends Sidecar {
|
|
24
24
|
initialDocument: DidDocument;
|
|
25
25
|
signalsMetadata: SignalsMetadata;
|
|
26
26
|
cidUpdates: Array<string>;
|
|
27
27
|
}
|
|
28
|
-
export interface SMTAggregateSidecar extends
|
|
28
|
+
export interface SMTAggregateSidecar extends Sidecar {
|
|
29
29
|
initialDocument: DidDocument;
|
|
30
30
|
signalsMetadata: SignalsMetadata;
|
|
31
31
|
smtProof: ProofBytes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crud.d.ts","sourceRoot":"","sources":["../../../src/types/crud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAA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,WAAW,CAAC;IAC7B,eAAe,EAAE,eAAe,CAAC;IACjC,QAAQ,EAAE,UAAU,CAAC;CACtB;AACD,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAC7B,CAAC,SAAS,iBAAiB,GAAG,gBAAgB,GAC9C,CAAC,SAAS,oBAAoB,GAAG,mBAAmB,GACpD,CAAC,SAAS,oBAAoB,GAAG,mBAAmB,GACpD,CAAC,CAAC;AACJ,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAC,gBAAgB,GAAG,mBAAmB,GAAG,mBAAmB,CAAC,CAAC;AAC1G,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Bytes, HashBytes } from '@did-btcr2/common';
|
|
2
2
|
import { DidDocument, DidService } from '@web5/dids';
|
|
3
|
-
import {
|
|
3
|
+
import { RootCapability } from '../interfaces/crud.js';
|
|
4
4
|
import { DidVerificationMethod } from './did-document.js';
|
|
5
5
|
export interface DidComponents {
|
|
6
6
|
hrp: string;
|
|
@@ -42,7 +42,7 @@ export declare class Appendix {
|
|
|
42
42
|
*/
|
|
43
43
|
static getVerificationMethods(didDocument: DidDocument): DidVerificationMethod[];
|
|
44
44
|
/**
|
|
45
|
-
* Implements {@link https://dcdpr.github.io/did-btcr2/#derive-root-capability-from-
|
|
45
|
+
* Implements {@link https://dcdpr.github.io/did-btcr2/#derive-root-capability-from-didbtcr2-identifier | 9.4.1 Derive Root Capability from did:btcr2 Identifier }.
|
|
46
46
|
*
|
|
47
47
|
* The Derive Root Capability algorithm deterministically generates a ZCAP-LD root capability from a given did:btcr2
|
|
48
48
|
* identifier. Each root capability is unique to the identifier. This root capability is defined and understood by the
|
|
@@ -50,7 +50,7 @@ export declare class Appendix {
|
|
|
50
50
|
* document. It takes in a did:btcr2 identifier and returns a rootCapability object. It returns the root capability.
|
|
51
51
|
*
|
|
52
52
|
* @param {string} identifier The did-btcr2 identifier to derive the root capability from
|
|
53
|
-
* @returns {
|
|
53
|
+
* @returns {RootCapability} The root capability object
|
|
54
54
|
* @example Root capability for updating the DID document for
|
|
55
55
|
* did:btcr2:k1q0rnnwf657vuu8trztlczvlmphjgc6q598h79cm6sp7c4fgqh0fkc0vzd9u
|
|
56
56
|
* ```
|
|
@@ -62,7 +62,7 @@ export declare class Appendix {
|
|
|
62
62
|
* }
|
|
63
63
|
* ```
|
|
64
64
|
*/
|
|
65
|
-
static deriveRootCapability(identifier: string):
|
|
65
|
+
static deriveRootCapability(identifier: string): RootCapability;
|
|
66
66
|
/**
|
|
67
67
|
* Implements {@link https://dcdpr.github.io/did-btcr2/#dereference-root-capability-identifier | 9.4.2 Dereference Root Capability Identifier}.
|
|
68
68
|
*
|
|
@@ -70,7 +70,7 @@ export declare class Appendix {
|
|
|
70
70
|
* capability object.
|
|
71
71
|
*
|
|
72
72
|
* @param {string} capabilityId The root capability identifier to dereference.
|
|
73
|
-
* @returns {
|
|
73
|
+
* @returns {RootCapability} The root capability object.
|
|
74
74
|
* @example a didUpdatePayload with an invoked ZCAP-LD capability containing a patch defining how the DID document
|
|
75
75
|
* for did:btcr2:k1q0rnnwf657vuu8trztlczvlmphjgc6q598h79cm6sp7c4fgqh0fkc0vzd9u SHOULD be mutated.
|
|
76
76
|
* ```
|
|
@@ -96,14 +96,14 @@ export declare class Appendix {
|
|
|
96
96
|
* "cryptosuite": "schnorr-secp256k1-jcs-2025",
|
|
97
97
|
* "verificationMethod": "did:btcr2:k1q0rnnwf657vuu8trztlczvlmphjgc6q598h79cm6sp7c4fgqh0fkc0vzd9u#initialKey",
|
|
98
98
|
* "invocationTarget": "did:btcr2:k1q0rnnwf657vuu8trztlczvlmphjgc6q598h79cm6sp7c4fgqh0fkc0vzd9u",
|
|
99
|
-
* "capability": "urn:zcap:root:did%
|
|
99
|
+
* "capability": "urn:zcap:root:did%3Abtcr2%3Ak1q0rnnwf657vuu8trztlczvlmphjgc6q598h79cm6sp7c4fgqh0fkc0vzd9u",
|
|
100
100
|
* "capabilityAction": "Write",
|
|
101
101
|
* "proofPurpose": "assertionMethod",
|
|
102
102
|
* "proofValue": "z381yXYmxU8NudZ4HXY56DfMN6zfD8syvWcRXzT9xD9uYoQToo8QsXD7ahM3gXTzuay5WJbqTswt2BKaGWYn2hHhVFKJLXaDz"
|
|
103
103
|
* }
|
|
104
104
|
* }
|
|
105
105
|
*/
|
|
106
|
-
static derefernceRootCapabilityIdentifier(capabilityId: string):
|
|
106
|
+
static derefernceRootCapabilityIdentifier(capabilityId: string): RootCapability;
|
|
107
107
|
/**
|
|
108
108
|
* Implements {@link https://dcdpr.github.io/did-btcr2/#fetch-content-from-addressable-storage | 9.3. Fetch Content from Addressable Storage}.
|
|
109
109
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appendix.d.ts","sourceRoot":"","sources":["../../../src/utils/appendix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAuB,MAAM,mBAAmB,CAAC;AAE1E,OAAO,EACL,WAAW,EAGX,UAAU,EAEX,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"appendix.d.ts","sourceRoot":"","sources":["../../../src/utils/appendix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAuB,MAAM,mBAAmB,CAAC;AAE1E,OAAO,EACL,WAAW,EAGX,UAAU,EAEX,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,MAAM,WAAW,aAAa;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,KAAK,CAAC;CACvB;AAED;;;;;GAKG;AACH,qBAAa,QAAQ;IACnB;;;;OAIG;WACW,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;IAMpE;;;;OAIG;WACW,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,qBAAqB;IAcjF;;;;OAIG;WACW,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,UAAU;IAW3D;;;;;OAKG;WACW,sBAAsB,CAAC,WAAW,EAAE,WAAW,GAAG,qBAAqB,EAAE;IAgBvF;;;;;;;;;;;;;;;;;;;;OAoBG;WACW,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc;IAwBtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;WACW,kCAAkC,CAAC,YAAY,EAAE,MAAM,GAAG,cAAc;IA+CtF;;;;;;;;;OASG;WACiB,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAepF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BeaconService } from '../interfaces/ibeacon.js';
|
|
2
2
|
import { DidDocument, DidVerificationMethod } from './did-document.js';
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class DidDocumentBuilder {
|
|
4
4
|
private document;
|
|
5
5
|
constructor(initialDocument: Partial<DidDocument>);
|
|
6
6
|
withController(controller?: Array<string>): this;
|
|
@@ -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,0BAA0B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAEvE,qBAAa,
|
|
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,0BAA0B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAEvE,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAA4B;gBAEhC,eAAe,EAAE,OAAO,CAAC,WAAW,CAAC;IAYjD,cAAc,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI;IAOhD,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,8 +1,8 @@
|
|
|
1
|
-
import { JSONObject } from '@did-btcr2/common';
|
|
2
|
-
import {
|
|
1
|
+
import { JSONObject, KeyBytes } from '@did-btcr2/common';
|
|
2
|
+
import { DidDocument as IIDidDocument, DidVerificationMethod as IIDidVerificationMethod } from '@web5/dids';
|
|
3
3
|
import { BeaconService } from '../interfaces/ibeacon.js';
|
|
4
4
|
export declare const BECH32M_CHARS = "";
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const DID_REGEX: RegExp;
|
|
6
6
|
export type ExternalData = {
|
|
7
7
|
id: string;
|
|
8
8
|
verificationMethod: Array<DidVerificationMethod>;
|
|
@@ -172,7 +172,7 @@ export declare class DidDocument implements IDidDocument {
|
|
|
172
172
|
* Validate the IntermediateDidDocument.
|
|
173
173
|
* @returns {boolean} True if the IntermediateDidDocument is valid.
|
|
174
174
|
*/
|
|
175
|
-
validateIntermediate():
|
|
175
|
+
validateIntermediate(): boolean;
|
|
176
176
|
/**
|
|
177
177
|
* Convert the DidDocument to an IntermediateDidDocument.
|
|
178
178
|
* @returns {IntermediateDidDocument} The IntermediateDidDocument representation of the DidDocument.
|
|
@@ -187,7 +187,19 @@ export declare class DidDocument implements IDidDocument {
|
|
|
187
187
|
* @extends {DidDocument}
|
|
188
188
|
*/
|
|
189
189
|
export declare class IntermediateDidDocument extends DidDocument {
|
|
190
|
-
constructor(document:
|
|
190
|
+
constructor(document: JSONObject);
|
|
191
|
+
/**
|
|
192
|
+
* Convert the IntermediateDidDocument to a DidDocument by replacing the placeholder value with the provided DID.
|
|
193
|
+
* @param did The DID to replace the placeholder value in the document.
|
|
194
|
+
* @returns {DidDocument} A new DidDocument with the placeholder value replaced by the provided DID.
|
|
195
|
+
*/
|
|
196
|
+
toDidDocument(did: string): DidDocument;
|
|
197
|
+
/**
|
|
198
|
+
* Create an IntermediateDidDocument from a DidDocument by replacing the DID with a placeholder value.
|
|
199
|
+
* @param {DidDocument} didDocument The DidDocument to convert.
|
|
200
|
+
* @returns {IntermediateDidDocument} The IntermediateDidDocument representation of the DidDocument.
|
|
201
|
+
*/
|
|
202
|
+
static fromDidDocument(didDocument: DidDocument): IntermediateDidDocument;
|
|
191
203
|
/**
|
|
192
204
|
* Create a minimal IntermediateDidDocument with a placeholder ID.
|
|
193
205
|
* @param {Array<DidVerificationMethod>} verificationMethod The public key in multibase format.
|
|
@@ -197,15 +209,18 @@ export declare class IntermediateDidDocument extends DidDocument {
|
|
|
197
209
|
*/
|
|
198
210
|
static create(verificationMethod: Array<DidVerificationMethod>, relationships: VerificationRelationships, service: Array<BeaconService>): IntermediateDidDocument;
|
|
199
211
|
/**
|
|
200
|
-
*
|
|
201
|
-
* @param
|
|
202
|
-
* @returns {
|
|
212
|
+
* Create a minimal IntermediateDidDocument from a public key.
|
|
213
|
+
* @param {KeyBytes} publicKey The public key in bytes format.
|
|
214
|
+
* @returns {IntermediateDidDocument} A new IntermediateDidDocument with the placeholder ID.
|
|
203
215
|
*/
|
|
204
|
-
|
|
216
|
+
static fromPublicKey(publicKey: KeyBytes, network: string): IntermediateDidDocument;
|
|
205
217
|
/**
|
|
206
|
-
*
|
|
218
|
+
* Taken an object, convert it to an IntermediateDocuemnt and then to a DidDocument.
|
|
207
219
|
* @param {JSONObject} object The JSON object to convert.
|
|
208
220
|
* @returns {DidDocument} The created DidDocument.
|
|
209
221
|
*/
|
|
210
|
-
static
|
|
222
|
+
static fromJSON(object: JSONObject): IntermediateDidDocument;
|
|
223
|
+
}
|
|
224
|
+
export declare class Document {
|
|
225
|
+
static isValid(didDocument: DidDocument | IntermediateDidDocument): boolean;
|
|
211
226
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"did-document.d.ts","sourceRoot":"","sources":["../../../src/utils/did-document.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"did-document.d.ts","sourceRoot":"","sources":["../../../src/utils/did-document.ts"],"names":[],"mappings":"AACA,OAAO,EAML,UAAU,EACV,QAAQ,EAET,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAc,WAAW,IAAI,aAAa,EAAE,qBAAqB,IAAI,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACxH,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAKzD,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,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AU,GAAG,uBAAuB;CAGpE;AAED,qBAAa,QAAQ;WACL,OAAO,CAAC,WAAW,EAAE,WAAW,GAAG,uBAAuB,GAAG,OAAO;CAGnF"}
|
|
@@ -14,7 +14,7 @@ import { DidComponents } from './appendix.js';
|
|
|
14
14
|
*/
|
|
15
15
|
export declare class Identifier {
|
|
16
16
|
/**
|
|
17
|
-
* Implements {@link https://dcdpr.github.io/did-btcr2/#
|
|
17
|
+
* Implements {@link https://dcdpr.github.io/did-btcr2/#didbtcr2-identifier-encoding | 3.2 did:btcr2 Identifier Encoding}.
|
|
18
18
|
*
|
|
19
19
|
* A did:btcr2 DID consists of a did:btcr2 prefix, followed by an id-bech32 value, which is a Bech32m encoding of:
|
|
20
20
|
* - the specification version;
|
|
@@ -37,7 +37,7 @@ export declare class Identifier {
|
|
|
37
37
|
genesisBytes: Bytes;
|
|
38
38
|
}): string;
|
|
39
39
|
/**
|
|
40
|
-
* Implements {@link https://dcdpr.github.io/did-btcr2/#
|
|
40
|
+
* Implements {@link https://dcdpr.github.io/did-btcr2/#didbtcr2-identifier-decoding | 3.3 did:btcr2 Identifier Decoding}.
|
|
41
41
|
* @param {string} identifier The BTCR2 DID to be parsed
|
|
42
42
|
* @returns {DidComponents} The parsed identifier components. See {@link DidComponents} for details.
|
|
43
43
|
* @throws {DidError} if an error occurs while parsing the identifier
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identifier.d.ts","sourceRoot":"","sources":["../../../src/utils/identifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,EAAqC,MAAM,mBAAmB,CAAC;AAChI,OAAO,
|
|
1
|
+
{"version":3,"file":"identifier.d.ts","sourceRoot":"","sources":["../../../src/utils/identifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,EAAqC,MAAM,mBAAmB,CAAC;AAChI,OAAO,EAAgC,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;;;;;;;GAUG;AACH,qBAAa,UAAU;IACrB;;;;;;;;;;;;;;;;OAgBG;WACW,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE;QAC/D,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;QACzB,YAAY,EAAE,KAAK,CAAC;KACrB,GAAG,MAAM;IAuFV;;;;;;;OAOG;WACW,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa;IA8HvD;;;OAGG;WACW,QAAQ,IAAI;QAAE,IAAI,EAAE,cAAc,CAAC;QAAC,UAAU,EAAE;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,EAAE,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE;CAWnG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@did-btcr2/method",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Javascript/TypeScript reference implementation of did:btcr2 method, a censorship resistant DID Method using the Bitcoin blockchain as a Verifiable Data Registry to announce changes to the DID document. Core package of the did-btcr2-js monorepo.",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -83,10 +83,10 @@
|
|
|
83
83
|
"multiformats": "^13.3.1",
|
|
84
84
|
"nostr-tools": "^2.15.0",
|
|
85
85
|
"tiny-secp256k1": "^2.2.3",
|
|
86
|
-
"@did-btcr2/bitcoin": "0.
|
|
87
|
-
"@did-btcr2/common": "2.
|
|
88
|
-
"@did-btcr2/cryptosuite": "3.
|
|
89
|
-
"@did-btcr2/keypair": "0.
|
|
86
|
+
"@did-btcr2/bitcoin": "0.3.1",
|
|
87
|
+
"@did-btcr2/common": "2.2.0",
|
|
88
|
+
"@did-btcr2/cryptosuite": "3.2.0",
|
|
89
|
+
"@did-btcr2/keypair": "0.7.0"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@eslint/js": "^9.22.0",
|
|
@@ -140,6 +140,7 @@
|
|
|
140
140
|
"do": "pnpm tsx",
|
|
141
141
|
"do:lib": "${PWD}/lib/run-lib.sh",
|
|
142
142
|
"do:lib:btc": "${PWD}/lib/do-lib.sh bitcoin",
|
|
143
|
-
"do:lib:btcr2": "${PWD}/lib/do-lib.sh btcr2"
|
|
143
|
+
"do:lib:btcr2": "${PWD}/lib/do-lib.sh btcr2",
|
|
144
|
+
"pack:local": "pnpm pack && mv *.tgz ./release"
|
|
144
145
|
}
|
|
145
146
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SchnorrKeyPair,
|
|
1
|
+
import { SchnorrKeyPair, Secp256k1SecretKey } from '@did-btcr2/keypair';
|
|
2
2
|
import { Filter } from 'nostr-tools';
|
|
3
3
|
import { SimplePool, } from 'nostr-tools/pool';
|
|
4
4
|
import { Identifier } from '../../../../utils/identifier.js';
|
|
@@ -62,12 +62,12 @@ export class NostrAdapter implements ProtocolService {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
|
-
* Generates a Nostr identity using the
|
|
65
|
+
* Generates a Nostr identity using the Secp256k1SecretKey and Identifier classes.
|
|
66
66
|
* @returns {string} A BTCR2 DID used for communication over the nostr protocol
|
|
67
67
|
*/
|
|
68
68
|
public generateIdentity(): string {
|
|
69
|
-
this.config.keys.secret =
|
|
70
|
-
this.config.keys.public =
|
|
69
|
+
this.config.keys.secret = Secp256k1SecretKey.random();
|
|
70
|
+
this.config.keys.public = Secp256k1SecretKey.getPublicKey(this.config.keys.secret).compressed;
|
|
71
71
|
this.config.did = Identifier.encode(
|
|
72
72
|
{
|
|
73
73
|
idType : this.config.components.idType || 'KEY',
|
|
@@ -111,8 +111,8 @@ export class CIDAggregateBeacon extends Beacon {
|
|
|
111
111
|
*
|
|
112
112
|
* The Broadcast CIDAggregate Beacon Signal algorithm involving two roles: a set of cohort participants and a Beacon
|
|
113
113
|
* coordinator. The Beacon coordinator collects individual DID Update Payload Content Identifiers (CIDs) for specific
|
|
114
|
-
* did:
|
|
115
|
-
* (CAS). The CID for the DID Update Bundle is included in a Partially Signed Bitcoin Transaction (PSBT) transaction
|
|
114
|
+
* did:btcr2 idntifiers and aggregates them into a DID Update Bundle, which is then published to a Content Addressable
|
|
115
|
+
* Storage (CAS). The CID for the DID Update Bundle is included in a Partially Signed Bitcoin Transaction (PSBT) transaction
|
|
116
116
|
* output spent from the Beacon’s n-of-n address. Each of the n cohort participants in the Beacon MUST sign the
|
|
117
117
|
* transaction before it can be broadcast to the network. It is RECOMMENDED that cohort participants keep a copy of
|
|
118
118
|
* the DID Update Bundle and separately pin it to the CAS.
|
|
@@ -119,7 +119,7 @@ export class SingletonBeacon extends Beacon {
|
|
|
119
119
|
// 5. If signalsMetadata:
|
|
120
120
|
if (signalsMetadata) {
|
|
121
121
|
// 5.1 Set didUpdatePayload to signalsMetadata.updatePayload
|
|
122
|
-
didUpdatePayload = signalsMetadataMap.get(signal.txid)?.
|
|
122
|
+
didUpdatePayload = signalsMetadataMap.get(signal.txid)?.didUpdate;
|
|
123
123
|
|
|
124
124
|
if(!didUpdatePayload) {
|
|
125
125
|
throw new SingletonBeaconError('Update Payload not found in signal metadata.', 'PROCESS_SIGNAL_ERROR');
|
|
@@ -246,6 +246,6 @@ export class SingletonBeacon extends Beacon {
|
|
|
246
246
|
// 10. Initialize signalMetadata to an empty object.
|
|
247
247
|
// 11. Set signalMetadata.updatePayload to didUpdatePayload.
|
|
248
248
|
// 12. Return the object {<signalId>: { updatePayload: DidUpdatePayload; proofs?: any; }}.
|
|
249
|
-
return { [spentTx]: {
|
|
249
|
+
return { [spentTx]: { didUpdate: didUpdatePayload } };
|
|
250
250
|
}
|
|
251
251
|
}
|
|
@@ -6,8 +6,8 @@ import { DidBtcr2 } from '../../did-btcr2.js';
|
|
|
6
6
|
* document. To do this, the DID controller constructs a valid DID Update Payload with a JSON patch that adds this
|
|
7
7
|
* property and announces the payload through a Beacon in their current DID document following the algorithm in Update.
|
|
8
8
|
* Once a did:btcr2 has been deactivated this state is considered permanent and resolution MUST terminate.
|
|
9
|
-
* @class
|
|
10
|
-
* @type {
|
|
11
|
-
* @extends {
|
|
9
|
+
* @class Deactivate
|
|
10
|
+
* @type {Deactivate}
|
|
11
|
+
* @extends {DidBtcr2}
|
|
12
12
|
*/
|
|
13
|
-
export class
|
|
13
|
+
export class Deactivate extends DidBtcr2 {}
|