@sig-net/midnight 0.24.0-rc.9 → 0.24.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.
Files changed (44) hide show
  1. package/README.md +6 -6
  2. package/dist/abi-serde.d.ts +27 -11
  3. package/dist/abi-serde.d.ts.map +1 -1
  4. package/dist/abi-serde.js +156 -54
  5. package/dist/abi-serde.js.map +1 -1
  6. package/dist/compact-descriptors.js +1 -1
  7. package/dist/compact-descriptors.js.map +1 -1
  8. package/dist/constants.d.ts +2 -2
  9. package/dist/constants.js +3 -3
  10. package/dist/ecdsa-attestation.d.ts +8 -3
  11. package/dist/ecdsa-attestation.d.ts.map +1 -1
  12. package/dist/ecdsa-attestation.js +3 -2
  13. package/dist/ecdsa-attestation.js.map +1 -1
  14. package/dist/epsilon-derivation.d.ts +9 -7
  15. package/dist/epsilon-derivation.d.ts.map +1 -1
  16. package/dist/epsilon-derivation.js +6 -5
  17. package/dist/epsilon-derivation.js.map +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/managed/compiler/contract-manifest.json +2 -2
  20. package/dist/managed/contract/index.js +27 -27
  21. package/dist/managed/contract/index.js.map +1 -1
  22. package/dist/mpc-output-cache.d.ts +7 -5
  23. package/dist/mpc-output-cache.d.ts.map +1 -1
  24. package/dist/mpc-output-cache.js +5 -4
  25. package/dist/mpc-output-cache.js.map +1 -1
  26. package/dist/signet-contract-events.d.ts +16 -4
  27. package/dist/signet-contract-events.d.ts.map +1 -1
  28. package/dist/signet-contract-events.js +12 -7
  29. package/dist/signet-contract-events.js.map +1 -1
  30. package/dist/signet-evtype2tx-requests.d.ts +3 -5
  31. package/dist/signet-evtype2tx-requests.d.ts.map +1 -1
  32. package/dist/signet-evtype2tx-requests.js +2 -4
  33. package/dist/signet-evtype2tx-requests.js.map +1 -1
  34. package/dist/signet-request-response-reader.d.ts +8 -0
  35. package/dist/signet-request-response-reader.d.ts.map +1 -1
  36. package/dist/signet-request-response-reader.js +3 -1
  37. package/dist/signet-request-response-reader.js.map +1 -1
  38. package/dist/signet-requests.d.ts +5 -4
  39. package/dist/signet-requests.d.ts.map +1 -1
  40. package/dist/signet-requests.js.map +1 -1
  41. package/dist/testing.js +1 -1
  42. package/dist/testing.js.map +1 -1
  43. package/package.json +2 -2
  44. package/src/Signet.compact +32 -25
package/README.md CHANGED
@@ -78,12 +78,12 @@ What clients import from `@sig-net/midnight`:
78
78
  | Convert a foreign execution output into respond bytes | `deserializeEvmOutput` (raw EVM return data to named values) and `serializeRespondOutput` (named values to the attested Borsh bytes): the two conversions `executedEvmRespondOutput` runs on a contract call's return data. |
79
79
  | Know what an output schema attests to | `deriveRespondSchema` (the Borsh struct the MPC serialises with), `respondOutputWidth` (the `Bytes<N>` width a settle circuit declares) and `unsupportedEvmOutputFields` (the fields that make the MPC drop a request, without throwing). |
80
80
  | 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)). |
81
- | 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. |
81
+ | 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 in the cache (not written yet, or never written, since the cache is optional). |
82
82
  | 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. |
83
83
  | Verify attestations without the reader | `verifyRespondBidirectionalSignature`: the check the reader runs internally, exposed for custom pipelines. |
84
84
  | Mint attestations in your contract's unit tests | The `@sig-net/midnight/testing` entry point, see [Testing entry point](#testing-entry-point). |
85
85
  | 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. |
86
- | Call the compiled protocol circuits | `pureCircuits`: the compiled circuits of `Signet.compact`, for example the notification packer. Off-chain code calls these compiled artefacts, so it always agrees with what the contracts prove. |
86
+ | Call the compiled protocol circuits | `pureCircuits`: the compiled pure circuits of `circuits.compact`: the non-generic circuits of `Signet.compact` under their own names, for example the notification packer, and fixed-size instances of the generic ones with the sizes in the name, for example `calculateEvmType2RequestIdV1_1_0_0_34`. Off-chain code calls these compiled artefacts, so it always agrees with what the contracts prove. |
87
87
 
88
88
  ### Testing entry point
89
89
 
@@ -135,7 +135,7 @@ are reserved and remain outside the request id.
135
135
 
136
136
  ## EVM output and Borsh responses
137
137
 
138
- `outputDeserializationSchema` is an ethers-compatible ABI field array, and it is the only schema a request carries: `respondSerializationSchema` is reserved, pinned to `Bytes<0>` by `constructSignBidirectionalEventV1`. The MPC derives the Borsh schema of the attested bytes from the output schema, one struct member per field in schema order, under a closed mapping:
138
+ `outputDeserializationSchema` is an ethers-compatible ABI field array whose field names are unique Solidity identifiers (`[A-Za-z_$][A-Za-z0-9_$]*`, never `__proto__`) and whose types are ABI type strings `ethers.ParamType` accepts, matched literally against the table below (`uint256`, never `uint`). Its on-chain bytes are canonical: `canonicalSchemaText(fields)` (`JSON.stringify` of `{name, type}` per field in order, no whitespace, which is the [RFC 8785](https://www.rfc-editor.org/rfc/rfc8785) encoding of those objects) followed by NUL padding only, with `[]` or an all-NUL field for the empty schema. Every reader in this module refuses text or bytes in any other form. It is the only schema a request carries: `respondSerializationSchema` is reserved, pinned to `Bytes<0>` by `constructSignBidirectionalEventV1`. The MPC derives the Borsh schema of the attested bytes from the output schema, one struct member per field in schema order, under a closed mapping:
139
139
 
140
140
  | ABI type | Borsh | Compact | Width |
141
141
  | --- | --- | --- | --- |
@@ -144,8 +144,8 @@ are reserved and remain outside the request id.
144
144
  | `address` | `[u8; 20]` | `Bytes<20>` | 20 |
145
145
  | `bytes1` to `bytes32` | `[u8; N]` | `Bytes<N>` | N |
146
146
 
147
- Every other ABI type is unsupported. `unsupportedEvmOutputFields` names the offending fields without throwing (the MPC drops such a request), and `deriveRespondSchema`, `respondOutputWidth` and `serializeRespondOutput` throw on them. For example, `[{"name":"success","type":"bool"},{"name":"amount","type":"uint256"}]` derives `{"struct":{"success":"bool","amount":{"array":{"type":"u8","len":32}}}}`, 33 bytes.
147
+ Every other ABI type is unsupported. `unsupportedEvmOutputFields` names the offending fields without throwing on them (the MPC drops such a request), though it throws on a malformed schema or a type string that is not an ABI type, and `deriveRespondSchema`, `respondOutputWidth` and `serializeRespondOutput` throw on them. For example, `[{"name":"success","type":"bool"},{"name":"amount","type":"uint256"}]` derives `{"struct":{"success":"bool","amount":{"array":{"type":"u8","len":32}}}}`, 33 bytes.
148
148
 
149
- `serializeRespondOutput` converts the decoded values (ethers' bigint, boolean and hex forms, plus plain numbers and decimal strings for `uint256`) into that struct and calls `@sig-net/midnight-serde`. A `uint256` is carried whole as 32 little-endian bytes, the byte order of every Borsh and Compact integer and the ABI wire word reversed: nothing is narrowed off chain, and a value outside `0 <= v < 2^256` is rejected. `executedEvmRespondOutput` requires the output schema and the return data to agree: an empty schema with no return data (a plain transfer, or a call that returned nothing) attests an EMPTY output, a non-empty schema with return data runs the two conversions, and either mismatch throws. The schema's types are checked on every path, a plain transfer included.
149
+ `serializeRespondOutput` converts the decoded values (ethers' bigint, boolean and hex forms, plus plain numbers and decimal strings for `uint256`) into that struct and calls `@sig-net/midnight-serde`. A `uint256` is carried whole as 32 little-endian bytes, the byte order of every Borsh and Compact integer and the ABI wire word reversed: nothing is narrowed off chain, and a value outside `0 <= v < 2^256` is rejected. `executedEvmRespondOutput` requires the output schema and the return data to agree: an empty schema with no return data (a plain transfer, or a call that returned nothing) attests an EMPTY output, a non-empty schema with return data runs the two conversions, and either mismatch throws. The return data must be canonical ABI (whole words, a `bool` word of 0 or 1, zero high bytes on an `address`, zero padding after a `bytesN`), checked before the lenient ABI decode. Words past the declared fields are ignored. The schema's types are checked on every path, a plain transfer included.
150
150
 
151
- Output schema JSON accepts text or UTF-8 bytes and trims NUL padding in either form. Blank text is the empty schema, and malformed JSON fails with schema context.
151
+ Output schema JSON accepts text or UTF-8 bytes and trims NUL padding in either form. Empty text is the empty schema, and malformed JSON fails with schema context.
@@ -1,10 +1,10 @@
1
1
  import { type Schema } from "@sig-net/midnight-serde";
2
2
  import { ethers } from "ethers";
3
3
  /**
4
- * One field of an outputDeserializationSchema: `type` is ANY type string the
5
- * ABI library accepts. {@link deserializeEvmOutput} decodes every ABI type,
6
- * while the respond side ({@link deriveRespondSchema}) accepts only the
7
- * {@link EvmOutputTypeKind} subset.
4
+ * One field of an outputDeserializationSchema: `type` is an ABI type string
5
+ * `ethers.ParamType` accepts. {@link deserializeEvmOutput} decodes every
6
+ * such type, while the respond side ({@link deriveRespondSchema}) accepts
7
+ * only the {@link EvmOutputTypeKind} subset, matched on the raw string.
8
8
  */
9
9
  export interface EvmSchemaField {
10
10
  name: string;
@@ -66,19 +66,23 @@ export declare enum EvmOutputTypeKind {
66
66
  /**
67
67
  * The fields of an outputDeserializationSchema whose ABI type is outside the
68
68
  * supported subset ({@link EvmOutputTypeKind}). The check itself never
69
- * throws on an unsupported type: an empty result means the MPC attests the
70
- * request, a non-empty one means it drops it.
69
+ * throws on an unsupported type: an empty result means the output types do
70
+ * not stop the MPC from admitting the request, a non-empty one means it drops it.
71
71
  *
72
72
  * @param schema - The outputDeserializationSchema: parsed, JSON text, or the raw NUL-padded on-chain bytes.
73
73
  * @returns The unsupported fields in schema order, empty when every field is supported.
74
- * @throws {Error} If the schema is not an array of uniquely named fields (its shape, not its types).
74
+ * @throws {Error} If the schema is malformed: text or bytes not in canonical form, a
75
+ * field name that is not a unique Solidity identifier (or is `__proto__`), or a
76
+ * type that is not a valid ABI type string.
75
77
  */
76
78
  export declare function unsupportedEvmOutputFields(schema: EvmSchemaInput): EvmSchemaField[];
77
79
  /**
78
80
  * The Borsh schema the respond bytes of an executed call are serialised
79
81
  * with: a struct with one member per output field, in schema order, each
80
82
  * typed by {@link EvmOutputTypeKind}. An empty output schema derives an
81
- * empty struct, which serialises to zero bytes.
83
+ * empty struct, which serialises to zero bytes. Borsh writes struct members
84
+ * in the struct object's key order, which equals schema order because field
85
+ * names are Solidity identifiers (see {@link parseSchemaShape}).
82
86
  *
83
87
  * @param schema - The outputDeserializationSchema: parsed, JSON text, or the raw NUL-padded on-chain bytes.
84
88
  * @returns The derived Borsh struct schema.
@@ -146,12 +150,12 @@ export declare enum EvmTraceOutputKind {
146
150
  * reads it off a frame.
147
151
  */
148
152
  export type EvmTraceOutput = {
149
- /** The frame carried an `output` field. */
153
+ /** The frame carried a string `output` field. */
150
154
  readonly kind: EvmTraceOutputKind.Output;
151
155
  /** The frame's `output`: the ABI-encoded return data (hex string or bytes). */
152
156
  readonly returnData: ethers.BytesLike;
153
157
  } | {
154
- /** The frame carried no `output` field. */
158
+ /** The frame carried no string `output` field. */
155
159
  readonly kind: EvmTraceOutputKind.NoReturnData;
156
160
  } | {
157
161
  /** No trace was taken. */
@@ -186,7 +190,8 @@ export type EvmTraceOutput = {
186
190
  * @throws {Error} Exactly where the MPC refuses to attest an execution: a
187
191
  * malformed schema or an unsupported output type, a contract call not
188
192
  * traced, return data under an empty schema, no or empty return data
189
- * under a non-empty schema, return data the schema cannot decode, and
193
+ * under a non-empty schema, return data that is not canonical ABI
194
+ * ({@link checkCanonicalReturnData}) or that the schema cannot decode, and
190
195
  * every {@link serializeRespondOutput} rejection.
191
196
  */
192
197
  export declare function executedEvmRespondOutput(schema: EvmSchemaInput, isContractCall: boolean, trace: EvmTraceOutput): Uint8Array;
@@ -215,4 +220,15 @@ export type JsonValue = null | boolean | number | string | readonly JsonValue[]
215
220
  * `error`, or carries an `output` that is not even-length hex.
216
221
  */
217
222
  export declare function evmTraceOutputFromCallFrame(frame: JsonValue): EvmTraceOutput;
223
+ /**
224
+ * The canonical text of an output schema: `JSON.stringify` of its fields
225
+ * reduced to `{name, type}` in schema order, with no whitespace. A schema's
226
+ * on-chain bytes must be exactly this text followed by NUL padding, so one
227
+ * schema has exactly one byte form. Write a contract's schema literal with
228
+ * this function's output.
229
+ *
230
+ * @param fields - The schema's fields in order.
231
+ * @returns The canonical JSON text, `[]` for an empty schema.
232
+ */
233
+ export declare function canonicalSchemaText(fields: readonly EvmSchemaField[]): string;
218
234
  //# sourceMappingURL=abi-serde.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"abi-serde.d.ts","sourceRoot":"","sources":["../src/abi-serde.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAMhC;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,sGAAsG;AACtG,MAAM,MAAM,cAAc,GAAG,SAAS,cAAc,EAAE,GAAG,MAAM,GAAG,UAAU,CAAC;AAM7E;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,eAAe,EAAE,CAAC;AAElG,sFAAsF;AACtF,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAM/D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,cAAc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ACpB,UAAU,CAiCZ;AAED,4BAA4B;AAC5B,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC;AAED,+DAA+D;AAC/D,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,SAAS,EAAE,GAAG,UAAU,CAAC;AAyB7F;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,SAAS,GAAG,cAAc,CA2B5E;AA8BD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,GAAG,MAAM,CAE7E"}
package/dist/abi-serde.js CHANGED
@@ -23,11 +23,10 @@ export function deserializeEvmOutput(schema, callResult) {
23
23
  return {};
24
24
  }
25
25
  const decoded = ethers.AbiCoder.defaultAbiCoder().decode(fields.map((field) => field.type), callResult);
26
- const output = {};
27
- fields.forEach((field, i) => {
28
- output[field.name] = toPlainValue(decoded[i], field.name);
29
- });
30
- return output;
26
+ return Object.fromEntries(fields.map((field, i) => [
27
+ field.name,
28
+ toPlainValue(decoded[i], field.name),
29
+ ]));
31
30
  }
32
31
  // ---------------------------------------------------------------------------
33
32
  // 2. decoded values -> respond bytes (Borsh schema derived from the output schema)
@@ -64,7 +63,9 @@ const ABI_WORD_BYTES = 32;
64
63
  /** The byte width of an EVM address, and of the Borsh array an `address` output maps to. */
65
64
  const EVM_ADDRESS_BYTES = 20;
66
65
  /**
67
- * Classify an ABI type string into the supported output subset.
66
+ * Classify an ABI type string into the supported output subset. The match is
67
+ * on the raw string, so `uint` is unsupported although the ABI library reads
68
+ * it as `uint256`: the MPC matches the same raw string.
68
69
  *
69
70
  * @param type - The ABI type string of an output schema field.
70
71
  * @returns The field's kind and respond byte width, or `undefined` for an unsupported type.
@@ -85,12 +86,14 @@ function classifyEvmOutputType(type) {
85
86
  /**
86
87
  * The fields of an outputDeserializationSchema whose ABI type is outside the
87
88
  * supported subset ({@link EvmOutputTypeKind}). The check itself never
88
- * throws on an unsupported type: an empty result means the MPC attests the
89
- * request, a non-empty one means it drops it.
89
+ * throws on an unsupported type: an empty result means the output types do
90
+ * not stop the MPC from admitting the request, a non-empty one means it drops it.
90
91
  *
91
92
  * @param schema - The outputDeserializationSchema: parsed, JSON text, or the raw NUL-padded on-chain bytes.
92
93
  * @returns The unsupported fields in schema order, empty when every field is supported.
93
- * @throws {Error} If the schema is not an array of uniquely named fields (its shape, not its types).
94
+ * @throws {Error} If the schema is malformed: text or bytes not in canonical form, a
95
+ * field name that is not a unique Solidity identifier (or is `__proto__`), or a
96
+ * type that is not a valid ABI type string.
94
97
  */
95
98
  export function unsupportedEvmOutputFields(schema) {
96
99
  return parseSchemaShape(schema).filter((field) => classifyEvmOutputType(field.type) === undefined);
@@ -120,7 +123,9 @@ function classifiedEvmOutputFields(schema) {
120
123
  * The Borsh schema the respond bytes of an executed call are serialised
121
124
  * with: a struct with one member per output field, in schema order, each
122
125
  * typed by {@link EvmOutputTypeKind}. An empty output schema derives an
123
- * empty struct, which serialises to zero bytes.
126
+ * empty struct, which serialises to zero bytes. Borsh writes struct members
127
+ * in the struct object's key order, which equals schema order because field
128
+ * names are Solidity identifiers (see {@link parseSchemaShape}).
124
129
  *
125
130
  * @param schema - The outputDeserializationSchema: parsed, JSON text, or the raw NUL-padded on-chain bytes.
126
131
  * @returns The derived Borsh struct schema.
@@ -157,7 +162,8 @@ export function respondOutputWidth(schema) {
157
162
  * @param value - The decoded value.
158
163
  * @param name - The field name, for the error message.
159
164
  * @returns The value's 32 little-endian bytes.
160
- * @throws {RangeError} If the value is not an integer in `0 <= value < 2^256`.
165
+ * @throws {TypeError} If the value is not a bigint, number or string.
166
+ * @throws {RangeError} If it is not an integer in `0 <= value < 2^256`.
161
167
  */
162
168
  function uint256Word(value, name) {
163
169
  if (typeof value !== "bigint" && typeof value !== "number" && typeof value !== "string") {
@@ -206,27 +212,24 @@ function byteString(value, field) {
206
212
  * field is missing from `output`, or a value is outside its type.
207
213
  */
208
214
  export function serializeRespondOutput(schema, output) {
209
- const values = {};
210
- for (const field of classifiedEvmOutputFields(schema)) {
215
+ const values = Object.fromEntries(classifiedEvmOutputFields(schema).map((field) => {
211
216
  const value = output[field.name];
212
- if (value === undefined)
217
+ if (value === undefined) {
213
218
  throw new Error(`respond output: missing value for '${field.name}'`);
219
+ }
214
220
  switch (field.kind) {
215
221
  case EvmOutputTypeKind.Bool:
216
222
  if (typeof value !== "boolean") {
217
223
  throw new TypeError(`respond output: '${field.name}' (bool) expects a boolean`);
218
224
  }
219
- values[field.name] = value;
220
- break;
225
+ return [field.name, value];
221
226
  case EvmOutputTypeKind.Uint256:
222
- values[field.name] = uint256Word(value, field.name);
223
- break;
227
+ return [field.name, uint256Word(value, field.name)];
224
228
  case EvmOutputTypeKind.Address:
225
229
  case EvmOutputTypeKind.FixedBytes:
226
- values[field.name] = byteString(value, field);
227
- break;
230
+ return [field.name, byteString(value, field)];
228
231
  }
229
- }
232
+ }));
230
233
  return compactSerialize(deriveRespondSchema(schema), values);
231
234
  }
232
235
  // ---------------------------------------------------------------------------
@@ -264,6 +267,43 @@ export var EvmTraceOutputKind;
264
267
  /** The top call frame carries no string `output` field. */
265
268
  EvmTraceOutputKind["NoReturnData"] = "NoReturnData";
266
269
  })(EvmTraceOutputKind || (EvmTraceOutputKind = {}));
270
+ /**
271
+ * Refuse return data that is not canonical ABI before it is decoded: whole
272
+ * 32-byte words, at least one per declared field, a `bool` word of 0 or 1,
273
+ * an `address` word with zero high bytes and a `bytesN` word zero-padded
274
+ * after its N bytes. Words past the declared fields are not checked. The ABI
275
+ * library decodes such data leniently (a `bool` word of 2 reads as true), so
276
+ * the check sits here, where the MPC decides whether to attest.
277
+ *
278
+ * @param fields - The schema's classified fields, in order.
279
+ * @param returnData - The traced return data, non-empty.
280
+ * @throws {Error} If the data is not whole words, holds fewer words than
281
+ * fields, or a field's word is not canonical for its type.
282
+ */
283
+ function checkCanonicalReturnData(fields, returnData) {
284
+ if (returnData.length % ABI_WORD_BYTES !== 0) {
285
+ throw new Error(`respond output: return data of ${String(returnData.length)} bytes is not whole ABI words`);
286
+ }
287
+ const words = returnData.length / ABI_WORD_BYTES;
288
+ if (words < fields.length) {
289
+ throw new Error(`respond output: return data holds ${String(words)} word${words === 1 ? "" : "s"} but the output schema declares ${String(fields.length)} fields`);
290
+ }
291
+ const isZero = (bytes) => bytes.every((byte) => byte === 0);
292
+ fields.forEach((field, i) => {
293
+ const word = returnData.subarray(i * ABI_WORD_BYTES, (i + 1) * ABI_WORD_BYTES);
294
+ const last = word[ABI_WORD_BYTES - 1];
295
+ const canonical = field.kind === EvmOutputTypeKind.Bool
296
+ ? isZero(word.subarray(0, ABI_WORD_BYTES - 1)) && (last === 0 || last === 1)
297
+ : field.kind === EvmOutputTypeKind.Address
298
+ ? isZero(word.subarray(0, ABI_WORD_BYTES - EVM_ADDRESS_BYTES))
299
+ : field.kind === EvmOutputTypeKind.FixedBytes
300
+ ? isZero(word.subarray(field.bytes))
301
+ : true;
302
+ if (!canonical) {
303
+ throw new Error(`respond output: '${field.name}' (${field.type}) word 0x${ethers.hexlify(word).slice(2)} is not canonical ABI`);
304
+ }
305
+ });
306
+ }
267
307
  /**
268
308
  * The exact respond output the MPC attests for an EVM transaction that
269
309
  * executed (the payload of an `OutputKind.executed` attestation), derived
@@ -293,11 +333,13 @@ export var EvmTraceOutputKind;
293
333
  * @throws {Error} Exactly where the MPC refuses to attest an execution: a
294
334
  * malformed schema or an unsupported output type, a contract call not
295
335
  * traced, return data under an empty schema, no or empty return data
296
- * under a non-empty schema, return data the schema cannot decode, and
336
+ * under a non-empty schema, return data that is not canonical ABI
337
+ * ({@link checkCanonicalReturnData}) or that the schema cannot decode, and
297
338
  * every {@link serializeRespondOutput} rejection.
298
339
  */
299
340
  export function executedEvmRespondOutput(schema, isContractCall, trace) {
300
- const expectsOutput = classifiedEvmOutputFields(schema).length > 0;
341
+ const fields = classifiedEvmOutputFields(schema);
342
+ const expectsOutput = fields.length > 0;
301
343
  if (!isContractCall) {
302
344
  if (expectsOutput) {
303
345
  throw new Error("respond output: a plain transfer returns nothing, but the output schema declares return values");
@@ -319,6 +361,7 @@ export function executedEvmRespondOutput(schema, isContractCall, trace) {
319
361
  if (!expectsOutput) {
320
362
  throw new Error("respond output: the contract call returned data, but the output schema declares no return values");
321
363
  }
364
+ checkCanonicalReturnData(fields, returnData);
322
365
  return serializeRespondOutput(schema, deserializeEvmOutput(schema, returnData));
323
366
  }
324
367
  /**
@@ -385,8 +428,8 @@ export function evmTraceOutputFromCallFrame(frame) {
385
428
  return { kind: EvmTraceOutputKind.Output, returnData: ethers.getBytes(`0x${digits}`) };
386
429
  }
387
430
  // ===========================================================================
388
- // Helpers from here down. The exports above are the whole public surface:
389
- // everything below serves them.
431
+ // Helpers from here down. Apart from canonicalSchemaText, everything below
432
+ // serves the exports above.
390
433
  // ===========================================================================
391
434
  function toPlainValue(value, label) {
392
435
  if (value instanceof ethers.Result) {
@@ -408,38 +451,96 @@ function toPlainValue(value, label) {
408
451
  // Schema parsing + validation
409
452
  // ---------------------------------------------------------------------------
410
453
  /**
411
- * Parse schema text as JSON with the parse failure named. Blank text (an
412
- * unset all-NUL on-chain schema field) is the empty schema.
454
+ * The canonical text of an output schema: `JSON.stringify` of its fields
455
+ * reduced to `{name, type}` in schema order, with no whitespace. A schema's
456
+ * on-chain bytes must be exactly this text followed by NUL padding, so one
457
+ * schema has exactly one byte form. Write a contract's schema literal with
458
+ * this function's output.
413
459
  *
414
- * @param text - The schema text, NUL-trimmed.
415
- * @returns The parsed JSON value, `[]` for blank text.
416
- * @throws {Error} If non-blank text is not valid JSON.
460
+ * @param fields - The schema's fields in order.
461
+ * @returns The canonical JSON text, `[]` for an empty schema.
417
462
  */
418
- function parseSchemaJson(text) {
419
- if (text.trim() === "") {
463
+ export function canonicalSchemaText(fields) {
464
+ return JSON.stringify(fields.map(({ name, type }) => ({ name, type })));
465
+ }
466
+ /**
467
+ * Parse a schema's bytes, requiring the canonical form: the bytes before the
468
+ * first NUL are exactly {@link canonicalSchemaText} of the fields they
469
+ * encode, every byte from the first NUL on is NUL, and an empty schema is
470
+ * `[]` or no bytes at all (an unset all-NUL field).
471
+ *
472
+ * @param bytes - The schema text's UTF-8 bytes, NUL-padded or not.
473
+ * @returns The schema's fields.
474
+ * @throws {Error} If the padding holds a non-NUL byte, the text is not JSON,
475
+ * the fields fail {@link checkSchemaFields}, or the text is not canonical.
476
+ */
477
+ function parseCanonicalSchema(bytes) {
478
+ const nul = bytes.indexOf(0);
479
+ const body = nul === -1 ? bytes : bytes.subarray(0, nul);
480
+ if (nul !== -1 && bytes.subarray(nul).some((byte) => byte !== 0)) {
481
+ throw new Error("schema: every byte from the first NUL on must be NUL");
482
+ }
483
+ if (body.length === 0) {
420
484
  return [];
421
485
  }
486
+ let parsed;
422
487
  try {
423
- return JSON.parse(text);
488
+ parsed = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(body));
424
489
  }
425
490
  catch (error) {
426
491
  throw new Error(`schema is not valid JSON (${String(error)})`, { cause: error });
427
492
  }
493
+ const fields = checkSchemaFields(parsed);
494
+ const canonical = new TextEncoder().encode(canonicalSchemaText(fields));
495
+ if (canonical.length !== body.length || canonical.some((byte, i) => byte !== body[i])) {
496
+ throw new Error(`schema is not canonical: expected exactly ${canonicalSchemaText(fields)}`);
497
+ }
498
+ return fields;
428
499
  }
429
500
  /**
430
- * Parse a schema in any input form and check its SHAPE only: an array of
431
- * fields with non-empty, unique names and non-empty type strings. An empty
432
- * schema is valid here: {@link deserializeEvmOutput} decodes nothing from
433
- * it and {@link executedEvmRespondOutput} attests an empty output.
501
+ * A Solidity identifier, the only form a field name takes. A name outside
502
+ * this grammar can start with a digit, and a JavaScript object orders
503
+ * integer-like keys first, which would move the derived Borsh struct's
504
+ * members out of schema order.
505
+ */
506
+ const SOLIDITY_IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
507
+ /**
508
+ * The one identifier no field may use: assigning it on a JavaScript object
509
+ * reaches the prototype accessor, so an output object cannot carry it.
510
+ */
511
+ const PROTOTYPE_ACCESSOR_NAME = "__proto__";
512
+ /**
513
+ * Parse a schema in any input form and check its SHAPE only: text and bytes
514
+ * must be the canonical form ({@link parseCanonicalSchema}), and every form
515
+ * passes {@link checkSchemaFields}. Whether a type is in the attested subset
516
+ * is decided later, by {@link classifyEvmOutputType}. An empty schema is
517
+ * valid here: {@link deserializeEvmOutput} decodes nothing from it and
518
+ * {@link executedEvmRespondOutput} attests an empty output.
434
519
  *
435
- * @param schema - The schema as JSON text, packed bytes, or a field array.
436
- * @returns The schema's fields, names and type strings unvalidated beyond shape.
437
- * @throws {Error} If the schema is not an array of uniquely named fields.
520
+ * @param schema - The schema as canonical JSON text, NUL-padded bytes, or a field array.
521
+ * @returns The schema's fields, type strings as written.
522
+ * @throws {Error} If the text or bytes are not canonical, or the fields fail {@link checkSchemaFields}.
438
523
  */
439
524
  function parseSchemaShape(schema) {
440
- const parsed = typeof schema === "string" || schema instanceof Uint8Array
441
- ? parseSchemaJson(schemaText(schema))
442
- : schema;
525
+ if (typeof schema === "string") {
526
+ return parseCanonicalSchema(new TextEncoder().encode(schema));
527
+ }
528
+ if (schema instanceof Uint8Array) {
529
+ return parseCanonicalSchema(schema);
530
+ }
531
+ return checkSchemaFields(schema);
532
+ }
533
+ /**
534
+ * Check a parsed schema value's shape: an array of fields with unique
535
+ * Solidity-identifier names and ABI type strings `ethers.ParamType` accepts.
536
+ *
537
+ * @param parsed - The schema as parsed JSON or a field array.
538
+ * @returns The schema's fields, type strings as written.
539
+ * @throws {Error} If the value is not an array of fields, a name is not a
540
+ * Solidity identifier or is `__proto__`, a name repeats, or a type is
541
+ * missing or not an ABI type.
542
+ */
543
+ function checkSchemaFields(parsed) {
443
544
  if (!Array.isArray(parsed)) {
444
545
  throw new Error("schema must be a JSON array of fields");
445
546
  }
@@ -452,6 +553,12 @@ function parseSchemaShape(schema) {
452
553
  if (typeof name !== "string" || name.length === 0) {
453
554
  throw new Error(`schema field ${String(i)} needs a non-empty name`);
454
555
  }
556
+ if (!SOLIDITY_IDENTIFIER.test(name)) {
557
+ throw new Error(`schema: field name '${name}' is not a Solidity identifier`);
558
+ }
559
+ if (name === PROTOTYPE_ACCESSOR_NAME) {
560
+ throw new Error(`schema: field name '${name}' is refused`);
561
+ }
455
562
  if (seen.has(name)) {
456
563
  throw new Error(`schema: duplicate field name '${name}'`);
457
564
  }
@@ -459,18 +566,13 @@ function parseSchemaShape(schema) {
459
566
  if (typeof type !== "string" || type.length === 0) {
460
567
  throw new Error(`schema: '${name}' needs a type`);
461
568
  }
569
+ try {
570
+ ethers.ParamType.from(type);
571
+ }
572
+ catch (error) {
573
+ throw new Error(`schema: '${name}' has an invalid ABI type '${type}'`, { cause: error });
574
+ }
462
575
  return { name, type };
463
576
  });
464
577
  }
465
- /**
466
- * Cut a NUL-padded on-chain schema at the first NUL and decode to text.
467
- *
468
- * @param schema - Schema text, or the NUL-padded bytes read from the ledger.
469
- * @returns The schema text with the padding removed.
470
- */
471
- function schemaText(schema) {
472
- const raw = typeof schema === "string" ? schema : new TextDecoder().decode(schema);
473
- const nul = raw.indexOf("\0");
474
- return nul === -1 ? raw : raw.slice(0, nul);
475
- }
476
578
  //# sourceMappingURL=abi-serde.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"abi-serde.js","sourceRoot":"","sources":["../src/abi-serde.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,gBAAgB,EAAe,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAoChC,8EAA8E;AAC9E,sEAAsE;AACtE,8EAA8E;AAE9E;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAsB,EACtB,UAA4B;IAE5B,MAAM,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACxC,IAAI,MAA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I,gBAAgB,CAAC,CAAC;QACpD,CAAC;QACD,IAAI,CAAC;YACH,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,YAAY,IAAI,8BAA8B,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAC3F,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -8,7 +8,7 @@
8
8
  // it under
9
9
  // These descriptors are required as Midnight libraries expose no supported equivalent:
10
10
  // - A compiled contract module (`src/managed/`) builds one such codec per
11
- // ledger type but keeps them module-private, exporting only `ledger()`,
11
+ // ledger type but keeps them module-private: its only decoder is `ledger()`,
12
12
  // which decodes the FULL state of the one contract it was compiled from.
13
13
  // Signet readers hold neither that contract's compiled module nor its
14
14
  // full state: just a cell.
@@ -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;AAEF,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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AAS,MAAM,CAAC,KAAK,CAAC,gBAAgB,OAAO,CAAC,KAAK,CAAC,GAAG,gCAAgC,CAC/F,CAAC;QACJ,CAAC;QACD,OAAO,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,WAAW,GAAG,IAAI,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE9C;;;;;;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"}
@@ -5,8 +5,8 @@ export declare const MPC_PARAMS_BYTES = 64;
5
5
  /** Width of `EvmCalldata.selector` (`Bytes<4>`): the literal first 4 calldata bytes. */
6
6
  export declare const SELECTOR_BYTES = 4;
7
7
  /**
8
- * Default MPC key version (`keyVersion` field value). The canonical MPC
9
- * (and `constructSignBidirectionalEventV1`) requires `keyVersion >= 1`.
8
+ * Default MPC key version (`keyVersion` field value). `constructSignBidirectionalEventV1`
9
+ * requires `keyVersion >= 1`.
10
10
  */
11
11
  export declare const SIGNET_DEFAULT_KEY_VERSION = 1n;
12
12
  /**
package/dist/constants.js CHANGED
@@ -13,8 +13,8 @@ export const MPC_PARAMS_BYTES = 64;
13
13
  /** Width of `EvmCalldata.selector` (`Bytes<4>`): the literal first 4 calldata bytes. */
14
14
  export const SELECTOR_BYTES = 4;
15
15
  /**
16
- * Default MPC key version (`keyVersion` field value). The canonical MPC
17
- * (and `constructSignBidirectionalEventV1`) requires `keyVersion >= 1`.
16
+ * Default MPC key version (`keyVersion` field value). `constructSignBidirectionalEventV1`
17
+ * requires `keyVersion >= 1`.
18
18
  */
19
19
  export const SIGNET_DEFAULT_KEY_VERSION = 1n;
20
20
  /**
@@ -103,7 +103,7 @@ export function getMpcRootPublicKey(networkId) {
103
103
  // singleton is deployed there. An empty string means "not yet deployed or
104
104
  // published" and makes getSignetContractAddress throw for that network.
105
105
  const signetContractAddresses = {
106
- [MidnightNetwork.Stagenet]: "1df4ce25fc9f9c03dc6f4d0eb12ddf3d0db094995d4c70aca1142eebb3b77a5d",
106
+ [MidnightNetwork.Stagenet]: "5ecbb10ce05c9e55d1990048aec4c0a5669036fb1c1f5922b900880047d8e2bf",
107
107
  [MidnightNetwork.Preview]: "",
108
108
  [MidnightNetwork.Preprod]: "",
109
109
  [MidnightNetwork.Mainnet]: "",
@@ -139,8 +139,9 @@ export declare function secp256k1PublicKeyOf(secretKey: Uint8Array): Secp256k1Po
139
139
  * twin of the size-generic Compact circuit `calculateSignetAttestationDigestV1`.
140
140
  *
141
141
  * @param requestId - The 32-byte request id the response answers.
142
- * @param blockHeight - Height of the finalised destination block holding the
143
- * attested transaction, in the destination chain's own numbering.
142
+ * @param blockHeight - Height of the finalised target-chain block holding the
143
+ * transaction the outcome describes (for unviable, the transaction that
144
+ * used up the replay protection), in the target chain's own numbering.
144
145
  * @param outputKind - The MPC's verdict on the execution.
145
146
  * @param serializedOutput - The serialised execution output, exact unpadded bytes.
146
147
  * @returns The 32-byte attestation digest.
@@ -150,7 +151,11 @@ export declare function calculateSignetAttestationDigest(requestId: RequestId, b
150
151
  export interface RespondBidirectionalAttestation {
151
152
  /** The 32-byte request id the response answers. */
152
153
  requestId: RequestId;
153
- /** Height of the finalised destination block holding the attested transaction. */
154
+ /**
155
+ * Height of the finalised target-chain block holding the transaction the
156
+ * outcome describes (for unviable, the transaction that used up the replay
157
+ * protection).
158
+ */
154
159
  blockHeight: bigint;
155
160
  /** The MPC's verdict on the execution. */
156
161
  outputKind: OutputKind;