@sig-net/midnight 0.18.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.
Files changed (85) hide show
  1. package/README.md +42 -2
  2. package/dist/abi-serde.d.ts +32 -30
  3. package/dist/abi-serde.d.ts.map +1 -1
  4. package/dist/abi-serde.js +139 -75
  5. package/dist/abi-serde.js.map +1 -1
  6. package/dist/byte-codecs.d.ts +62 -0
  7. package/dist/byte-codecs.d.ts.map +1 -0
  8. package/dist/byte-codecs.js +116 -0
  9. package/dist/byte-codecs.js.map +1 -0
  10. package/dist/compact-descriptors.d.ts +89 -0
  11. package/dist/compact-descriptors.d.ts.map +1 -0
  12. package/dist/compact-descriptors.js +139 -0
  13. package/dist/compact-descriptors.js.map +1 -0
  14. package/dist/constants.d.ts +18 -43
  15. package/dist/constants.d.ts.map +1 -1
  16. package/dist/constants.js +19 -45
  17. package/dist/constants.js.map +1 -1
  18. package/dist/ecdsa-attestation.d.ts +49 -97
  19. package/dist/ecdsa-attestation.d.ts.map +1 -1
  20. package/dist/ecdsa-attestation.js +78 -142
  21. package/dist/ecdsa-attestation.js.map +1 -1
  22. package/dist/epsilon-derivation.d.ts +24 -31
  23. package/dist/epsilon-derivation.d.ts.map +1 -1
  24. package/dist/epsilon-derivation.js +52 -62
  25. package/dist/epsilon-derivation.js.map +1 -1
  26. package/dist/index.d.ts +10 -9
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +17 -8
  29. package/dist/index.js.map +1 -1
  30. package/dist/managed/compiler/contract-info.json +0 -22
  31. package/dist/managed/compiler/contract-manifest.json +8 -8
  32. package/dist/managed/contract/index.d.ts +0 -3
  33. package/dist/managed/contract/index.js +65 -80
  34. package/dist/managed/contract/index.js.map +1 -1
  35. package/dist/raw-contract-state.d.ts +25 -0
  36. package/dist/raw-contract-state.d.ts.map +1 -0
  37. package/dist/raw-contract-state.js +52 -0
  38. package/dist/raw-contract-state.js.map +1 -0
  39. package/dist/signature-requests-state-reader.d.ts +18 -44
  40. package/dist/signature-requests-state-reader.d.ts.map +1 -1
  41. package/dist/signature-requests-state-reader.js +82 -146
  42. package/dist/signature-requests-state-reader.js.map +1 -1
  43. package/dist/signature-response-verification.d.ts +9 -8
  44. package/dist/signature-response-verification.d.ts.map +1 -1
  45. package/dist/signature-response-verification.js +20 -17
  46. package/dist/signature-response-verification.js.map +1 -1
  47. package/dist/signet-contract-events.d.ts +56 -64
  48. package/dist/signet-contract-events.d.ts.map +1 -1
  49. package/dist/signet-contract-events.js +46 -48
  50. package/dist/signet-contract-events.js.map +1 -1
  51. package/dist/signet-evtype2tx-record-decoding.d.ts +18 -0
  52. package/dist/signet-evtype2tx-record-decoding.d.ts.map +1 -0
  53. package/dist/signet-evtype2tx-record-decoding.js +97 -0
  54. package/dist/signet-evtype2tx-record-decoding.js.map +1 -0
  55. package/dist/signet-evtype2tx-requests.d.ts +43 -87
  56. package/dist/signet-evtype2tx-requests.d.ts.map +1 -1
  57. package/dist/signet-evtype2tx-requests.js +59 -130
  58. package/dist/signet-evtype2tx-requests.js.map +1 -1
  59. package/dist/signet-request-id.d.ts +14 -0
  60. package/dist/signet-request-id.d.ts.map +1 -0
  61. package/dist/signet-request-id.js +27 -0
  62. package/dist/signet-request-id.js.map +1 -0
  63. package/dist/signet-request-response-reader.d.ts +34 -56
  64. package/dist/signet-request-response-reader.d.ts.map +1 -1
  65. package/dist/signet-request-response-reader.js +56 -68
  66. package/dist/signet-request-response-reader.js.map +1 -1
  67. package/dist/signet-requests.d.ts +28 -92
  68. package/dist/signet-requests.d.ts.map +1 -1
  69. package/dist/signet-requests.js +39 -141
  70. package/dist/signet-requests.js.map +1 -1
  71. package/dist/testing.d.ts +3 -0
  72. package/dist/testing.d.ts.map +1 -0
  73. package/dist/testing.js +20 -0
  74. package/dist/testing.js.map +1 -0
  75. package/package.json +13 -4
  76. package/src/Signet.compact +110 -171
  77. package/src/circuits.compact +9 -16
  78. package/dist/signature-state-reading.d.ts +0 -43
  79. package/dist/signature-state-reading.d.ts.map +0 -1
  80. package/dist/signature-state-reading.js +0 -74
  81. package/dist/signature-state-reading.js.map +0 -1
  82. package/dist/signet-request-feed.d.ts +0 -126
  83. package/dist/signet-request-feed.d.ts.map +0 -1
  84. package/dist/signet-request-feed.js +0 -216
  85. package/dist/signet-request-feed.js.map +0 -1
package/README.md CHANGED
@@ -197,6 +197,8 @@ const reader = new SignetRequestResponseReader({
197
197
  // Address of YOUR deployed contract
198
198
  requesterContractAddress: myContractAddress,
199
199
 
200
+ // signBidirectionalEventMap's ledger-tree path (see The request map's ledger-tree path)
201
+ requesterRequestsPath: [0],
200
202
  // signBidirectionalEventMap's ledger-tree path (see The request map's ledger-tree path)
201
203
  requesterRequestsPath: [0],
202
204
 
@@ -232,6 +234,8 @@ const expectedSigner = deriveEvmAddress(mpcRootPublicKey, myContractAddress, "my
232
234
  // Notify the MPC of the SignBidirectionalEvent and the location of your signBidirectionalEventMap.
233
235
  // The map is at ledger field 0 (Setup step 2), so its path is [0] at depth 1
234
236
  // (see The request map's ledger-tree path).
237
+ // The map is at ledger field 0 (Setup step 2), so its path is [0] at depth 1
238
+ // (see The request map's ledger-tree path).
235
239
  signetSigner.signBidirectional(
236
240
  requestId,
237
241
  constructSignBidirectionalEventNotificationV1(
@@ -370,10 +374,46 @@ What clients import from `@sig-net/midnight`:
370
374
  | 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 (see [EVM Type 2 transactions and ABI calldata words](#evm-type-2-transactions-and-abi-calldata-words)). |
371
375
  | 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. |
372
376
  | Recognise a failed remote execution | `MPC_FAILURE_OUTPUT` and `isMpcFailureOutput`: the MPC's fixed 5-byte failure payload for reverted or replaced transactions. |
373
- | Verify attestations without the reader | `calculateSignetAttestationDigest` and `verifyRespondBidirectionalSignature`: the checks the reader runs internally, exposed for custom pipelines. |
374
- | Discover requests MPC-side (responders, background workers) | `SignetRequestFeed`: polls the signet contract's emitted notification events, looks each declared request id up in the named caller's own request map (the authenticated read), and dedupes by request id. |
377
+ | Verify attestations without the reader | `verifyRespondBidirectionalSignature`: the check the reader runs internally, exposed for custom pipelines. |
378
+ | Mint attestations in your contract's unit tests | The `@sig-net/midnight/testing` entry point, see [Testing entry point](#testing-entry-point). |
379
+ | Discover requests MPC-side (responders, background workers) | The discovery primitives: decode the signet contract's emitted notification events with `decodeSignBidirectionalEventNotificationPayload` and `decodeSignBidirectionalNotification`, then resolve each pointer against the named caller's own request map with `lookupSignetRequestAt` (the authenticated read). The polling loop belongs to the responder. |
375
380
  | 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. |
376
381
 
382
+ ### Testing entry point
383
+
384
+ The package has two entry points. The root import, `@sig-net/midnight`, carries
385
+ everything a running integration needs: clients verify and decode posts, they
386
+ never sign them. The helpers that SIGN (mint a real attestation with a
387
+ throwaway secret key) live on `@sig-net/midnight/testing`, so a signing
388
+ function never sits beside the runtime API.
389
+
390
+ You need the testing entry in exactly one situation: unit testing a contract
391
+ whose circuit verifies an MPC attestation. The circuit needs a genuine record
392
+ to accept, and the testing helpers produce, with a throwaway key, the exact
393
+ record shape the MPC posts, so the claim path is testable in-process with no
394
+ stack and no MPC:
395
+
396
+ ```ts
397
+ import { verifyRespondBidirectionalSignature } from "@sig-net/midnight"; // runtime
398
+ import {
399
+ calculateSignetAttestationDigest,
400
+ ecdsaSignatureToMpcSignature,
401
+ secp256k1PublicKeyOf,
402
+ signAttestationDigest,
403
+ } from "@sig-net/midnight/testing"; // tests only
404
+
405
+ // A real RespondBidirectionalEvent for (requestId, output), signed by secretKey.
406
+ // It verifies, in-circuit and off chain, against secp256k1PublicKeyOf(secretKey).
407
+ const event = {
408
+ signature: ecdsaSignatureToMpcSignature(
409
+ signAttestationDigest(
410
+ calculateSignetAttestationDigest(requestId, serializedOutput),
411
+ secretKey,
412
+ ),
413
+ ),
414
+ };
415
+ ```
416
+
377
417
  ## More examples
378
418
 
379
419
  For full integration examples (such as an ERC20 cross chain vault) see the [`sig-net/midnight-examples`](https://github.com/sig-net/midnight-examples) repository.
@@ -1,14 +1,12 @@
1
1
  import { ethers } from "ethers";
2
2
  /** Fixed-width schema types: the byte size follows entirely from the type. */
3
3
  export type AbiFixedType = "bool" | "address" | "field" | `uint${number}` | `bytes${number}`;
4
+ /** A fixed-width schema field: its byte size follows entirely from its type. */
4
5
  export interface AbiFixedField {
5
6
  name: string;
6
7
  type: AbiFixedType;
7
8
  }
8
- /**
9
- * A dynamic string/bytes field. `maxBytes` is the fixed Compact buffer
10
- * capacity (Compact types are fixed-size, so capacity is part of the type).
11
- */
9
+ /** A dynamic string/bytes field. `maxBytes` is the fixed Compact buffer capacity. */
12
10
  export interface AbiDynamicField {
13
11
  name: string;
14
12
  type: "string" | "bytes";
@@ -20,6 +18,7 @@ export interface AbiArrayField {
20
18
  type: `${AbiFixedType}[]`;
21
19
  maxItems: number;
22
20
  }
21
+ /** One respond-schema field: fixed-width, dynamic string/bytes, or array. */
23
22
  export type AbiSchemaField = AbiFixedField | AbiDynamicField | AbiArrayField;
24
23
  /** An ABI-style schema exactly as carried on chain (JSON array of fields). */
25
24
  export type AbiSchema = AbiSchemaField[];
@@ -27,9 +26,8 @@ export type AbiSchema = AbiSchemaField[];
27
26
  export type AbiSchemaInput = AbiSchema | string | Uint8Array;
28
27
  /**
29
28
  * A decode-side schema field: `type` is ANY type string the ABI library
30
- * accepts (the canonical ABI grammar, so signed ints, tuples and unbounded
31
- * arrays are all fine here). The restricted {@link AbiSchemaField} vocabulary
32
- * is a respond-side concern only, and is assignable to this shape.
29
+ * accepts. The restricted {@link AbiSchemaField} vocabulary is a respond-side
30
+ * concern only, and is assignable to this shape.
33
31
  */
34
32
  export interface EvmSchemaField {
35
33
  name: string;
@@ -45,45 +43,49 @@ export type EvmSchemaInput = readonly EvmSchemaField[] | string | Uint8Array;
45
43
  * numeric strings, the forms indexer JSON typically yields).
46
44
  */
47
45
  export type AbiDecodedValue = bigint | boolean | number | string | Uint8Array | AbiDecodedValue[];
48
- export type AbiDecodedOutput = {
49
- [field: string]: AbiDecodedValue;
50
- };
46
+ /** Decoded output values keyed by schema field name (see {@link AbiDecodedValue}). */
47
+ export type AbiDecodedOutput = Record<string, AbiDecodedValue>;
51
48
  /**
52
49
  * Decode a raw EVM call result (eth_call return data / debug_trace output)
53
50
  * into named values, driven by the request's outputDeserializationSchema.
54
- *
55
- * Type validation is FULLY delegated to ethers (the canonical ABI grammar,
56
- * mirroring the MPC's delegation to alloy): this function only checks the
57
- * schema's shape, then hands the type strings straight to the ABI coder.
58
- *
59
- * Returns a plain object keyed by field name (never an ethers `Result`, so it
60
- * survives JSON round-trips and structural comparison), with nested ethers
61
- * Results flattened to plain arrays.
51
+ * The decode-side counterpart of {@link serializeRespondOutput}. Type
52
+ * validation is FULLY delegated to ethers: this function checks the schema's
53
+ * shape only. An empty schema decodes to an empty object (a plain transfer
54
+ * has no output), matching the MPC's empty-schema handling. Returns a plain
55
+ * object (never an ethers `Result`), so it survives JSON round-trips and
56
+ * structural comparison.
62
57
  *
63
58
  * @param schema - The outputDeserializationSchema: parsed, JSON text, or the raw NUL-padded on-chain bytes.
64
59
  * @param callResult - The ABI-encoded return data (hex string or bytes).
65
- * @returns The decoded values keyed by schema field name.
60
+ * @returns The decoded values keyed by schema field name, empty for an empty schema.
66
61
  */
67
62
  export declare function deserializeEvmOutput(schema: EvmSchemaInput, callResult: ethers.BytesLike): AbiDecodedOutput;
63
+ /**
64
+ * Ceiling on a respond schema's total packed byte width. Schemas are
65
+ * requester-authored on-chain data, so unbounded maxBytes/maxItems would let
66
+ * a hostile request demand giant allocations from the responder. A real
67
+ * respond payload must fit its consumer contract's fixed `deserialize<T, N>`
68
+ * width, orders of magnitude below this.
69
+ */
70
+ export declare const MAX_RESPOND_PACKED_BYTES = 65536;
68
71
  /**
69
72
  * Encode decoded output values into the respond payload, driven by the
70
- * request's respondSerializationSchema. The bytes are exactly what a consumer
71
- * contract reads with `deserialize<T, N>` and what the MPC attests, so
72
- * clients can recompute and verify them independently.
73
+ * request's respondSerializationSchema: the bytes a consumer contract reads
74
+ * with `deserialize<T, N>` and the MPC attests. The respond-side counterpart
75
+ * of {@link deserializeEvmOutput}.
73
76
  *
74
77
  * The result is the PACKED value, unpadded and unbounded: its length follows
75
- * entirely from the schema. Padding to any fixed container width is the
76
- * caller's concern.
77
- *
78
- * Strict: values are range-checked (Uint widths, the Field modulus, the
79
- * 2^160 address bound), dynamic payloads must fit their capacity (no silent
80
- * truncation), and signed integer types are rejected outright.
78
+ * entirely from the schema, and padding to a fixed container width is the
79
+ * caller's concern. Strict: values are range-checked, dynamic payloads must
80
+ * fit their capacity with no silent truncation, and signed integer types are
81
+ * rejected.
81
82
  *
82
83
  * @param schema - The respondSerializationSchema: parsed, JSON text, or the raw NUL-padded on-chain bytes.
83
84
  * @param output - Decoded values keyed by field name (from {@link deserializeEvmOutput} or any source using the same forms).
84
85
  * @returns The packed respond bytes.
86
+ * @throws {Error} If the schema is empty or malformed, packs to more than
87
+ * {@link MAX_RESPOND_PACKED_BYTES} bytes, a value falls outside its declared
88
+ * range, or a dynamic payload exceeds its capacity.
85
89
  */
86
90
  export declare function serializeRespondOutput(schema: AbiSchemaInput, output: AbiDecodedOutput): Uint8Array;
87
- export declare function isAbiDynamicField(field: AbiSchemaField): field is AbiDynamicField;
88
- export declare function isAbiArrayField(field: AbiSchemaField): field is AbiArrayField;
89
91
  //# sourceMappingURL=abi-serde.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"abi-serde.d.ts","sourceRoot":"","sources":["../src/abi-serde.ts"],"names":[],"mappings":"AA0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AM,GAAG,UAAU,CAAC;AAE7D;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,uFAAuF;AACvF,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,EACtB,UAAU,EAAE,MAAM,CAAC,SAAS,GAC3B,gBAAgB,CAclB;AAMD;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,QAAQ,CAAC;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,gBAAgB,GACvB,UAAU,CAqBZ"}
package/dist/abi-serde.js CHANGED
@@ -1,4 +1,4 @@
1
- // The two schema-driven conversions every signet participant performs on the
1
+ // The two schema-driven conversions every Signet participant performs on the
2
2
  // respond path, named after the protocol fields that drive them:
3
3
  //
4
4
  // EVM call result --deserializeEvmOutput--> decoded values
@@ -6,30 +6,25 @@
6
6
  // decoded values --serializeRespondOutput--> RespondBidirectionalEvent bytes
7
7
  // (respondSerializationSchema)
8
8
  //
9
- // Who runs them:
10
- // - fakenet (and eventually the real MPC): both, back to back, after the
11
- // destination-chain transaction confirms.
12
- // - signet clients: both, to independently recompute the exact respond
13
- // bytes the MPC attested (read the EVM result off chain, re-encode, then
14
- // hand the result to their Compact contract for claim/validation) or to
15
- // display a decoded result.
9
+ // Run by fakenet and the real MPC, back to back, after the
10
+ // destination-chain transaction confirms, and by Signet clients to
11
+ // independently recompute the respond bytes the MPC attested or to display
12
+ // a decoded result.
16
13
  //
17
- // The respond output is UNBOUNDED: this module never pads or clamps it. The
18
- // protocol attests a hash of the bytes, clients fetch the full output off
19
- // chain and recompute; any fixed event-field width is the caller's concern.
14
+ // The respond output is UNBOUNDED: this module never pads or clamps it. Any
15
+ // fixed event-field width is the caller's concern. Schemas are the ABI-style
16
+ // JSON carried on chain (NUL-padded fixed-width bytes). Both functions
17
+ // accept the schema in any form: already-parsed fields, a JSON string, or
18
+ // the raw on-chain bytes. An EMPTY output schema (an unset all-NUL field, a
19
+ // blank string, or `[]`) decodes to no values: a plain transfer has no call
20
+ // output. A respond schema must be non-empty, and its declared capacities
21
+ // are bounded ({@link MAX_RESPOND_PACKED_BYTES}): schemas are
22
+ // requester-authored on-chain data, so the responder never honours a schema
23
+ // demanding a giant allocation.
20
24
  //
21
- // Schemas are the ABI-style JSON carried on chain (NUL-padded fixed-width
22
- // bytes). Both functions accept the schema in any form: already-parsed
23
- // fields, a JSON string, or the raw on-chain bytes.
24
- //
25
- // Validation is split exactly the way the MPC splits it:
26
- // - decode side: the type grammar is left FULLY to the ABI library
27
- // (ethers), the same way the MPC delegates to alloy's DynSolType parser.
28
- // This module only checks the schema's shape (a non-empty array of
29
- // uniquely, non-emptily named fields).
30
- // - respond side: the restricted Compact-carrier vocabulary below is the
31
- // law, strictly enforced: unknown types, missing capacities, duplicate
32
- // names and malformed JSON all throw with the offending field named.
25
+ // Decode-side type grammar is left FULLY to the ABI library (ethers): this
26
+ // module checks only the schema's shape. Respond-side types are restricted
27
+ // to the Compact-carrier vocabulary below, strictly enforced.
33
28
  //
34
29
  // The respond byte layout is Compact's builtin serialize<T, N> /
35
30
  // deserialize<T, N> (via @sig-net/midnight-serde, pinned against compiled
@@ -50,34 +45,33 @@
50
45
  //
51
46
  // RANGE TRAP: uint256, address and field all map to Compact `Field`, whose
52
47
  // values must lie strictly below the BLS12-381 Fr modulus (just under
53
- // 2^255). An EVM uint256 at or above Fr therefore cannot be
54
- // respond-serialised, and `serializeRespondOutput` throws at respond time.
55
- // The max-uint256 allowance readback is the everyday case that hits this.
56
- // Schema authors who need the full 256-bit range should carry the value as
57
- // bytes32 instead.
48
+ // 2^255). An EVM uint256 at or above Fr cannot be respond-serialised, and
49
+ // `serializeRespondOutput` throws at respond time. Schema authors who need
50
+ // the full 256-bit range carry the value as bytes32.
51
+ import { compactSerialize, compactSerializedSize, } from "@sig-net/midnight-serde";
58
52
  import { ethers } from "ethers";
59
- import { compactSerialize, } from "@sig-net/midnight-serde";
60
53
  // ---------------------------------------------------------------------------
61
54
  // 1. EVM call result -> decoded values (outputDeserializationSchema)
62
55
  // ---------------------------------------------------------------------------
63
56
  /**
64
57
  * Decode a raw EVM call result (eth_call return data / debug_trace output)
65
58
  * into named values, driven by the request's outputDeserializationSchema.
66
- *
67
- * Type validation is FULLY delegated to ethers (the canonical ABI grammar,
68
- * mirroring the MPC's delegation to alloy): this function only checks the
69
- * schema's shape, then hands the type strings straight to the ABI coder.
70
- *
71
- * Returns a plain object keyed by field name (never an ethers `Result`, so it
72
- * survives JSON round-trips and structural comparison), with nested ethers
73
- * Results flattened to plain arrays.
59
+ * The decode-side counterpart of {@link serializeRespondOutput}. Type
60
+ * validation is FULLY delegated to ethers: this function checks the schema's
61
+ * shape only. An empty schema decodes to an empty object (a plain transfer
62
+ * has no output), matching the MPC's empty-schema handling. Returns a plain
63
+ * object (never an ethers `Result`), so it survives JSON round-trips and
64
+ * structural comparison.
74
65
  *
75
66
  * @param schema - The outputDeserializationSchema: parsed, JSON text, or the raw NUL-padded on-chain bytes.
76
67
  * @param callResult - The ABI-encoded return data (hex string or bytes).
77
- * @returns The decoded values keyed by schema field name.
68
+ * @returns The decoded values keyed by schema field name, empty for an empty schema.
78
69
  */
79
70
  export function deserializeEvmOutput(schema, callResult) {
80
71
  const fields = parseSchemaShape(schema);
72
+ if (fields.length === 0) {
73
+ return {};
74
+ }
81
75
  const decoded = ethers.AbiCoder.defaultAbiCoder().decode(fields.map((field) => field.type), callResult);
82
76
  const output = {};
83
77
  fields.forEach((field, i) => {
@@ -88,27 +82,43 @@ export function deserializeEvmOutput(schema, callResult) {
88
82
  // ---------------------------------------------------------------------------
89
83
  // 2. decoded values -> respond bytes (respondSerializationSchema)
90
84
  // ---------------------------------------------------------------------------
85
+ /**
86
+ * Ceiling on a respond schema's total packed byte width. Schemas are
87
+ * requester-authored on-chain data, so unbounded maxBytes/maxItems would let
88
+ * a hostile request demand giant allocations from the responder. A real
89
+ * respond payload must fit its consumer contract's fixed `deserialize<T, N>`
90
+ * width, orders of magnitude below this.
91
+ */
92
+ export const MAX_RESPOND_PACKED_BYTES = 65536;
91
93
  /**
92
94
  * Encode decoded output values into the respond payload, driven by the
93
- * request's respondSerializationSchema. The bytes are exactly what a consumer
94
- * contract reads with `deserialize<T, N>` and what the MPC attests, so
95
- * clients can recompute and verify them independently.
95
+ * request's respondSerializationSchema: the bytes a consumer contract reads
96
+ * with `deserialize<T, N>` and the MPC attests. The respond-side counterpart
97
+ * of {@link deserializeEvmOutput}.
96
98
  *
97
99
  * The result is the PACKED value, unpadded and unbounded: its length follows
98
- * entirely from the schema. Padding to any fixed container width is the
99
- * caller's concern.
100
- *
101
- * Strict: values are range-checked (Uint widths, the Field modulus, the
102
- * 2^160 address bound), dynamic payloads must fit their capacity (no silent
103
- * truncation), and signed integer types are rejected outright.
100
+ * entirely from the schema, and padding to a fixed container width is the
101
+ * caller's concern. Strict: values are range-checked, dynamic payloads must
102
+ * fit their capacity with no silent truncation, and signed integer types are
103
+ * rejected.
104
104
  *
105
105
  * @param schema - The respondSerializationSchema: parsed, JSON text, or the raw NUL-padded on-chain bytes.
106
106
  * @param output - Decoded values keyed by field name (from {@link deserializeEvmOutput} or any source using the same forms).
107
107
  * @returns The packed respond bytes.
108
+ * @throws {Error} If the schema is empty or malformed, packs to more than
109
+ * {@link MAX_RESPOND_PACKED_BYTES} bytes, a value falls outside its declared
110
+ * range, or a dynamic payload exceeds its capacity.
108
111
  */
109
112
  export function serializeRespondOutput(schema, output) {
110
113
  const fields = normalizeRespondSchema(schema);
114
+ // Size the descriptor BEFORE any value work: the ceiling check is what
115
+ // keeps a hostile capacity from ever reaching an allocation.
111
116
  const descriptor = respondSchemaToCompactType(fields);
117
+ const packedWidth = compactSerializedSize(descriptor);
118
+ if (packedWidth > MAX_RESPOND_PACKED_BYTES) {
119
+ throw new Error(`respond schema packs to ${String(packedWidth)} bytes, above the ` +
120
+ `${String(MAX_RESPOND_PACKED_BYTES)}-byte ceiling`);
121
+ }
112
122
  const value = {};
113
123
  for (const field of fields) {
114
124
  const raw = output[field.name];
@@ -121,27 +131,34 @@ export function serializeRespondOutput(schema, output) {
121
131
  }
122
132
  // ===========================================================================
123
133
  // Helpers from here down. The two functions above are the whole public
124
- // surface; everything below serves them.
134
+ // surface: everything below serves them.
125
135
  // ===========================================================================
126
136
  // ---------------------------------------------------------------------------
127
137
  // Field-kind guards
128
138
  // ---------------------------------------------------------------------------
129
- export function isAbiDynamicField(field) {
139
+ function isAbiDynamicField(field) {
130
140
  return field.type === "string" || field.type === "bytes";
131
141
  }
132
- export function isAbiArrayField(field) {
142
+ function isAbiArrayField(field) {
133
143
  return field.type.endsWith("[]");
134
144
  }
135
145
  // ---------------------------------------------------------------------------
136
146
  // Decode-side value flattening
137
147
  // ---------------------------------------------------------------------------
138
- /** Flatten ethers `Result` arrays into plain arrays, pass scalars through. */
148
+ /**
149
+ * Flatten ethers `Result` arrays into plain arrays, pass scalars through.
150
+ *
151
+ * @param value - A decoded ABI value, possibly a nested `Result`.
152
+ * @param label - Field path, used in error messages.
153
+ * @returns The value with every `Result` replaced by a plain array.
154
+ * @throws {Error} If the value is of a kind the respond side cannot carry.
155
+ */
139
156
  function toPlainValue(value, label) {
140
157
  if (value instanceof ethers.Result) {
141
- return value.toArray().map((v, i) => toPlainValue(v, `${label}[${i}]`));
158
+ return value.toArray().map((v, i) => toPlainValue(v, `${label}[${String(i)}]`));
142
159
  }
143
160
  if (Array.isArray(value)) {
144
- return value.map((v, i) => toPlainValue(v, `${label}[${i}]`));
161
+ return value.map((v, i) => toPlainValue(v, `${label}[${String(i)}]`));
145
162
  }
146
163
  if (typeof value === "bigint" ||
147
164
  typeof value === "boolean" ||
@@ -160,27 +177,50 @@ const MAX_UINT_BITS = 248;
160
177
  /** Length-prefix width of the dynamic string/bytes/array convention (Uint<64>). */
161
178
  const DYN_LEN_BYTES = 8;
162
179
  /**
163
- * Parse a schema in any input form and check its SHAPE only: a non-empty
164
- * array of fields with non-empty, unique names and non-empty type strings.
165
- * The type grammar is deliberately not checked here: the decode side leaves
166
- * it fully to the ABI library, the respond side runs
167
- * {@link normalizeRespondSchema} on top.
180
+ * Parse schema text as JSON with the parse failure named. Blank text (an
181
+ * unset all-NUL on-chain schema field) is the empty schema.
182
+ *
183
+ * @param text - The schema text, NUL-trimmed.
184
+ * @returns The parsed JSON value, `[]` for blank text.
185
+ * @throws {Error} If non-blank text is not valid JSON.
186
+ */
187
+ function parseSchemaJson(text) {
188
+ if (text.trim() === "") {
189
+ return [];
190
+ }
191
+ try {
192
+ return JSON.parse(text);
193
+ }
194
+ catch (error) {
195
+ throw new Error(`schema is not valid JSON (${String(error)})`, { cause: error });
196
+ }
197
+ }
198
+ /**
199
+ * Parse a schema in any input form and check its SHAPE only: an array of
200
+ * fields with non-empty, unique names and non-empty type strings. An empty
201
+ * schema is valid here: emptiness policy belongs to the callers
202
+ * ({@link deserializeEvmOutput} decodes nothing, {@link serializeRespondOutput}
203
+ * rejects).
204
+ *
205
+ * @param schema - The schema as JSON text, packed bytes, or a field array.
206
+ * @returns The schema's fields, names and type strings unvalidated beyond shape.
207
+ * @throws {Error} If the schema is not an array of uniquely named fields.
168
208
  */
169
209
  function parseSchemaShape(schema) {
170
210
  const parsed = typeof schema === "string" || schema instanceof Uint8Array
171
- ? JSON.parse(schemaText(schema))
211
+ ? parseSchemaJson(schemaText(schema))
172
212
  : schema;
173
- if (!Array.isArray(parsed) || parsed.length === 0) {
174
- throw new Error("schema must be a non-empty JSON array of fields");
213
+ if (!Array.isArray(parsed)) {
214
+ throw new Error("schema must be a JSON array of fields");
175
215
  }
176
216
  const seen = new Set();
177
217
  return parsed.map((raw, i) => {
178
218
  if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
179
- throw new Error(`schema field ${i} is not an object`);
219
+ throw new Error(`schema field ${String(i)} is not an object`);
180
220
  }
181
221
  const { name, type, maxBytes, maxItems } = raw;
182
222
  if (typeof name !== "string" || name.length === 0) {
183
- throw new Error(`schema field ${i} needs a non-empty name`);
223
+ throw new Error(`schema field ${String(i)} needs a non-empty name`);
184
224
  }
185
225
  if (seen.has(name)) {
186
226
  throw new Error(`schema: duplicate field name '${name}'`);
@@ -197,9 +237,17 @@ function parseSchemaShape(schema) {
197
237
  * schema: every type needs a Compact carrier (no signed ints, uint widths of
198
238
  * at most 248 bits or exactly 256, bytesN at most 32) and every dynamic field
199
239
  * needs its fixed capacity.
240
+ *
241
+ * @param schema - The schema to normalize.
242
+ * @returns The schema with every field proven to have a Compact carrier.
243
+ * @throws {Error} If a type has no carrier or a dynamic field omits its capacity.
200
244
  */
201
245
  function normalizeRespondSchema(schema) {
202
- return parseSchemaShape(schema).map(({ name, type, maxBytes, maxItems }) => {
246
+ const fields = parseSchemaShape(schema);
247
+ if (fields.length === 0) {
248
+ throw new Error("respond schema is empty: a respond serialization schema needs at least one field");
249
+ }
250
+ return fields.map(({ name, type, maxBytes, maxItems }) => {
203
251
  if (type === "string" || type === "bytes") {
204
252
  assertCapacity(maxBytes, `'${name}' (${type}) maxBytes`);
205
253
  return { name, type, maxBytes };
@@ -213,7 +261,12 @@ function normalizeRespondSchema(schema) {
213
261
  return { name, type: type };
214
262
  });
215
263
  }
216
- /** Cut a NUL-padded on-chain schema at the first NUL and decode to text. */
264
+ /**
265
+ * Cut a NUL-padded on-chain schema at the first NUL and decode to text.
266
+ *
267
+ * @param schema - Schema text, or the NUL-padded bytes read from the ledger.
268
+ * @returns The schema text with the padding removed.
269
+ */
217
270
  function schemaText(schema) {
218
271
  const raw = typeof schema === "string" ? schema : new TextDecoder().decode(schema);
219
272
  const nul = raw.indexOf("\0");
@@ -235,6 +288,11 @@ function assertCapacity(value, label) {
235
288
  * drift between them. Respond-side uint widths are restricted to whole-byte
236
289
  * widths (multiples of 8 from 8 to 248, packing to bits / 8 bytes), plus
237
290
  * uint256 which maps to Field. Throws with the offending field named.
291
+ *
292
+ * @param type - The fixed-width ABI type name.
293
+ * @param fieldName - The field the type belongs to, used in error messages.
294
+ * @returns The Compact descriptor that carries the type.
295
+ * @throws {Error} If the type has no respond-side Compact carrier.
238
296
  */
239
297
  function classifyFixedType(type, fieldName) {
240
298
  if (type === "bool")
@@ -245,17 +303,17 @@ function classifyFixedType(type, fieldName) {
245
303
  if (/^int\d+$/.test(type)) {
246
304
  throw new Error(`schema: '${fieldName}' (${type}) is unsupported: Compact has no signed integers`);
247
305
  }
248
- const uintMatch = type.match(/^uint(\d+)$/);
306
+ const uintMatch = /^uint([1-9]\d*)$/.exec(type);
249
307
  if (uintMatch) {
250
308
  const bits = Number(uintMatch[1]);
251
309
  const wholeByteWidth = bits >= 8 && bits <= MAX_UINT_BITS && bits % 8 === 0;
252
310
  if (!wholeByteWidth) {
253
311
  throw new Error(`schema: '${fieldName}' (${type}) has no respond carrier: uint widths ` +
254
- `must be multiples of 8 from 8 to ${MAX_UINT_BITS}, or uint256 (maps to Field)`);
312
+ `must be multiples of 8 from 8 to ${String(MAX_UINT_BITS)}, or uint256 (maps to Field)`);
255
313
  }
256
314
  return { kind: "uint", bits };
257
315
  }
258
- const bytesMatch = type.match(/^bytes(\d+)$/);
316
+ const bytesMatch = /^bytes([1-9]\d*)$/.exec(type);
259
317
  if (bytesMatch) {
260
318
  const n = Number(bytesMatch[1]);
261
319
  if (n < 1 || n > 32) {
@@ -314,7 +372,7 @@ function toCompactValue(value, field) {
314
372
  ? new TextEncoder().encode(asString(value, name))
315
373
  : asBytes(value, name);
316
374
  if (payload.length > field.maxBytes) {
317
- throw new Error(`'${name}': payload is ${payload.length} bytes, maxBytes is ${field.maxBytes}`);
375
+ throw new Error(`'${name}': payload is ${String(payload.length)} bytes, maxBytes is ${String(field.maxBytes)}`);
318
376
  }
319
377
  const data = new Uint8Array(field.maxBytes);
320
378
  data.set(payload);
@@ -325,10 +383,10 @@ function toCompactValue(value, field) {
325
383
  throw new Error(`'${name}' (${field.type}) expects an array`);
326
384
  }
327
385
  if (value.length > field.maxItems) {
328
- throw new Error(`'${name}': ${value.length} elements, maxItems is ${field.maxItems}`);
386
+ throw new Error(`'${name}': ${String(value.length)} elements, maxItems is ${String(field.maxItems)}`);
329
387
  }
330
388
  const elementType = field.type.slice(0, -2);
331
- const items = value.map((element, i) => fixedCompactValue(element, elementType, `${name}[${i}]`));
389
+ const items = value.map((element, i) => fixedCompactValue(element, elementType, `${name}[${String(i)}]`));
332
390
  // Unused capacity encodes as zero values of the element type.
333
391
  while (items.length < field.maxItems)
334
392
  items.push(zeroOf(elementType));
@@ -347,14 +405,14 @@ function fixedCompactValue(value, type, label) {
347
405
  const raw = asBytes(value, label);
348
406
  const expected = Number(type.slice(5));
349
407
  if (raw.length !== expected) {
350
- throw new Error(`'${label}' (${type}) expects exactly ${expected} bytes, got ${raw.length}`);
408
+ throw new Error(`'${label}' (${type}) expects exactly ${String(expected)} bytes, got ${String(raw.length)}`);
351
409
  }
352
410
  return raw;
353
411
  }
354
412
  // Numeric carriers: uintN, uint256/field and address.
355
413
  const n = asBigint(value, label);
356
414
  if (type === "address" && n >= ADDRESS_BOUND) {
357
- throw new Error(`'${label}': value ${n} exceeds an address`);
415
+ throw new Error(`'${label}': value ${String(n)} exceeds an address`);
358
416
  }
359
417
  // Uint width and Field modulus bounds are enforced by @sig-net/midnight-serde.
360
418
  return n;
@@ -387,8 +445,14 @@ function asBigint(value, label) {
387
445
  function asBytes(value, label) {
388
446
  if (value instanceof Uint8Array)
389
447
  return value;
390
- if (typeof value === "string")
391
- return ethers.getBytes(value);
448
+ if (typeof value === "string") {
449
+ try {
450
+ return ethers.getBytes(value);
451
+ }
452
+ catch {
453
+ throw new Error(`'${label}': not a valid 0x hex byte string: "${value}"`);
454
+ }
455
+ }
392
456
  throw new Error(`'${label}': expected bytes (Uint8Array or hex string)`);
393
457
  }
394
458
  function asString(value, label) {
@@ -1 +1 @@
1
- {"version":3,"file":"abi-serde.js","sourceRoot":"","sources":["../src/abi-serde.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,iEAAiE;AACjE,EAAE;AACF,6DAA6D;AAC7D,uDAAuD;AACvD,+EAA+E;AAC/E,sDAAsD;AACtD,EAAE;AACF,iBAAiB;AACjB,2EAA2E;AAC3E,8CAA8C;AAC9C,yEAAyE;AACzE,6EAA6E;AAC7E,4EAA4E;AAC5E,gCAAgC;AAChC,EAAE;AACF,4EAA4E;AAC5E,0EAA0E;AAC1E,4EAA4E;AAC5E,EAAE;AACF,0EAA0E;AAC1E,uEAAuE;AACvE,oDAAoD;AACpD,EAAE;AACF,yDAAyD;AACzD,qEAAqE;AACrE,6EAA6E;AAC7E,uEAAuE;AACvE,2CAA2C;AAC3C,2EAA2E;AAC3E,2EAA2E;AAC3E,yEAAyE;AACzE,EAAE;AACF,iEAAiE;AACjE,0EAA0E;AAC1E,+DAA+D;AAC/D,wEAAwE;AACxE,UAAU;AACV,sDAAsD;AACtD,yDAAyD;AACzD,oEAAoE;AACpE,oDAAoD;AACpD,oDAAoD;AACpD,uDAAuD;AACvD,uEAAuE;AACvE,+FAA+F;AAC/F,qEAAqE;AACrE,oGAAoG;AACpG,6DAA6D;AAC7D,EAAE;AACF,2EAA2E;AAC3E,sEAAsE;AACtE,4DAA4D;AAC5D,2EAA2E;AAC3E,0EAA0E;AAC1E,2EAA2E;AAC3E,mBAAmB;AAEnB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EACL,gBAAgB,GAGjB,MAA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