@sig-net/midnight 0.24.0-rc.2 → 0.24.0-rc.4
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 +26 -21
- package/dist/compact-descriptors.d.ts +23 -8
- package/dist/compact-descriptors.d.ts.map +1 -1
- package/dist/compact-descriptors.js +34 -31
- package/dist/compact-descriptors.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/ecdsa-attestation.d.ts +6 -6
- package/dist/ecdsa-attestation.d.ts.map +1 -1
- package/dist/ecdsa-attestation.js +7 -5
- package/dist/ecdsa-attestation.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/managed/compiler/contract-info.json +1580 -122
- package/dist/managed/compiler/contract-manifest.json +8 -8
- package/dist/managed/contract/index.d.ts +352 -0
- package/dist/managed/contract/index.js +1042 -208
- package/dist/managed/contract/index.js.map +1 -1
- package/dist/mpc-output-cache.js +2 -2
- package/dist/mpc-output-cache.js.map +1 -1
- package/dist/signature-requests-state-reader.js +3 -3
- package/dist/signature-requests-state-reader.js.map +1 -1
- package/dist/signet-contract-events.d.ts +5 -5
- package/dist/signet-contract-events.d.ts.map +1 -1
- package/dist/signet-evtype2tx-record-decoding.d.ts.map +1 -1
- package/dist/signet-evtype2tx-record-decoding.js +5 -4
- package/dist/signet-evtype2tx-record-decoding.js.map +1 -1
- package/dist/signet-evtype2tx-requests.d.ts +17 -12
- package/dist/signet-evtype2tx-requests.d.ts.map +1 -1
- package/dist/signet-evtype2tx-requests.js +92 -16
- package/dist/signet-evtype2tx-requests.js.map +1 -1
- package/dist/signet-request-id.d.ts +5 -3
- package/dist/signet-request-id.d.ts.map +1 -1
- package/dist/signet-request-id.js +20 -12
- package/dist/signet-request-id.js.map +1 -1
- package/dist/signet-requests.d.ts +30 -34
- package/dist/signet-requests.d.ts.map +1 -1
- package/dist/signet-requests.js +15 -23
- package/dist/signet-requests.js.map +1 -1
- package/package.json +2 -2
- package/src/Signet.compact +204 -92
- package/src/circuits.compact +61 -9
package/README.md
CHANGED
|
@@ -51,11 +51,11 @@ What your contract imports with `import "@sig-net/midnight/src/Signet"`:
|
|
|
51
51
|
|
|
52
52
|
| Task | Exports |
|
|
53
53
|
|---|---|
|
|
54
|
-
| Declare the protocol ledger state (setup step 3) | `
|
|
55
|
-
| Build and store a signature request (runtime step 1) | `
|
|
54
|
+
| Declare the protocol ledger state (setup step 3) | `SignBidirectionalEventMapV1` (the request map the MPC reads) and `SignetSigner` (the Signet singleton's cross-contract-call interface, pinned at deploy). |
|
|
55
|
+
| Build and store a signature request (runtime step 1) | `constructSignBidirectionalEventV1` and `calculateEvmType2RequestIdV1`, over the request structs `EvmType2TxParams`, `EvmCalldata` and `EvmAccessListEntry`. The id hashes `calculateEvmType2TxParamsDigestV1`, a digest over the transaction's used entries only, so it ignores your struct's capacities and unused slots. |
|
|
56
56
|
| Notify the MPC of the request (runtime step 1) | `constructSignBidirectionalEventNotificationV1`: packs your contract's address and the request map's ledger-tree path. |
|
|
57
57
|
| Build and read calldata words in-circuit | The builders `evmAddressAbiWord`, `numericAbiWord` and `boolAbiWord`, and the readers `abiWordToUint128` and `abiWordToBool` (see [EVM Type 2 transactions and ABI calldata words](https://github.com/sig-net/midnight-integration/blob/main/README.md#evm-type-2-transactions-and-abi-calldata-words)). |
|
|
58
|
-
| Verify the execution attestation (runtime step 5) | `
|
|
58
|
+
| Verify the execution attestation (runtime step 5) | `verifyRespondBidirectionalEventV1`: recomputes the attestation digest from the output bytes and the posted request id, output kind and block height, and checks the MPC's signature against your pinned response key. |
|
|
59
59
|
|
|
60
60
|
### TypeScript library
|
|
61
61
|
|
|
@@ -72,9 +72,11 @@ What clients import from `@sig-net/midnight`:
|
|
|
72
72
|
| Read a text field of a request record | `asciiUnpadded`: the inverse of `asciiPadded`, for the zero-padded text fields (`executionDest`, the two schemas). |
|
|
73
73
|
| Compute a request id off chain | `calculateRequestId`: the TS twin of the on-chain circuit, plus `requestIdHex` and `parseRequestIdHex` for the hex form. |
|
|
74
74
|
| Compose expected calldata words off chain (UIs, expected-record builders, tests) | The builders `numericAbiWord`, `evmAddressAbiWord` and `boolAbiWord`, and the readers `abiWordToUint128` and `abiWordToBool`: TS twins of the circuits under identical names. |
|
|
75
|
+
| Digest a transaction decomposition off chain | `calculateEvmType2TxParamsDigest`: the TS twin of the circuit, what `calculateRequestId` hashes in place of the parameters. |
|
|
75
76
|
| Convert a foreign execution output into respond bytes | `deserializeEvmOutput` (raw EVM return data to named values) and `serializeRespondOutput` (named values to the packed respond payload the MPC attests): together they rebuild the `serializedOutput` of steps 4 and 5. |
|
|
76
77
|
| Recognise a failed remote execution | `OutputKind` on the verified `RespondBidirectionalEvent`: `failed` or `unviable` beside an empty output (see [Handling Failure](https://github.com/sig-net/midnight-integration/blob/main/README.md#handling-failure)). |
|
|
77
78
|
| Read the attested output bytes from the MPC's output cache | `MpcOutputCacheReader`: one reader per network and Signet singleton pair, over the public bucket an MPC configured with output storage writes each request's exact attested bytes to before posting, defaulting to the bucket `getMpcOutputCacheUrl` publishes for the network. `fetchSerializedOutput` yields the bytes step 5 verifies, `undefined` while the object is not written yet. |
|
|
79
|
+
| Hand a verified attestation to your verify circuit (runtime step 5) | `respondBidirectionalEventToCircuitInput`: flips the wire event's big-endian `bigR.x` and `s` into the little-endian record `verifyRespondBidirectionalEventV1` reads. |
|
|
78
80
|
| Verify attestations without the reader | `verifyRespondBidirectionalSignature`: the check the reader runs internally, exposed for custom pipelines. |
|
|
79
81
|
| Mint attestations in your contract's unit tests | The `@sig-net/midnight/testing` entry point, see [Testing entry point](#testing-entry-point). |
|
|
80
82
|
| Discover requests MPC-side (responders, background workers) | The discovery primitives: decode the signet contract's emitted notification events with `decodeSignetEventNamed(event, SignetEventName.SignBidirectionalEvent)` (or every kind at once with `decodeSignetEvent`, which throws on an undecodable payload anyone can emit, or its non-throwing sibling `tryDecodeSignetEvent`), then resolve each pointer against the named caller's own request map with `lookupSignetRequestAt` (the authenticated read). The polling loop belongs to the responder. |
|
|
@@ -96,26 +98,16 @@ stack and no MPC:
|
|
|
96
98
|
|
|
97
99
|
```ts
|
|
98
100
|
import { verifyRespondBidirectionalSignature } from "@sig-net/midnight"; // runtime
|
|
99
|
-
import {
|
|
100
|
-
calculateSignetAttestationDigest,
|
|
101
|
-
ecdsaSignatureToMpcSignature,
|
|
102
|
-
secp256k1PublicKeyOf,
|
|
103
|
-
signAttestationDigest,
|
|
104
|
-
} from "@sig-net/midnight/testing"; // tests only
|
|
101
|
+
import { attestRespondBidirectional, secp256k1PublicKeyOf } from "@sig-net/midnight/testing"; // tests only
|
|
105
102
|
|
|
106
103
|
// A real RespondBidirectionalEvent for (requestId, blockHeight, outputKind,
|
|
107
|
-
//
|
|
108
|
-
//
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
),
|
|
115
|
-
),
|
|
116
|
-
outputKind,
|
|
117
|
-
blockHeight,
|
|
118
|
-
};
|
|
104
|
+
// serializedOutput), signed by secretKey: the request id, block height, kind,
|
|
105
|
+
// output width, attestation digest and signature the MPC would post. It
|
|
106
|
+
// verifies, in-circuit and off chain, against secp256k1PublicKeyOf(secretKey).
|
|
107
|
+
const event = attestRespondBidirectional(
|
|
108
|
+
{ requestId, blockHeight, outputKind, serializedOutput },
|
|
109
|
+
secretKey,
|
|
110
|
+
);
|
|
119
111
|
```
|
|
120
112
|
|
|
121
113
|
## Related packages
|
|
@@ -124,3 +116,16 @@ const event = {
|
|
|
124
116
|
- [`@sig-net/midnight-contract-deploy`](https://www.npmjs.com/package/@sig-net/midnight-contract-deploy): deploy tooling for that contract plus generic Midnight deploy/wallet plumbing.
|
|
125
117
|
|
|
126
118
|
Developed in [sig-net/midnight-integration](https://github.com/sig-net/midnight-integration).
|
|
119
|
+
|
|
120
|
+
## Protocol hash domains
|
|
121
|
+
|
|
122
|
+
`HashDomain` is the shared append-only enum exported by the Compact module
|
|
123
|
+
and the TypeScript SDK. Its indices are `requestId = 0`,
|
|
124
|
+
`attestationDigest = 1`, `evmType2TxHeader = 2`, `evmType2TxWord = 3`,
|
|
125
|
+
`evmType2TxAccessEntry = 4` and `evmType2TxStorageKey = 5`. Each protocol
|
|
126
|
+
hash input starts with its domain tag. Off-chain recomputation must use
|
|
127
|
+
the same tags and field order as the circuits.
|
|
128
|
+
|
|
129
|
+
`constructSignBidirectionalEventV1` rejects a `signatureDest` other than
|
|
130
|
+
`MPCDestination.unused` and any non-zero byte in `params`. Both fields
|
|
131
|
+
are reserved and remain outside the request id.
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { type AlignedValue, type CompactType, CompactTypeBytes, CompactTypeUnsignedInteger } from "@midnight-ntwrk/compact-runtime";
|
|
2
|
-
/**
|
|
1
|
+
import { type AlignedValue, type CompactType, CompactTypeBytes, CompactTypeEnum, CompactTypeUnsignedInteger } from "@midnight-ntwrk/compact-runtime";
|
|
2
|
+
/** Protocol HashDomain enum, matching the Compact variant indices and byte width. */
|
|
3
|
+
export declare const HASH_DOMAIN: CompactTypeEnum;
|
|
4
|
+
/** `Boolean`. */
|
|
5
|
+
export declare const BOOLEAN: CompactType<boolean>;
|
|
6
|
+
/** `Field`: the accumulator of the transaction digest folds. */
|
|
7
|
+
export declare const FIELD: CompactType<bigint>;
|
|
8
|
+
/** `Bytes<4>`. */
|
|
3
9
|
export declare const BYTES_4: CompactTypeBytes;
|
|
4
10
|
/** Descriptor of a Compact `Bytes<20>`. */
|
|
5
11
|
export declare const BYTES_20: CompactTypeBytes;
|
|
@@ -86,16 +92,25 @@ export declare function decodeExactly<T>(type: CompactType<T>, atoms: readonly U
|
|
|
86
92
|
* not a `Bytes` atom.
|
|
87
93
|
*/
|
|
88
94
|
export declare function declaredWidths(cell: AlignedValue, what: string): number[];
|
|
95
|
+
/**
|
|
96
|
+
* Descriptor of a Compact tuple, composed the way the compiler composes one:
|
|
97
|
+
* the elements' alignments and values concatenated in order.
|
|
98
|
+
*
|
|
99
|
+
* @param elements - One descriptor per tuple element, in order.
|
|
100
|
+
* @returns The tuple's descriptor.
|
|
101
|
+
*/
|
|
102
|
+
export declare function compactTupleDescriptor<T extends unknown[]>(elements: {
|
|
103
|
+
[K in keyof T]: CompactType<T[K]>;
|
|
104
|
+
}): CompactType<T>;
|
|
89
105
|
/**
|
|
90
106
|
* Descriptor of the Compact tuple
|
|
91
|
-
* `[RequestId, Uint<64>, OutputKind, Uint<64>, Bytes<serializedOutputLength>]`
|
|
92
|
-
* the attestation digest hashes (request id, block height, output kind,
|
|
93
|
-
* output length, output)
|
|
94
|
-
*
|
|
95
|
-
* width enters the descriptor, so it is built per call.
|
|
107
|
+
* `[HashDomain, RequestId, Uint<64>, OutputKind, Uint<64>, Bytes<serializedOutputLength>]`
|
|
108
|
+
* the attestation digest hashes (domain tag, request id, block height, output kind,
|
|
109
|
+
* output length, output). The output width enters the descriptor, so it is
|
|
110
|
+
* built per call.
|
|
96
111
|
*
|
|
97
112
|
* @param serializedOutputLength - Declared width of the output element, in bytes.
|
|
98
113
|
* @returns The tuple descriptor for {@link calculateSignetAttestationDigest}.
|
|
99
114
|
*/
|
|
100
|
-
export declare function attestationPreimageDescriptor(serializedOutputLength: number): CompactType<[Uint8Array, bigint, number, bigint, Uint8Array]>;
|
|
115
|
+
export declare function attestationPreimageDescriptor(serializedOutputLength: number): CompactType<[number, Uint8Array, bigint, number, bigint, Uint8Array]>;
|
|
101
116
|
//# sourceMappingURL=compact-descriptors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compact-descriptors.d.ts","sourceRoot":"","sources":["../src/compact-descriptors.ts"],"names":[],"mappings":"AA4BA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAEhB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"compact-descriptors.d.ts","sourceRoot":"","sources":["../src/compact-desc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AgBjB;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAKtF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EACpB,KAAK,EAAE,SAAS,UAAU,EAAE,EAC5B,IAAI,EAAE,MAAM,GACX,CAAC,CASH;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAoBzE;AASD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,OAAO,EAAE,EAAE,QAAQ,EAAE;KACnE,CAAC,IAAI,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC,CAAC,CAAC,CAOjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAC3C,sBAAsB,EAAE,MAAM,GAC7B,WAAW,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CASvE"}
|
|
@@ -25,10 +25,16 @@
|
|
|
25
25
|
// (that package describes the `serialize<T, N>` wire format, a different
|
|
26
26
|
// layer). Package-internal: consumers use the reader/request functions built
|
|
27
27
|
// on top, never these directly.
|
|
28
|
-
import { CompactTypeBoolean, CompactTypeBytes, CompactTypeEnum, CompactTypeUnsignedInteger, } from "@midnight-ntwrk/compact-runtime";
|
|
28
|
+
import { CompactTypeBoolean, CompactTypeBytes, CompactTypeEnum, CompactTypeField, CompactTypeUnsignedInteger, } from "@midnight-ntwrk/compact-runtime";
|
|
29
29
|
// Runtime descriptors of the Compact base types, at the same literals the
|
|
30
30
|
// compiler emits.
|
|
31
|
-
/**
|
|
31
|
+
/** Protocol HashDomain enum, matching the Compact variant indices and byte width. */
|
|
32
|
+
export const HASH_DOMAIN = new CompactTypeEnum(5, 1);
|
|
33
|
+
/** `Boolean`. */
|
|
34
|
+
export const BOOLEAN = CompactTypeBoolean;
|
|
35
|
+
/** `Field`: the accumulator of the transaction digest folds. */
|
|
36
|
+
export const FIELD = CompactTypeField;
|
|
37
|
+
/** `Bytes<4>`. */
|
|
32
38
|
export const BYTES_4 = new CompactTypeBytes(4);
|
|
33
39
|
/** Descriptor of a Compact `Bytes<20>`. */
|
|
34
40
|
export const BYTES_20 = new CompactTypeBytes(20);
|
|
@@ -145,41 +151,38 @@ export function declaredWidths(cell, what) {
|
|
|
145
151
|
* variant to the Compact enum means raising the index here in lockstep.
|
|
146
152
|
*/
|
|
147
153
|
const OUTPUT_KIND = new CompactTypeEnum(2, 1);
|
|
154
|
+
/**
|
|
155
|
+
* Descriptor of a Compact tuple, composed the way the compiler composes one:
|
|
156
|
+
* the elements' alignments and values concatenated in order.
|
|
157
|
+
*
|
|
158
|
+
* @param elements - One descriptor per tuple element, in order.
|
|
159
|
+
* @returns The tuple's descriptor.
|
|
160
|
+
*/
|
|
161
|
+
export function compactTupleDescriptor(elements) {
|
|
162
|
+
return {
|
|
163
|
+
alignment: () => elements.flatMap((element) => element.alignment()),
|
|
164
|
+
toValue: (values) => elements.flatMap((element, index) => element.toValue(values[index])),
|
|
165
|
+
fromValue: (value) => elements.map((element) => element.fromValue(value)),
|
|
166
|
+
};
|
|
167
|
+
}
|
|
148
168
|
/**
|
|
149
169
|
* Descriptor of the Compact tuple
|
|
150
|
-
* `[RequestId, Uint<64>, OutputKind, Uint<64>, Bytes<serializedOutputLength>]`
|
|
151
|
-
* the attestation digest hashes (request id, block height, output kind,
|
|
152
|
-
* output length, output)
|
|
153
|
-
*
|
|
154
|
-
* width enters the descriptor, so it is built per call.
|
|
170
|
+
* `[HashDomain, RequestId, Uint<64>, OutputKind, Uint<64>, Bytes<serializedOutputLength>]`
|
|
171
|
+
* the attestation digest hashes (domain tag, request id, block height, output kind,
|
|
172
|
+
* output length, output). The output width enters the descriptor, so it is
|
|
173
|
+
* built per call.
|
|
155
174
|
*
|
|
156
175
|
* @param serializedOutputLength - Declared width of the output element, in bytes.
|
|
157
176
|
* @returns The tuple descriptor for {@link calculateSignetAttestationDigest}.
|
|
158
177
|
*/
|
|
159
178
|
export function attestationPreimageDescriptor(serializedOutputLength) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
],
|
|
169
|
-
toValue: ([requestId, blockHeight, outputKind, outputLength, serializedOutput]) => [
|
|
170
|
-
...BYTES_32.toValue(requestId),
|
|
171
|
-
...UINT_64.toValue(blockHeight),
|
|
172
|
-
...OUTPUT_KIND.toValue(outputKind),
|
|
173
|
-
...UINT_64.toValue(outputLength),
|
|
174
|
-
...output.toValue(serializedOutput),
|
|
175
|
-
],
|
|
176
|
-
fromValue: (value) => [
|
|
177
|
-
BYTES_32.fromValue(value),
|
|
178
|
-
UINT_64.fromValue(value),
|
|
179
|
-
OUTPUT_KIND.fromValue(value),
|
|
180
|
-
UINT_64.fromValue(value),
|
|
181
|
-
output.fromValue(value),
|
|
182
|
-
],
|
|
183
|
-
};
|
|
179
|
+
return compactTupleDescriptor([
|
|
180
|
+
HASH_DOMAIN,
|
|
181
|
+
BYTES_32,
|
|
182
|
+
UINT_64,
|
|
183
|
+
OUTPUT_KIND,
|
|
184
|
+
UINT_64,
|
|
185
|
+
new CompactTypeBytes(serializedOutputLength),
|
|
186
|
+
]);
|
|
184
187
|
}
|
|
185
188
|
//# sourceMappingURL=compact-descriptors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compact-descriptors.js","sourceRoot":"","sources":["../src/compact-descriptors.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,yEAAyE;AACzE,6EAA6E;AAC7E,0CAA0C;AAC1C,mFAAmF;AACnF,gFAAgF;AAChF,oFAAoF;AACpF,eAAe;AACf,uFAAuF;AACvF,2EAA2E;AAC3E,2EAA2E;AAC3E,4EAA4E;AAC5E,yEAAyE;AACzE,8BAA8B;AAC9B,2EAA2E;AAC3E,2EAA2E;AAC3E,yEAAyE;AACzE,0EAA0E;AAC1E,4CAA4C;AAC5C,EAAE;AACF,sEAAsE;AACtE,wBAAwB;AACxB,EAAE;AACF,0EAA0E;AAC1E,yEAAyE;AACzE,6EAA6E;AAC7E,gCAAgC;AAEhC,OAAO,EAGL,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,0BAA0B,GAC3B,MAAM,iCAAiC,CAAC;AAEzC,0EAA0E;AAC1E,kBAAkB;AAElB,
|
|
1
|
+
{"version":3,"file":"compact-descriptors.js","sourceRoot":"","sources":["../src/compact-descriptors.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,yEAAyE;AACzE,6EAA6E;AAC7E,0CAA0C;AAC1C,mFAAmF;AACnF,gFAAgF;AAChF,oFAAoF;AACpF,eAAe;AACf,uFAAuF;AACvF,2EAA2E;AAC3E,2EAA2E;AAC3E,4EAA4E;AAC5E,yEAAyE;AACzE,8BAA8B;AAC9B,2EAA2E;AAC3E,2EAA2E;AAC3E,yEAAyE;AACzE,0EAA0E;AAC1E,4CAA4C;AAC5C,EAAE;AACF,sEAAsE;AACtE,wBAAwB;AACxB,EAAE;AACF,0EAA0E;AAC1E,yEAAyE;AACzE,6EAA6E;AAC7E,gCAAgC;AAEhC,OAAO,EAGL,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,iCAAiC,CAAC;AAEzC,0EAA0E;AAC1E,kBAAkB;AAElB,qFAAqF;AACrF,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAErD,iBAAiB;AACjB,M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AE9C;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAsB,QAE3D;IACC,OAAO;QACL,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QACnE,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAClB,QAAQ,CAAC,OAAO,CAAC,CAAC,OAA6B,EAAE,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC5F,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAM;KAC/E,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,6BAA6B,CAC3C,sBAA8B;IAE9B,OAAO,sBAAsB,CAA2D;QACtF,WAAW;QACX,QAAQ;QACR,OAAO;QACP,WAAW;QACX,OAAO;QACP,IAAI,gBAAgB,CAAC,sBAAsB,CAAC;KAC7C,CAAC,CAAC;AACL,CAAC"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const MPC_PARAMS_BYTES = 64;
|
|
|
6
6
|
export declare const SELECTOR_BYTES = 4;
|
|
7
7
|
/**
|
|
8
8
|
* Default MPC key version (`keyVersion` field value). The canonical MPC
|
|
9
|
-
* (and `
|
|
9
|
+
* (and `constructSignBidirectionalEventV1`) requires `keyVersion >= 1`.
|
|
10
10
|
*/
|
|
11
11
|
export declare const SIGNET_DEFAULT_KEY_VERSION = 1n;
|
|
12
12
|
/**
|
package/dist/constants.js
CHANGED
|
@@ -14,7 +14,7 @@ export const MPC_PARAMS_BYTES = 64;
|
|
|
14
14
|
export const SELECTOR_BYTES = 4;
|
|
15
15
|
/**
|
|
16
16
|
* Default MPC key version (`keyVersion` field value). The canonical MPC
|
|
17
|
-
* (and `
|
|
17
|
+
* (and `constructSignBidirectionalEventV1`) requires `keyVersion >= 1`.
|
|
18
18
|
*/
|
|
19
19
|
export const SIGNET_DEFAULT_KEY_VERSION = 1n;
|
|
20
20
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Secp256k1Point } from "@midnight-ntwrk/compact-runtime";
|
|
2
2
|
import { secp256k1 } from "@noble/curves/secp256k1.js";
|
|
3
3
|
import { Signature } from "ethers";
|
|
4
|
-
import type
|
|
4
|
+
import { type OutputKind } from "./managed/contract/index.js";
|
|
5
5
|
import type { MpcSignature, RespondBidirectionalEvent, SignatureRespondedEvent } from "./signet-contract-events.ts";
|
|
6
6
|
import type { RequestId } from "./signet-requests.ts";
|
|
7
7
|
export type { Secp256k1Point } from "@midnight-ntwrk/compact-runtime";
|
|
@@ -17,7 +17,7 @@ export interface EcdsaSignature {
|
|
|
17
17
|
r: bigint;
|
|
18
18
|
/** Signature scalar s (low-s normalised by the signer). */
|
|
19
19
|
s: bigint;
|
|
20
|
-
/** Recovery
|
|
20
|
+
/** Recovery flag matching the supplied signature scalar: 0 or 1. */
|
|
21
21
|
recoveryId: number;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
@@ -134,9 +134,9 @@ export declare function normaliseSecp256k1PublicKey(value: string): string;
|
|
|
134
134
|
export declare function secp256k1PublicKeyOf(secretKey: Uint8Array): Secp256k1Point;
|
|
135
135
|
/**
|
|
136
136
|
* The attestation digest of a respond-bidirectional response:
|
|
137
|
-
* `upgradeFromTransient(transientHash([requestId, blockHeight, outputKind, outputLength, serializedOutput]))`,
|
|
137
|
+
* `upgradeFromTransient(transientHash([HashDomain.attestationDigest, requestId, blockHeight, outputKind, outputLength, serializedOutput]))`,
|
|
138
138
|
* the 32-byte digest the MPC ECDSA-signs to attest a remote execution. TS
|
|
139
|
-
* twin of the size-generic Compact circuit
|
|
139
|
+
* twin of the size-generic Compact circuit `calculateSignetAttestationDigestV1`.
|
|
140
140
|
*
|
|
141
141
|
* @param requestId - The 32-byte request id the response answers.
|
|
142
142
|
* @param blockHeight - Height of the finalised destination block holding the
|
|
@@ -174,7 +174,7 @@ export declare function attestRespondBidirectional(attestation: RespondBidirecti
|
|
|
174
174
|
* Produce the circuit-input form of a posted respond-bidirectional
|
|
175
175
|
* attestation: `signature.bigR.x` and `signature.s` byte-reversed into
|
|
176
176
|
* little-endian, everything else verbatim. The in-circuit
|
|
177
|
-
* `
|
|
177
|
+
* `verifyRespondBidirectionalEventV1` reads those two scalars through
|
|
178
178
|
* little-endian casts (the reversal is free off-chain and costly
|
|
179
179
|
* in-circuit), while the wire and ledger records stay big-endian: pass every
|
|
180
180
|
* event through this exactly once, at the circuit call. A record passed
|
|
@@ -186,7 +186,7 @@ export declare function attestRespondBidirectional(attestation: RespondBidirecti
|
|
|
186
186
|
*/
|
|
187
187
|
export declare function respondBidirectionalEventToCircuitInput(event: RespondBidirectionalEvent): RespondBidirectionalEvent;
|
|
188
188
|
/**
|
|
189
|
-
* Off-chain twin of the in-circuit `
|
|
189
|
+
* Off-chain twin of the in-circuit `verifyRespondBidirectionalEventV1`: checks
|
|
190
190
|
* a posted respond-bidirectional attestation against the execution output
|
|
191
191
|
* and the contract's pinned MPC response key, over the request id, block
|
|
192
192
|
* height and output kind the post declares. Clients run it to sift candidate posts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ecdsa-attestation.d.ts","sourceRoot":"","sources":["../src/ecdsa-attestation.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,KAAK,cAAc,EAGpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAgB,SAAS,EAAW,MAAM,QAAQ,CAAC;AAI1D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ecdsa-attestation.d.ts","sourceRoot":"","sources":["../src/ecdsa-attestation.ts"],"names":[],"mappings":"AAeA,OAAO,E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@@ -3,7 +3,7 @@
|
|
|
3
3
|
// parsing/formatting, the signature-record codecs both respond events
|
|
4
4
|
// share, and the attestation digest's TS twin.
|
|
5
5
|
// Everything provable stays in Compact where possible: in-circuit
|
|
6
|
-
// verification is `
|
|
6
|
+
// verification is `verifyRespondBidirectionalEventV1`. The digest circuit is
|
|
7
7
|
// size-generic and the compiler cannot export size-generic circuits
|
|
8
8
|
// top-level, so the digest is
|
|
9
9
|
// the ONE sanctioned TS twin here, pinned byte-for-byte against the
|
|
@@ -17,6 +17,7 @@ import { secp256k1 } from "@noble/curves/secp256k1.js";
|
|
|
17
17
|
import { decodeBase58, Signature, toBeHex } from "ethers";
|
|
18
18
|
import { bigintToBytes32BE, bytesToBigintBE, stripHexPrefix } from "./byte-codecs.js";
|
|
19
19
|
import { attestationPreimageDescriptor } from "./compact-descriptors.js";
|
|
20
|
+
import { HashDomain } from "./managed/contract/index.js";
|
|
20
21
|
/** secp256k1 curve (group) order n. */
|
|
21
22
|
export const SECP256K1_ORDER = secp256k1.Point.Fn.ORDER;
|
|
22
23
|
/**
|
|
@@ -270,9 +271,9 @@ export function secp256k1PublicKeyOf(secretKey) {
|
|
|
270
271
|
}
|
|
271
272
|
/**
|
|
272
273
|
* The attestation digest of a respond-bidirectional response:
|
|
273
|
-
* `upgradeFromTransient(transientHash([requestId, blockHeight, outputKind, outputLength, serializedOutput]))`,
|
|
274
|
+
* `upgradeFromTransient(transientHash([HashDomain.attestationDigest, requestId, blockHeight, outputKind, outputLength, serializedOutput]))`,
|
|
274
275
|
* the 32-byte digest the MPC ECDSA-signs to attest a remote execution. TS
|
|
275
|
-
* twin of the size-generic Compact circuit
|
|
276
|
+
* twin of the size-generic Compact circuit `calculateSignetAttestationDigestV1`.
|
|
276
277
|
*
|
|
277
278
|
* @param requestId - The 32-byte request id the response answers.
|
|
278
279
|
* @param blockHeight - Height of the finalised destination block holding the
|
|
@@ -283,6 +284,7 @@ export function secp256k1PublicKeyOf(secretKey) {
|
|
|
283
284
|
*/
|
|
284
285
|
export function calculateSignetAttestationDigest(requestId, blockHeight, outputKind, serializedOutput) {
|
|
285
286
|
return upgradeFromTransient(transientHash(attestationPreimageDescriptor(serializedOutput.length), [
|
|
287
|
+
HashDomain.attestationDigest,
|
|
286
288
|
requestId,
|
|
287
289
|
blockHeight,
|
|
288
290
|
outputKind,
|
|
@@ -331,7 +333,7 @@ function reverseBytes32(bytes) {
|
|
|
331
333
|
* Produce the circuit-input form of a posted respond-bidirectional
|
|
332
334
|
* attestation: `signature.bigR.x` and `signature.s` byte-reversed into
|
|
333
335
|
* little-endian, everything else verbatim. The in-circuit
|
|
334
|
-
* `
|
|
336
|
+
* `verifyRespondBidirectionalEventV1` reads those two scalars through
|
|
335
337
|
* little-endian casts (the reversal is free off-chain and costly
|
|
336
338
|
* in-circuit), while the wire and ledger records stay big-endian: pass every
|
|
337
339
|
* event through this exactly once, at the circuit call. A record passed
|
|
@@ -352,7 +354,7 @@ export function respondBidirectionalEventToCircuitInput(event) {
|
|
|
352
354
|
};
|
|
353
355
|
}
|
|
354
356
|
/**
|
|
355
|
-
* Off-chain twin of the in-circuit `
|
|
357
|
+
* Off-chain twin of the in-circuit `verifyRespondBidirectionalEventV1`: checks
|
|
356
358
|
* a posted respond-bidirectional attestation against the execution output
|
|
357
359
|
* and the contract's pinned MPC response key, over the request id, block
|
|
358
360
|
* height and output kind the post declares. Clients run it to sift candidate posts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ecdsa-attestation.js","sourceRoot":"","sources":["../src/ecdsa-attestation.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,0EAA0E;AAC1E,sEAAsE;AACtE,+CAA+C;AAC/C,kEAAkE;AAClE,
|
|
1
|
+
{"version":3,"file":"ecdsa-attestation.js","sourceRoot":"","sources":["../src/ecdsa-attestation.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,0EAA0E;AAC1E,sEAAsE;AACtE,+CAA+C;AAC/C,kEAAkE;AACl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AAC;IAC5D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,MAAM,GAAG,gCAAgC,CAC7C,KAAK,CAAC,SAAS,EACf,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,UAAU,EAChB,gBAAgB,CACjB,CAAC;IACF,qEAAqE;IACrE,sCAAsC;IACtC,MAAM,gBAAgB,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IAC5C,gBAAgB,CAAC,GAAG,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxD,gBAAgB,CAAC,GAAG,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACzD,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IACrC,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IACpB,SAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACtD,SAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACvD,IAAI,CAAC;QACH,OAAO,SAAS,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE;YAC3D,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,KAAK;SACZ,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,15 +8,15 @@ export * from "./signature-requests-state-reader.ts";
|
|
|
8
8
|
export * from "./signature-response-verification.ts";
|
|
9
9
|
export * from "./signet-contract-events.ts";
|
|
10
10
|
export { decodeEvmType2SignBidirectionalEvent } from "./signet-evtype2tx-record-decoding.ts";
|
|
11
|
-
export { abiWordToBool, abiWordToUint128, assembleCalldata, boolAbiWord, type EvmAccessListEntry, evmAddressAbiWord, type EvmCalldata, type EvmType2TxParams, numericAbiWord, signBidirectionalEventToSignedEvmTransaction, signBidirectionalEventToUnsignedEvmTransaction, } from "./signet-evtype2tx-requests.ts";
|
|
11
|
+
export { abiWordToBool, abiWordToUint128, assembleCalldata, boolAbiWord, calculateEvmType2TxParamsDigest, type EvmAccessListEntry, evmAddressAbiWord, type EvmCalldata, type EvmType2TxParams, numericAbiWord, signBidirectionalEventToSignedEvmTransaction, signBidirectionalEventToUnsignedEvmTransaction, } from "./signet-evtype2tx-requests.ts";
|
|
12
12
|
export { calculateRequestId } from "./signet-request-id.ts";
|
|
13
13
|
export * from "./signet-request-response-reader.ts";
|
|
14
14
|
export { type ContractAddress, contractAddressFromHex, type Maybe, MPCDestination, MPCSignatureAlgorithm, parseRequestIdHex, PATH_BYTES, type RequestId, requestIdBytes, type RequestIdHex, requestIdHex, type RequestIdPreimage, type SignBidirectionalEvent, type SignBidirectionalEventIndex, type SignBidirectionalEventLedgerMap, toSignBidirectionalEventIndex, TxParamType, } from "./signet-requests.ts";
|
|
15
15
|
export { formatSecp256k1PublicKey, normaliseSecp256k1PublicKey, parseSecp256k1PublicKey, respondBidirectionalEventToCircuitInput, SECP256K1_ORDER, type Secp256k1Point, signatureRespondedEventToSignature, verifyRespondBidirectionalSignature, } from "./ecdsa-attestation.ts";
|
|
16
16
|
/**
|
|
17
|
-
* Compiled pure circuits of Signet.compact
|
|
17
|
+
* Compiled pure circuits and protocol enums of Signet.compact (run
|
|
18
18
|
* `yarn compile` first). Off-chain code MUST use these instead of re-porting
|
|
19
19
|
* the algorithms: they are the same compiled logic the contracts prove.
|
|
20
20
|
*/
|
|
21
|
-
export { OutputKind, type PureCircuits, pureCircuits } from "./managed/contract/index.js";
|
|
21
|
+
export { HashDomain, OutputKind, type PureCircuits, pureCircuits, } from "./managed/contract/index.js";
|
|
22
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,eAAe,EACf,UAAU,EACV,UAAU,EACV,cAAc,GACf,MAAM,kBAAkB,CAAC;AAI1B,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,+BAA+B,EAC/B,yBAAyB,EACzB,4CAA4C,EAC5C,sCAAsC,EACtC,yBAAyB,EACzB,iBAAiB,EACjB,mCAAmC,EACnC,KAAK,iCAAiC,GACvC,MAAM,yBAAyB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,KAAK,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACvF,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,oCAAoC,EAAE,MAAM,uCAAuC,CAAC;AAC7F,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,cAAc,EACd,4CAA4C,EAC5C,8CAA8C,GAC/C,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,cAAc,qCAAqC,CAAC;AACpD,OAAO,EACL,KAAK,eAAe,EACpB,sBAAsB,EACtB,KAAK,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,UAAU,EACV,KAAK,SAAS,EACd,cAAc,EACd,KAAK,YAAY,EACjB,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,2BAA2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CAAC;AACpD,OAAO,EACL,KAAK,eAAe,EACpB,sBAAsB,EACtB,KAAK,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,UAAU,EACV,KAAK,SAAS,EACd,cAAc,EACd,KAAK,YAAY,EACjB,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,+BAA+B,EACpC,6BAA6B,EAC7B,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,uBAAuB,EACvB,uCAAuC,EACvC,eAAe,EACf,KAAK,cAAc,EACnB,kCAAkC,EAClC,mCAAmC,GACpC,MAAM,wBAAwB,CAAC;AAEhC;;;;GAIG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,KAAK,YAAY,EACjB,YAAY,GACb,MAAM,6BAA6B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ export * from "./signature-requests-state-reader.js";
|
|
|
16
16
|
export * from "./signature-response-verification.js";
|
|
17
17
|
export * from "./signet-contract-events.js";
|
|
18
18
|
export { decodeEvmType2SignBidirectionalEvent } from "./signet-evtype2tx-record-decoding.js";
|
|
19
|
-
export { abiWordToBool, abiWordToUint128, assembleCalldata, boolAbiWord, evmAddressAbiWord, numericAbiWord, signBidirectionalEventToSignedEvmTransaction, signBidirectionalEventToUnsignedEvmTransaction, } from "./signet-evtype2tx-requests.js";
|
|
19
|
+
export { abiWordToBool, abiWordToUint128, assembleCalldata, boolAbiWord, calculateEvmType2TxParamsDigest, evmAddressAbiWord, numericAbiWord, signBidirectionalEventToSignedEvmTransaction, signBidirectionalEventToUnsignedEvmTransaction, } from "./signet-evtype2tx-requests.js";
|
|
20
20
|
export { calculateRequestId } from "./signet-request-id.js";
|
|
21
21
|
export * from "./signet-request-response-reader.js";
|
|
22
22
|
export { contractAddressFromHex, MPCDestination, MPCSignatureAlgorithm, parseRequestIdHex, PATH_BYTES, requestIdBytes, requestIdHex, toSignBidirectionalEventIndex, TxParamType, } from "./signet-requests.js";
|
|
@@ -26,9 +26,9 @@ export { contractAddressFromHex, MPCDestination, MPCSignatureAlgorithm, parseReq
|
|
|
26
26
|
// (parseSecp256k1PublicKeyToNoblePoint) are package-internal.
|
|
27
27
|
export { formatSecp256k1PublicKey, normaliseSecp256k1PublicKey, parseSecp256k1PublicKey, respondBidirectionalEventToCircuitInput, SECP256K1_ORDER, signatureRespondedEventToSignature, verifyRespondBidirectionalSignature, } from "./ecdsa-attestation.js";
|
|
28
28
|
/**
|
|
29
|
-
* Compiled pure circuits of Signet.compact
|
|
29
|
+
* Compiled pure circuits and protocol enums of Signet.compact (run
|
|
30
30
|
* `yarn compile` first). Off-chain code MUST use these instead of re-porting
|
|
31
31
|
* the algorithms: they are the same compiled logic the contracts prove.
|
|
32
32
|
*/
|
|
33
|
-
export { OutputKind, pureCircuits } from "./managed/contract/index.js";
|
|
33
|
+
export { HashDomain, OutputKind, pureCircuits, } from "./managed/contract/index.js";
|
|
34
34
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,sEAAsE;AACtE,wEAAwE;AAExE,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,eAAe,EACf,UAAU,EACV,UAAU,EACV,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,uEAAuE;AACvE,4EAA4E;AAC5E,4EAA4E;AAC5E,cAAc,gBAAgB,CAAC;AAC/B,2EAA2E;AAC3E,yEAAyE;AACzE,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,+BAA+B,EAC/B,yBAAyB,EACzB,4CAA4C,EAC5C,sCAAsC,EACtC,yBAAyB,EACzB,iBAAiB,EACjB,mCA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