@enbox/dids 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/browser.mjs +1 -1
  2. package/dist/browser.mjs.map +4 -4
  3. package/dist/esm/methods/did-dht-dns.js +455 -0
  4. package/dist/esm/methods/did-dht-dns.js.map +1 -0
  5. package/dist/esm/methods/did-dht-pkarr.js +168 -0
  6. package/dist/esm/methods/did-dht-pkarr.js.map +1 -0
  7. package/dist/esm/methods/did-dht-types.js +116 -0
  8. package/dist/esm/methods/did-dht-types.js.map +1 -0
  9. package/dist/esm/methods/did-dht-utils.js +143 -0
  10. package/dist/esm/methods/did-dht-utils.js.map +1 -0
  11. package/dist/esm/methods/did-dht.js +65 -842
  12. package/dist/esm/methods/did-dht.js.map +1 -1
  13. package/dist/esm/methods/did-ion-utils.js +161 -0
  14. package/dist/esm/methods/did-ion-utils.js.map +1 -0
  15. package/dist/esm/methods/did-ion.js +4 -151
  16. package/dist/esm/methods/did-ion.js.map +1 -1
  17. package/dist/esm/methods/did-key-utils.js +235 -0
  18. package/dist/esm/methods/did-key-utils.js.map +1 -0
  19. package/dist/esm/methods/did-key.js +6 -222
  20. package/dist/esm/methods/did-key.js.map +1 -1
  21. package/dist/esm/utils.js +15 -19
  22. package/dist/esm/utils.js.map +1 -1
  23. package/dist/types/methods/did-dht-dns.d.ts +114 -0
  24. package/dist/types/methods/did-dht-dns.d.ts.map +1 -0
  25. package/dist/types/methods/did-dht-pkarr.d.ts +56 -0
  26. package/dist/types/methods/did-dht-pkarr.d.ts.map +1 -0
  27. package/dist/types/methods/did-dht-types.d.ts +286 -0
  28. package/dist/types/methods/did-dht-types.d.ts.map +1 -0
  29. package/dist/types/methods/did-dht-utils.d.ts +54 -0
  30. package/dist/types/methods/did-dht-utils.d.ts.map +1 -0
  31. package/dist/types/methods/did-dht.d.ts +42 -457
  32. package/dist/types/methods/did-dht.d.ts.map +1 -1
  33. package/dist/types/methods/did-ion-utils.d.ts +86 -0
  34. package/dist/types/methods/did-ion-utils.d.ts.map +1 -0
  35. package/dist/types/methods/did-ion.d.ts +2 -82
  36. package/dist/types/methods/did-ion.d.ts.map +1 -1
  37. package/dist/types/methods/did-key-utils.d.ts +138 -0
  38. package/dist/types/methods/did-key-utils.d.ts.map +1 -0
  39. package/dist/types/methods/did-key.d.ts +3 -124
  40. package/dist/types/methods/did-key.d.ts.map +1 -1
  41. package/dist/types/utils.d.ts +25 -25
  42. package/dist/types/utils.d.ts.map +1 -1
  43. package/dist/utils.js +1 -1
  44. package/dist/utils.js.map +4 -4
  45. package/package.json +4 -4
  46. package/src/methods/did-dht-dns.ts +516 -0
  47. package/src/methods/did-dht-pkarr.ts +192 -0
  48. package/src/methods/did-dht-types.ts +316 -0
  49. package/src/methods/did-dht-utils.ts +157 -0
  50. package/src/methods/did-dht.ts +122 -1128
  51. package/src/methods/did-ion-utils.ts +186 -0
  52. package/src/methods/did-ion.ts +14 -190
  53. package/src/methods/did-key-utils.ts +258 -0
  54. package/src/methods/did-key.ts +14 -266
  55. package/src/utils.ts +31 -30
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Represents an optional extension to a DID Document's DNS packet representation exposed as a
3
+ * type index.
4
+ *
5
+ * Type indexing is an OPTIONAL feature that enables DIDs to become discoverable. DIDs that wish to
6
+ * be discoverable and resolveable by type can include one or more types when publishing their DID
7
+ * document to a DID DHT Gateway.
8
+ *
9
+ * The registered DID types are published in the {@link https://did-dht.com/registry/index.html#indexed-types | DID DHT Registry}.
10
+ */
11
+ export var DidDhtRegisteredDidType;
12
+ (function (DidDhtRegisteredDidType) {
13
+ /**
14
+ * Type 0 is reserved for DIDs that do not wish to associate themselves with a specific type but
15
+ * wish to make themselves discoverable.
16
+ */
17
+ DidDhtRegisteredDidType[DidDhtRegisteredDidType["Discoverable"] = 0] = "Discoverable";
18
+ /**
19
+ * Organization
20
+ * @see {@link https://schema.org/Organization | schema definition}
21
+ */
22
+ DidDhtRegisteredDidType[DidDhtRegisteredDidType["Organization"] = 1] = "Organization";
23
+ /**
24
+ * Government Organization
25
+ * @see {@link https://schema.org/GovernmentOrganization | schema definition}
26
+ */
27
+ DidDhtRegisteredDidType[DidDhtRegisteredDidType["Government"] = 2] = "Government";
28
+ /**
29
+ * Corporation
30
+ * @see {@link https://schema.org/Corporation | schema definition}
31
+ */
32
+ DidDhtRegisteredDidType[DidDhtRegisteredDidType["Corporation"] = 3] = "Corporation";
33
+ /**
34
+ * Corporation
35
+ * @see {@link https://schema.org/Corporation | schema definition}
36
+ */
37
+ DidDhtRegisteredDidType[DidDhtRegisteredDidType["LocalBusiness"] = 4] = "LocalBusiness";
38
+ /**
39
+ * Software Package
40
+ * @see {@link https://schema.org/SoftwareSourceCode | schema definition}
41
+ */
42
+ DidDhtRegisteredDidType[DidDhtRegisteredDidType["SoftwarePackage"] = 5] = "SoftwarePackage";
43
+ /**
44
+ * Web App
45
+ * @see {@link https://schema.org/WebApplication | schema definition}
46
+ */
47
+ DidDhtRegisteredDidType[DidDhtRegisteredDidType["WebApp"] = 6] = "WebApp";
48
+ /**
49
+ * Financial Institution
50
+ * @see {@link https://schema.org/FinancialService | schema definition}
51
+ */
52
+ DidDhtRegisteredDidType[DidDhtRegisteredDidType["FinancialInstitution"] = 7] = "FinancialInstitution";
53
+ })(DidDhtRegisteredDidType || (DidDhtRegisteredDidType = {}));
54
+ /**
55
+ * Enumerates the types of keys that can be used in a DID DHT document.
56
+ *
57
+ * The DID DHT method supports various cryptographic key types. These key types are essential for
58
+ * the creation and management of DIDs and their associated cryptographic operations like signing
59
+ * and encryption. The registered key types are published in the DID DHT Registry and each is
60
+ * assigned a unique numerical value for use by client and gateway implementations.
61
+ *
62
+ * The registered key types are published in the {@link https://did-dht.com/registry/index.html#key-type-index | DID DHT Registry}.
63
+ */
64
+ export var DidDhtRegisteredKeyType;
65
+ (function (DidDhtRegisteredKeyType) {
66
+ /**
67
+ * Ed25519: A public-key signature system using the EdDSA (Edwards-curve Digital Signature
68
+ * Algorithm) and Curve25519.
69
+ */
70
+ DidDhtRegisteredKeyType[DidDhtRegisteredKeyType["Ed25519"] = 0] = "Ed25519";
71
+ /**
72
+ * secp256k1: A cryptographic curve used for digital signatures in a range of decentralized
73
+ * systems.
74
+ */
75
+ DidDhtRegisteredKeyType[DidDhtRegisteredKeyType["secp256k1"] = 1] = "secp256k1";
76
+ /**
77
+ * secp256r1: Also known as P-256 or prime256v1, this curve is used for cryptographic operations
78
+ * and is widely supported in various cryptographic libraries and standards.
79
+ */
80
+ DidDhtRegisteredKeyType[DidDhtRegisteredKeyType["secp256r1"] = 2] = "secp256r1";
81
+ /**
82
+ * X25519: A public key used for Diffie-Hellman key exchange using Curve25519.
83
+ */
84
+ DidDhtRegisteredKeyType[DidDhtRegisteredKeyType["X25519"] = 3] = "X25519";
85
+ })(DidDhtRegisteredKeyType || (DidDhtRegisteredKeyType = {}));
86
+ /**
87
+ * Maps {@link https://www.w3.org/TR/did-core/#verification-relationships | DID Core Verification Relationship}
88
+ * values to the corresponding record name in the DNS packet representation of a DHT DID document.
89
+ */
90
+ export var DidDhtVerificationRelationship;
91
+ (function (DidDhtVerificationRelationship) {
92
+ /**
93
+ * Specifies how the DID subject is expected to be authenticated.
94
+ */
95
+ DidDhtVerificationRelationship["authentication"] = "auth";
96
+ /**
97
+ * Specifies how the DID subject is expected to express claims, such as for issuing Verifiable
98
+ * Credentials.
99
+ */
100
+ DidDhtVerificationRelationship["assertionMethod"] = "asm";
101
+ /**
102
+ * Specifies a mechanism used by the DID subject to delegate a cryptographic capability to another
103
+ * party
104
+ */
105
+ DidDhtVerificationRelationship["capabilityDelegation"] = "del";
106
+ /**
107
+ * Specifies a verification method used by the DID subject to invoke a cryptographic capability.
108
+ */
109
+ DidDhtVerificationRelationship["capabilityInvocation"] = "inv";
110
+ /**
111
+ * Specifies how an entity can generate encryption material to communicate confidentially with the
112
+ * DID subject.
113
+ */
114
+ DidDhtVerificationRelationship["keyAgreement"] = "agm";
115
+ })(DidDhtVerificationRelationship || (DidDhtVerificationRelationship = {}));
116
+ //# sourceMappingURL=did-dht-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"did-dht-types.js","sourceRoot":"","sources":["../../../src/methods/did-dht-types.ts"],"names":[],"mappings":"AA4LA;;;;;;;;;GASG;AACH,MAAM,CAAN,IAAY,uBAgDX;AAhDD,WAAY,uBAAuB;IACjC;;;OAGG;IACH,qFAAgB,CAAA;IAEhB;;;OAGG;IACH,qFAAgB,CAAA;IAEhB;;;OAGG;IACH,iFAAc,CAAA;IAEd;;;OAGG;IACH,mFAAe,CAAA;IAEf;;;OAGG;IACH,uFAAiB,CAAA;IAEjB;;;OAGG;IACH,2FAAmB,CAAA;IAEnB;;;OAGG;IACH,yEAAU,CAAA;IAEV;;;OAGG;IACH,qGAAwB,CAAA;AAC1B,CAAC,EAhDW,uBAAuB,KAAvB,uBAAuB,QAgDlC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAN,IAAY,uBAuBX;AAvBD,WAAY,uBAAuB;IACjC;;;OAGG;IACH,2EAAW,CAAA;IAEX;;;OAGG;IACH,+EAAa,CAAA;IAEb;;;OAGG;IACH,+EAAa,CAAA;IAEb;;OAEG;IACH,yEAAU,CAAA;AACZ,CAAC,EAvBW,uBAAuB,KAAvB,uBAAuB,QAuBlC;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,8BA4BX;AA5BD,WAAY,8BAA8B;IACxC;;OAEG;IACH,yDAAuB,CAAA;IAEvB;;;OAGG;IACH,yDAAuB,CAAA;IAEvB;;;OAGG;IACH,8DAA4B,CAAA;IAE5B;;OAEG;IACH,8DAA4B,CAAA;IAE5B;;;OAGG;IACH,sDAAoB,CAAA;AACtB,CAAC,EA5BW,8BAA8B,KAA9B,8BAA8B,QA4BzC"}
@@ -0,0 +1,143 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { Convert } from '@enbox/common';
11
+ import { Ed25519, Secp256k1, Secp256r1, X25519 } from '@enbox/crypto';
12
+ import { Did } from '../did.js';
13
+ import { DidError, DidErrorCode } from '../did-error.js';
14
+ /**
15
+ * The DID DHT method name.
16
+ */
17
+ const DID_DHT_METHOD_NAME = 'dht';
18
+ /**
19
+ * Converts a DID URI to a JSON Web Key (JWK) representing the Identity Key.
20
+ *
21
+ * @param params - The parameters to use for the conversion.
22
+ * @param params.didUri - The DID URI containing the Identity Key.
23
+ * @returns A promise that resolves to a JWK representing the Identity Key.
24
+ */
25
+ export function identifierToIdentityKey(_a) {
26
+ return __awaiter(this, arguments, void 0, function* ({ didUri }) {
27
+ // Decode the method-specific identifier from z-base-32 to a byte array.
28
+ const identityKeyBytes = identifierToIdentityKeyBytes({ didUri });
29
+ // Convert the byte array to a JWK.
30
+ const identityKey = yield Ed25519.bytesToPublicKey({ publicKeyBytes: identityKeyBytes });
31
+ return identityKey;
32
+ });
33
+ }
34
+ /**
35
+ * Converts a DID URI to the byte array representation of the Identity Key.
36
+ *
37
+ * @param params - The parameters to use for the conversion.
38
+ * @param params.didUri - The DID URI containing the Identity Key.
39
+ * @returns A byte array representation of the Identity Key.
40
+ */
41
+ export function identifierToIdentityKeyBytes({ didUri }) {
42
+ // Parse the DID URI.
43
+ const parsedDid = Did.parse(didUri);
44
+ // Verify that the DID URI is valid.
45
+ if (!parsedDid) {
46
+ throw new DidError(DidErrorCode.InvalidDid, `Invalid DID URI: ${didUri}`);
47
+ }
48
+ // Verify the DID method is supported.
49
+ if (parsedDid.method !== DID_DHT_METHOD_NAME) {
50
+ throw new DidError(DidErrorCode.MethodNotSupported, `Method not supported: ${parsedDid.method}`);
51
+ }
52
+ // Decode the method-specific identifier from z-base-32 to a byte array.
53
+ let identityKeyBytes;
54
+ try {
55
+ identityKeyBytes = Convert.base32Z(parsedDid.id).toUint8Array();
56
+ }
57
+ catch (_a) {
58
+ throw new DidError(DidErrorCode.InvalidPublicKey, `Failed to decode method-specific identifier`);
59
+ }
60
+ if (identityKeyBytes.length !== 32) {
61
+ throw new DidError(DidErrorCode.InvalidPublicKeyLength, `Invalid public key length: ${identityKeyBytes.length}`);
62
+ }
63
+ return identityKeyBytes;
64
+ }
65
+ /**
66
+ * Encodes a DID DHT Identity Key into a DID identifier.
67
+ *
68
+ * This method first z-base-32 encodes the Identity Key. The resulting string is prefixed with
69
+ * `did:dht:` to form the DID identifier.
70
+ *
71
+ * @param params - The parameters to use for the conversion.
72
+ * @param params.identityKey The Identity Key from which the DID identifier is computed.
73
+ * @returns A promise that resolves to a string containing the DID identifier.
74
+ */
75
+ export function identityKeyToIdentifier(_a) {
76
+ return __awaiter(this, arguments, void 0, function* ({ identityKey }) {
77
+ // Convert the key from JWK format to a byte array.
78
+ const publicKeyBytes = yield Ed25519.publicKeyToBytes({ publicKey: identityKey });
79
+ // Encode the byte array as a z-base-32 string.
80
+ const identifier = Convert.uint8Array(publicKeyBytes).toBase32Z();
81
+ return `did:${DID_DHT_METHOD_NAME}:${identifier}`;
82
+ });
83
+ }
84
+ /**
85
+ * Returns the appropriate key converter for the specified cryptographic curve.
86
+ *
87
+ * @param curve - The cryptographic curve to use for the key conversion.
88
+ * @returns An `AsymmetricKeyConverter` for the specified curve.
89
+ */
90
+ export function keyConverter(curve) {
91
+ const converters = {
92
+ 'Ed25519': Ed25519,
93
+ 'P-256': {
94
+ // Wrap the key converter which produces uncompressed public key bytes to produce compressed key bytes as required by the DID DHT spec.
95
+ // See https://did-dht.com/#representing-keys for more info.
96
+ publicKeyToBytes: (_a) => __awaiter(this, [_a], void 0, function* ({ publicKey }) {
97
+ const publicKeyBytes = yield Secp256r1.publicKeyToBytes({ publicKey });
98
+ const compressedPublicKey = yield Secp256r1.compressPublicKey({ publicKeyBytes });
99
+ return compressedPublicKey;
100
+ }),
101
+ bytesToPublicKey: Secp256r1.bytesToPublicKey,
102
+ privateKeyToBytes: Secp256r1.privateKeyToBytes,
103
+ bytesToPrivateKey: Secp256r1.bytesToPrivateKey,
104
+ },
105
+ 'secp256k1': {
106
+ // Wrap the key converter which produces uncompressed public key bytes to produce compressed key bytes as required by the DID DHT spec.
107
+ // See https://did-dht.com/#representing-keys for more info.
108
+ publicKeyToBytes: (_a) => __awaiter(this, [_a], void 0, function* ({ publicKey }) {
109
+ const publicKeyBytes = yield Secp256k1.publicKeyToBytes({ publicKey });
110
+ const compressedPublicKey = yield Secp256k1.compressPublicKey({ publicKeyBytes });
111
+ return compressedPublicKey;
112
+ }),
113
+ bytesToPublicKey: Secp256k1.bytesToPublicKey,
114
+ privateKeyToBytes: Secp256k1.privateKeyToBytes,
115
+ bytesToPrivateKey: Secp256k1.bytesToPrivateKey,
116
+ },
117
+ X25519: X25519,
118
+ };
119
+ const converter = converters[curve];
120
+ if (!converter) {
121
+ throw new DidError(DidErrorCode.InvalidPublicKeyType, `Unsupported curve: ${curve}`);
122
+ }
123
+ return converter;
124
+ }
125
+ /**
126
+ * Validates the proof of previous DID given.
127
+ *
128
+ * @param params - The parameters to validate the previous DID proof.
129
+ * @param params.newDid - The new DID that the previous DID is linking to.
130
+ * @param params.previousDidProof - The proof of the previous DID, containing the previous DID and signature signed by the previous DID.
131
+ */
132
+ export function validatePreviousDidProof(_a) {
133
+ return __awaiter(this, arguments, void 0, function* ({ newDid, previousDidProof }) {
134
+ const key = yield identifierToIdentityKey({ didUri: previousDidProof.previousDid });
135
+ const data = identifierToIdentityKeyBytes({ didUri: newDid });
136
+ const signature = Convert.base64Url(previousDidProof.signature).toUint8Array();
137
+ const isValid = yield Ed25519.verify({ key, data, signature });
138
+ if (!isValid) {
139
+ throw new DidError(DidErrorCode.InvalidPreviousDidProof, 'The previous DID proof is invalid.');
140
+ }
141
+ });
142
+ }
143
+ //# sourceMappingURL=did-dht-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"did-dht-utils.js","sourceRoot":"","sources":["../../../src/methods/did-dht-utils.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAItE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEzD;;GAEG;AACH,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAElC;;;;;;GAMG;AACH,MAAM,UAAgB,uBAAuB;yDAAC,EAAE,MAAM,EAErD;QACC,wEAAwE;QACxE,MAAM,gBAAgB,GAAG,4BAA4B,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QAElE,mCAAmC;QACnC,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,gBAAgB,CAAC,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAC,CAAC;QAEzF,OAAO,WAAW,CAAC;IACrB,CAAC;CAAA;AAED;;;;;;GAMG;AACH,MAAM,UAAU,4BAA4B,CAAC,EAAE,MAAM,EAEpD;IACC,qBAAqB;IACrB,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAEpC,oCAAoC;IACpC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,QAAQ,CAAC,YAAY,CAAC,UAAU,EAAE,oBAAoB,MAAM,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,sCAAsC;IACtC,IAAI,SAAS,CAAC,MAAM,KAAK,mBAAmB,EAAE,CAAC;QAC7C,MAA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