nostr-veil 0.44.3 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/proof/contribute.d.ts +2 -1
- package/dist/proof/contribute.d.ts.map +1 -1
- package/dist/proof/contribute.js +20 -4
- package/dist/proof/contribute.js.map +1 -1
- package/llms-full.txt +2 -2
- package/llms.txt +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -306,7 +306,7 @@ The root entry point re-exports all of `nostr-veil/nip85`, `nostr-veil/proof` an
|
|
|
306
306
|
|
|
307
307
|
It returns `{ valid, circleSize, threshold, distinctSigners, subjectInRing, independentSigners, errors }`.
|
|
308
308
|
|
|
309
|
-
**`contributeAssertion` options and `canonicalMessageV2`.** `contributeAssertion(..., options?)` takes `{ proofVersion?: 'v1' | 'v2', kind?: number, subjectTag?: 'p' | 'e' | 'a' | 'k', subjectTagValue?: string }`; for v2 the defaults are kind 30382, tag `p` and the subject itself. The typed helpers (`contributeEventAssertion`, `contributeAddressableAssertion`, `contributeIdentifierAssertion`) take only `{ proofVersion?: 'v1' | 'v2' }`, fill in the kind and tag, and sign v2 unless given `{ proofVersion: 'v1' }`. `contributeAssertion` stays v1 by default, because it cannot know which kind the contribution will be published under. Aggregators follow the version the contributions were signed with, so an aggregator on this release still combines v1 contributions from members on an older one; contributions that mix versions throw, as does an explicit `proofVersion` that differs from theirs. `canonicalMessageV2(circleId, subject, metrics, context)` takes `context` as `{ kind, subjectTag, subjectTagValue }`, all required: `kind` a non-negative safe integer, `subjectTag` one of `p`, `e`, `a`, `k`, and `subjectTagValue` a non-empty string.
|
|
309
|
+
**`contributeAssertion` options and `canonicalMessageV2`.** `contributeAssertion(..., options?)` takes `{ proofVersion?: 'v1' | 'v2', kind?: number, subjectTag?: 'p' | 'e' | 'a' | 'k', subjectTagValue?: string }`; for v2 the defaults are kind 30382, tag `p` and the subject itself. The typed helpers (`contributeEventAssertion`, `contributeAddressableAssertion`, `contributeIdentifierAssertion`) take only `{ proofVersion?: 'v1' | 'v2' }`, fill in the kind and tag, and sign v2 unless given `{ proofVersion: 'v1' }`. `contributeAssertion` stays v1 by default, because it cannot know which kind the contribution will be published under. A `proofVersion` left out, `undefined` or `null` signs the helper's default; any value but `'v1'` or `'v2'` throws `proofVersion must be v1 or v2`, where before it signed the default. Aggregators follow the version the contributions were signed with, so an aggregator on this release still combines v1 contributions from members on an older one; contributions that mix versions throw, as does an explicit `proofVersion` that differs from theirs. `canonicalMessageV2(circleId, subject, metrics, context)` takes `context` as `{ kind, subjectTag, subjectTagValue }`, all required: `kind` a non-negative safe integer, `subjectTag` one of `p`, `e`, `a`, `k`, and `subjectTagValue` a non-empty string.
|
|
310
310
|
|
|
311
311
|
**External signers.** The `*Async` contribute helpers take an `LsagSigner` in place of a private key, so the key can stay on a hardware device, in a remote signer or in another process:
|
|
312
312
|
|
|
@@ -42,6 +42,7 @@ export interface LsagSigner {
|
|
|
42
42
|
* @throws If `memberIndex` is out of range or the private key doesn't match the pubkey at that index
|
|
43
43
|
* @throws {ValidationError} If `metrics` is not an object, a function not being taken as one (`metrics must be an object`)
|
|
44
44
|
* @throws {ValidationError} If a metric name is empty (`metric name must be non-empty`), which `verifyProof` never accepts
|
|
45
|
+
* @throws {ValidationError} If `options.proofVersion` is given as anything but `v1` or `v2` (`proofVersion must be v1 or v2`). Left out or null, it is v1 here and v2 in the typed helpers.
|
|
45
46
|
* @throws {ValidationError} If the member at `memberIndex` is the `subject`. A circle member cannot contribute to an assertion about themselves. A modified client can still do it, so verifiers should read `subjectInRing` and `independentSigners` from {@link verifyProof}.
|
|
46
47
|
*/
|
|
47
48
|
export declare function contributeAssertion(circle: TrustCircle, subject: string, metrics: Record<string, number>, privateKey: string, memberIndex: number, options?: ContributionOptions): Contribution;
|
|
@@ -66,7 +67,7 @@ export declare function contributeAssertion(circle: TrustCircle, subject: string
|
|
|
66
67
|
* @param signer - Holds the member's key; see {@link LsagSigner}
|
|
67
68
|
* @param memberIndex - 0-based index of this member in `circle.members`
|
|
68
69
|
* @returns A {@link Contribution}, as from {@link contributeAssertion}
|
|
69
|
-
* @throws {ValidationError} If the member at `memberIndex` is the `subject`, `metrics` is not an object (a function is not taken as one), a metric name is empty, a member is not a string, ring-sig would refuse to sign the request (an election id over 512 bytes, members that are not a list, fewer than 2 or more than 1,000 of them or one twice, a `memberIndex` that is not an integer or not a position among them, or a message over 65,536 bytes), or the signer's answer, once settled, is not an LSAG signature, cannot be read, is for another message, election id or ring, is under an LSAG domain of its own, or does not verify. For members that are a plain list of strings, ring-sig's checks give the errors the local helpers give, in ring-sig's order, and a member key that is not hex, or not a curve point, throws the error ring-sig's own reading of it gives.
|
|
70
|
+
* @throws {ValidationError} If the member at `memberIndex` is the `subject`, `metrics` is not an object (a function is not taken as one), `options.proofVersion` is given as anything but `v1` or `v2`, a metric name is empty, a member is not a string, ring-sig would refuse to sign the request (an election id over 512 bytes, members that are not a list, fewer than 2 or more than 1,000 of them or one twice, a `memberIndex` that is not an integer or not a position among them, or a message over 65,536 bytes), or the signer's answer, once settled, is not an LSAG signature, cannot be read, is for another message, election id or ring, is under an LSAG domain of its own, or does not verify. For members that are a plain list of strings, ring-sig's checks give the errors the local helpers give, in ring-sig's order, and a member key that is not hex, or not a curve point, throws the error ring-sig's own reading of it gives.
|
|
70
71
|
* @throws {TypeError} If `circle.members` is null or undefined, or `memberIndex` cannot be used as an index at all, as in the local helpers
|
|
71
72
|
* @throws Whatever the signer throws, or fails with while its answer settles, as it is: a member declining, say.
|
|
72
73
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contribute.d.ts","sourceRoot":"","sources":["../../src/proof/contribute.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGvF,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAA;AAC9C,MAAM,MAAM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CAAC,YAAY,CAAC,CASvB;AAED,0EAA0E;AAC1E,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,wBAAwB,GACjC,YAAY,CASd;AAED,sFAAsF;AACtF,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,wBAAwB,GACjC,YAAY,CASd;AAED,+EAA+E;AAC/E,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,wBAAwB,GACjC,YAAY,CASd"}
|
package/dist/proof/contribute.js
CHANGED
|
@@ -10,9 +10,22 @@ function v2Context(subject, options) {
|
|
|
10
10
|
subjectTagValue: options?.subjectTagValue ?? subject,
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Throws unless a proofVersion is v1, v2, or left out (undefined or null),
|
|
15
|
+
* which signs the helper's default. Any other value was signed as the
|
|
16
|
+
* default, whatever version it named.
|
|
17
|
+
*/
|
|
18
|
+
function assertProofVersion(value) {
|
|
19
|
+
if (value !== undefined && value !== null && value !== 'v1' && value !== 'v2') {
|
|
20
|
+
throw new ValidationError('proofVersion must be v1 or v2');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
13
23
|
function typedOptions(options, kind, subjectTag, subjectTagValue) {
|
|
14
|
-
|
|
15
|
-
|
|
24
|
+
// Read once, so the version checked is the version signed
|
|
25
|
+
const requested = options?.proofVersion;
|
|
26
|
+
if (requested === 'v1')
|
|
27
|
+
return { proofVersion: 'v1' };
|
|
28
|
+
assertProofVersion(requested);
|
|
16
29
|
return {
|
|
17
30
|
proofVersion: 'v2',
|
|
18
31
|
kind,
|
|
@@ -37,6 +50,7 @@ function typedOptions(options, kind, subjectTag, subjectTagValue) {
|
|
|
37
50
|
* @throws If `memberIndex` is out of range or the private key doesn't match the pubkey at that index
|
|
38
51
|
* @throws {ValidationError} If `metrics` is not an object, a function not being taken as one (`metrics must be an object`)
|
|
39
52
|
* @throws {ValidationError} If a metric name is empty (`metric name must be non-empty`), which `verifyProof` never accepts
|
|
53
|
+
* @throws {ValidationError} If `options.proofVersion` is given as anything but `v1` or `v2` (`proofVersion must be v1 or v2`). Left out or null, it is v1 here and v2 in the typed helpers.
|
|
40
54
|
* @throws {ValidationError} If the member at `memberIndex` is the `subject`. A circle member cannot contribute to an assertion about themselves. A modified client can still do it, so verifiers should read `subjectInRing` and `independentSigners` from {@link verifyProof}.
|
|
41
55
|
*/
|
|
42
56
|
export function contributeAssertion(circle, subject, metrics, privateKey, memberIndex, options) {
|
|
@@ -66,7 +80,9 @@ function signingInputs(circle, subject, metrics, memberIndex, options) {
|
|
|
66
80
|
throw new ValidationError('metrics must be an object');
|
|
67
81
|
}
|
|
68
82
|
const signed = { ...metrics };
|
|
69
|
-
const
|
|
83
|
+
const requested = options?.proofVersion;
|
|
84
|
+
assertProofVersion(requested);
|
|
85
|
+
const proofVersion = requested ?? 'v1';
|
|
70
86
|
const context = proofVersion === 'v2' ? v2Context(subject, options) : undefined;
|
|
71
87
|
// A v2 signature is bound to its kind, and on kind 30382 the subject is a
|
|
72
88
|
// pubkey, which verifyProof requires as 64 lowercase hex. A v1 signature is
|
|
@@ -262,7 +278,7 @@ function checkedSignature(returned, expected) {
|
|
|
262
278
|
* @param signer - Holds the member's key; see {@link LsagSigner}
|
|
263
279
|
* @param memberIndex - 0-based index of this member in `circle.members`
|
|
264
280
|
* @returns A {@link Contribution}, as from {@link contributeAssertion}
|
|
265
|
-
* @throws {ValidationError} If the member at `memberIndex` is the `subject`, `metrics` is not an object (a function is not taken as one), a metric name is empty, a member is not a string, ring-sig would refuse to sign the request (an election id over 512 bytes, members that are not a list, fewer than 2 or more than 1,000 of them or one twice, a `memberIndex` that is not an integer or not a position among them, or a message over 65,536 bytes), or the signer's answer, once settled, is not an LSAG signature, cannot be read, is for another message, election id or ring, is under an LSAG domain of its own, or does not verify. For members that are a plain list of strings, ring-sig's checks give the errors the local helpers give, in ring-sig's order, and a member key that is not hex, or not a curve point, throws the error ring-sig's own reading of it gives.
|
|
281
|
+
* @throws {ValidationError} If the member at `memberIndex` is the `subject`, `metrics` is not an object (a function is not taken as one), `options.proofVersion` is given as anything but `v1` or `v2`, a metric name is empty, a member is not a string, ring-sig would refuse to sign the request (an election id over 512 bytes, members that are not a list, fewer than 2 or more than 1,000 of them or one twice, a `memberIndex` that is not an integer or not a position among them, or a message over 65,536 bytes), or the signer's answer, once settled, is not an LSAG signature, cannot be read, is for another message, election id or ring, is under an LSAG domain of its own, or does not verify. For members that are a plain list of strings, ring-sig's checks give the errors the local helpers give, in ring-sig's order, and a member key that is not hex, or not a curve point, throws the error ring-sig's own reading of it gives.
|
|
266
282
|
* @throws {TypeError} If `circle.members` is null or undefined, or `memberIndex` cannot be used as an index at all, as in the local helpers
|
|
267
283
|
* @throws Whatever the signer throws, or fails with while its answer settles, as it is: a member declining, say.
|
|
268
284
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contribute.js","sourceRoot":"","sources":["../../src/proof/contribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAC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mB,EACnB,OAAkC;IAElC,OAAO,mBAAmB,CACxB,MAAM,EACN,OAAO,EACP,OAAO,EACP,UAAU,EACV,WAAW,EACX,YAAY,CAAC,OAAO,EAAE,WAAW,CAAC,WAAW,EAAE,GAAG,EAAE,OAAO,CAAC,CAC7D,CAAA;AACH,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,6BAA6B,CAC3C,MAAmB,EACnB,UAAkB,EAClB,IAAY,EACZ,OAA+B,EAC/B,UAAkB,EAClB,WAAmB,EACnB,OAAkC;IAElC,OAAO,mBAAmB,CACxB,MAAM,EACN,UAAU,EACV,OAAO,EACP,UAAU,EACV,WAAW,EACX,YAAY,CAAC,OAAO,EAAE,WAAW,CAAC,UAAU,EAAE,GAAG,EAAE,IAAI,CAAC,CACzD,CAAA;AACH,CAAC"}
|
package/llms-full.txt
CHANGED
|
@@ -412,7 +412,7 @@ interface ProofContext {
|
|
|
412
412
|
}
|
|
413
413
|
```
|
|
414
414
|
|
|
415
|
-
v2 signs assertion kind plus subject hint tag/value and uses those fields in the election ID. The typed helpers (`contributeEventAssertion`, `contributeAddressableAssertion`, `contributeIdentifierAssertion`) sign v2 by default; `contributeAssertion` stays v1 by default, since it cannot know the kind. Aggregators follow the contributions' version unless `proofVersion` is given, and throw on a mix.
|
|
415
|
+
v2 signs assertion kind plus subject hint tag/value and uses those fields in the election ID. The typed helpers (`contributeEventAssertion`, `contributeAddressableAssertion`, `contributeIdentifierAssertion`) sign v2 by default; `contributeAssertion` stays v1 by default, since it cannot know the kind. A `proofVersion` given to a contribute helper left out, `undefined` or `null` signs the default, and any value but `'v1'` or `'v2'` throws `proofVersion must be v1 or v2`. Aggregators follow the contributions' version unless `proofVersion` is given, and throw on a mix.
|
|
416
416
|
|
|
417
417
|
## API Reference
|
|
418
418
|
|
|
@@ -640,7 +640,7 @@ Produce an anonymous ring-signed contribution to a trust circle assertion.
|
|
|
640
640
|
- **`memberIndex`** `number` -- 0-based index in `circle.members` (sorted order); always use `circle.members.indexOf(memberPubkey)`
|
|
641
641
|
- **`options`** `ProofContext | undefined` — Omit for v1; pass `{ proofVersion: 'v2', kind, subjectTag, subjectTagValue }` for semantic binding
|
|
642
642
|
- **Returns** `Contribution` with ring signature, duplicate-detection token, and metrics
|
|
643
|
-
- **Throws** if `memberIndex` is out of range (`Signer index out of range`), `metrics` is not an object (`metrics must be an object`), the private key doesn't match the pubkey at that index (`Private key does not match ring member at signerIndex`), a metric name is reserved (`Metric name "<name>" is reserved: ...`: a single character, `veil-*`, `__proto__`, or a Nostr tag with its own meaning such as `expiration`, `alt`, `client`, `nonce` or `content-warning`),
|
|
643
|
+
- **Throws** if `memberIndex` is out of range (`Signer index out of range`), `metrics` is not an object (`metrics must be an object`), the private key doesn't match the pubkey at that index (`Private key does not match ring member at signerIndex`), a metric name is reserved (`Metric name "<name>" is reserved: ...`: a single character, `veil-*`, `__proto__`, or a Nostr tag with its own meaning such as `expiration`, `alt`, `client`, `nonce` or `content-warning`), a metric name is empty (`metric name must be non-empty`), or `options.proofVersion` is given as anything but `v1` or `v2` (`proofVersion must be v1 or v2`)
|
|
644
644
|
|
|
645
645
|
```ts
|
|
646
646
|
const contrib = contributeAssertion(circle, subjectPubkey, { rank: 85 }, alicePrivkey, circle.members.indexOf(alicePubkey))
|
package/llms.txt
CHANGED
|
@@ -144,7 +144,7 @@ every contributor scores the same verifier-compatible identifier.
|
|
|
144
144
|
- Aggregation options for `aggregateContributions` and the typed `aggregate*Contributions` helpers: a bare `(values: number[]) => number`, or `{ aggregate?: 'median' | 'mean' | 'sum' | 'min' | 'max', aggregateFn?, proofVersion?: 'v1' | 'v2', kind?, expiration?: number, alt?: string, contributionBounds?: Record<string, { min?, max?, integer?, required? }> }` (`contributionBounds` throws on a contribution outside the bounds; `kind` is legacy and only on `aggregateContributions`; `expiration` (unix seconds) and `alt` emit publisher tags that the circle does not sign and `verifyProof` does not read as metrics: at most one of each, `alt` non-empty; `verifyProof` does not check expiry against the clock, but the profile verifiers reject an assertion whose `expiration` is at or before `now`; trust these tags only after checking the outer Nostr signature; `aggregate` wins over `aggregateFn`; an unknown name throws `Unknown aggregate function: <name>`).
|
|
145
145
|
- `verifyProof(event, options?)`: a bare aggregate function, or `{ acceptedCircleIds?: Iterable<string>, aggregateFn?, expectedKind?: number, requireProofVersion?: 'v1' | 'v2', requireAggregate?: 'median' | 'mean' | 'sum' | 'min' | 'max' | 'custom', contributionBounds?: Record<string, { min?, max?, integer?, required? }>, rejectSubjectInRing?: boolean, limits?: Partial<VerifyLimits> }`. `requireAggregate` rejects an event whose `veil-agg` tag names another function (`veil-agg is "max" but "median" is required`; no tag reads as `median`); `contributionBounds` rejects an event holding a contribution outside the bounds, and malformed bounds fail the proof. `DEFAULT_VERIFY_LIMITS` is `maxRingSize` 1000, `maxSigPayloadBytes` 128000, `maxSignedMessageBytes` 16384, `maxMetricCount` 128, `maxMetricNameLength` 64, `maxSubjectLength` 512 (UTF-16 code units of the `d` tag: no longer subject can be signed, as the LSAG election id holds it and is limited to 512 bytes), and `maxTagCount`, which, left out, is `maxRingSize + maxMetricCount + 72` (1,200), so it rises with the ring limit. A proof's signatures, distinct metric names and fixed tags must together be within it, so a proof whose members sign different metric names can need it raised. An event with more tags, a tag name longer than `maxMetricNameLength` (or 14, the longest proof tag name) that does not begin `veil-`, or a longer `d` tag fails before any tag is read. Each limit must be a non-negative number, `Infinity` to lift it, and any other value, such as `NaN` or a string, fails the proof. Returns `{ valid, circleSize, threshold, distinctSigners, subjectInRing, independentSigners, errors }`; when the subject is a ring member one signature may be theirs, so compare `independentSigners` with your threshold or pass `rejectSubjectInRing: true`. A metric, `d` or `k` tag with anything after its value is invalid (the circle signs only name and value), and a `k` tag is accepted only on kind 30385. A second `veil-ring`, `veil-threshold`, `veil-agg`, `veil-version` or `veil-scope` tag, or extra elements on any of them or on `veil-sig`, is invalid; unknown `veil-*` tags are ignored, though they count towards the tag limit.
|
|
146
146
|
- `acceptedCircleIds` on `verifyProof` and `verifyFederation` turns away a proof from any other circle with `Circle is not accepted` before any signature is checked, so junk from an unknown circle costs one hash and no LSAG check. Each id is 64-character lowercase hex; a value that is not a list, or an entry that is not such an id, fails every proof, and an empty list accepts no circle. `verifyProof` reads the list on each call; `verifyFederation` reads it once for all its events. The profile verifiers turn away a circle the policy does not accept in the same way, and every circle where it accepts none (unless `requireKnownCircle` is `false`): once an event's ring names such a circle, its own proof check reads nothing more of it. It is reported as `proof.invalid` (`Circle is not accepted`) beside the circle check's own issue, is not counted against the signer threshold, and fails the report's `proof-threshold` control; a federation holding one also fails as `federation.invalid`, from the federation's own checks, with neither its threshold nor its count of distinct circles checked. Where the policy's own aggregate or contribution bounds are malformed, each event's own proof check stops at that fault, this one included, and it is held to the threshold as any proof is, with none of its signatures counted; the federation's own check, which is not handed them, still checks and counts the signers of proofs from accepted circles. `verifyProof` also requires a kind 30382 `d` tag to be a 64-character lowercase hex pubkey, and the builders refuse such a subject (`aggregateContributions`, and `contributeAssertion` when it signs v2).
|
|
147
|
-
- `contributeAssertion(..., options?)`: `{ proofVersion?, kind?, subjectTag?: 'p' | 'e' | 'a' | 'k', subjectTagValue? }`; the typed helpers take only `{ proofVersion? }` and sign v2 unless given `'v1'`; `contributeAssertion` defaults to v1. `canonicalMessageV2(circleId, subject, metrics, context)` needs `context` as `{ kind, subjectTag, subjectTagValue }`, all required (non-negative safe integer kind, `p`/`e`/`a`/`k` tag, non-empty value).
|
|
147
|
+
- `contributeAssertion(..., options?)`: `{ proofVersion?, kind?, subjectTag?: 'p' | 'e' | 'a' | 'k', subjectTagValue? }`; the typed helpers take only `{ proofVersion? }` and sign v2 unless given `'v1'`; `contributeAssertion` defaults to v1. Left out, `undefined` or `null` signs the default; any value but `'v1'` or `'v2'` throws `proofVersion must be v1 or v2`. `canonicalMessageV2(circleId, subject, metrics, context)` needs `context` as `{ kind, subjectTag, subjectTagValue }`, all required (non-negative safe integer kind, `p`/`e`/`a`/`k` tag, non-empty value).
|
|
148
148
|
- `parseAssertion(event)` returns `{ kind: number, subject: string, metrics: Record<string, string | number> }` (subject is the `d` tag value, metric values are raw tag strings; `expiration` and `alt` are left out with the other non-metric tags, so, on an event that passes `verifyProof`, `metrics` holds only circle-signed values). `parseProviderDeclaration(event)` returns `ParsedProvider[]` of `{ kind, metric, servicePubkey, relayHint }`, or a Promise of it when given `decryptFn: (ciphertext: string) => Promise<string>`.
|
|
149
149
|
- Profiles options (timestamps are Unix seconds; `now` defaults to the current time, and a `now` that cannot be compared, such as `NaN`, fails every verifier that takes one, with `verification.now_invalid` in every result that carries issue codes, which an admission request's result does only in its `deployment`, and circle manifest and admission presentation results do not; a `maxAgeSeconds` that is not a non-negative integer fails with `policy.max_age_seconds_invalid`, a `minDistinctSigners` that is not a positive integer with `policy.min_distinct_signers_invalid`, and a `metricPolicies` `min` or `max` that is not a finite number with `policy.metric_policy_invalid`; `minDistinctSigners` is held to `independentSigners` for a proof that verifies, so where the subject is a ring member one signature is set aside). `verifyUseCaseProfile` and `verifyDeploymentPolicy`, and the bundle, production and admission verifiers through them, take `limits` as `verifyProof` does: an event over one is rejected as `event.limit_exceeded` before any check reads its tags, none of its metrics is read, and the report fails its circle, profile, proof and metric controls; a limit that is not a non-negative number fails the run as `verification.limits_invalid`, and no event is checked beyond its Nostr signature. `createCircleManifest`: required `issuedAt`, `members`, `name`, `profileIds`, `purpose`; optional `expiresAt`, `status`, `supersedes`, `revokedCircleIds`, `contact`, `evidenceProcess`, `policyUri`. `createDeploymentPolicy(profile, options)`: required `expectedSubject` plus at least one active circle via `acceptedCircleIds` or `circleManifests`; optional `expectedSubjectTagValue`, `id`, `maxAgeSeconds`, `maxFutureSeconds` (default 60: how far ahead of the verifier's clock `created_at` may be before the assertion fails with `assertion.created_at_future`; 0 allows no skew, and setting it with `maxAgeSeconds` 0 is an error), `minDistinctSigners`, `metricPolicies` (`{ [metric]: { required?, min?, max?, integer? } }`, bounds on the published aggregate), `aggregate` (default: the profile's; every built-in profile pins `median`, or `sum` for `anonymous-group-decisions`), `contributionBounds` (`{ [metric]: { min?, max?, integer?, required? } }`, bounds on each contribution), `rejectUnknownMetrics` (default false), `requireNostrSignature` (default false), `acceptedPublishers` (hex pubkeys that may sign the assertion events; naming any turns `requireNostrSignature` on, and an event from any other key fails with `event.publisher_unaccepted`), `companionEvidence`, `allowSupersededCircleIds`, `now`. `createSignedDeploymentBundle(policy, options)`: required `id`, `issuedAt`, `privateKey`; optional `expiresAt`. `verifySignedDeploymentBundle(bundle, { now?, trustedPublishers? })`. `verifyDeploymentBundle(events, bundle, options?)` takes `aggregateFn`, `companionEvidence`, `limits`, `now`, `trustedPublishers`. `verifyProductionDeployment` adds `requireBundleExpiry` and `requireSignedEvents`, both true by default, and returns `{ decision: 'accept' | 'reject', valid, errors, issues, bundle, deployment }`. Without a valid `trustedPublishers` entry, bundle verification fails with `no trusted bundle publishers configured`. The bundled policy is applied only when the bundle is authentic (valid signature from a `trustedPublishers` key): for any other bundle `deployment` is a rejection with no findings, the report's policy controls read `not-checked`, and its `profile`, `policyId` and `subject` are blank. A malformed event, or a malformed bundle that is not authentic, is rejected with an issue code, and a malformed admission presentation is denied with an error; no verifier throws on any of them. In the policy of an authentic bundle, each field the verifier reads must be absent or of its type, and `null` is not absent: one that is not is rejected as `policy.field_invalid`, `profile.field_invalid` or `circle.manifest_field_invalid`, nothing else in that policy is checked, and the report's policy controls read `not-checked`, though a value with a check of its own, such as a time window, the signer threshold, a metric bound or the accepted publishers, keeps its own code and the run goes on. A bundle that stored a `null` `expectedSubjectTagValue`, or a `null` `required` or `integer` in a metric entry, as `createDeploymentPolicy` could, must be reissued. The verifier's own options are not covered.
|
|
150
150
|
- The lists an operator keeps of what must not pass (`revokedApplicantPubkeys` and `usedChallengeIds` for admission, `revokedCircleIds` for `verifyCircleManifest`) are read with each entry trimmed and in lower case. An entry that is still not a 64-character hex value, such as an `npub`, or a value that is not a list, fails what the list guards: the admission request is denied (an applicant on the readable part of the list is still revoked), the presentation fails, and the manifest fails as `circle.accepted_invalid`. That includes a list given as `null` or as a string, so leave the option out for no list. Pass an array or a `Set`: a one-shot iterator, such as a generator, is spent by the first call that reads it, and reads as an empty list after that.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nostr-veil",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.0",
|
|
4
4
|
"description": "Privacy layer for Nostr reputation systems. Groups collectively score trustworthiness using ring signatures -- scores are verifiable but contributors are unidentifiable.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|