@sig-net/midnight 0.19.0 → 0.20.0-rc.1
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 +42 -2
- package/dist/abi-serde.d.ts +32 -30
- package/dist/abi-serde.d.ts.map +1 -1
- package/dist/abi-serde.js +139 -75
- package/dist/abi-serde.js.map +1 -1
- package/dist/byte-codecs.d.ts +62 -0
- package/dist/byte-codecs.d.ts.map +1 -0
- package/dist/byte-codecs.js +116 -0
- package/dist/byte-codecs.js.map +1 -0
- package/dist/compact-descriptors.d.ts +89 -0
- package/dist/compact-descriptors.d.ts.map +1 -0
- package/dist/compact-descriptors.js +139 -0
- package/dist/compact-descriptors.js.map +1 -0
- package/dist/constants.d.ts +18 -43
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +19 -45
- package/dist/constants.js.map +1 -1
- package/dist/ecdsa-attestation.d.ts +49 -97
- package/dist/ecdsa-attestation.d.ts.map +1 -1
- package/dist/ecdsa-attestation.js +78 -142
- package/dist/ecdsa-attestation.js.map +1 -1
- package/dist/epsilon-derivation.d.ts +24 -31
- package/dist/epsilon-derivation.d.ts.map +1 -1
- package/dist/epsilon-derivation.js +52 -62
- package/dist/epsilon-derivation.js.map +1 -1
- package/dist/index.d.ts +10 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -8
- package/dist/index.js.map +1 -1
- package/dist/managed/compiler/contract-info.json +0 -22
- package/dist/managed/compiler/contract-manifest.json +8 -8
- package/dist/managed/contract/index.d.ts +0 -3
- package/dist/managed/contract/index.js +65 -80
- package/dist/managed/contract/index.js.map +1 -1
- package/dist/raw-contract-state.d.ts +25 -0
- package/dist/raw-contract-state.d.ts.map +1 -0
- package/dist/raw-contract-state.js +52 -0
- package/dist/raw-contract-state.js.map +1 -0
- package/dist/signature-requests-state-reader.d.ts +18 -44
- package/dist/signature-requests-state-reader.d.ts.map +1 -1
- package/dist/signature-requests-state-reader.js +82 -146
- package/dist/signature-requests-state-reader.js.map +1 -1
- package/dist/signature-response-verification.d.ts +9 -8
- package/dist/signature-response-verification.d.ts.map +1 -1
- package/dist/signature-response-verification.js +20 -17
- package/dist/signature-response-verification.js.map +1 -1
- package/dist/signet-contract-events.d.ts +56 -64
- package/dist/signet-contract-events.d.ts.map +1 -1
- package/dist/signet-contract-events.js +46 -48
- package/dist/signet-contract-events.js.map +1 -1
- package/dist/signet-evtype2tx-record-decoding.d.ts +18 -0
- package/dist/signet-evtype2tx-record-decoding.d.ts.map +1 -0
- package/dist/signet-evtype2tx-record-decoding.js +97 -0
- package/dist/signet-evtype2tx-record-decoding.js.map +1 -0
- package/dist/signet-evtype2tx-requests.d.ts +43 -87
- package/dist/signet-evtype2tx-requests.d.ts.map +1 -1
- package/dist/signet-evtype2tx-requests.js +59 -130
- package/dist/signet-evtype2tx-requests.js.map +1 -1
- package/dist/signet-request-id.d.ts +14 -0
- package/dist/signet-request-id.d.ts.map +1 -0
- package/dist/signet-request-id.js +27 -0
- package/dist/signet-request-id.js.map +1 -0
- package/dist/signet-request-response-reader.d.ts +34 -56
- package/dist/signet-request-response-reader.d.ts.map +1 -1
- package/dist/signet-request-response-reader.js +56 -68
- package/dist/signet-request-response-reader.js.map +1 -1
- package/dist/signet-requests.d.ts +28 -92
- package/dist/signet-requests.d.ts.map +1 -1
- package/dist/signet-requests.js +39 -141
- package/dist/signet-requests.js.map +1 -1
- package/dist/testing.d.ts +3 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +20 -0
- package/dist/testing.js.map +1 -0
- package/package.json +12 -3
- package/src/Signet.compact +110 -171
- package/src/circuits.compact +9 -16
- package/dist/signature-state-reading.d.ts +0 -43
- package/dist/signature-state-reading.d.ts.map +0 -1
- package/dist/signature-state-reading.js +0 -74
- package/dist/signature-state-reading.js.map +0 -1
- package/dist/signet-request-feed.d.ts +0 -126
- package/dist/signet-request-feed.d.ts.map +0 -1
- package/dist/signet-request-feed.js +0 -216
- package/dist/signet-request-feed.js.map +0 -1
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
import { type CompactType } from "@midnight-ntwrk/compact-runtime";
|
|
2
|
+
import { type ContractAddress } from "./compact-descriptors.ts";
|
|
2
3
|
import type { EvmType2TxParams } from "./signet-evtype2tx-requests.ts";
|
|
4
|
+
export type { ContractAddress, Maybe } from "./compact-descriptors.ts";
|
|
3
5
|
/**
|
|
4
6
|
* 32-byte signet request id (Compact: `new type RequestId = Bytes<32>`).
|
|
5
|
-
* Chain-agnostic
|
|
6
|
-
* minted by `calculateRequestId` in Signet.compact: the persistent hash of
|
|
7
|
-
* the full {@link SignBidirectionalEvent} record (which includes the sender
|
|
8
|
-
* contract address, scoping ids per contract).
|
|
7
|
+
* Chain-agnostic opaque key, minted by `calculateRequestId`.
|
|
9
8
|
*/
|
|
10
9
|
export type RequestId = Uint8Array;
|
|
11
10
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* Descriptor of a request id ledger key (Compact `RequestId`, a nominal
|
|
12
|
+
* `Bytes<32>`): encodes a {@link RequestId} to the stored aligned form and
|
|
13
|
+
* back.
|
|
15
14
|
*/
|
|
16
|
-
export
|
|
17
|
-
bytes: Uint8Array;
|
|
18
|
-
}
|
|
15
|
+
export declare const requestIdType: CompactType<RequestId>;
|
|
19
16
|
/**
|
|
20
17
|
* Which transaction-param decomposition a request carries (Compact:
|
|
21
18
|
* `enum TxParamType`), as the generated code represents enums: a `number`
|
|
@@ -26,9 +23,9 @@ export declare const TxParamType: {
|
|
|
26
23
|
/** `EvmType2TxParams` (signet-evtype2tx-requests.ts): an EIP-1559 EVM transaction. */
|
|
27
24
|
readonly evmType2: 0;
|
|
28
25
|
/**
|
|
29
|
-
* Never emitted:
|
|
30
|
-
*
|
|
31
|
-
*
|
|
26
|
+
* Never emitted: the Compact-side padding variant that keeps the enum at
|
|
27
|
+
* >= 2 variants (a 1-variant enum is a zero-byte value the proof server
|
|
28
|
+
* cannot parse inside persistentHash preimages).
|
|
32
29
|
*/
|
|
33
30
|
readonly reserved: 1;
|
|
34
31
|
};
|
|
@@ -52,26 +49,13 @@ export declare const MPCDestination: {
|
|
|
52
49
|
/** Never emitted: the >= 2 variants padding (see {@link TxParamType}). */
|
|
53
50
|
readonly reserved: 1;
|
|
54
51
|
};
|
|
55
|
-
/**
|
|
56
|
-
* Compact's standard-library `Maybe<T>` as the compiler generates it: a
|
|
57
|
-
* plain struct. Even when `is_some` is false, `value` carries a full
|
|
58
|
-
* default-valued `T` (so vector capacities remain inferable).
|
|
59
|
-
*/
|
|
60
|
-
export interface Maybe<T> {
|
|
61
|
-
is_some: boolean;
|
|
62
|
-
value: T;
|
|
63
|
-
}
|
|
64
52
|
/**
|
|
65
53
|
* Canonical signet request record (Compact:
|
|
66
54
|
* `SignBidirectionalEvent<TxParams, #LenOutputDeserialization,
|
|
67
55
|
* #LenRespondSerialization>`), stored per {@link RequestId} in a requesting
|
|
68
|
-
* contract's `SignBidirectionalEventMap
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* instantiation is {@link EvmType2TxParams}, the only decomposition so far:
|
|
72
|
-
* new tx kinds supply their own type argument alongside their Compact struct.
|
|
73
|
-
* The schema fields carry their contract-declared byte widths in their array
|
|
74
|
-
* lengths.
|
|
56
|
+
* contract's `SignBidirectionalEventMap`. Generic over the tx-params
|
|
57
|
+
* decomposition, {@link EvmType2TxParams} by default. The schema fields
|
|
58
|
+
* carry their contract-declared byte widths in their array lengths.
|
|
75
59
|
*/
|
|
76
60
|
export interface SignBidirectionalEvent<TxParams = EvmType2TxParams> {
|
|
77
61
|
/** Address of the client contract that stores this event (`kernel.self()`). */
|
|
@@ -86,7 +70,7 @@ export interface SignBidirectionalEvent<TxParams = EvmType2TxParams> {
|
|
|
86
70
|
algo: number;
|
|
87
71
|
/** An {@link MPCDestination} value. */
|
|
88
72
|
dest: number;
|
|
89
|
-
/** Extra MPC parameters, reserved,
|
|
73
|
+
/** Extra MPC parameters: 64 opaque bytes, reserved, zero-filled. */
|
|
90
74
|
params: Uint8Array;
|
|
91
75
|
/** A {@link TxParamType} value tagging the txParams decomposition. */
|
|
92
76
|
txParamType: number;
|
|
@@ -100,33 +84,10 @@ export interface SignBidirectionalEvent<TxParams = EvmType2TxParams> {
|
|
|
100
84
|
respondSerializationSchema: Uint8Array;
|
|
101
85
|
}
|
|
102
86
|
/**
|
|
103
|
-
|
|
104
|
-
* descriptors: the generic form of the struct descriptor classes the
|
|
105
|
-
* compiler generates (field-by-field concatenation of alignments and values).
|
|
106
|
-
*
|
|
107
|
-
* Field ORDER must match the Compact struct declaration order. Object
|
|
108
|
-
* literals preserve insertion order for string keys, so pass fields in
|
|
109
|
-
* declaration order.
|
|
110
|
-
*
|
|
111
|
-
* @param fields - One runtime descriptor per struct field, in declaration order.
|
|
112
|
-
* @returns The composed struct descriptor.
|
|
113
|
-
*/
|
|
114
|
-
export declare function compactStructDescriptor<T extends object>(fields: {
|
|
115
|
-
readonly [K in keyof T]-?: CompactType<T[K]>;
|
|
116
|
-
}): CompactType<T>;
|
|
117
|
-
/**
|
|
118
|
-
* Descriptor of Compact's standard-library `Maybe<T>`: the compiler
|
|
119
|
-
* generates it as the struct `{ is_some: Boolean, value: T }`.
|
|
120
|
-
*
|
|
121
|
-
* @param inner - Descriptor of the wrapped type.
|
|
122
|
-
* @returns The Maybe struct descriptor.
|
|
123
|
-
*/
|
|
124
|
-
export declare function compactMaybeDescriptor<T>(inner: CompactType<T>): CompactType<Maybe<T>>;
|
|
125
|
-
/**
|
|
87
|
+
|
|
126
88
|
* Descriptor of {@link SignBidirectionalEvent} over ANY tx-params
|
|
127
89
|
* decomposition: the TS analogue of Compact's generic
|
|
128
|
-
* `SignBidirectionalEvent
|
|
129
|
-
* #LenRespondSerialization>`. Each decomposition wraps this with its own
|
|
90
|
+
* `SignBidirectionalEvent`. Each decomposition wraps this with its own
|
|
130
91
|
* capacity-parameterised convenience (see `signBidirectionalEventDescriptor`
|
|
131
92
|
* in signet-evtype2tx-requests.ts for the EVM Type-2 one).
|
|
132
93
|
*
|
|
@@ -144,7 +105,10 @@ export declare function signBidirectionalEventDescriptorWith<TxParams>(txParams:
|
|
|
144
105
|
* what a contract's `ledger(state).signetRequestsIndex` provides. Structural,
|
|
145
106
|
* so any contract exposing the index satisfies it.
|
|
146
107
|
*/
|
|
147
|
-
export interface SignBidirectionalEventLedgerMap extends Iterable<[
|
|
108
|
+
export interface SignBidirectionalEventLedgerMap extends Iterable<[
|
|
109
|
+
RequestId,
|
|
110
|
+
SignBidirectionalEvent
|
|
111
|
+
]> {
|
|
148
112
|
/** @returns `true` when the index holds no requests. */
|
|
149
113
|
isEmpty(): boolean;
|
|
150
114
|
/** @returns Number of requests in the index. */
|
|
@@ -164,11 +128,9 @@ export interface SignBidirectionalEventLedgerMap extends Iterable<[RequestId, Si
|
|
|
164
128
|
declare const requestIdHexBrand: unique symbol;
|
|
165
129
|
/**
|
|
166
130
|
* 64-char lowercase hex rendering of a {@link RequestId}: THE
|
|
167
|
-
* representation of a request id everywhere in TypeScript
|
|
168
|
-
* {@link RequestId} bytes
|
|
169
|
-
*
|
|
170
|
-
* becomes this type. Branded (the TS analogue of Compact's `new type`) so an
|
|
171
|
-
* arbitrary string cannot pose as a request id: mint one with
|
|
131
|
+
* representation of a request id everywhere in TypeScript, with raw
|
|
132
|
+
* {@link RequestId} bytes appearing only at the Compact boundary. Branded
|
|
133
|
+
* so an arbitrary string cannot pose as a request id: mint one with
|
|
172
134
|
* {@link requestIdHex} (from ledger bytes) or {@link parseRequestIdHex}
|
|
173
135
|
* (from user input), and go back to bytes with {@link requestIdBytes}.
|
|
174
136
|
*/
|
|
@@ -178,30 +140,7 @@ export type RequestIdHex = string & {
|
|
|
178
140
|
/** Plain-JS index parsed out of the ledger, keyed by hex request id. */
|
|
179
141
|
export type SignBidirectionalEventIndex = Map<RequestIdHex, SignBidirectionalEvent>;
|
|
180
142
|
/**
|
|
181
|
-
* Render
|
|
182
|
-
*
|
|
183
|
-
* @param bytes - The bytes to render.
|
|
184
|
-
* @returns Lowercase hex, two chars per byte.
|
|
185
|
-
*/
|
|
186
|
-
export declare function bytesToHex(bytes: Uint8Array): string;
|
|
187
|
-
/**
|
|
188
|
-
* Strip an optional `0x`/`0X` prefix from a hex string.
|
|
189
|
-
*
|
|
190
|
-
* @param hex - A hex string, with or without a `0x` prefix.
|
|
191
|
-
* @returns The bare hex digits.
|
|
192
|
-
*/
|
|
193
|
-
export declare function stripHexPrefix(hex: string): string;
|
|
194
|
-
/**
|
|
195
|
-
* Decode a hex string into bytes: the inverse of {@link bytesToHex}.
|
|
196
|
-
*
|
|
197
|
-
* @param hex - Hex digits, with or without a `0x` prefix.
|
|
198
|
-
* @returns The decoded bytes.
|
|
199
|
-
*/
|
|
200
|
-
export declare function hexToBytes(hex: string): Uint8Array;
|
|
201
|
-
/**
|
|
202
|
-
* Render a request id in its canonical TS form (see
|
|
203
|
-
* {@link RequestIdHex}), also usable as a JS `Map` key, which raw
|
|
204
|
-
* `Uint8Array` ids are not (they compare by reference).
|
|
143
|
+
* Render a request id in its canonical TS form (see {@link RequestIdHex}).
|
|
205
144
|
*
|
|
206
145
|
* @param requestId - 32-byte request id.
|
|
207
146
|
* @returns The branded 64-char lowercase hex string, no `0x` prefix.
|
|
@@ -209,12 +148,12 @@ export declare function hexToBytes(hex: string): Uint8Array;
|
|
|
209
148
|
export declare function requestIdHex(requestId: RequestId): RequestIdHex;
|
|
210
149
|
/**
|
|
211
150
|
* Validate and normalise an untrusted string (CLI argument, config value)
|
|
212
|
-
* into a {@link RequestIdHex}: an optional `0x` prefix
|
|
213
|
-
*
|
|
151
|
+
* into a {@link RequestIdHex}: strips an optional `0x` prefix and
|
|
152
|
+
* lowercases.
|
|
214
153
|
*
|
|
215
154
|
* @param value - The candidate request id string.
|
|
216
155
|
* @returns The branded, normalised request id hex.
|
|
217
|
-
* @throws Error
|
|
156
|
+
* @throws {Error} If the value is not 64 hex chars after normalisation.
|
|
218
157
|
*/
|
|
219
158
|
export declare function parseRequestIdHex(value: string): RequestIdHex;
|
|
220
159
|
/**
|
|
@@ -227,9 +166,7 @@ export declare function parseRequestIdHex(value: string): RequestIdHex;
|
|
|
227
166
|
export declare function requestIdBytes(id: RequestIdHex): RequestId;
|
|
228
167
|
/**
|
|
229
168
|
* Byte width of the path field (Compact `Bytes<32>`): 32 opaque bytes of the
|
|
230
|
-
* client contract's choosing.
|
|
231
|
-
* (contract address, path), so a contract can only ever reach keys scoped to
|
|
232
|
-
* itself.
|
|
169
|
+
* client contract's choosing.
|
|
233
170
|
*/
|
|
234
171
|
export declare const PATH_BYTES = 32;
|
|
235
172
|
/**
|
|
@@ -242,5 +179,4 @@ export declare const PATH_BYTES = 32;
|
|
|
242
179
|
* @returns A new `Map` from {@link requestIdHex} key to request record.
|
|
243
180
|
*/
|
|
244
181
|
export declare function toSignBidirectionalEventIndex(ledgerIndex: Iterable<[RequestId, SignBidirectionalEvent]>): SignBidirectionalEventIndex;
|
|
245
|
-
export {};
|
|
246
182
|
//# sourceMappingURL=signet-requests.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signet-requests.d.ts","sourceRoot":"","sources":["../src/signet-requests.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"signet-requests.d.ts","sourceRoot":"","sources":["../src/signet-requests.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAKL,KAAK,eAAe,EAGrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAGvE,YAAY,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEvE;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC;AAEnC;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,SAAS,CAAY,CAAC;AAE9D;;;;;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IG;AACH,MAAM,WAAW,+BAAgC,SAAQ,QAAQ,CAC/D;IAAC,SAAS;IAAE,sBAAsB;CAAC,CACpC;IACC,wDAAwD;IACxD,OAAO,IAAI,OAAO,CAAC;IACnB,gDAAgD;IAChD,IAAI,IAAI,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC;IACtC;;;;OAIG;IACH,MAAM,CAAC,SAAS,EAAE,SAAS,GAAG,sBAAsB,CAAC;CACtD;AAED,OAAO,CAAC,MAAM,iBAAiB,EAAE,OAAO,MAAM,CAAC;AAE/C;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IAClC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC;CACpC,CAAC;AAEF,wEAAwE;AACxE,MAAM,MAAM,2BAA2B,GAAG,GAAG,CAAC,YAAY,EAAE,sBAAsB,CAAC,CAAC;AAEpF;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,YAAY,CAE/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAM7D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,YAAY,GAAG,SAAS,CAE1D;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,KAAK,CAAC;AAE7B;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE,QAAQ,CAAC,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC,GACzD,2BAA2B,CAM7B"}
|
package/dist/signet-requests.js
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
// TypeScript twins of the CHAIN-AGNOSTIC request-side structs in the Compact
|
|
2
2
|
// library `Signet.compact` (same directory): the request record, its enums,
|
|
3
3
|
// request ids, and the runtime-descriptor toolkit shared by every tx-params
|
|
4
|
-
// decomposition. Everything specific to the EVM Type-2 decomposition
|
|
5
|
-
//
|
|
4
|
+
// decomposition. Everything specific to the EVM Type-2 decomposition lives
|
|
5
|
+
// in `signet-evtype2tx-requests.ts`.
|
|
6
6
|
//
|
|
7
|
-
// The shapes MUST stay in lockstep with the Compact structs
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
// flow) and this package's README ("Sign bidirectional flow").
|
|
21
|
-
import { CompactTypeBoolean, CompactTypeBytes, CompactTypeEnum, CompactTypeUnsignedInteger, } from "@midnight-ntwrk/compact-runtime";
|
|
7
|
+
// The shapes MUST stay structurally in lockstep with the Compact structs,
|
|
8
|
+
// field by field in declaration order. Enforced by each consuming contract's
|
|
9
|
+
// simulator tests (the "ledger shape" test in
|
|
10
|
+
// packages/test-caller-contract/tests/contract.test.ts).
|
|
11
|
+
import { CompactTypeBytes, CompactTypeEnum, } from "@midnight-ntwrk/compact-runtime";
|
|
12
|
+
import { bytesToHex, hexToBytes } from "./byte-codecs.js";
|
|
13
|
+
import { BYTES_32, BYTES_64, compactStructDescriptor, CONTRACT_ADDRESS, UINT_8, UINT_64, } from "./compact-descriptors.js";
|
|
14
|
+
/**
|
|
15
|
+
* Descriptor of a request id ledger key (Compact `RequestId`, a nominal
|
|
16
|
+
* `Bytes<32>`): encodes a {@link RequestId} to the stored aligned form and
|
|
17
|
+
* back.
|
|
18
|
+
*/
|
|
19
|
+
export const requestIdType = BYTES_32;
|
|
22
20
|
/**
|
|
23
21
|
* Which transaction-param decomposition a request carries (Compact:
|
|
24
22
|
* `enum TxParamType`), as the generated code represents enums: a `number`
|
|
@@ -29,9 +27,9 @@ export const TxParamType = {
|
|
|
29
27
|
/** `EvmType2TxParams` (signet-evtype2tx-requests.ts): an EIP-1559 EVM transaction. */
|
|
30
28
|
evmType2: 0,
|
|
31
29
|
/**
|
|
32
|
-
* Never emitted:
|
|
33
|
-
*
|
|
34
|
-
*
|
|
30
|
+
* Never emitted: the Compact-side padding variant that keeps the enum at
|
|
31
|
+
* >= 2 variants (a 1-variant enum is a zero-byte value the proof server
|
|
32
|
+
* cannot parse inside persistentHash preimages).
|
|
35
33
|
*/
|
|
36
34
|
reserved: 1,
|
|
37
35
|
};
|
|
@@ -59,88 +57,28 @@ export const MPCDestination = {
|
|
|
59
57
|
//
|
|
60
58
|
// DEVIATION from the "pure circuits are compiled, never re-written in TS"
|
|
61
59
|
// rule (see circuits.compact): the request-id circuit is generic over the
|
|
62
|
-
// tx-params type and schema lengths, the Compact compiler cannot export
|
|
63
|
-
// type-parameterised circuits from the top level,
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
// Ids still come from the very `persistentHash` runtime builtin that
|
|
70
|
-
// compiled circuits call, over runtime type descriptors mirroring the ones
|
|
71
|
-
// the compiler generates (compare `_calculateRequestId_0` in any consuming
|
|
72
|
-
// contract's managed/contract/index.js). What must stay in lockstep with
|
|
73
|
-
// Signet.compact is exactly what this file already keeps in lockstep: the
|
|
74
|
-
// struct shapes, field by field, in declaration order. Enforced by test-caller-contract's
|
|
60
|
+
// tx-params type and schema lengths, and the Compact compiler cannot export
|
|
61
|
+
// type-parameterised circuits from the top level, so the record descriptor
|
|
62
|
+
// (and `calculateRequestId` built on it, see signet-request-id.ts) gets a TS
|
|
63
|
+
// twin here. Ids come from the same
|
|
64
|
+
// `keccak256` runtime builtin compiled circuits call. Lockstep with
|
|
65
|
+
// Signet.compact is enforced by test-caller-contract's
|
|
75
66
|
// "submitSignatureRequest round-trip" test, which asserts the id computed
|
|
76
|
-
// here equals the ledger map key minted by the
|
|
77
|
-
// Runtime descriptors of the
|
|
78
|
-
//
|
|
79
|
-
//
|
|
80
|
-
//
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
// `reserved` variant so it stays at (1, 1).
|
|
84
|
-
const BYTES_32 = new CompactTypeBytes(32);
|
|
85
|
-
const BYTES_64 = new CompactTypeBytes(64);
|
|
86
|
-
const UINT_8 = new CompactTypeUnsignedInteger(2n ** 8n - 1n, 1);
|
|
87
|
-
const UINT_64 = new CompactTypeUnsignedInteger(2n ** 64n - 1n, 8);
|
|
67
|
+
// here equals the ledger map key minted by the compiled contract.
|
|
68
|
+
// Runtime descriptors of the signet enums, at the literals the compiler
|
|
69
|
+
// emits. NOTE: a 1-variant enum would compile to `CompactTypeEnum(0, 0)`,
|
|
70
|
+
// zero bytes, which the proof server cannot parse inside persistentHash
|
|
71
|
+
// preimages. Every enum therefore carries a padding `reserved` variant so it
|
|
72
|
+
// stays at (1, 1). The Compact-generic base descriptors live in
|
|
73
|
+
// compact-descriptors.ts.
|
|
88
74
|
const TX_PARAM_TYPE = new CompactTypeEnum(1, 1);
|
|
89
75
|
const MPC_SIGNATURE_ALGORITHM = new CompactTypeEnum(1, 1);
|
|
90
76
|
const MPC_DESTINATION = new CompactTypeEnum(1, 1);
|
|
91
77
|
/**
|
|
92
|
-
|
|
93
|
-
* compiler generates it: a single-field `{ bytes: Bytes<32> }` wrapper.
|
|
94
|
-
*/
|
|
95
|
-
const CONTRACT_ADDRESS = {
|
|
96
|
-
alignment: () => BYTES_32.alignment(),
|
|
97
|
-
fromValue: (value) => ({ bytes: BYTES_32.fromValue(value) }),
|
|
98
|
-
toValue: (value) => BYTES_32.toValue(value.bytes),
|
|
99
|
-
};
|
|
100
|
-
/**
|
|
101
|
-
* Build the runtime descriptor of a Compact struct from its per-field
|
|
102
|
-
* descriptors: the generic form of the struct descriptor classes the
|
|
103
|
-
* compiler generates (field-by-field concatenation of alignments and values).
|
|
104
|
-
*
|
|
105
|
-
* Field ORDER must match the Compact struct declaration order. Object
|
|
106
|
-
* literals preserve insertion order for string keys, so pass fields in
|
|
107
|
-
* declaration order.
|
|
108
|
-
*
|
|
109
|
-
* @param fields - One runtime descriptor per struct field, in declaration order.
|
|
110
|
-
* @returns The composed struct descriptor.
|
|
111
|
-
*/
|
|
112
|
-
export function compactStructDescriptor(fields) {
|
|
113
|
-
const entries = Object.entries(fields);
|
|
114
|
-
return {
|
|
115
|
-
alignment: () => entries.flatMap(([, type]) => type.alignment()),
|
|
116
|
-
toValue: (value) => entries.flatMap(([key, type]) => type.toValue(value[key])),
|
|
117
|
-
fromValue: (value) => {
|
|
118
|
-
const result = {};
|
|
119
|
-
for (const [key, type] of entries) {
|
|
120
|
-
result[key] = type.fromValue(value);
|
|
121
|
-
}
|
|
122
|
-
return result;
|
|
123
|
-
},
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Descriptor of Compact's standard-library `Maybe<T>`: the compiler
|
|
128
|
-
* generates it as the struct `{ is_some: Boolean, value: T }`.
|
|
129
|
-
*
|
|
130
|
-
* @param inner - Descriptor of the wrapped type.
|
|
131
|
-
* @returns The Maybe struct descriptor.
|
|
132
|
-
*/
|
|
133
|
-
export function compactMaybeDescriptor(inner) {
|
|
134
|
-
return compactStructDescriptor({
|
|
135
|
-
is_some: CompactTypeBoolean,
|
|
136
|
-
value: inner,
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
78
|
+
|
|
140
79
|
* Descriptor of {@link SignBidirectionalEvent} over ANY tx-params
|
|
141
80
|
* decomposition: the TS analogue of Compact's generic
|
|
142
|
-
* `SignBidirectionalEvent
|
|
143
|
-
* #LenRespondSerialization>`. Each decomposition wraps this with its own
|
|
81
|
+
* `SignBidirectionalEvent`. Each decomposition wraps this with its own
|
|
144
82
|
* capacity-parameterised convenience (see `signBidirectionalEventDescriptor`
|
|
145
83
|
* in signet-evtype2tx-requests.ts for the EVM Type-2 one).
|
|
146
84
|
*
|
|
@@ -169,41 +107,7 @@ export function signBidirectionalEventDescriptorWith(txParams, lenOutputDeserial
|
|
|
169
107
|
});
|
|
170
108
|
}
|
|
171
109
|
/**
|
|
172
|
-
* Render
|
|
173
|
-
*
|
|
174
|
-
* @param bytes - The bytes to render.
|
|
175
|
-
* @returns Lowercase hex, two chars per byte.
|
|
176
|
-
*/
|
|
177
|
-
export function bytesToHex(bytes) {
|
|
178
|
-
return Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Strip an optional `0x`/`0X` prefix from a hex string.
|
|
182
|
-
*
|
|
183
|
-
* @param hex - A hex string, with or without a `0x` prefix.
|
|
184
|
-
* @returns The bare hex digits.
|
|
185
|
-
*/
|
|
186
|
-
export function stripHexPrefix(hex) {
|
|
187
|
-
return hex.startsWith("0x") || hex.startsWith("0X") ? hex.slice(2) : hex;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Decode a hex string into bytes: the inverse of {@link bytesToHex}.
|
|
191
|
-
*
|
|
192
|
-
* @param hex - Hex digits, with or without a `0x` prefix.
|
|
193
|
-
* @returns The decoded bytes.
|
|
194
|
-
*/
|
|
195
|
-
export function hexToBytes(hex) {
|
|
196
|
-
const digits = stripHexPrefix(hex);
|
|
197
|
-
const out = new Uint8Array(digits.length >> 1);
|
|
198
|
-
for (let i = 0; i < out.length; i++) {
|
|
199
|
-
out[i] = Number.parseInt(digits.slice(2 * i, 2 * i + 2), 16);
|
|
200
|
-
}
|
|
201
|
-
return out;
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Render a request id in its canonical TS form (see
|
|
205
|
-
* {@link RequestIdHex}), also usable as a JS `Map` key, which raw
|
|
206
|
-
* `Uint8Array` ids are not (they compare by reference).
|
|
110
|
+
* Render a request id in its canonical TS form (see {@link RequestIdHex}).
|
|
207
111
|
*
|
|
208
112
|
* @param requestId - 32-byte request id.
|
|
209
113
|
* @returns The branded 64-char lowercase hex string, no `0x` prefix.
|
|
@@ -213,12 +117,12 @@ export function requestIdHex(requestId) {
|
|
|
213
117
|
}
|
|
214
118
|
/**
|
|
215
119
|
* Validate and normalise an untrusted string (CLI argument, config value)
|
|
216
|
-
* into a {@link RequestIdHex}: an optional `0x` prefix
|
|
217
|
-
*
|
|
120
|
+
* into a {@link RequestIdHex}: strips an optional `0x` prefix and
|
|
121
|
+
* lowercases.
|
|
218
122
|
*
|
|
219
123
|
* @param value - The candidate request id string.
|
|
220
124
|
* @returns The branded, normalised request id hex.
|
|
221
|
-
* @throws Error
|
|
125
|
+
* @throws {Error} If the value is not 64 hex chars after normalisation.
|
|
222
126
|
*/
|
|
223
127
|
export function parseRequestIdHex(value) {
|
|
224
128
|
const hex = value.replace(/^0x/i, "").toLowerCase();
|
|
@@ -235,17 +139,11 @@ export function parseRequestIdHex(value) {
|
|
|
235
139
|
* @returns The 32-byte request id.
|
|
236
140
|
*/
|
|
237
141
|
export function requestIdBytes(id) {
|
|
238
|
-
|
|
239
|
-
for (let i = 0; i < 32; i++) {
|
|
240
|
-
bytes[i] = Number.parseInt(id.slice(2 * i, 2 * i + 2), 16);
|
|
241
|
-
}
|
|
242
|
-
return bytes;
|
|
142
|
+
return hexToBytes(id);
|
|
243
143
|
}
|
|
244
144
|
/**
|
|
245
145
|
* Byte width of the path field (Compact `Bytes<32>`): 32 opaque bytes of the
|
|
246
|
-
* client contract's choosing.
|
|
247
|
-
* (contract address, path), so a contract can only ever reach keys scoped to
|
|
248
|
-
* itself.
|
|
146
|
+
* client contract's choosing.
|
|
249
147
|
*/
|
|
250
148
|
export const PATH_BYTES = 32;
|
|
251
149
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signet-requests.js","sourceRoot":"","sources":["../src/signet-requests.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,4EAA4E;AAC5E,4EAA4E;AAC5E,
|
|
1
|
+
{"version":3,"file":"signet-requests.js","sourceRoot":"","sources":["../src/signet-requests.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,4EAA4E;AAC5E,4EAA4E;AAC5E,2EAA2E;AAC3E,qCAAqC;A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CAC3C,WAA0D;IAE1D,MAAM,KAAK,GAAgC,IAAI,GAAG,EAAE,CAAC;IACrD,KAAK,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,WAAW,EAAE,CAAC;QAC/C,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { calculateSignetAttestationDigest, type EcdsaSignature, ecdsaSignatureToMpcSignature, secp256k1PublicKeyOf, signAttestationDigest, signatureToSignatureRespondedEvent, } from "./ecdsa-attestation.ts";
|
|
2
|
+
export { deriveMidnightResponseSecretKey } from "./epsilon-derivation.ts";
|
|
3
|
+
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,gCAAgC,EAChC,KAAK,cAAc,EACnB,4BAA4B,EAC5B,oBAAoB,EACpB,qBAAqB,EACrB,kCAAkC,GACnC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/testing.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Test-fixture surface of @sig-net/midnight (the `@sig-net/midnight/testing`
|
|
2
|
+
// entry point): mint a REAL respond-bidirectional attestation with a
|
|
3
|
+
// throwaway secret key, so a claim circuit can be unit tested in-process
|
|
4
|
+
// against the same record shape the MPC posts. Runtime integrations verify
|
|
5
|
+
// posts (root entry: `verifyRespondBidirectionalSignature`,
|
|
6
|
+
// `SignetRequestResponseReader`) and never sign. The fakenet responder, the
|
|
7
|
+
// MPC's test double, posts through these same helpers, which keeps its bytes
|
|
8
|
+
// pinned to this package's decoders.
|
|
9
|
+
//
|
|
10
|
+
// The canonical fixture chain:
|
|
11
|
+
// ecdsaSignatureToMpcSignature(
|
|
12
|
+
// signAttestationDigest(
|
|
13
|
+
// calculateSignetAttestationDigest(requestId, serializedOutput),
|
|
14
|
+
// secretKey,
|
|
15
|
+
// ),
|
|
16
|
+
// )
|
|
17
|
+
// verifies in-circuit against secp256k1PublicKeyOf(secretKey).
|
|
18
|
+
export { calculateSignetAttestationDigest, ecdsaSignatureToMpcSignature, secp256k1PublicKeyOf, signAttestationDigest, signatureToSignatureRespondedEvent, } from "./ecdsa-attestation.js";
|
|
19
|
+
export { deriveMidnightResponseSecretKey } from "./epsilon-derivation.js";
|
|
20
|
+
//# sourceMappingURL=testing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,qEAAqE;AACrE,yEAAyE;AACzE,2EAA2E;AAC3E,4DAA4D;AAC5D,4EAA4E;AAC5E,6EAA6E;AAC7E,qCAAqC;AACrC,EAAE;AACF,+BAA+B;AAC/B,kCAAkC;AAClC,6BAA6B;AAC7B,uEAAuE;AACvE,mBAAmB;AACnB,SAAS;AACT,MAAM;AACN,+DAA+D;AAE/D,OAAO,EACL,gCAAgC,EAEhC,4BAA4B,EAC5B,oBAAoB,EACpB,qBAAqB,EACrB,kCAAkC,GACnC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sig-net/midnight",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0-rc.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/sig-net/midnight-integration",
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
".": {
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"default": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./testing": {
|
|
18
|
+
"types": "./dist/testing.d.ts",
|
|
19
|
+
"default": "./dist/testing.js"
|
|
16
20
|
}
|
|
17
21
|
},
|
|
18
22
|
"files": [
|
|
@@ -33,6 +37,10 @@
|
|
|
33
37
|
".": {
|
|
34
38
|
"types": "./dist/index.d.ts",
|
|
35
39
|
"default": "./dist/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./testing": {
|
|
42
|
+
"types": "./dist/testing.d.ts",
|
|
43
|
+
"default": "./dist/testing.js"
|
|
36
44
|
}
|
|
37
45
|
}
|
|
38
46
|
},
|
|
@@ -40,12 +48,13 @@
|
|
|
40
48
|
"@midnight-ntwrk/compact-runtime": "0.18.0-rc.1",
|
|
41
49
|
"@midnight-ntwrk/midnight-js-types": "5.0.0-beta.6",
|
|
42
50
|
"@noble/curves": "^2.2.0",
|
|
43
|
-
"@sig-net/midnight-serde": "^0.
|
|
51
|
+
"@sig-net/midnight-serde": "^0.20.0-rc.1",
|
|
44
52
|
"ethers": "^6.17.0"
|
|
45
53
|
},
|
|
46
54
|
"devDependencies": {
|
|
47
55
|
"@types/node": "^26.1.0",
|
|
48
|
-
"
|
|
56
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
57
|
+
"typescript": "^7.0.2",
|
|
49
58
|
"vitest": "^4.1.9"
|
|
50
59
|
},
|
|
51
60
|
"main": "./dist/index.js",
|