signet-protocol 0.1.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/LICENSE +21 -0
- package/README.md +112 -0
- package/dist/anomaly.d.ts +42 -0
- package/dist/anomaly.d.ts.map +1 -0
- package/dist/anomaly.js +209 -0
- package/dist/anomaly.js.map +1 -0
- package/dist/badge.d.ts +56 -0
- package/dist/badge.d.ts.map +1 -0
- package/dist/badge.js +171 -0
- package/dist/badge.js.map +1 -0
- package/dist/bonds.d.ts +39 -0
- package/dist/bonds.d.ts.map +1 -0
- package/dist/bonds.js +149 -0
- package/dist/bonds.js.map +1 -0
- package/dist/challenges.d.ts +18 -0
- package/dist/challenges.d.ts.map +1 -0
- package/dist/challenges.js +145 -0
- package/dist/challenges.js.map +1 -0
- package/dist/cold-call.d.ts +74 -0
- package/dist/cold-call.d.ts.map +1 -0
- package/dist/cold-call.js +176 -0
- package/dist/cold-call.js.map +1 -0
- package/dist/compliance.d.ts +82 -0
- package/dist/compliance.d.ts.map +1 -0
- package/dist/compliance.js +478 -0
- package/dist/compliance.js.map +1 -0
- package/dist/connections.d.ts +63 -0
- package/dist/connections.d.ts.map +1 -0
- package/dist/connections.js +170 -0
- package/dist/connections.js.map +1 -0
- package/dist/constants.d.ts +86 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +124 -0
- package/dist/constants.js.map +1 -0
- package/dist/credentials.d.ts +190 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +686 -0
- package/dist/credentials.js.map +1 -0
- package/dist/crypto.d.ts +27 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/crypto.js +75 -0
- package/dist/crypto.js.map +1 -0
- package/dist/errors.d.ts +17 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +29 -0
- package/dist/errors.js.map +1 -0
- package/dist/i18n.d.ts +98 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +1118 -0
- package/dist/i18n.js.map +1 -0
- package/dist/identity-bridge.d.ts +52 -0
- package/dist/identity-bridge.d.ts.map +1 -0
- package/dist/identity-bridge.js +228 -0
- package/dist/identity-bridge.js.map +1 -0
- package/dist/identity-tree.d.ts +47 -0
- package/dist/identity-tree.d.ts.map +1 -0
- package/dist/identity-tree.js +69 -0
- package/dist/identity-tree.js.map +1 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +86 -0
- package/dist/index.js.map +1 -0
- package/dist/key-derivation.d.ts +43 -0
- package/dist/key-derivation.d.ts.map +1 -0
- package/dist/key-derivation.js +212 -0
- package/dist/key-derivation.js.map +1 -0
- package/dist/lsag.d.ts +23 -0
- package/dist/lsag.d.ts.map +1 -0
- package/dist/lsag.js +35 -0
- package/dist/lsag.js.map +1 -0
- package/dist/merkle.d.ts +19 -0
- package/dist/merkle.d.ts.map +1 -0
- package/dist/merkle.js +155 -0
- package/dist/merkle.js.map +1 -0
- package/dist/policies.d.ts +22 -0
- package/dist/policies.d.ts.map +1 -0
- package/dist/policies.js +123 -0
- package/dist/policies.js.map +1 -0
- package/dist/range-proof.d.ts +6 -0
- package/dist/range-proof.d.ts.map +1 -0
- package/dist/range-proof.js +45 -0
- package/dist/range-proof.js.map +1 -0
- package/dist/relay.d.ts +106 -0
- package/dist/relay.d.ts.map +1 -0
- package/dist/relay.js +336 -0
- package/dist/relay.js.map +1 -0
- package/dist/ring-signature.d.ts +35 -0
- package/dist/ring-signature.d.ts.map +1 -0
- package/dist/ring-signature.js +56 -0
- package/dist/ring-signature.js.map +1 -0
- package/dist/shamir.d.ts +55 -0
- package/dist/shamir.d.ts.map +1 -0
- package/dist/shamir.js +253 -0
- package/dist/shamir.js.map +1 -0
- package/dist/signet-words.d.ts +42 -0
- package/dist/signet-words.d.ts.map +1 -0
- package/dist/signet-words.js +82 -0
- package/dist/signet-words.js.map +1 -0
- package/dist/store.d.ts +65 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +290 -0
- package/dist/store.js.map +1 -0
- package/dist/trust-score.d.ts +9 -0
- package/dist/trust-score.d.ts.map +1 -0
- package/dist/trust-score.js +186 -0
- package/dist/trust-score.js.map +1 -0
- package/dist/types.d.ts +358 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +15 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +11 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +21 -0
- package/dist/utils.js.map +1 -0
- package/dist/validation.d.ts +33 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +312 -0
- package/dist/validation.js.map +1 -0
- package/dist/verifiers.d.ts +18 -0
- package/dist/verifiers.d.ts.map +1 -0
- package/dist/verifiers.js +118 -0
- package/dist/verifiers.js.map +1 -0
- package/dist/vouches.d.ts +14 -0
- package/dist/vouches.d.ts.map +1 -0
- package/dist/vouches.js +103 -0
- package/dist/vouches.js.map +1 -0
- package/package.json +76 -0
- package/src/anomaly.ts +307 -0
- package/src/badge.ts +208 -0
- package/src/bonds.ts +203 -0
- package/src/challenges.ts +187 -0
- package/src/cold-call.ts +238 -0
- package/src/compliance.ts +612 -0
- package/src/connections.ts +216 -0
- package/src/constants.ts +146 -0
- package/src/credentials.ts +908 -0
- package/src/crypto.ts +85 -0
- package/src/errors.ts +31 -0
- package/src/i18n.ts +1347 -0
- package/src/identity-bridge.ts +262 -0
- package/src/identity-tree.ts +90 -0
- package/src/index.ts +452 -0
- package/src/lsag.ts +53 -0
- package/src/merkle.ts +176 -0
- package/src/policies.ts +154 -0
- package/src/range-proof.ts +66 -0
- package/src/relay.ts +433 -0
- package/src/ring-signature.ts +76 -0
- package/src/signet-words.ts +122 -0
- package/src/store.ts +336 -0
- package/src/trust-score.ts +208 -0
- package/src/types.ts +482 -0
- package/src/utils.ts +20 -0
- package/src/validation.ts +391 -0
- package/src/verifiers.ts +156 -0
- package/src/vouches.ts +141 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// Signet Peer Connection Management
|
|
2
|
+
// ECDH-based shared secret derivation and connection lifecycle
|
|
3
|
+
import { secp256k1 } from '@noble/curves/secp256k1.js';
|
|
4
|
+
import { sha256 } from '@noble/hashes/sha2.js';
|
|
5
|
+
import { bytesToHex, hexToBytes, randomBytes } from '@noble/hashes/utils.js';
|
|
6
|
+
import { SignetValidationError } from './errors.js';
|
|
7
|
+
// ── ECDH ─────────────────────────────────────────────────────────────────────
|
|
8
|
+
/** Compute an ECDH shared secret from our private key and their x-only public key.
|
|
9
|
+
* The result is the SHA-256 of the x-coordinate of the ECDH point, returned as
|
|
10
|
+
* a 32-byte hex string. The secret is symmetric: A(priv)+B(pub) === B(priv)+A(pub). */
|
|
11
|
+
export function computeSharedSecret(myPrivateKey, theirPublicKey) {
|
|
12
|
+
// Nostr/schnorr public keys are x-only (32 bytes). To perform ECDH we need
|
|
13
|
+
// the full compressed point, so we prepend 0x02 (assume even y-coordinate,
|
|
14
|
+
// per BIP-340 convention used by Nostr).
|
|
15
|
+
const privBytes = hexToBytes(myPrivateKey);
|
|
16
|
+
const sharedPoint = secp256k1.getSharedSecret(privBytes, hexToBytes('02' + theirPublicKey));
|
|
17
|
+
privBytes.fill(0);
|
|
18
|
+
// sharedPoint is 33 bytes (compressed): prefix + x-coordinate. Take x bytes [1..33].
|
|
19
|
+
const xBytes = sharedPoint.slice(1, 33);
|
|
20
|
+
return bytesToHex(sha256(xBytes));
|
|
21
|
+
}
|
|
22
|
+
// ── QR Payload ───────────────────────────────────────────────────────────────
|
|
23
|
+
/**
|
|
24
|
+
* Create a QR payload containing our public key and a random nonce.
|
|
25
|
+
*
|
|
26
|
+
* **SECURITY WARNING — unencrypted payload:** The returned object is serialised
|
|
27
|
+
* as cleartext JSON by `serializeQRPayload`. Any `ContactInfo` embedded in the
|
|
28
|
+
* payload (name, mobile, email, address, children's public keys) is transmitted
|
|
29
|
+
* without encryption. Only display this QR code on trusted screens in
|
|
30
|
+
* controlled environments. Do not transmit it over untrusted channels.
|
|
31
|
+
*/
|
|
32
|
+
export function createQRPayload(publicKey, info) {
|
|
33
|
+
const nonce = bytesToHex(randomBytes(32));
|
|
34
|
+
const payload = { pubkey: publicKey, nonce };
|
|
35
|
+
if (info !== undefined) {
|
|
36
|
+
payload.info = info;
|
|
37
|
+
}
|
|
38
|
+
return payload;
|
|
39
|
+
}
|
|
40
|
+
/** Serialize a QR payload to a JSON string. */
|
|
41
|
+
export function serializeQRPayload(payload) {
|
|
42
|
+
return JSON.stringify(payload);
|
|
43
|
+
}
|
|
44
|
+
const MAX_CONTACT_FIELD_LENGTH = 256;
|
|
45
|
+
const MAX_CHILD_PUBKEYS = 20;
|
|
46
|
+
/** Validate ContactInfo field sizes to prevent oversized payloads from untrusted sources. */
|
|
47
|
+
function validateContactInfo(info) {
|
|
48
|
+
if (typeof info !== 'object' || info === null) {
|
|
49
|
+
throw new SignetValidationError('Invalid ContactInfo: must be an object');
|
|
50
|
+
}
|
|
51
|
+
const ci = info;
|
|
52
|
+
for (const field of ['name', 'mobile', 'email', 'address']) {
|
|
53
|
+
if (ci[field] !== undefined) {
|
|
54
|
+
if (typeof ci[field] !== 'string')
|
|
55
|
+
throw new SignetValidationError(`Invalid ContactInfo: ${field} must be a string`);
|
|
56
|
+
if (ci[field].length > MAX_CONTACT_FIELD_LENGTH) {
|
|
57
|
+
throw new SignetValidationError(`Invalid ContactInfo: ${field} exceeds ${MAX_CONTACT_FIELD_LENGTH} characters`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (ci.childPubkeys !== undefined) {
|
|
62
|
+
if (!Array.isArray(ci.childPubkeys))
|
|
63
|
+
throw new SignetValidationError('Invalid ContactInfo: childPubkeys must be an array');
|
|
64
|
+
if (ci.childPubkeys.length > MAX_CHILD_PUBKEYS) {
|
|
65
|
+
throw new SignetValidationError(`Invalid ContactInfo: childPubkeys exceeds ${MAX_CHILD_PUBKEYS} entries`);
|
|
66
|
+
}
|
|
67
|
+
for (const pk of ci.childPubkeys) {
|
|
68
|
+
if (typeof pk !== 'string' || !/^[0-9a-f]{64}$/i.test(pk)) {
|
|
69
|
+
throw new SignetValidationError('Invalid ContactInfo: childPubkeys must contain valid 64-char hex pubkeys');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/** Parse and validate a QR payload from a JSON string.
|
|
75
|
+
* Throws if the data is not valid JSON or is missing required fields. */
|
|
76
|
+
export function parseQRPayload(data) {
|
|
77
|
+
let parsed;
|
|
78
|
+
try {
|
|
79
|
+
parsed = JSON.parse(data);
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
throw new SignetValidationError('Invalid QR payload: malformed JSON');
|
|
83
|
+
}
|
|
84
|
+
if (typeof parsed !== 'object' || parsed === null) {
|
|
85
|
+
throw new SignetValidationError('Invalid QR payload: not an object');
|
|
86
|
+
}
|
|
87
|
+
const obj = parsed;
|
|
88
|
+
if (typeof obj.pubkey !== 'string' || !/^[0-9a-f]{64}$/i.test(obj.pubkey)) {
|
|
89
|
+
throw new SignetValidationError('Invalid QR payload: pubkey must be a 64-character hex string');
|
|
90
|
+
}
|
|
91
|
+
if (typeof obj.nonce !== 'string' || obj.nonce.length < 32 || obj.nonce.length > 128) {
|
|
92
|
+
throw new SignetValidationError('Invalid QR payload: nonce must be 32-128 hex characters');
|
|
93
|
+
}
|
|
94
|
+
// Validate ContactInfo field sizes if present
|
|
95
|
+
if (obj.info !== undefined) {
|
|
96
|
+
validateContactInfo(obj.info);
|
|
97
|
+
}
|
|
98
|
+
return parsed;
|
|
99
|
+
}
|
|
100
|
+
// ── Connection ───────────────────────────────────────────────────────────────
|
|
101
|
+
/** Create a Connection from our private key and a scanned QR payload. */
|
|
102
|
+
export function createConnection(myPrivateKey, qrPayload, ourInfo) {
|
|
103
|
+
const sharedSecret = computeSharedSecret(myPrivateKey, qrPayload.pubkey);
|
|
104
|
+
return {
|
|
105
|
+
pubkey: qrPayload.pubkey,
|
|
106
|
+
sharedSecret,
|
|
107
|
+
theirInfo: qrPayload.info ?? {},
|
|
108
|
+
ourInfo,
|
|
109
|
+
connectedAt: Math.floor(Date.now() / 1000),
|
|
110
|
+
method: 'qr-in-person',
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
// ── ConnectionStore ──────────────────────────────────────────────────────────
|
|
114
|
+
/** Simple in-memory connection manager keyed by remote public key. */
|
|
115
|
+
export class ConnectionStore {
|
|
116
|
+
connections = new Map();
|
|
117
|
+
/** Add a connection. If a connection with the same pubkey already exists it is replaced. */
|
|
118
|
+
add(connection) {
|
|
119
|
+
this.connections.set(connection.pubkey, connection);
|
|
120
|
+
}
|
|
121
|
+
/** Get a connection by remote public key. */
|
|
122
|
+
get(pubkey) {
|
|
123
|
+
return this.connections.get(pubkey);
|
|
124
|
+
}
|
|
125
|
+
/** List all connections. */
|
|
126
|
+
list() {
|
|
127
|
+
return Array.from(this.connections.values());
|
|
128
|
+
}
|
|
129
|
+
/** Remove a connection by remote public key. Returns true if a connection was removed. */
|
|
130
|
+
remove(pubkey) {
|
|
131
|
+
return this.connections.delete(pubkey);
|
|
132
|
+
}
|
|
133
|
+
/** Check whether a connection for the given public key exists. */
|
|
134
|
+
has(pubkey) {
|
|
135
|
+
return this.connections.has(pubkey);
|
|
136
|
+
}
|
|
137
|
+
/** Export all connections as an array (for serialization). */
|
|
138
|
+
export() {
|
|
139
|
+
return this.list();
|
|
140
|
+
}
|
|
141
|
+
/** Import connections from an array, replacing any existing connections with the same pubkey. */
|
|
142
|
+
import(connections) {
|
|
143
|
+
for (const conn of connections) {
|
|
144
|
+
if (!conn || typeof conn !== 'object')
|
|
145
|
+
continue;
|
|
146
|
+
if (typeof conn.pubkey !== 'string' || !/^[0-9a-f]{64}$/i.test(conn.pubkey))
|
|
147
|
+
continue;
|
|
148
|
+
if (typeof conn.sharedSecret !== 'string' || !/^[0-9a-f]{64}$/i.test(conn.sharedSecret))
|
|
149
|
+
continue;
|
|
150
|
+
if (typeof conn.connectedAt !== 'number' || conn.connectedAt <= 0)
|
|
151
|
+
continue;
|
|
152
|
+
if (typeof conn.theirInfo !== 'object' || conn.theirInfo === null)
|
|
153
|
+
continue;
|
|
154
|
+
if (typeof conn.ourInfo !== 'object' || conn.ourInfo === null)
|
|
155
|
+
continue;
|
|
156
|
+
if (conn.method !== 'qr-in-person' && conn.method !== 'online')
|
|
157
|
+
continue;
|
|
158
|
+
// Validate ContactInfo field sizes to prevent oversized data from untrusted sources
|
|
159
|
+
try {
|
|
160
|
+
validateContactInfo(conn.theirInfo);
|
|
161
|
+
validateContactInfo(conn.ourInfo);
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
this.connections.set(conn.pubkey, conn);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=connections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connections.js","sourceRoot":"","sources":["../src/connections.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,+DAA+D;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AA8BpD,gFAAgF;AAEhF;;yFAEyF;AACzF,MAAM,UAAU,mBAAmB,CAAC,YAAoB,EAAE,cAAsB;IAC9E,4EAA4E;IAC5E,2EAA2E;IAC3E,yCAAyC;IACzC,MAAM,SAAS,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IAC3C,MAAM,WAAW,GAAG,SAAS,CAAC,eAAe,CAAC,SAAS,EAAE,UAAU,CAAC,IAAI,GAAG,cAAc,CAAC,CAAC,CAAC;IAC5F,SAAS,CAAC,IAAI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AAO,KAAK,IAAI;gBAAE,SAAS;YACxE,IAAI,IAAI,CAAC,MAAM,KAAK,cAAc,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ;gBAAE,SAAS;YACzE,oFAAoF;YACpF,IAAI,CAAC;gBACH,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBACpC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACpC,CAAC;YAAC,MAAM,CAAC;gBACP,SAAS;YACX,CAAC;YACD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { ATTESTATION_KIND } from 'nostr-attestations';
|
|
2
|
+
/** Generic Verifiable Attestation kind (NIP-VA, kind 31000) */
|
|
3
|
+
export { ATTESTATION_KIND };
|
|
4
|
+
/** NIP-78 App-specific Data kind (existing Nostr kind) */
|
|
5
|
+
export declare const APP_DATA_KIND = 30078;
|
|
6
|
+
/** Attestation type identifiers */
|
|
7
|
+
export declare const ATTESTATION_TYPES: {
|
|
8
|
+
readonly CREDENTIAL: "credential";
|
|
9
|
+
readonly VOUCH: "vouch";
|
|
10
|
+
readonly VERIFIER: "verifier";
|
|
11
|
+
readonly CHALLENGE: "challenge";
|
|
12
|
+
readonly REVOCATION: "revocation";
|
|
13
|
+
readonly IDENTITY_BRIDGE: "identity-bridge";
|
|
14
|
+
readonly DELEGATION: "delegation";
|
|
15
|
+
};
|
|
16
|
+
/** @deprecated — use ATTESTATION_KIND + ATTESTATION_TYPES instead */
|
|
17
|
+
export declare const SIGNET_KINDS: {
|
|
18
|
+
readonly CREDENTIAL: 31000;
|
|
19
|
+
readonly VOUCH: 31000;
|
|
20
|
+
readonly POLICY: 30078;
|
|
21
|
+
readonly VERIFIER: 31000;
|
|
22
|
+
readonly CHALLENGE: 31000;
|
|
23
|
+
readonly REVOCATION: 31000;
|
|
24
|
+
readonly IDENTITY_BRIDGE: 31000;
|
|
25
|
+
readonly DELEGATION: 31000;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated NIP-VA labels are now auto-generated by nostr-attestations.
|
|
29
|
+
* Kept for backwards compatibility with parsers consuming legacy events.
|
|
30
|
+
*/
|
|
31
|
+
export declare const SIGNET_LABEL = "signet";
|
|
32
|
+
/** Default number of vouches needed for Tier 2 */
|
|
33
|
+
export declare const DEFAULT_VOUCH_THRESHOLD = 3;
|
|
34
|
+
/** Default minimum tier of vouchers for Tier 2 */
|
|
35
|
+
export declare const DEFAULT_VOUCHER_MIN_TIER = 2;
|
|
36
|
+
/** Default credential expiry: 2 years in seconds */
|
|
37
|
+
export declare const DEFAULT_CREDENTIAL_EXPIRY_SECONDS: number;
|
|
38
|
+
/** Default number of Tier 3+ confirmations to revoke a verifier */
|
|
39
|
+
export declare const DEFAULT_REVOCATION_THRESHOLD = 5;
|
|
40
|
+
/** Minimum cross-verification requirements for verifier activation */
|
|
41
|
+
export declare const VERIFIER_ACTIVATION: {
|
|
42
|
+
readonly MIN_VOUCHES: 2;
|
|
43
|
+
readonly MIN_PROFESSIONS: 2;
|
|
44
|
+
};
|
|
45
|
+
/** Signet Score weights (default implementation, 0-200 scale) */
|
|
46
|
+
export declare const TRUST_WEIGHTS: {
|
|
47
|
+
readonly PROFESSIONAL_VERIFICATION: 80;
|
|
48
|
+
readonly IN_PERSON_VOUCH: 16;
|
|
49
|
+
readonly ONLINE_VOUCH: 4;
|
|
50
|
+
readonly ACCOUNT_AGE_PER_YEAR: 10;
|
|
51
|
+
readonly ACCOUNT_AGE_MAX: 30;
|
|
52
|
+
readonly IDENTITY_BRIDGE: 50;
|
|
53
|
+
};
|
|
54
|
+
/** Minimum ring size for identity bridges (anonymity threshold) */
|
|
55
|
+
export declare const MIN_BRIDGE_RING_SIZE = 5;
|
|
56
|
+
/** Maximum Signet Score */
|
|
57
|
+
export declare const MAX_TRUST_SCORE = 200;
|
|
58
|
+
/** Valid entity types */
|
|
59
|
+
export declare const ENTITY_TYPES: readonly ["natural_person", "persona", "personal_agent", "unlinked_personal_agent", "juridical_person", "juridical_persona", "organised_agent", "unlinked_organised_agent", "unlinked_agent"];
|
|
60
|
+
/** Valid delegation owner → agent type mappings */
|
|
61
|
+
export declare const DELEGATION_CONSTRAINTS: Record<string, string>;
|
|
62
|
+
/** App-friendly labels for entity types */
|
|
63
|
+
export declare const ENTITY_LABELS: Record<string, string>;
|
|
64
|
+
/** Domain separator for bond proof messages */
|
|
65
|
+
export declare const BOND_DOMAIN_SEPARATOR = "signet:bond";
|
|
66
|
+
/** Default maximum age for bond proofs: 30 days in seconds */
|
|
67
|
+
export declare const DEFAULT_BOND_MAX_AGE_SECS: number;
|
|
68
|
+
/** Valid Bitcoin address types for bond proofs */
|
|
69
|
+
export declare const VALID_BOND_ADDRESS_TYPES: readonly ["p2wpkh", "p2sh", "p2tr", "p2pkh"];
|
|
70
|
+
/** Default asymmetric cryptographic algorithm (Nostr standard secp256k1).
|
|
71
|
+
* Tagged on events so future parsers can distinguish pre- and post-quantum events. */
|
|
72
|
+
export declare const DEFAULT_CRYPTO_ALGORITHM: "secp256k1";
|
|
73
|
+
/** Cold-call verification constants */
|
|
74
|
+
export declare const COLD_CALL_CONTEXT = "signet:cold-call";
|
|
75
|
+
export declare const COLD_CALL_EPOCH_SECONDS = 30;
|
|
76
|
+
export declare const COLD_CALL_TOLERANCE = 1;
|
|
77
|
+
export declare const WELL_KNOWN_PATH = "/.well-known/signet.json";
|
|
78
|
+
export declare const WELL_KNOWN_MAX_SIZE = 10240;
|
|
79
|
+
export declare const WELL_KNOWN_MAX_PUBKEYS = 20;
|
|
80
|
+
export declare const WELL_KNOWN_MAX_CACHE_HOURS = 24;
|
|
81
|
+
export declare const SESSION_CODE_EXPIRY_SECONDS = 300;
|
|
82
|
+
/** NATO phonetic alphabet for session codes */
|
|
83
|
+
export declare const NATO_ALPHABET: readonly ["ALFA", "BRAVO", "CHARLIE", "DELTA", "ECHO", "FOXTROT", "GOLF", "HOTEL", "INDIA", "JULIET", "KILO", "LIMA", "MIKE", "NOVEMBER", "OSCAR", "PAPA", "QUEBEC", "ROMEO", "SIERRA", "TANGO", "UNIFORM", "VICTOR", "WHISKEY", "XRAY", "YANKEE", "ZULU"];
|
|
84
|
+
/** Signal ordering (protocol-mandated) */
|
|
85
|
+
export declare const SIGNAL_PRIORITY: readonly ["professional-verification", "identity-bridge", "in-person-vouch", "online-vouch", "account-age"];
|
|
86
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,+DAA+D;AAC/D,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,0DAA0D;AAC1D,eAAO,MAAM,aAAa,QAAQ,CAAC;AAEnC,mCAAmC;AACnC,eAAO,MAAM,iBAAiB;;;;;;;;CAQpB,CAAC;AAEX,qEAAqE;AACrE,eAAO,MAAM,YAAY;;;;;;;;;CASf,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,YAAY,WAAW,CAAC;AAErC,kDAAkD;AAClD,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC,kDAAkD;AAClD,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,oDAAoD;AACpD,eAAO,MAAM,iCAAiC,QAAyB,CAAC;AAExE,mEAAmE;AACnE,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAE9C,sEAAsE;AACtE,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX,iEAAiE;AACjE,eAAO,MAAM,aAAa;;;;;;;CAOhB,CAAC;AAEX,mEAAmE;AACnE,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,2BAA2B;AAC3B,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,yBAAyB;AACzB,eAAO,MAAM,YAAY,+LAUf,CAAC;AAEX,mDAAmD;AACnD,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAKzD,CAAC;AAEF,2CAA2C;AAC3C,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAUhD,CAAC;AAEF,+CAA+C;AAC/C,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AAEnD,8DAA8D;AAC9D,eAAO,MAAM,yBAAyB,QAAoB,CAAC;AAE3D,kDAAkD;AAClD,eAAO,MAAM,wBAAwB,8CAA+C,CAAC;AAErF;sFACsF;AACtF,eAAO,MAAM,wBAAwB,EAAG,WAAoB,CAAC;AAE7D,uCAAuC;AACvC,eAAO,MAAM,iBAAiB,qBAAqB,CAAC;AACpD,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAC1D,eAAO,MAAM,mBAAmB,QAAQ,CAAC;AACzC,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAC7C,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C,+CAA+C;AAC/C,eAAO,MAAM,aAAa,4PAMhB,CAAC;AAEX,0CAA0C;AAC1C,eAAO,MAAM,eAAe,6GAMlB,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// Signet Protocol Constants
|
|
2
|
+
import { ATTESTATION_KIND } from 'nostr-attestations';
|
|
3
|
+
/** Generic Verifiable Attestation kind (NIP-VA, kind 31000) */
|
|
4
|
+
export { ATTESTATION_KIND };
|
|
5
|
+
/** NIP-78 App-specific Data kind (existing Nostr kind) */
|
|
6
|
+
export const APP_DATA_KIND = 30078;
|
|
7
|
+
/** Attestation type identifiers */
|
|
8
|
+
export const ATTESTATION_TYPES = {
|
|
9
|
+
CREDENTIAL: 'credential',
|
|
10
|
+
VOUCH: 'vouch',
|
|
11
|
+
VERIFIER: 'verifier',
|
|
12
|
+
CHALLENGE: 'challenge',
|
|
13
|
+
REVOCATION: 'revocation',
|
|
14
|
+
IDENTITY_BRIDGE: 'identity-bridge',
|
|
15
|
+
DELEGATION: 'delegation',
|
|
16
|
+
};
|
|
17
|
+
/** @deprecated — use ATTESTATION_KIND + ATTESTATION_TYPES instead */
|
|
18
|
+
export const SIGNET_KINDS = {
|
|
19
|
+
CREDENTIAL: ATTESTATION_KIND,
|
|
20
|
+
VOUCH: ATTESTATION_KIND,
|
|
21
|
+
POLICY: APP_DATA_KIND,
|
|
22
|
+
VERIFIER: ATTESTATION_KIND,
|
|
23
|
+
CHALLENGE: ATTESTATION_KIND,
|
|
24
|
+
REVOCATION: ATTESTATION_KIND,
|
|
25
|
+
IDENTITY_BRIDGE: ATTESTATION_KIND,
|
|
26
|
+
DELEGATION: ATTESTATION_KIND,
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated NIP-VA labels are now auto-generated by nostr-attestations.
|
|
30
|
+
* Kept for backwards compatibility with parsers consuming legacy events.
|
|
31
|
+
*/
|
|
32
|
+
export const SIGNET_LABEL = 'signet';
|
|
33
|
+
/** Default number of vouches needed for Tier 2 */
|
|
34
|
+
export const DEFAULT_VOUCH_THRESHOLD = 3;
|
|
35
|
+
/** Default minimum tier of vouchers for Tier 2 */
|
|
36
|
+
export const DEFAULT_VOUCHER_MIN_TIER = 2;
|
|
37
|
+
/** Default credential expiry: 2 years in seconds */
|
|
38
|
+
export const DEFAULT_CREDENTIAL_EXPIRY_SECONDS = 2 * 365 * 24 * 60 * 60;
|
|
39
|
+
/** Default number of Tier 3+ confirmations to revoke a verifier */
|
|
40
|
+
export const DEFAULT_REVOCATION_THRESHOLD = 5;
|
|
41
|
+
/** Minimum cross-verification requirements for verifier activation */
|
|
42
|
+
export const VERIFIER_ACTIVATION = {
|
|
43
|
+
MIN_VOUCHES: 2,
|
|
44
|
+
MIN_PROFESSIONS: 2,
|
|
45
|
+
};
|
|
46
|
+
/** Signet Score weights (default implementation, 0-200 scale) */
|
|
47
|
+
export const TRUST_WEIGHTS = {
|
|
48
|
+
PROFESSIONAL_VERIFICATION: 80,
|
|
49
|
+
IN_PERSON_VOUCH: 16,
|
|
50
|
+
ONLINE_VOUCH: 4,
|
|
51
|
+
ACCOUNT_AGE_PER_YEAR: 10,
|
|
52
|
+
ACCOUNT_AGE_MAX: 30,
|
|
53
|
+
IDENTITY_BRIDGE: 50,
|
|
54
|
+
};
|
|
55
|
+
/** Minimum ring size for identity bridges (anonymity threshold) */
|
|
56
|
+
export const MIN_BRIDGE_RING_SIZE = 5;
|
|
57
|
+
/** Maximum Signet Score */
|
|
58
|
+
export const MAX_TRUST_SCORE = 200;
|
|
59
|
+
/** Valid entity types */
|
|
60
|
+
export const ENTITY_TYPES = [
|
|
61
|
+
'natural_person',
|
|
62
|
+
'persona',
|
|
63
|
+
'personal_agent',
|
|
64
|
+
'unlinked_personal_agent',
|
|
65
|
+
'juridical_person',
|
|
66
|
+
'juridical_persona',
|
|
67
|
+
'organised_agent',
|
|
68
|
+
'unlinked_organised_agent',
|
|
69
|
+
'unlinked_agent',
|
|
70
|
+
];
|
|
71
|
+
/** Valid delegation owner → agent type mappings */
|
|
72
|
+
export const DELEGATION_CONSTRAINTS = {
|
|
73
|
+
natural_person: 'personal_agent',
|
|
74
|
+
persona: 'unlinked_personal_agent',
|
|
75
|
+
juridical_person: 'organised_agent',
|
|
76
|
+
juridical_persona: 'unlinked_organised_agent',
|
|
77
|
+
};
|
|
78
|
+
/** App-friendly labels for entity types */
|
|
79
|
+
export const ENTITY_LABELS = {
|
|
80
|
+
natural_person: 'Person',
|
|
81
|
+
persona: 'Alias',
|
|
82
|
+
personal_agent: 'Personal Agent',
|
|
83
|
+
unlinked_personal_agent: 'Unlinked Personal Agent',
|
|
84
|
+
juridical_person: 'Organisation',
|
|
85
|
+
juridical_persona: 'Org Alias',
|
|
86
|
+
organised_agent: 'Organised Agent',
|
|
87
|
+
unlinked_organised_agent: 'Unlinked Org Agent',
|
|
88
|
+
unlinked_agent: 'Unlinked Agent',
|
|
89
|
+
};
|
|
90
|
+
/** Domain separator for bond proof messages */
|
|
91
|
+
export const BOND_DOMAIN_SEPARATOR = 'signet:bond';
|
|
92
|
+
/** Default maximum age for bond proofs: 30 days in seconds */
|
|
93
|
+
export const DEFAULT_BOND_MAX_AGE_SECS = 30 * 24 * 60 * 60;
|
|
94
|
+
/** Valid Bitcoin address types for bond proofs */
|
|
95
|
+
export const VALID_BOND_ADDRESS_TYPES = ['p2wpkh', 'p2sh', 'p2tr', 'p2pkh'];
|
|
96
|
+
/** Default asymmetric cryptographic algorithm (Nostr standard secp256k1).
|
|
97
|
+
* Tagged on events so future parsers can distinguish pre- and post-quantum events. */
|
|
98
|
+
export const DEFAULT_CRYPTO_ALGORITHM = 'secp256k1';
|
|
99
|
+
/** Cold-call verification constants */
|
|
100
|
+
export const COLD_CALL_CONTEXT = 'signet:cold-call';
|
|
101
|
+
export const COLD_CALL_EPOCH_SECONDS = 30;
|
|
102
|
+
export const COLD_CALL_TOLERANCE = 1; // ±1 epoch
|
|
103
|
+
export const WELL_KNOWN_PATH = '/.well-known/signet.json';
|
|
104
|
+
export const WELL_KNOWN_MAX_SIZE = 10240; // 10 KB
|
|
105
|
+
export const WELL_KNOWN_MAX_PUBKEYS = 20;
|
|
106
|
+
export const WELL_KNOWN_MAX_CACHE_HOURS = 24;
|
|
107
|
+
export const SESSION_CODE_EXPIRY_SECONDS = 300; // 5 minutes
|
|
108
|
+
/** NATO phonetic alphabet for session codes */
|
|
109
|
+
export const NATO_ALPHABET = [
|
|
110
|
+
'ALFA', 'BRAVO', 'CHARLIE', 'DELTA', 'ECHO', 'FOXTROT',
|
|
111
|
+
'GOLF', 'HOTEL', 'INDIA', 'JULIET', 'KILO', 'LIMA',
|
|
112
|
+
'MIKE', 'NOVEMBER', 'OSCAR', 'PAPA', 'QUEBEC', 'ROMEO',
|
|
113
|
+
'SIERRA', 'TANGO', 'UNIFORM', 'VICTOR', 'WHISKEY',
|
|
114
|
+
'XRAY', 'YANKEE', 'ZULU',
|
|
115
|
+
];
|
|
116
|
+
/** Signal ordering (protocol-mandated) */
|
|
117
|
+
export const SIGNAL_PRIORITY = [
|
|
118
|
+
'professional-verification',
|
|
119
|
+
'identity-bridge',
|
|
120
|
+
'in-person-vouch',
|
|
121
|
+
'online-vouch',
|
|
122
|
+
'account-age',
|
|
123
|
+
];
|
|
124
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,+DAA+D;AAC/D,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,0DAA0D;AAC1D,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC;AAEnC,mCAAmC;AACnC,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;IACxB,eAAe,EAAE,iBAAiB;IAClC,UAAU,EAAE,YAAY;CAChB,CAAC;AAEX,qEAAqE;AACrE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,UAAU,EAAE,gBAAgB;IAC5B,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,aAAa;IACrB,QAAQ,EAAE,gBAAgB;IAC1B,SAAS,EAAE,gBAAgB;IAC3B,UAAU,EAAE,gBAAgB;IAC5B,eAAe,EAAE,gBAAgB;IACjC,UAAU,EAAE,gBAAgB;CACpB,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC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AAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO;IACtD,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS;IACjD,MAAM,EAAE,QAAQ,EAAE,MAAM;CAChB,CAAC;AAEX,0CAA0C;AAC1C,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,2BAA2B;IAC3B,iBAAiB;IACjB,iBAAiB;IACjB,cAAc;IACd,aAAa;CACL,CAAC"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { type RingSignature } from './ring-signature.js';
|
|
2
|
+
import { type RangeProof } from './range-proof.js';
|
|
3
|
+
import type { NostrEvent, UnsignedEvent, CredentialParams, ParsedCredential, VerificationScope, TwoCredentialResult, CredentialChain, GuardianDelegationParams } from './types.js';
|
|
4
|
+
/** Build an unsigned credential event */
|
|
5
|
+
export declare function buildCredentialEvent(verifierPubkey: string, params: CredentialParams): UnsignedEvent;
|
|
6
|
+
/** Create and sign a Tier 1 (self-declared) credential */
|
|
7
|
+
export declare function createSelfDeclaredCredential(privateKey: string, scope?: VerificationScope, expiresAt?: number): Promise<NostrEvent>;
|
|
8
|
+
/** Create and sign a Tier 2 (web-of-trust vouched) credential.
|
|
9
|
+
* Typically issued by an aggregator service when vouch threshold is met.
|
|
10
|
+
* Uses assertion-first hybrid pattern: references the subject's Tier 1 self-declaration. */
|
|
11
|
+
export declare function createPeerVouchedCredential(issuerPrivateKey: string, subjectPubkey: string, opts: {
|
|
12
|
+
assertionEventId: string;
|
|
13
|
+
assertionRelay?: string;
|
|
14
|
+
expiresAt?: number;
|
|
15
|
+
}): Promise<NostrEvent>;
|
|
16
|
+
/** Create and sign a Tier 3 (professional verified adult) credential.
|
|
17
|
+
* Uses assertion-first hybrid pattern: references the subject's Tier 1 self-declaration. */
|
|
18
|
+
export declare function createProfessionalCredential(verifierPrivateKey: string, subjectPubkey: string, opts: {
|
|
19
|
+
assertionEventId: string;
|
|
20
|
+
profession: string;
|
|
21
|
+
jurisdiction: string;
|
|
22
|
+
assertionRelay?: string;
|
|
23
|
+
expiresAt?: number;
|
|
24
|
+
occurredAt?: number;
|
|
25
|
+
proofBlob?: string;
|
|
26
|
+
}): Promise<NostrEvent>;
|
|
27
|
+
/** Create and sign a Tier 4 (professional verified adult+child) credential.
|
|
28
|
+
* Uses assertion-first hybrid pattern: references the subject's Tier 1 self-declaration. */
|
|
29
|
+
export declare function createChildSafetyCredential(verifierPrivateKey: string, subjectPubkey: string, opts: {
|
|
30
|
+
assertionEventId: string;
|
|
31
|
+
profession: string;
|
|
32
|
+
jurisdiction: string;
|
|
33
|
+
ageRange: string;
|
|
34
|
+
assertionRelay?: string;
|
|
35
|
+
expiresAt?: number;
|
|
36
|
+
occurredAt?: number;
|
|
37
|
+
proofBlob?: string;
|
|
38
|
+
}): Promise<NostrEvent>;
|
|
39
|
+
/** Verify a credential event's signature and structure */
|
|
40
|
+
export declare function verifyCredential(event: NostrEvent): Promise<{
|
|
41
|
+
signatureValid: boolean;
|
|
42
|
+
structureValid: boolean;
|
|
43
|
+
expired: boolean;
|
|
44
|
+
errors: string[];
|
|
45
|
+
}>;
|
|
46
|
+
/** Check if a credential is expired */
|
|
47
|
+
export declare function isCredentialExpired(event: NostrEvent): boolean;
|
|
48
|
+
/** Parse a credential event into a structured object */
|
|
49
|
+
export declare function parseCredential(event: NostrEvent): ParsedCredential | null;
|
|
50
|
+
/** Content structure for ring-signature-protected credentials */
|
|
51
|
+
export interface RingProtectedContent {
|
|
52
|
+
ringSignature: RingSignature;
|
|
53
|
+
rangeProof?: RangeProof;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Create a Tier 3 credential with ring signature issuer privacy.
|
|
57
|
+
* The credential is signed by the verifier's Nostr key (for relay acceptance),
|
|
58
|
+
* but the content includes a ring signature proving "one of N verifiers" issued it.
|
|
59
|
+
*/
|
|
60
|
+
export declare function createRingProtectedCredential(verifierPrivateKey: string, subjectPubkey: string, ring: string[], signerIndex: number, opts: {
|
|
61
|
+
profession: string;
|
|
62
|
+
jurisdiction: string;
|
|
63
|
+
expiresAt?: number;
|
|
64
|
+
}): Promise<NostrEvent>;
|
|
65
|
+
/**
|
|
66
|
+
* Create a Tier 4 credential with ring signature AND age range proof.
|
|
67
|
+
*/
|
|
68
|
+
export declare function createRingProtectedChildCredential(verifierPrivateKey: string, subjectPubkey: string, ring: string[], signerIndex: number, opts: {
|
|
69
|
+
profession: string;
|
|
70
|
+
jurisdiction: string;
|
|
71
|
+
ageRange: string;
|
|
72
|
+
actualAge: number;
|
|
73
|
+
expiresAt?: number;
|
|
74
|
+
}): Promise<NostrEvent>;
|
|
75
|
+
/**
|
|
76
|
+
* Verify the ring signature and optional range proof inside a credential's content.
|
|
77
|
+
*/
|
|
78
|
+
export declare function verifyRingProtectedContent(event: NostrEvent): {
|
|
79
|
+
hasRingSignature: boolean;
|
|
80
|
+
ringValid: boolean;
|
|
81
|
+
hasRangeProof: boolean;
|
|
82
|
+
rangeProofValid: boolean;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Renew an expiring credential. Creates a new credential with the same parameters
|
|
86
|
+
* but a fresh expiry. Must be issued by the same verifier (or a new one for re-verification).
|
|
87
|
+
*/
|
|
88
|
+
export declare function renewCredential(verifierPrivateKey: string, existingCredential: NostrEvent, newExpiresAt?: number): Promise<NostrEvent>;
|
|
89
|
+
/**
|
|
90
|
+
* Check if a credential needs renewal (within N days of expiry).
|
|
91
|
+
*/
|
|
92
|
+
export declare function needsRenewal(event: NostrEvent, withinDays?: number): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Create a two-credential ceremony issuing Natural Person + Persona credentials.
|
|
95
|
+
* The verifier sees all documents but only publishes privacy-preserving tags.
|
|
96
|
+
*/
|
|
97
|
+
export declare function createTwoCredentialCeremony(verifierPrivateKey: string, naturalPersonPubkey: string, personaPubkey: string, opts: {
|
|
98
|
+
name: string;
|
|
99
|
+
nationality: string;
|
|
100
|
+
documentType: string;
|
|
101
|
+
documentNumber: string;
|
|
102
|
+
documentCountry: string;
|
|
103
|
+
dateOfBirth: string;
|
|
104
|
+
profession: string;
|
|
105
|
+
jurisdiction: string;
|
|
106
|
+
ageRange?: string;
|
|
107
|
+
guardianPubkeys?: string[];
|
|
108
|
+
expiresAt?: number;
|
|
109
|
+
occurredAt?: number;
|
|
110
|
+
}): Promise<TwoCredentialResult>;
|
|
111
|
+
/**
|
|
112
|
+
* Issue a new credential that supersedes an existing one.
|
|
113
|
+
* The old credential gets a superseded-by tag added (returned as updated event).
|
|
114
|
+
*/
|
|
115
|
+
export declare function supersedeCredential(verifierPrivateKey: string, oldCredential: NostrEvent, newParams: Partial<CredentialParams> & {
|
|
116
|
+
subjectPubkey: string;
|
|
117
|
+
}): Promise<{
|
|
118
|
+
newCredential: NostrEvent;
|
|
119
|
+
oldCredential: NostrEvent;
|
|
120
|
+
}>;
|
|
121
|
+
/**
|
|
122
|
+
* Follow supersedes/superseded-by chain to find current active credential.
|
|
123
|
+
*/
|
|
124
|
+
export declare function resolveCredentialChain(events: NostrEvent[]): CredentialChain | null;
|
|
125
|
+
/**
|
|
126
|
+
* Check if a credential has been superseded.
|
|
127
|
+
*/
|
|
128
|
+
export declare function isSuperseded(event: NostrEvent): boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Compute a deterministic nullifier from document details.
|
|
131
|
+
* Uses length-prefixed encoding to prevent field-boundary collisions:
|
|
132
|
+
* SHA-256( len(docType) + docType + len(country) + country + len(docNum) + docNum + domainTag )
|
|
133
|
+
*
|
|
134
|
+
* Each field is prefixed with its UTF-8 byte length as a 2-byte big-endian uint16,
|
|
135
|
+
* followed by a fixed domain separation tag.
|
|
136
|
+
*/
|
|
137
|
+
export declare function computeNullifier(documentType: string, countryCode: string, documentNumber: string): string;
|
|
138
|
+
/**
|
|
139
|
+
* Check if a nullifier already exists in a set of credentials.
|
|
140
|
+
* Returns the conflicting credential if found.
|
|
141
|
+
*/
|
|
142
|
+
export declare function checkNullifierDuplicate(nullifier: string, existingCredentials: NostrEvent[]): {
|
|
143
|
+
isDuplicate: boolean;
|
|
144
|
+
conflicting?: NostrEvent;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Build a nullifier-chain tag linking old and new nullifiers (for document renewal).
|
|
148
|
+
*/
|
|
149
|
+
export declare function buildNullifierChainTag(oldNullifier: string): string[][];
|
|
150
|
+
export interface DocumentDescriptor {
|
|
151
|
+
documentType: string;
|
|
152
|
+
countryCode: string;
|
|
153
|
+
documentNumber: string;
|
|
154
|
+
}
|
|
155
|
+
export interface NullifierFamily {
|
|
156
|
+
/** Primary nullifier (first document) */
|
|
157
|
+
primary: string;
|
|
158
|
+
/** All nullifiers in the family (including primary) */
|
|
159
|
+
nullifiers: Array<{
|
|
160
|
+
documentType: string;
|
|
161
|
+
nullifier: string;
|
|
162
|
+
}>;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Compute nullifiers for ALL documents presented during a verification ceremony.
|
|
166
|
+
* Returns a nullifier family containing all nullifiers. Collision with ANY nullifier
|
|
167
|
+
* in ANY family triggers duplicate detection.
|
|
168
|
+
*/
|
|
169
|
+
export declare function computeNullifierFamily(documents: DocumentDescriptor[]): NullifierFamily;
|
|
170
|
+
/**
|
|
171
|
+
* Build nullifier-family tags for a credential event.
|
|
172
|
+
* The primary nullifier is stored in the 'nullifier' tag (backwards compatible).
|
|
173
|
+
* Additional nullifiers are stored in 'nullifier-family' tags.
|
|
174
|
+
*/
|
|
175
|
+
export declare function buildNullifierFamilyTags(family: NullifierFamily): string[][];
|
|
176
|
+
/**
|
|
177
|
+
* Check if ANY nullifier in a family collides with ANY nullifier in existing credentials.
|
|
178
|
+
* This catches attempts to use different documents for the same person.
|
|
179
|
+
*/
|
|
180
|
+
export declare function checkNullifierFamilyDuplicate(family: NullifierFamily, existingCredentials: NostrEvent[]): {
|
|
181
|
+
isDuplicate: boolean;
|
|
182
|
+
conflicting?: NostrEvent;
|
|
183
|
+
matchedNullifier?: string;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Create a guardian delegation event (kind 31000, type: delegation).
|
|
187
|
+
* Allows a guardian to delegate specific permissions to another adult for a child.
|
|
188
|
+
*/
|
|
189
|
+
export declare function createGuardianDelegation(guardianPrivateKey: string, params: GuardianDelegationParams): Promise<NostrEvent>;
|
|
190
|
+
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAOA,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAA4C,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE7F,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAGhB,iBAAiB,EAGjB,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EAGzB,MAAM,YAAY,CAAC;AAGpB,yCAAyC;AACzC,wBAAgB,oBAAoB,CAClC,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,gBAAgB,GACvB,aAAa,CA8Cf;AAED,0DAA0D;AAC1D,wBAAsB,4BAA4B,CAChD,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,iBAA2B,EAClC,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,UAAU,CAAC,CAWrB;AAED;;4FAE4F;AAC5F,wBAAsB,2BAA2B,CAC/C,gBAAgB,EAAE,MAAM,EACxB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE;IACJ,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GACA,OAAO,CAAC,UAAU,CAAC,CAarB;AAED;4FAC4F;AAC5F,wBAAsB,4BAA4B,CAChD,kBAAkB,EAAE,MAAM,EAC1B,aAAa,EAAE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