@did-btcr2/method 0.28.0 → 0.32.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 +13 -5
- package/dist/.tsbuildinfo +1 -1
- package/dist/browser.js +34125 -44647
- package/dist/browser.mjs +26409 -36931
- package/dist/cjs/index.js +2869 -679
- package/dist/esm/core/aggregation/beacon-strategy.js +62 -0
- package/dist/esm/core/aggregation/beacon-strategy.js.map +1 -0
- package/dist/esm/core/aggregation/cohort.js +31 -8
- package/dist/esm/core/aggregation/cohort.js.map +1 -1
- package/dist/esm/core/aggregation/logger.js +15 -0
- package/dist/esm/core/aggregation/logger.js.map +1 -0
- package/dist/esm/core/aggregation/messages/base.js +12 -1
- package/dist/esm/core/aggregation/messages/base.js.map +1 -1
- package/dist/esm/core/aggregation/messages/bodies.js +90 -0
- package/dist/esm/core/aggregation/messages/bodies.js.map +1 -0
- package/dist/esm/core/aggregation/messages/factories.js.map +1 -1
- package/dist/esm/core/aggregation/messages/index.js +1 -0
- package/dist/esm/core/aggregation/messages/index.js.map +1 -1
- package/dist/esm/core/aggregation/participant.js +39 -46
- package/dist/esm/core/aggregation/participant.js.map +1 -1
- package/dist/esm/core/aggregation/runner/participant-runner.js +33 -7
- package/dist/esm/core/aggregation/runner/participant-runner.js.map +1 -1
- package/dist/esm/core/aggregation/runner/service-runner.js +198 -19
- package/dist/esm/core/aggregation/runner/service-runner.js.map +1 -1
- package/dist/esm/core/aggregation/service.js +143 -15
- package/dist/esm/core/aggregation/service.js.map +1 -1
- package/dist/esm/core/aggregation/signing-session.js +44 -5
- package/dist/esm/core/aggregation/signing-session.js.map +1 -1
- package/dist/esm/core/aggregation/transport/didcomm.js +9 -0
- package/dist/esm/core/aggregation/transport/didcomm.js.map +1 -1
- package/dist/esm/core/aggregation/transport/factory.js +15 -6
- package/dist/esm/core/aggregation/transport/factory.js.map +1 -1
- package/dist/esm/core/aggregation/transport/http/client.js +350 -0
- package/dist/esm/core/aggregation/transport/http/client.js.map +1 -0
- package/dist/esm/core/aggregation/transport/http/envelope.js +126 -0
- package/dist/esm/core/aggregation/transport/http/envelope.js.map +1 -0
- package/dist/esm/core/aggregation/transport/http/errors.js +11 -0
- package/dist/esm/core/aggregation/transport/http/errors.js.map +1 -0
- package/dist/esm/core/aggregation/transport/http/inbox-buffer.js +45 -0
- package/dist/esm/core/aggregation/transport/http/inbox-buffer.js.map +1 -0
- package/dist/esm/core/aggregation/transport/http/index.js +12 -0
- package/dist/esm/core/aggregation/transport/http/index.js.map +1 -0
- package/dist/esm/core/aggregation/transport/http/nonce-cache.js +38 -0
- package/dist/esm/core/aggregation/transport/http/nonce-cache.js.map +1 -0
- package/dist/esm/core/aggregation/transport/http/protocol.js +28 -0
- package/dist/esm/core/aggregation/transport/http/protocol.js.map +1 -0
- package/dist/esm/core/aggregation/transport/http/rate-limiter.js +45 -0
- package/dist/esm/core/aggregation/transport/http/rate-limiter.js.map +1 -0
- package/dist/esm/core/aggregation/transport/http/request-auth.js +100 -0
- package/dist/esm/core/aggregation/transport/http/request-auth.js.map +1 -0
- package/dist/esm/core/aggregation/transport/http/server.js +481 -0
- package/dist/esm/core/aggregation/transport/http/server.js.map +1 -0
- package/dist/esm/core/aggregation/transport/http/sse-stream.js +110 -0
- package/dist/esm/core/aggregation/transport/http/sse-stream.js.map +1 -0
- package/dist/esm/core/aggregation/transport/http/sse-writer.js +25 -0
- package/dist/esm/core/aggregation/transport/http/sse-writer.js.map +1 -0
- package/dist/esm/core/aggregation/transport/index.js +1 -0
- package/dist/esm/core/aggregation/transport/index.js.map +1 -1
- package/dist/esm/core/aggregation/transport/nostr.js +245 -16
- package/dist/esm/core/aggregation/transport/nostr.js.map +1 -1
- package/dist/esm/core/beacon/beacon.js +295 -63
- package/dist/esm/core/beacon/beacon.js.map +1 -1
- package/dist/esm/core/beacon/cas-beacon.js +3 -3
- package/dist/esm/core/beacon/cas-beacon.js.map +1 -1
- package/dist/esm/core/beacon/singleton-beacon.js +3 -3
- package/dist/esm/core/beacon/singleton-beacon.js.map +1 -1
- package/dist/esm/core/beacon/smt-beacon.js +3 -3
- package/dist/esm/core/beacon/smt-beacon.js.map +1 -1
- package/dist/esm/core/beacon/utils.js +14 -9
- package/dist/esm/core/beacon/utils.js.map +1 -1
- package/dist/esm/core/updater.js +63 -55
- package/dist/esm/core/updater.js.map +1 -1
- package/dist/esm/did-btcr2.js +0 -4
- package/dist/esm/did-btcr2.js.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/did-document.js +2 -2
- package/dist/esm/utils/did-document.js.map +1 -1
- package/dist/types/core/aggregation/beacon-strategy.d.ts +52 -0
- package/dist/types/core/aggregation/beacon-strategy.d.ts.map +1 -0
- package/dist/types/core/aggregation/cohort.d.ts +20 -3
- package/dist/types/core/aggregation/cohort.d.ts.map +1 -1
- package/dist/types/core/aggregation/logger.d.ts +22 -0
- package/dist/types/core/aggregation/logger.d.ts.map +1 -0
- package/dist/types/core/aggregation/messages/base.d.ts +13 -1
- package/dist/types/core/aggregation/messages/base.d.ts.map +1 -1
- package/dist/types/core/aggregation/messages/bodies.d.ts +130 -0
- package/dist/types/core/aggregation/messages/bodies.d.ts.map +1 -0
- package/dist/types/core/aggregation/messages/factories.d.ts +1 -0
- package/dist/types/core/aggregation/messages/factories.d.ts.map +1 -1
- package/dist/types/core/aggregation/messages/index.d.ts +1 -0
- package/dist/types/core/aggregation/messages/index.d.ts.map +1 -1
- package/dist/types/core/aggregation/participant.d.ts +2 -0
- package/dist/types/core/aggregation/participant.d.ts.map +1 -1
- package/dist/types/core/aggregation/runner/events.d.ts +32 -6
- package/dist/types/core/aggregation/runner/events.d.ts.map +1 -1
- package/dist/types/core/aggregation/runner/participant-runner.d.ts +7 -5
- package/dist/types/core/aggregation/runner/participant-runner.d.ts.map +1 -1
- package/dist/types/core/aggregation/runner/service-runner.d.ts +33 -3
- package/dist/types/core/aggregation/runner/service-runner.d.ts.map +1 -1
- package/dist/types/core/aggregation/service.d.ts +33 -2
- package/dist/types/core/aggregation/service.d.ts.map +1 -1
- package/dist/types/core/aggregation/signing-session.d.ts +5 -1
- package/dist/types/core/aggregation/signing-session.d.ts.map +1 -1
- package/dist/types/core/aggregation/transport/didcomm.d.ts +3 -0
- package/dist/types/core/aggregation/transport/didcomm.d.ts.map +1 -1
- package/dist/types/core/aggregation/transport/factory.d.ts +22 -7
- package/dist/types/core/aggregation/transport/factory.d.ts.map +1 -1
- package/dist/types/core/aggregation/transport/http/client.d.ts +48 -0
- package/dist/types/core/aggregation/transport/http/client.d.ts.map +1 -0
- package/dist/types/core/aggregation/transport/http/envelope.d.ts +64 -0
- package/dist/types/core/aggregation/transport/http/envelope.d.ts.map +1 -0
- package/dist/types/core/aggregation/transport/http/errors.d.ts +9 -0
- package/dist/types/core/aggregation/transport/http/errors.d.ts.map +1 -0
- package/dist/types/core/aggregation/transport/http/inbox-buffer.d.ts +32 -0
- package/dist/types/core/aggregation/transport/http/inbox-buffer.d.ts.map +1 -0
- package/dist/types/core/aggregation/transport/http/index.d.ts +12 -0
- package/dist/types/core/aggregation/transport/http/index.d.ts.map +1 -0
- package/dist/types/core/aggregation/transport/http/nonce-cache.d.ts +26 -0
- package/dist/types/core/aggregation/transport/http/nonce-cache.d.ts.map +1 -0
- package/dist/types/core/aggregation/transport/http/protocol.d.ts +53 -0
- package/dist/types/core/aggregation/transport/http/protocol.d.ts.map +1 -0
- package/dist/types/core/aggregation/transport/http/rate-limiter.d.ts +41 -0
- package/dist/types/core/aggregation/transport/http/rate-limiter.d.ts.map +1 -0
- package/dist/types/core/aggregation/transport/http/request-auth.d.ts +50 -0
- package/dist/types/core/aggregation/transport/http/request-auth.d.ts.map +1 -0
- package/dist/types/core/aggregation/transport/http/server.d.ts +110 -0
- package/dist/types/core/aggregation/transport/http/server.d.ts.map +1 -0
- package/dist/types/core/aggregation/transport/http/sse-stream.d.ts +34 -0
- package/dist/types/core/aggregation/transport/http/sse-stream.d.ts.map +1 -0
- package/dist/types/core/aggregation/transport/http/sse-writer.d.ts +12 -0
- package/dist/types/core/aggregation/transport/http/sse-writer.d.ts.map +1 -0
- package/dist/types/core/aggregation/transport/index.d.ts +1 -0
- package/dist/types/core/aggregation/transport/index.d.ts.map +1 -1
- package/dist/types/core/aggregation/transport/nostr.d.ts +99 -1
- package/dist/types/core/aggregation/transport/nostr.d.ts.map +1 -1
- package/dist/types/core/aggregation/transport/transport.d.ts +26 -1
- package/dist/types/core/aggregation/transport/transport.d.ts.map +1 -1
- package/dist/types/core/beacon/beacon.d.ts +149 -22
- package/dist/types/core/beacon/beacon.d.ts.map +1 -1
- package/dist/types/core/beacon/cas-beacon.d.ts +3 -3
- package/dist/types/core/beacon/cas-beacon.d.ts.map +1 -1
- package/dist/types/core/beacon/singleton-beacon.d.ts +3 -3
- package/dist/types/core/beacon/singleton-beacon.d.ts.map +1 -1
- package/dist/types/core/beacon/smt-beacon.d.ts +3 -3
- package/dist/types/core/beacon/smt-beacon.d.ts.map +1 -1
- package/dist/types/core/beacon/utils.d.ts +2 -2
- package/dist/types/core/beacon/utils.d.ts.map +1 -1
- package/dist/types/core/updater.d.ts +27 -12
- package/dist/types/core/updater.d.ts.map +1 -1
- package/dist/types/did-btcr2.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +5 -7
- package/src/core/aggregation/beacon-strategy.ts +123 -0
- package/src/core/aggregation/cohort.ts +34 -8
- package/src/core/aggregation/logger.ts +33 -0
- package/src/core/aggregation/messages/base.ts +20 -5
- package/src/core/aggregation/messages/bodies.ts +223 -0
- package/src/core/aggregation/messages/factories.ts +1 -0
- package/src/core/aggregation/messages/index.ts +1 -0
- package/src/core/aggregation/participant.ts +40 -46
- package/src/core/aggregation/runner/events.ts +27 -3
- package/src/core/aggregation/runner/participant-runner.ts +41 -7
- package/src/core/aggregation/runner/service-runner.ts +227 -19
- package/src/core/aggregation/service.ts +189 -20
- package/src/core/aggregation/signing-session.ts +65 -7
- package/src/core/aggregation/transport/didcomm.ts +17 -0
- package/src/core/aggregation/transport/factory.ts +48 -12
- package/src/core/aggregation/transport/http/client.ts +409 -0
- package/src/core/aggregation/transport/http/envelope.ts +204 -0
- package/src/core/aggregation/transport/http/errors.ts +11 -0
- package/src/core/aggregation/transport/http/inbox-buffer.ts +53 -0
- package/src/core/aggregation/transport/http/index.ts +11 -0
- package/src/core/aggregation/transport/http/nonce-cache.ts +43 -0
- package/src/core/aggregation/transport/http/protocol.ts +57 -0
- package/src/core/aggregation/transport/http/rate-limiter.ts +75 -0
- package/src/core/aggregation/transport/http/request-auth.ts +164 -0
- package/src/core/aggregation/transport/http/server.ts +615 -0
- package/src/core/aggregation/transport/http/sse-stream.ts +121 -0
- package/src/core/aggregation/transport/http/sse-writer.ts +23 -0
- package/src/core/aggregation/transport/index.ts +1 -0
- package/src/core/aggregation/transport/nostr.ts +266 -23
- package/src/core/aggregation/transport/transport.ts +34 -1
- package/src/core/beacon/beacon.ts +411 -79
- package/src/core/beacon/cas-beacon.ts +4 -4
- package/src/core/beacon/singleton-beacon.ts +4 -4
- package/src/core/beacon/smt-beacon.ts +4 -4
- package/src/core/beacon/utils.ts +16 -11
- package/src/core/updater.ts +113 -67
- package/src/did-btcr2.ts +0 -5
- package/src/index.ts +2 -0
- package/src/utils/did-document.ts +2 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal injectable logger for the aggregation subsystem.
|
|
3
|
+
*
|
|
4
|
+
* Each runner and transport adapter accepts a `Logger` option; the default is
|
|
5
|
+
* {@link CONSOLE_LOGGER}, which forwards to `console.*`. Pass
|
|
6
|
+
* {@link SILENT_LOGGER} to suppress output (useful for tests) or a custom
|
|
7
|
+
* implementation to route logs to pino, winston, Sentry, etc.
|
|
8
|
+
*
|
|
9
|
+
* The interface is intentionally small — we don't want production code taking
|
|
10
|
+
* a hard dependency on any specific logger library.
|
|
11
|
+
*/
|
|
12
|
+
export interface Logger {
|
|
13
|
+
debug(message: string, ...args: unknown[]): void;
|
|
14
|
+
info(message: string, ...args: unknown[]): void;
|
|
15
|
+
warn(message: string, ...args: unknown[]): void;
|
|
16
|
+
error(message: string, ...args: unknown[]): void;
|
|
17
|
+
}
|
|
18
|
+
/** Console-backed logger. Default for runners and transports. */
|
|
19
|
+
export declare const CONSOLE_LOGGER: Logger;
|
|
20
|
+
/** No-op logger. Useful for tests and production environments with own logging pipeline. */
|
|
21
|
+
export declare const SILENT_LOGGER: Logger;
|
|
22
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../src/core/aggregation/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;CAClD;AAED,iEAAiE;AACjE,eAAO,MAAM,cAAc,EAAE,MAK5B,CAAC;AAEF,4FAA4F;AAC5F,eAAO,MAAM,aAAa,EAAE,MAK3B,CAAC"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Current on-the-wire protocol version.
|
|
3
|
+
*
|
|
4
|
+
* Receivers reject messages with an unknown (mismatched) version. Bumping this
|
|
5
|
+
* requires coordinated updates across all participants and any intermediate
|
|
6
|
+
* relays that inspect message content.
|
|
7
|
+
*/
|
|
8
|
+
export declare const AGGREGATION_WIRE_VERSION = 1;
|
|
1
9
|
export type BaseBody = {
|
|
2
10
|
cohortId: string;
|
|
3
11
|
cohortSize?: number;
|
|
@@ -10,6 +18,8 @@ export type BaseBody = {
|
|
|
10
18
|
nonceContribution?: Uint8Array;
|
|
11
19
|
partialSignature?: Uint8Array;
|
|
12
20
|
pendingTx?: string;
|
|
21
|
+
/** Hex-encoded scriptPubKey of the UTXO being spent. Required for BIP-341 sighash. */
|
|
22
|
+
prevOutScriptHex?: string;
|
|
13
23
|
prevOutValue?: string;
|
|
14
24
|
communicationPk?: Uint8Array;
|
|
15
25
|
beaconType?: string;
|
|
@@ -22,16 +32,18 @@ export type BaseBody = {
|
|
|
22
32
|
};
|
|
23
33
|
export type Base = {
|
|
24
34
|
type: string;
|
|
35
|
+
version?: number;
|
|
25
36
|
to?: string;
|
|
26
37
|
from: string;
|
|
27
38
|
body?: BaseBody;
|
|
28
39
|
};
|
|
29
40
|
export declare class BaseMessage {
|
|
30
41
|
type: string;
|
|
42
|
+
version: number;
|
|
31
43
|
to?: string;
|
|
32
44
|
from: string;
|
|
33
45
|
body?: BaseBody;
|
|
34
|
-
constructor({ type, to, from, body }: Base);
|
|
46
|
+
constructor({ type, version, to, from, body }: Base);
|
|
35
47
|
/**
|
|
36
48
|
* Converts a BaseMessage to a JSON object.
|
|
37
49
|
* @returns {Base} The JSON representation of the BaseMessage.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/core/aggregation/messages/base.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,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AI,CAAC,EAAE,QAAQ,CAAC;gBAEX,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI;IAQnD;;;OAGG;IACI,MAAM,IAAI,IAAI;CAStB"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-message-type body interfaces and a discriminated {@link AggregationMessage}
|
|
3
|
+
* union.
|
|
4
|
+
*
|
|
5
|
+
* {@link BaseBody} remains the superset-of-all-fields body type used by the
|
|
6
|
+
* raw {@link BaseMessage} class (see `base.ts`). The narrow interfaces here
|
|
7
|
+
* describe what each specific message type is *required* to carry and are
|
|
8
|
+
* exposed alongside type guards for consumers who want compile-time narrowing.
|
|
9
|
+
*
|
|
10
|
+
* Guards validate both `type` and the presence of required body fields so they
|
|
11
|
+
* are safe to use on messages that have round-tripped through JSON / a relay.
|
|
12
|
+
*/
|
|
13
|
+
import type { SerializedSMTProof } from '@did-btcr2/smt';
|
|
14
|
+
import type { BaseMessage } from './base.js';
|
|
15
|
+
import { AGGREGATED_NONCE, AUTHORIZATION_REQUEST, COHORT_ADVERT, COHORT_OPT_IN, COHORT_OPT_IN_ACCEPT, COHORT_READY, DISTRIBUTE_AGGREGATED_DATA, NONCE_CONTRIBUTION, SIGNATURE_AUTHORIZATION, SUBMIT_UPDATE, VALIDATION_ACK } from './constants.js';
|
|
16
|
+
export interface CohortAdvertBody {
|
|
17
|
+
cohortId: string;
|
|
18
|
+
cohortSize: number;
|
|
19
|
+
beaconType: string;
|
|
20
|
+
network: string;
|
|
21
|
+
communicationPk: Uint8Array;
|
|
22
|
+
}
|
|
23
|
+
export interface CohortOptInBody {
|
|
24
|
+
cohortId: string;
|
|
25
|
+
participantPk: Uint8Array;
|
|
26
|
+
communicationPk: Uint8Array;
|
|
27
|
+
}
|
|
28
|
+
export interface CohortOptInAcceptBody {
|
|
29
|
+
cohortId: string;
|
|
30
|
+
}
|
|
31
|
+
export interface CohortReadyBody {
|
|
32
|
+
cohortId: string;
|
|
33
|
+
beaconAddress: string;
|
|
34
|
+
cohortKeys: Array<Uint8Array>;
|
|
35
|
+
}
|
|
36
|
+
export interface SubmitUpdateBody {
|
|
37
|
+
cohortId: string;
|
|
38
|
+
signedUpdate: Record<string, unknown>;
|
|
39
|
+
}
|
|
40
|
+
export interface DistributeAggregatedDataBody {
|
|
41
|
+
cohortId: string;
|
|
42
|
+
beaconType: string;
|
|
43
|
+
signalBytesHex: string;
|
|
44
|
+
casAnnouncement?: Record<string, string>;
|
|
45
|
+
smtProof?: Record<string, unknown> | SerializedSMTProof;
|
|
46
|
+
}
|
|
47
|
+
export interface ValidationAckBody {
|
|
48
|
+
cohortId: string;
|
|
49
|
+
approved: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface AuthorizationRequestBody {
|
|
52
|
+
cohortId: string;
|
|
53
|
+
sessionId: string;
|
|
54
|
+
pendingTx: string;
|
|
55
|
+
prevOutScriptHex: string;
|
|
56
|
+
prevOutValue: string;
|
|
57
|
+
}
|
|
58
|
+
export interface NonceContributionBody {
|
|
59
|
+
cohortId: string;
|
|
60
|
+
sessionId: string;
|
|
61
|
+
nonceContribution: Uint8Array;
|
|
62
|
+
}
|
|
63
|
+
export interface AggregatedNonceBody {
|
|
64
|
+
cohortId: string;
|
|
65
|
+
sessionId: string;
|
|
66
|
+
aggregatedNonce: Uint8Array;
|
|
67
|
+
}
|
|
68
|
+
export interface SignatureAuthorizationBody {
|
|
69
|
+
cohortId: string;
|
|
70
|
+
sessionId: string;
|
|
71
|
+
partialSignature: Uint8Array;
|
|
72
|
+
}
|
|
73
|
+
export type CohortAdvertMessage = BaseMessage & {
|
|
74
|
+
type: typeof COHORT_ADVERT;
|
|
75
|
+
body: CohortAdvertBody;
|
|
76
|
+
};
|
|
77
|
+
export type CohortOptInMessage = BaseMessage & {
|
|
78
|
+
type: typeof COHORT_OPT_IN;
|
|
79
|
+
body: CohortOptInBody;
|
|
80
|
+
};
|
|
81
|
+
export type CohortOptInAcceptMessage = BaseMessage & {
|
|
82
|
+
type: typeof COHORT_OPT_IN_ACCEPT;
|
|
83
|
+
body: CohortOptInAcceptBody;
|
|
84
|
+
};
|
|
85
|
+
export type CohortReadyMessage = BaseMessage & {
|
|
86
|
+
type: typeof COHORT_READY;
|
|
87
|
+
body: CohortReadyBody;
|
|
88
|
+
};
|
|
89
|
+
export type SubmitUpdateMessage = BaseMessage & {
|
|
90
|
+
type: typeof SUBMIT_UPDATE;
|
|
91
|
+
body: SubmitUpdateBody;
|
|
92
|
+
};
|
|
93
|
+
export type DistributeAggregatedDataMessage = BaseMessage & {
|
|
94
|
+
type: typeof DISTRIBUTE_AGGREGATED_DATA;
|
|
95
|
+
body: DistributeAggregatedDataBody;
|
|
96
|
+
};
|
|
97
|
+
export type ValidationAckMessage = BaseMessage & {
|
|
98
|
+
type: typeof VALIDATION_ACK;
|
|
99
|
+
body: ValidationAckBody;
|
|
100
|
+
};
|
|
101
|
+
export type AuthorizationRequestMessage = BaseMessage & {
|
|
102
|
+
type: typeof AUTHORIZATION_REQUEST;
|
|
103
|
+
body: AuthorizationRequestBody;
|
|
104
|
+
};
|
|
105
|
+
export type NonceContributionMessage = BaseMessage & {
|
|
106
|
+
type: typeof NONCE_CONTRIBUTION;
|
|
107
|
+
body: NonceContributionBody;
|
|
108
|
+
};
|
|
109
|
+
export type AggregatedNonceMessage = BaseMessage & {
|
|
110
|
+
type: typeof AGGREGATED_NONCE;
|
|
111
|
+
body: AggregatedNonceBody;
|
|
112
|
+
};
|
|
113
|
+
export type SignatureAuthorizationMessage = BaseMessage & {
|
|
114
|
+
type: typeof SIGNATURE_AUTHORIZATION;
|
|
115
|
+
body: SignatureAuthorizationBody;
|
|
116
|
+
};
|
|
117
|
+
/** Discriminated union of every well-formed aggregation message. */
|
|
118
|
+
export type AggregationMessage = CohortAdvertMessage | CohortOptInMessage | CohortOptInAcceptMessage | CohortReadyMessage | SubmitUpdateMessage | DistributeAggregatedDataMessage | ValidationAckMessage | AuthorizationRequestMessage | NonceContributionMessage | AggregatedNonceMessage | SignatureAuthorizationMessage;
|
|
119
|
+
export declare function isCohortAdvertMessage(m: BaseMessage): m is CohortAdvertMessage;
|
|
120
|
+
export declare function isCohortOptInMessage(m: BaseMessage): m is CohortOptInMessage;
|
|
121
|
+
export declare function isCohortOptInAcceptMessage(m: BaseMessage): m is CohortOptInAcceptMessage;
|
|
122
|
+
export declare function isCohortReadyMessage(m: BaseMessage): m is CohortReadyMessage;
|
|
123
|
+
export declare function isSubmitUpdateMessage(m: BaseMessage): m is SubmitUpdateMessage;
|
|
124
|
+
export declare function isDistributeAggregatedDataMessage(m: BaseMessage): m is DistributeAggregatedDataMessage;
|
|
125
|
+
export declare function isValidationAckMessage(m: BaseMessage): m is ValidationAckMessage;
|
|
126
|
+
export declare function isAuthorizationRequestMessage(m: BaseMessage): m is AuthorizationRequestMessage;
|
|
127
|
+
export declare function isNonceContributionMessage(m: BaseMessage): m is NonceContributionMessage;
|
|
128
|
+
export declare function isAggregatedNonceMessage(m: BaseMessage): m is AggregatedNonceMessage;
|
|
129
|
+
export declare function isSignatureAuthorizationMessage(m: BaseMessage): m is SignatureAuthorizationMessage;
|
|
130
|
+
//# sourceMappingURL=bodies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bodies.d.ts","sourceRoot":"","sources":["../../../../../src/core/aggregation/messages/bodies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,0BAA0B,EAC1B,kBAAkB,EAClB,uBAAuB,EACvB,aAAa,EACb,cAAc,EACf,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,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CAIhF;AAED,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,IAAI,2BAA2B,CAO9F;AAED,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,IAAI,wBAAwB,CAKxF;AAED,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,IAAI,sBAAsB,CAKpF;AAED,wBAAgB,+BAA+B,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,IAAI,6BAA6B,CAKlG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factories.d.ts","sourceRoot":"","sources":["../../../../../src/core/aggregation/messages/factories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAexC;;;;GAIG;AACH,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,UAAU,CAAC;CAC7B,CAAC;AACF,KAAK,kBAAkB,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,UAAU,CAAC;IAC1B,eAAe,EAAE,UAAU,CAAC;CAC7B,CAAC;AACF,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AACF,KAAK,kBAAkB,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;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AE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,UAAU,CAAC;CAC/B,CAAC;AACF,KAAK,sBAAsB,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,UAAU,CAAC;CAC7B,CAAC;AACF,KAAK,6BAA6B,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,UAAU,CAAC;CAC9B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,2BAA2B,GAAG,WAAW,CAGlG;AAED;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,wBAAwB,GAAG,WAAW,CAG5F;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,sBAAsB,GAAG,WAAW,CAGxF;AAED;;;;;;;GAOG;AACH,wBAAgB,mCAAmC,CAAC,MAAM,EAAE,6BAA6B,GAAG,WAAW,CAGtG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/aggregation/messages/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/aggregation/messages/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
|
|
@@ -34,6 +34,8 @@ export interface PendingSigningRequest {
|
|
|
34
34
|
cohortId: string;
|
|
35
35
|
sessionId: string;
|
|
36
36
|
pendingTxHex: string;
|
|
37
|
+
/** Hex-encoded scriptPubKey of the UTXO being spent. Required for BIP-341 sighash. */
|
|
38
|
+
prevOutScriptHex: string;
|
|
37
39
|
prevOutValue: string;
|
|
38
40
|
}
|
|
39
41
|
export interface AggregationParticipantParams {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"participant.d.ts","sourceRoot":"","sources":["../../../../src/core/aggregation/participant.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AAMxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"participant.d.ts","sourceRoot":"","sources":["../../../../src/core/aggregation/participant.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AAMxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAiBtD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAI9D,qFAAqF;AACrF,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,UAAU,CAAC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AAI,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAahE;IAqBD;;;OAGG;IACI,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,iBAAiB,GAAG,WAAW,EAAE;IAsBrF,gDAAgD;IAChD,IAAW,kBAAkB,IAAI,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAQtE;IAmCD;;OAEG;IACI,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE;IAiBzD;;OAEG;IACI,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE;IAkBxD,+CAA+C;IAC/C,IAAW,sBAAsB,IAAI,WAAW,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAQ9E;IAyBD;;OAEG;IACI,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE;IAgEpD;;;;OAIG;IACI,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE;IA4BzD,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,0BAA0B,GAAG,SAAS;CAGhF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { SerializedSMTProof } from '@did-btcr2/smt';
|
|
1
2
|
import type { CohortAdvert, PendingSigningRequest, PendingValidation } from '../participant.js';
|
|
2
|
-
import type { AggregationResult, PendingOptIn } from '../service.js';
|
|
3
|
+
import type { AggregationResult, PendingOptIn, Rejection } from '../service.js';
|
|
3
4
|
/**
|
|
4
5
|
* AggregationServiceRunner events are emitted by the AggregationServiceRunner to signal important
|
|
5
6
|
* milestones and actions during the aggregation process. They can be listened to by external code
|
|
@@ -25,6 +26,14 @@ export type AggregationServiceEvents = {
|
|
|
25
26
|
'update-received': [{
|
|
26
27
|
participantDid: string;
|
|
27
28
|
}];
|
|
29
|
+
/**
|
|
30
|
+
* An inbound message was silently dropped by the state machine (bad proof,
|
|
31
|
+
* oversized payload, wrong wire version, etc.). Fires for *any* rejection,
|
|
32
|
+
* not just SUBMIT_UPDATE.
|
|
33
|
+
*/
|
|
34
|
+
'message-rejected': [Rejection & {
|
|
35
|
+
cohortId: string;
|
|
36
|
+
}];
|
|
28
37
|
/** Aggregated data has been distributed to all participants for validation. */
|
|
29
38
|
'data-distributed': [{
|
|
30
39
|
cohortId: string;
|
|
@@ -44,6 +53,11 @@ export type AggregationServiceEvents = {
|
|
|
44
53
|
}];
|
|
45
54
|
/** Signing complete — final aggregated signature is ready to broadcast. */
|
|
46
55
|
'signing-complete': [AggregationResult];
|
|
56
|
+
/** Cohort transitioned to Failed phase (e.g. a participant rejected validation). */
|
|
57
|
+
'cohort-failed': [{
|
|
58
|
+
cohortId: string;
|
|
59
|
+
reason: string;
|
|
60
|
+
}];
|
|
47
61
|
/** A non-fatal error occurred. Fatal errors reject the run() promise. */
|
|
48
62
|
'error': [Error];
|
|
49
63
|
};
|
|
@@ -73,11 +87,23 @@ export type AggregationParticipantEvents = {
|
|
|
73
87
|
'validation-requested': [PendingValidation];
|
|
74
88
|
/** Signing request has arrived. Fires before the sign approval callback. */
|
|
75
89
|
'signing-requested': [PendingSigningRequest];
|
|
76
|
-
/**
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Cohort signing is complete from this participant's perspective.
|
|
92
|
+
* Includes the aggregated sidecar data the participant needs to keep for
|
|
93
|
+
* future DID resolution: the CAS Announcement map (for CAS beacons) or the
|
|
94
|
+
* SMT inclusion proof (for SMT beacons).
|
|
95
|
+
*/
|
|
96
|
+
'cohort-complete': [
|
|
97
|
+
{
|
|
98
|
+
cohortId: string;
|
|
99
|
+
beaconAddress: string;
|
|
100
|
+
beaconType: string;
|
|
101
|
+
/** DID → base64url update hash. Populated only for CAS beacons. */
|
|
102
|
+
casAnnouncement?: Record<string, string>;
|
|
103
|
+
/** Merkle inclusion proof for this participant's slot. Populated only for SMT beacons. */
|
|
104
|
+
smtProof?: SerializedSMTProof;
|
|
105
|
+
}
|
|
106
|
+
];
|
|
81
107
|
/** Cohort failed (rejected validation, signing error, etc.). */
|
|
82
108
|
'cohort-failed': [{
|
|
83
109
|
cohortId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../../src/core/aggregation/runner/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAChG,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../../src/core/aggregation/runner/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAChG,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEhF;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,kEAAkE;IAClE,mBAAmB,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAE5C,6EAA6E;IAC7E,iBAAiB,EAAE,CAAC,YAAY,CAAC,CAAC;IAElC,uDAAuD;IACvD,sBAAsB,EAAE,CAAC;QAAE,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAErD,mEAAmE;IACnE,iBAAiB,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEjE,mDAAmD;IACnD,iBAAiB,EAAE,CAAC;QAAE,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEhD;;;;OAIG;IACH,kBAAkB,EAAE,CAAC,SA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CAAC;IAE7C;;;;;OAKG;IACH,iBAAiB,EAAE;QAAC;YAClB,QAAQ,EAAE,MAAM,CAAC;YACjB,aAAa,EAAE,MAAM,CAAC;YACtB,UAAU,EAAE,MAAM,CAAC;YACnB,mEAAmE;YACnE,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YACzC,0FAA0F;YAC1F,QAAQ,CAAC,EAAE,kBAAkB,CAAC;SAC/B;KAAC,CAAC;IAEH,gEAAgE;IAChE,eAAe,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAExD,kCAAkC;IAClC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;CAClB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SignedBTCR2Update } from '@did-btcr2/cryptosuite';
|
|
2
2
|
import type { SchnorrKeyPair } from '@did-btcr2/keypair';
|
|
3
|
+
import type { SerializedSMTProof } from '@did-btcr2/smt';
|
|
3
4
|
import type { CohortAdvert, PendingSigningRequest, PendingValidation } from '../participant.js';
|
|
4
5
|
import { AggregationParticipant } from '../participant.js';
|
|
5
6
|
import type { Transport } from '../transport/transport.js';
|
|
@@ -65,11 +66,7 @@ export interface AggregationParticipantRunnerOptions {
|
|
|
65
66
|
* keys: myKeys,
|
|
66
67
|
* shouldJoin: async (advert) => advert.beaconType === 'CASBeacon',
|
|
67
68
|
* onProvideUpdate: async ({ beaconAddress }) => {
|
|
68
|
-
<<<<<<< Updated upstream
|
|
69
|
-
* return Update.sign(myDid, unsigned, vm, secretKey);
|
|
70
|
-
=======
|
|
71
69
|
* return Updater.sign(myDid, unsigned, vm, secretKey);
|
|
72
|
-
>>>>>>> Stashed changes
|
|
73
70
|
* },
|
|
74
71
|
* });
|
|
75
72
|
*
|
|
@@ -97,7 +94,7 @@ export declare class AggregationParticipantRunner extends TypedEventEmitter<Aggr
|
|
|
97
94
|
* is called or the underlying transport disconnects.
|
|
98
95
|
*/
|
|
99
96
|
start(): Promise<void>;
|
|
100
|
-
/** Stop the runner
|
|
97
|
+
/** Stop the runner and detach transport handlers. Safe to call repeatedly. */
|
|
101
98
|
stop(): void;
|
|
102
99
|
/**
|
|
103
100
|
* Single-shot helper: start, join the first cohort that passes `shouldJoin`,
|
|
@@ -106,6 +103,11 @@ export declare class AggregationParticipantRunner extends TypedEventEmitter<Aggr
|
|
|
106
103
|
static joinFirst(options: AggregationParticipantRunnerOptions): Promise<{
|
|
107
104
|
cohortId: string;
|
|
108
105
|
beaconAddress: string;
|
|
106
|
+
beaconType: string;
|
|
107
|
+
/** DID → base64url update hash. Populated only for CAS beacons. */
|
|
108
|
+
casAnnouncement?: Record<string, string>;
|
|
109
|
+
/** Merkle inclusion proof for this participant's slot. Populated only for SMT beacons. */
|
|
110
|
+
smtProof?: SerializedSMTProof;
|
|
109
111
|
}>;
|
|
110
112
|
}
|
|
111
113
|
//# sourceMappingURL=participant-runner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"participant-runner.d.ts","sourceRoot":"","sources":["../../../../../src/core/aggregation/runner/participant-runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAUzD,OAAO,KAAK,EACV,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACL,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,yEAAyE;AACzE,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,YAAY,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpE,wEAAwE;AACxE,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;CACvB,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEjC,4DAA4D;AAC5D,MAAM,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,iBAAiB,KAAK,OAAO,CAAC;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAEzF,oDAAoD;AACpD,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,qBAAqB,KAAK,OAAO,CAAC;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAE/F,MAAM,WAAW,mCAAmC;IAClD,4BAA4B;IAC5B,SAAS,EAAE,SAAS,CAAC;IAErB,4BAA4B;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,cAAc,CAAC;IAErB;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;;OAGG;IACH,eAAe,EAAE,eAAe,CAAC;IAEjC;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC;AAED
|
|
1
|
+
{"version":3,"file":"participant-runner.d.ts","sourceRoot":"","sources":["../../../../../src/core/aggregation/runner/participant-runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAUzD,OAAO,KAAK,EACV,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,E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C/F,sEAAsE;IACtE,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;gBAY7B,OAAO,EAAE,mCAAmC;IAYxD;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B,8EAA8E;IAC9E,IAAI,IAAI,IAAI;IAwBZ;;;OAGG;WACU,SAAS,CACpB,OAAO,EAAE,mCAAmC,GAC3C,OAAO,CAAC;QACT,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;QACnB,mEAAmE;QACnE,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACzC,0FAA0F;QAC1F,QAAQ,CAAC,EAAE,kBAAkB,CAAC;KAC/B,CAAC;CAwNH"}
|
|
@@ -45,7 +45,38 @@ export interface AggregationServiceRunnerOptions {
|
|
|
45
45
|
* REQUIRED — no sensible default.
|
|
46
46
|
*/
|
|
47
47
|
onProvideTxData: OnProvideTxData;
|
|
48
|
+
/**
|
|
49
|
+
* Maximum canonicalized byte-length of a signed update body. Submissions
|
|
50
|
+
* above this cap are rejected and surfaced via the `message-rejected` event.
|
|
51
|
+
* Defaults to {@link DEFAULT_MAX_UPDATE_SIZE_BYTES} (256 KiB).
|
|
52
|
+
*/
|
|
53
|
+
maxUpdateSizeBytes?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Overall wall-clock budget for the cohort, from run() to signing-complete.
|
|
56
|
+
* On expiry the cohort is dropped, `cohort-failed` is emitted, and run()
|
|
57
|
+
* rejects with a timeout error. Leave undefined to disable.
|
|
58
|
+
*/
|
|
59
|
+
cohortTtlMs?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Maximum time allowed between phase transitions. Protects against stalled
|
|
62
|
+
* cohorts (e.g. a participant vanishing mid-protocol). Reset automatically
|
|
63
|
+
* on every observed phase change. Leave undefined to disable.
|
|
64
|
+
*/
|
|
65
|
+
phaseTimeoutMs?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Re-publish COHORT_ADVERT on this interval until keygen is finalized.
|
|
68
|
+
* Works around relays that don't backfill historical events to late
|
|
69
|
+
* subscribers — a republish gives late joiners a window to discover the
|
|
70
|
+
* advert without protocol changes. The first publish is immediate;
|
|
71
|
+
* subsequent publishes fire every `advertRepeatIntervalMs` until
|
|
72
|
+
* keygen-complete, fail, or stop(). Defaults to
|
|
73
|
+
* {@link DEFAULT_ADVERT_REPEAT_INTERVAL_MS} (60 s). Set to 0 to publish
|
|
74
|
+
* once and never retry.
|
|
75
|
+
*/
|
|
76
|
+
advertRepeatIntervalMs?: number;
|
|
48
77
|
}
|
|
78
|
+
/** Default cadence for re-publishing COHORT_ADVERT until keygen completes: 60 seconds. */
|
|
79
|
+
export declare const DEFAULT_ADVERT_REPEAT_INTERVAL_MS = 60000;
|
|
49
80
|
/**
|
|
50
81
|
* High-level facade for running an Aggregation Service over a Transport.
|
|
51
82
|
*
|
|
@@ -93,9 +124,8 @@ export declare class AggregationServiceRunner extends TypedEventEmitter<Aggregat
|
|
|
93
124
|
*/
|
|
94
125
|
run(): Promise<AggregationResult>;
|
|
95
126
|
/**
|
|
96
|
-
* Stop the runner early.
|
|
97
|
-
*
|
|
98
|
-
* does not currently expose unregister).
|
|
127
|
+
* Stop the runner early. Marks the runner stopped and detaches transport
|
|
128
|
+
* handlers so a restart or a new runner doesn't inherit stale dispatch.
|
|
99
129
|
*/
|
|
100
130
|
stop(): void;
|
|
101
131
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-runner.d.ts","sourceRoot":"","sources":["../../../../../src/core/aggregation/runner/service-runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAUzD,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,EACL,kBAAkB,EACnB,MAAM,e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;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;;;;;OASG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,0FAA0F;AAC1F,eAAO,MAAM,iCAAiC,QAAS,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAAa,wBAAyB,SAAQ,iBAAiB,CAAC,wBAAwB,CAAC;;IACvF,sEAAsE;IACtE,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;gBA8BzB,OAAO,EAAE,+BAA+B;IAiCpD;;;;;OAKG;IACH,GAAG,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAiGjC;;;OAGG;IACH,IAAI,IAAI,IAAI;CAqQb"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SignedBTCR2Update } from '@did-btcr2/cryptosuite';
|
|
2
2
|
import type { SchnorrKeyPair } from '@did-btcr2/keypair';
|
|
3
|
-
import type { Transaction } from '
|
|
3
|
+
import type { Transaction } from '@scure/btc-signer';
|
|
4
4
|
import { AggregationCohort } from './cohort.js';
|
|
5
5
|
import type { BaseMessage } from './messages/base.js';
|
|
6
6
|
import type { ServiceCohortPhaseType } from './phases.js';
|
|
@@ -36,9 +36,28 @@ export interface SigningTxData {
|
|
|
36
36
|
prevOutScripts: Uint8Array[];
|
|
37
37
|
prevOutValues: bigint[];
|
|
38
38
|
}
|
|
39
|
+
/** Reason an incoming message was silently dropped by the state machine. */
|
|
40
|
+
export type RejectionReason = 'WRONG_VERSION' | 'UPDATE_TOO_LARGE' | 'UPDATE_VERIFICATION_FAILED' | 'UPDATE_MALFORMED';
|
|
41
|
+
/** Record of a silently-dropped inbound message. Drained by the runner to emit events. */
|
|
42
|
+
export interface Rejection {
|
|
43
|
+
/** DID of the sender whose message was rejected. */
|
|
44
|
+
from: string;
|
|
45
|
+
/** Machine-readable code. */
|
|
46
|
+
code: RejectionReason;
|
|
47
|
+
/** Human-readable reason. */
|
|
48
|
+
reason: string;
|
|
49
|
+
}
|
|
50
|
+
/** Default maximum canonicalized byte-length of a submitted BTCR2 update. */
|
|
51
|
+
export declare const DEFAULT_MAX_UPDATE_SIZE_BYTES: number;
|
|
39
52
|
export interface AggregationServiceParams {
|
|
40
53
|
did: string;
|
|
41
54
|
keys: SchnorrKeyPair;
|
|
55
|
+
/**
|
|
56
|
+
* Maximum canonicalized byte-length of a signed update body accepted by the
|
|
57
|
+
* service. Submissions above this cap are silently dropped and surfaced as
|
|
58
|
+
* `UPDATE_TOO_LARGE` rejections. Defaults to {@link DEFAULT_MAX_UPDATE_SIZE_BYTES}.
|
|
59
|
+
*/
|
|
60
|
+
maxUpdateSizeBytes?: number;
|
|
42
61
|
}
|
|
43
62
|
/**
|
|
44
63
|
* Sans-I/O state machine for an Aggregation Service.
|
|
@@ -55,8 +74,15 @@ export declare class AggregationService {
|
|
|
55
74
|
#private;
|
|
56
75
|
readonly did: string;
|
|
57
76
|
readonly keys: SchnorrKeyPair;
|
|
58
|
-
|
|
77
|
+
readonly maxUpdateSizeBytes: number;
|
|
78
|
+
constructor({ did, keys, maxUpdateSizeBytes }: AggregationServiceParams);
|
|
59
79
|
receive(message: BaseMessage): void;
|
|
80
|
+
/**
|
|
81
|
+
* Drain the rejection log for a cohort. Used by runners to surface silent
|
|
82
|
+
* drops (bad proof, oversized update, wrong version, etc.) as structured
|
|
83
|
+
* events without breaking the sans-I/O state machine contract.
|
|
84
|
+
*/
|
|
85
|
+
drainRejections(cohortId: string): Array<Rejection>;
|
|
60
86
|
/**
|
|
61
87
|
* Create a new cohort with the given config. Returns the cohort ID.
|
|
62
88
|
* Cohort starts in `Created` phase — call `advertise()` to broadcast.
|
|
@@ -108,5 +134,10 @@ export declare class AggregationService {
|
|
|
108
134
|
*/
|
|
109
135
|
getSigningSessionId(cohortId: string): string | undefined;
|
|
110
136
|
get cohorts(): ReadonlyArray<AggregationCohort>;
|
|
137
|
+
/**
|
|
138
|
+
* Remove a cohort from the state map. Used by runners to GC state on cohort
|
|
139
|
+
* completion, failure, or expiry. No-op if the cohort doesn't exist.
|
|
140
|
+
*/
|
|
141
|
+
removeCohort(cohortId: string): void;
|
|
111
142
|
}
|
|
112
143
|
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/core/aggregation/service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/core/aggregation/service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAiBtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAI1D,wDAAwD;AACxD,MAAM,WAAW,YAAY;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,yDAAyD;AACzD,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,UAAU,CAAC;IAC1B,eAAe,EAAE,UAAU,CAAC;CAC7B;AAED,oCAAoC;AACpC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9B,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9B,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,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action } from '@scure/btc-signer';
|
|
2
2
|
import type { AggregationCohort } from './cohort.js';
|
|
3
3
|
import type { SigningSessionPhaseType } from './phases.js';
|
|
4
4
|
type PublicKeyHex = string;
|
|
@@ -60,6 +60,10 @@ export declare class BeaconSigningSession {
|
|
|
60
60
|
/**
|
|
61
61
|
* Generates a partial signature using the participant's secret key + secret nonce.
|
|
62
62
|
* Requires the aggregated nonce to have been set first (via the service).
|
|
63
|
+
*
|
|
64
|
+
* Zeros the stored `secretNonce` after use. JS cannot truly erase memory (GC
|
|
65
|
+
* and immutable strings), but overwriting the bytes shortens the exposure
|
|
66
|
+
* window and prevents accidental reuse or serialization of a spent nonce.
|
|
63
67
|
*/
|
|
64
68
|
generatePartialSignature(participantSecretKey: Uint8Array): Uint8Array;
|
|
65
69
|
isComplete(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signing-session.d.ts","sourceRoot":"","sources":["../../../../src/core/aggregation/signing-session.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"signing-session.d.ts","sourceRoot":"","sources":["../../../../src/core/aggregation/signing-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAG3D,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,KAAK,GAAG,UAAU,CAAC;AAExB,MAAM,WAAW,oBAAoB;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,iBAAiB,CAAC;IAC1B,SAAS,EAAE,WAAW,CAAC;IACvB,cAAc,CAAC,EAAE,UAAU,EAAE,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED;;;;;;;;;GASG;AACH,qBAAa,oBAAoB;IAC/B,kDAAkD;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erPeer(_did: string, _communicationPk: Uint8Array): void;
|
|
16
16
|
getPeerPk(_did: string): Uint8Array | undefined;
|
|
17
17
|
registerMessageHandler(_actorDid: string, _messageType: string, _handler: MessageHandler): void;
|
|
18
|
+
unregisterMessageHandler(_actorDid: string, _messageType: string): void;
|
|
19
|
+
unregisterActor(_did: string): void;
|
|
18
20
|
sendMessage(_message: BaseMessage, _sender: string, _recipient?: string): Promise<void>;
|
|
21
|
+
publishRepeating(_message: BaseMessage, _sender: string, _intervalMs: number, _recipient?: string): () => void;
|
|
19
22
|
}
|
|
20
23
|
//# sourceMappingURL=didcomm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"didcomm.d.ts","sourceRoot":"","sources":["../../../../../src/core/aggregation/transport/didcomm.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhE;;;;;GAKG;AACH,qBAAa,gBAAiB,YAAW,SAAS;IACzC,IAAI,EAAE,MAAM,CAAa;IAEzB,KAAK,IAAI,IAAI;IAIb,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI;IAIxD,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAIhD,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,UAAU,GAAG,IAAI;IAI9D,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAI/C,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"didcomm.d.ts","sourceRoot":"","sources":["../../../../../src/core/aggregation/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