@sig-net/midnight 0.24.0-rc.1 → 0.24.0-rc.3

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 (58) hide show
  1. package/README.md +19 -24
  2. package/dist/compact-descriptors.d.ts +22 -7
  3. package/dist/compact-descriptors.d.ts.map +1 -1
  4. package/dist/compact-descriptors.js +39 -28
  5. package/dist/compact-descriptors.js.map +1 -1
  6. package/dist/constants.d.ts +3 -22
  7. package/dist/constants.d.ts.map +1 -1
  8. package/dist/constants.js +3 -25
  9. package/dist/constants.js.map +1 -1
  10. package/dist/ecdsa-attestation.d.ts +43 -15
  11. package/dist/ecdsa-attestation.d.ts.map +1 -1
  12. package/dist/ecdsa-attestation.js +47 -17
  13. package/dist/ecdsa-attestation.js.map +1 -1
  14. package/dist/index.d.ts +6 -6
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +5 -5
  17. package/dist/index.js.map +1 -1
  18. package/dist/managed/compiler/contract-info.json +1212 -13
  19. package/dist/managed/compiler/contract-manifest.json +8 -8
  20. package/dist/managed/contract/index.d.ts +282 -7
  21. package/dist/managed/contract/index.js +1072 -161
  22. package/dist/managed/contract/index.js.map +1 -1
  23. package/dist/mpc-output-cache.d.ts +5 -29
  24. package/dist/mpc-output-cache.d.ts.map +1 -1
  25. package/dist/mpc-output-cache.js +8 -42
  26. package/dist/mpc-output-cache.js.map +1 -1
  27. package/dist/signature-requests-state-reader.js +3 -3
  28. package/dist/signature-requests-state-reader.js.map +1 -1
  29. package/dist/signet-contract-events.d.ts +40 -10
  30. package/dist/signet-contract-events.d.ts.map +1 -1
  31. package/dist/signet-contract-events.js +79 -29
  32. package/dist/signet-contract-events.js.map +1 -1
  33. package/dist/signet-evtype2tx-record-decoding.d.ts.map +1 -1
  34. package/dist/signet-evtype2tx-record-decoding.js +6 -5
  35. package/dist/signet-evtype2tx-record-decoding.js.map +1 -1
  36. package/dist/signet-evtype2tx-requests.d.ts +17 -12
  37. package/dist/signet-evtype2tx-requests.d.ts.map +1 -1
  38. package/dist/signet-evtype2tx-requests.js +85 -16
  39. package/dist/signet-evtype2tx-requests.js.map +1 -1
  40. package/dist/signet-request-id.d.ts +5 -2
  41. package/dist/signet-request-id.d.ts.map +1 -1
  42. package/dist/signet-request-id.js +21 -9
  43. package/dist/signet-request-id.js.map +1 -1
  44. package/dist/signet-request-response-reader.d.ts +2 -4
  45. package/dist/signet-request-response-reader.d.ts.map +1 -1
  46. package/dist/signet-request-response-reader.js +7 -11
  47. package/dist/signet-request-response-reader.js.map +1 -1
  48. package/dist/signet-requests.d.ts +48 -17
  49. package/dist/signet-requests.d.ts.map +1 -1
  50. package/dist/signet-requests.js +18 -6
  51. package/dist/signet-requests.js.map +1 -1
  52. package/dist/testing.d.ts +1 -1
  53. package/dist/testing.d.ts.map +1 -1
  54. package/dist/testing.js +3 -8
  55. package/dist/testing.js.map +1 -1
  56. package/package.json +2 -2
  57. package/src/Signet.compact +258 -80
  58. package/src/circuits.compact +68 -13
@@ -7,26 +7,26 @@
7
7
  "type": "directory",
8
8
  "contract-info.json": {
9
9
  "type": "file",
10
- "size": 9366,
11
- "hash": "9b6d635514d427e216bf4eaf59a63b87c98bff313c6c78270249aaffdbb29988"
10
+ "size": 45915,
11
+ "hash": "c115624c5160b3e4735c88f9e17755e39c0d0fd59afd899b6088088c8d743456"
12
12
  }
13
13
  },
14
14
  "contract": {
15
15
  "type": "directory",
16
16
  "index.d.ts": {
17
17
  "type": "file",
18
- "size": 7438,
19
- "hash": "4c96529090ff4ef485c8f9f51cbf33ee4a206a1d367221f418cde28b6eba3aba"
18
+ "size": 30639,
19
+ "hash": "945aaa4c71039dad29a9812a91f436848d09bc616407f622c3927b2cc9d22d18"
20
20
  },
21
21
  "index.js": {
22
22
  "type": "file",
23
- "size": 47565,
24
- "hash": "dde928e918b4a9e79016ea091f1009b72cd24ce97606a6527cceb1ab4fd37c0c"
23
+ "size": 119434,
24
+ "hash": "38f96294398f109555940a1a99be90e6cae2f99516dff84bb1966c9788f6e300"
25
25
  },
26
26
  "index.js.map": {
27
27
  "type": "file",
28
- "size": 5124,
29
- "hash": "10ce78fc9176c1175101611345ab1374ea6b66b1119dc07d560acc65797c4b41"
28
+ "size": 9537,
29
+ "hash": "da321767cc7e4eca810eaa0874039ad98ad4bd6c71a73297e19c7267d09fdcae"
30
30
  }
31
31
  }
32
32
  }
@@ -1,5 +1,7 @@
1
1
  import type * as __compactRuntime from '@midnight-ntwrk/compact-runtime';
2
2
 
3
+ export enum OutputKind { executed = 0, failed = 1, unviable = 2 }
4
+
3
5
  export type Witnesses<PS> = {
4
6
  }
5
7
 
@@ -10,6 +12,14 @@ export type ProvableCircuits<PS> = {
10
12
  }
11
13
 
12
14
  export type PureCircuits = {
15
+ calculateRequestIdV1(preimage_0: { keyVersion: bigint,
16
+ sender: { bytes: Uint8Array },
17
+ path: Uint8Array,
18
+ algo: number,
19
+ txParamType: number,
20
+ txParamsDigest: Uint8Array,
21
+ executionDest: Uint8Array
22
+ }): Uint8Array;
13
23
  constructSignBidirectionalEventNotificationV1(callerAddress_0: { bytes: Uint8Array
14
24
  },
15
25
  requestsPathDepth_0: bigint,
@@ -22,22 +32,147 @@ export type PureCircuits = {
22
32
  boolAbiWord(value_0: boolean): Uint8Array;
23
33
  abiWordToUint128(word_0: Uint8Array): bigint;
24
34
  abiWordToBool(word_0: Uint8Array): boolean;
35
+ calculateSignetAttestationDigest0(requestId_0: Uint8Array,
36
+ blockHeight_0: bigint,
37
+ outputKind_0: OutputKind,
38
+ serializedOutput_0: Uint8Array): Uint8Array;
25
39
  calculateSignetAttestationDigest1(requestId_0: Uint8Array,
26
40
  blockHeight_0: bigint,
41
+ outputKind_0: OutputKind,
27
42
  serializedOutput_0: Uint8Array): Uint8Array;
28
43
  calculateSignetAttestationDigest2(requestId_0: Uint8Array,
29
44
  blockHeight_0: bigint,
45
+ outputKind_0: OutputKind,
30
46
  serializedOutput_0: Uint8Array): Uint8Array;
31
47
  calculateSignetAttestationDigest32(requestId_0: Uint8Array,
32
48
  blockHeight_0: bigint,
49
+ outputKind_0: OutputKind,
33
50
  serializedOutput_0: Uint8Array): Uint8Array;
34
51
  calculateSignetAttestationDigest100(requestId_0: Uint8Array,
35
52
  blockHeight_0: bigint,
53
+ outputKind_0: OutputKind,
36
54
  serializedOutput_0: Uint8Array): Uint8Array;
37
- verifyRespondBidirectionalEvent32(requestId_0: Uint8Array,
38
- blockHeight_0: bigint,
39
- serializedOutput_0: Uint8Array,
40
- respondBidirectionalEvent_0: { signature: { bigR: { x: Uint8Array,
55
+ calculateEvmType2TxParamsDigestV1_1_0_0(txParams_0: { chainId: bigint,
56
+ nonce: bigint,
57
+ maxPriorityFeePerGas: bigint,
58
+ maxFeePerGas: bigint,
59
+ gasLimit: bigint,
60
+ to: Uint8Array,
61
+ value: bigint,
62
+ calldata: { is_some: boolean,
63
+ value: { selector: Uint8Array,
64
+ noWords: bigint,
65
+ words: Uint8Array[]
66
+ }
67
+ },
68
+ accessListEntryCount: bigint,
69
+ accessList: { address: Uint8Array,
70
+ storageKeyCount: bigint,
71
+ storageKeys: Uint8Array[]
72
+ }[]
73
+ }): Uint8Array;
74
+ calculateEvmType2TxParamsDigestV1_2_1_2(txParams_0: { chainId: bigint,
75
+ nonce: bigint,
76
+ maxPriorityFeePerGas: bigint,
77
+ maxFeePerGas: bigint,
78
+ gasLimit: bigint,
79
+ to: Uint8Array,
80
+ value: bigint,
81
+ calldata: { is_some: boolean,
82
+ value: { selector: Uint8Array,
83
+ noWords: bigint,
84
+ words: Uint8Array[]
85
+ }
86
+ },
87
+ accessListEntryCount: bigint,
88
+ accessList: { address: Uint8Array,
89
+ storageKeyCount: bigint,
90
+ storageKeys: Uint8Array[]
91
+ }[]
92
+ }): Uint8Array;
93
+ calculateEvmType2RequestIdV1_1_0_0_34_34(request_0: { keyVersion: bigint,
94
+ sender: { bytes: Uint8Array
95
+ },
96
+ path: Uint8Array,
97
+ algo: number,
98
+ txParamType: number,
99
+ txParams: { chainId: bigint,
100
+ nonce: bigint,
101
+ maxPriorityFeePerGas: bigint,
102
+ maxFeePerGas: bigint,
103
+ gasLimit: bigint,
104
+ to: Uint8Array,
105
+ value: bigint,
106
+ calldata: { is_some: boolean,
107
+ value: { selector: Uint8Array,
108
+ noWords: bigint,
109
+ words: Uint8Array[]
110
+ }
111
+ },
112
+ accessListEntryCount: bigint,
113
+ accessList: { address: Uint8Array,
114
+ storageKeyCount: bigint,
115
+ storageKeys: Uint8Array[]
116
+ }[]
117
+ },
118
+ executionDest: Uint8Array,
119
+ signatureDest: number,
120
+ params: Uint8Array,
121
+ outputDeserializationSchema: Uint8Array,
122
+ respondSerializationSchema: Uint8Array
123
+ }): Uint8Array;
124
+ calculateEvmType2RequestIdV1_2_1_2_34_34(request_0: { keyVersion: bigint,
125
+ sender: { bytes: Uint8Array
126
+ },
127
+ path: Uint8Array,
128
+ algo: number,
129
+ txParamType: number,
130
+ txParams: { chainId: bigint,
131
+ nonce: bigint,
132
+ maxPriorityFeePerGas: bigint,
133
+ maxFeePerGas: bigint,
134
+ gasLimit: bigint,
135
+ to: Uint8Array,
136
+ value: bigint,
137
+ calldata: { is_some: boolean,
138
+ value: { selector: Uint8Array,
139
+ noWords: bigint,
140
+ words: Uint8Array[]
141
+ }
142
+ },
143
+ accessListEntryCount: bigint,
144
+ accessList: { address: Uint8Array,
145
+ storageKeyCount: bigint,
146
+ storageKeys: Uint8Array[]
147
+ }[]
148
+ },
149
+ executionDest: Uint8Array,
150
+ signatureDest: number,
151
+ params: Uint8Array,
152
+ outputDeserializationSchema: Uint8Array,
153
+ respondSerializationSchema: Uint8Array
154
+ }): Uint8Array;
155
+ verifyRespondBidirectionalEvent0(serializedOutput_0: Uint8Array,
156
+ respondBidirectionalEvent_0: { requestId: Uint8Array,
157
+ blockHeight: bigint,
158
+ outputKind: OutputKind,
159
+ serializedOutputLength: bigint,
160
+ digest: Uint8Array,
161
+ signature: { bigR: { x: Uint8Array,
162
+ y: Uint8Array
163
+ },
164
+ s: Uint8Array,
165
+ recoveryId: bigint
166
+ }
167
+ },
168
+ mpcResponseKey_0: __compactRuntime.Secp256k1Point): boolean;
169
+ verifyRespondBidirectionalEvent32(serializedOutput_0: Uint8Array,
170
+ respondBidirectionalEvent_0: { requestId: Uint8Array,
171
+ blockHeight: bigint,
172
+ outputKind: OutputKind,
173
+ serializedOutputLength: bigint,
174
+ digest: Uint8Array,
175
+ signature: { bigR: { x: Uint8Array,
41
176
  y: Uint8Array
42
177
  },
43
178
  s: Uint8Array,
@@ -48,6 +183,15 @@ export type PureCircuits = {
48
183
  }
49
184
 
50
185
  export type Circuits<PS> = {
186
+ calculateRequestIdV1(context: __compactRuntime.CircuitContext<PS>,
187
+ preimage_0: { keyVersion: bigint,
188
+ sender: { bytes: Uint8Array },
189
+ path: Uint8Array,
190
+ algo: number,
191
+ txParamType: number,
192
+ txParamsDigest: Uint8Array,
193
+ executionDest: Uint8Array
194
+ }): Promise<__compactRuntime.CircuitResults<PS, Uint8Array>>;
51
195
  constructSignBidirectionalEventNotificationV1(context: __compactRuntime.CircuitContext<PS>,
52
196
  callerAddress_0: { bytes: Uint8Array
53
197
  },
@@ -63,27 +207,158 @@ export type Circuits<PS> = {
63
207
  abiWordToUint128(context: __compactRuntime.CircuitContext<PS>,
64
208
  word_0: Uint8Array): Promise<__compactRuntime.CircuitResults<PS, bigint>>;
65
209
  abiWordToBool(context: __compactRuntime.CircuitContext<PS>, word_0: Uint8Array): Promise<__compactRuntime.CircuitResults<PS, boolean>>;
210
+ calculateSignetAttestationDigest0(context: __compactRuntime.CircuitContext<PS>,
211
+ requestId_0: Uint8Array,
212
+ blockHeight_0: bigint,
213
+ outputKind_0: OutputKind,
214
+ serializedOutput_0: Uint8Array): Promise<__compactRuntime.CircuitResults<PS, Uint8Array>>;
66
215
  calculateSignetAttestationDigest1(context: __compactRuntime.CircuitContext<PS>,
67
216
  requestId_0: Uint8Array,
68
217
  blockHeight_0: bigint,
218
+ outputKind_0: OutputKind,
69
219
  serializedOutput_0: Uint8Array): Promise<__compactRuntime.CircuitResults<PS, Uint8Array>>;
70
220
  calculateSignetAttestationDigest2(context: __compactRuntime.CircuitContext<PS>,
71
221
  requestId_0: Uint8Array,
72
222
  blockHeight_0: bigint,
223
+ outputKind_0: OutputKind,
73
224
  serializedOutput_0: Uint8Array): Promise<__compactRuntime.CircuitResults<PS, Uint8Array>>;
74
225
  calculateSignetAttestationDigest32(context: __compactRuntime.CircuitContext<PS>,
75
226
  requestId_0: Uint8Array,
76
227
  blockHeight_0: bigint,
228
+ outputKind_0: OutputKind,
77
229
  serializedOutput_0: Uint8Array): Promise<__compactRuntime.CircuitResults<PS, Uint8Array>>;
78
230
  calculateSignetAttestationDigest100(context: __compactRuntime.CircuitContext<PS>,
79
231
  requestId_0: Uint8Array,
80
232
  blockHeight_0: bigint,
233
+ outputKind_0: OutputKind,
81
234
  serializedOutput_0: Uint8Array): Promise<__compactRuntime.CircuitResults<PS, Uint8Array>>;
235
+ calculateEvmType2TxParamsDigestV1_1_0_0(context: __compactRuntime.CircuitContext<PS>,
236
+ txParams_0: { chainId: bigint,
237
+ nonce: bigint,
238
+ maxPriorityFeePerGas: bigint,
239
+ maxFeePerGas: bigint,
240
+ gasLimit: bigint,
241
+ to: Uint8Array,
242
+ value: bigint,
243
+ calldata: { is_some: boolean,
244
+ value: { selector: Uint8Array,
245
+ noWords: bigint,
246
+ words: Uint8Array[]
247
+ }
248
+ },
249
+ accessListEntryCount: bigint,
250
+ accessList: { address: Uint8Array,
251
+ storageKeyCount: bigint,
252
+ storageKeys: Uint8Array[]
253
+ }[]
254
+ }): Promise<__compactRuntime.CircuitResults<PS, Uint8Array>>;
255
+ calculateEvmType2TxParamsDigestV1_2_1_2(context: __compactRuntime.CircuitContext<PS>,
256
+ txParams_0: { chainId: bigint,
257
+ nonce: bigint,
258
+ maxPriorityFeePerGas: bigint,
259
+ maxFeePerGas: bigint,
260
+ gasLimit: bigint,
261
+ to: Uint8Array,
262
+ value: bigint,
263
+ calldata: { is_some: boolean,
264
+ value: { selector: Uint8Array,
265
+ noWords: bigint,
266
+ words: Uint8Array[]
267
+ }
268
+ },
269
+ accessListEntryCount: bigint,
270
+ accessList: { address: Uint8Array,
271
+ storageKeyCount: bigint,
272
+ storageKeys: Uint8Array[]
273
+ }[]
274
+ }): Promise<__compactRuntime.CircuitResults<PS, Uint8Array>>;
275
+ calculateEvmType2RequestIdV1_1_0_0_34_34(context: __compactRuntime.CircuitContext<PS>,
276
+ request_0: { keyVersion: bigint,
277
+ sender: { bytes: Uint8Array
278
+ },
279
+ path: Uint8Array,
280
+ algo: number,
281
+ txParamType: number,
282
+ txParams: { chainId: bigint,
283
+ nonce: bigint,
284
+ maxPriorityFeePerGas: bigint,
285
+ maxFeePerGas: bigint,
286
+ gasLimit: bigint,
287
+ to: Uint8Array,
288
+ value: bigint,
289
+ calldata: { is_some: boolean,
290
+ value: { selector: Uint8Array,
291
+ noWords: bigint,
292
+ words: Uint8Array[]
293
+ }
294
+ },
295
+ accessListEntryCount: bigint,
296
+ accessList: { address: Uint8Array,
297
+ storageKeyCount: bigint,
298
+ storageKeys: Uint8Array[]
299
+ }[]
300
+ },
301
+ executionDest: Uint8Array,
302
+ signatureDest: number,
303
+ params: Uint8Array,
304
+ outputDeserializationSchema: Uint8Array,
305
+ respondSerializationSchema: Uint8Array
306
+ }): Promise<__compactRuntime.CircuitResults<PS, Uint8Array>>;
307
+ calculateEvmType2RequestIdV1_2_1_2_34_34(context: __compactRuntime.CircuitContext<PS>,
308
+ request_0: { keyVersion: bigint,
309
+ sender: { bytes: Uint8Array
310
+ },
311
+ path: Uint8Array,
312
+ algo: number,
313
+ txParamType: number,
314
+ txParams: { chainId: bigint,
315
+ nonce: bigint,
316
+ maxPriorityFeePerGas: bigint,
317
+ maxFeePerGas: bigint,
318
+ gasLimit: bigint,
319
+ to: Uint8Array,
320
+ value: bigint,
321
+ calldata: { is_some: boolean,
322
+ value: { selector: Uint8Array,
323
+ noWords: bigint,
324
+ words: Uint8Array[]
325
+ }
326
+ },
327
+ accessListEntryCount: bigint,
328
+ accessList: { address: Uint8Array,
329
+ storageKeyCount: bigint,
330
+ storageKeys: Uint8Array[]
331
+ }[]
332
+ },
333
+ executionDest: Uint8Array,
334
+ signatureDest: number,
335
+ params: Uint8Array,
336
+ outputDeserializationSchema: Uint8Array,
337
+ respondSerializationSchema: Uint8Array
338
+ }): Promise<__compactRuntime.CircuitResults<PS, Uint8Array>>;
339
+ verifyRespondBidirectionalEvent0(context: __compactRuntime.CircuitContext<PS>,
340
+ serializedOutput_0: Uint8Array,
341
+ respondBidirectionalEvent_0: { requestId: Uint8Array,
342
+ blockHeight: bigint,
343
+ outputKind: OutputKind,
344
+ serializedOutputLength: bigint,
345
+ digest: Uint8Array,
346
+ signature: { bigR: { x: Uint8Array,
347
+ y: Uint8Array
348
+ },
349
+ s: Uint8Array,
350
+ recoveryId: bigint
351
+ }
352
+ },
353
+ mpcResponseKey_0: __compactRuntime.Secp256k1Point): Promise<__compactRuntime.CircuitResults<PS, boolean>>;
82
354
  verifyRespondBidirectionalEvent32(context: __compactRuntime.CircuitContext<PS>,
83
- requestId_0: Uint8Array,
84
- blockHeight_0: bigint,
85
355
  serializedOutput_0: Uint8Array,
86
- respondBidirectionalEvent_0: { signature: { bigR: { x: Uint8Array,
356
+ respondBidirectionalEvent_0: { requestId: Uint8Array,
357
+ blockHeight: bigint,
358
+ outputKind: OutputKind,
359
+ serializedOutputLength: bigint,
360
+ digest: Uint8Array,
361
+ signature: { bigR: { x: Uint8Array,
87
362
  y: Uint8Array
88
363
  },
89
364
  s: Uint8Array,