@sig-net/midnight-contract 0.10.0 → 0.11.0

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 (23) hide show
  1. package/README.md +1 -1
  2. package/dist/managed/compiler/contract-info.json +173 -87
  3. package/dist/managed/compiler/contract-manifest.json +34 -34
  4. package/dist/managed/contract/index.d.ts +98 -76
  5. package/dist/managed/contract/index.js +157 -127
  6. package/dist/managed/contract/index.js.map +1 -1
  7. package/dist/managed/keys/{postRespondBidirectional.prover → respondBidirectional.prover} +0 -0
  8. package/dist/managed/keys/respondBidirectional.verifier +0 -0
  9. package/dist/managed/zkir/respondBidirectional.bzkir +0 -0
  10. package/dist/managed/zkir/{postRespondBidirectional.zkir → respondBidirectional.zkir} +17 -13
  11. package/dist/witnesses.js +3 -3
  12. package/dist/witnesses.js.map +1 -1
  13. package/package.json +2 -2
  14. package/dist/managed/keys/postRespondBidirectional.verifier +0 -0
  15. package/dist/managed/zkir/postRespondBidirectional.bzkir +0 -0
  16. /package/dist/managed/keys/{postSignatureResponse.prover → respond.prover} +0 -0
  17. /package/dist/managed/keys/{postSignatureResponse.verifier → respond.verifier} +0 -0
  18. /package/dist/managed/keys/{signBidirectionalEvent.prover → signBidirectional.prover} +0 -0
  19. /package/dist/managed/keys/{signBidirectionalEvent.verifier → signBidirectional.verifier} +0 -0
  20. /package/dist/managed/zkir/{postSignatureResponse.bzkir → respond.bzkir} +0 -0
  21. /package/dist/managed/zkir/{postSignatureResponse.zkir → respond.zkir} +0 -0
  22. /package/dist/managed/zkir/{signBidirectionalEvent.bzkir → signBidirectional.bzkir} +0 -0
  23. /package/dist/managed/zkir/{signBidirectionalEvent.zkir → signBidirectional.zkir} +0 -0
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  The central [Sig Network](https://sig.network) signet contract on the [Midnight blockchain](https://midnight.network): the singleton that exposes the MPC's [sign bidirectional flow](https://docs.sig.network/architecture/sign-bidirectional) to other Midnight contracts. The MPC posts back to it and clients poll it:
4
4
 
5
5
  - **Signature responses**: an unauthenticated counted log; callers verify the signatures off-chain or in their own circuits.
6
- - **Remote execution responses**: Schnorr attestations by the MPC's Jubjub key, verified in-circuit at post time.
6
+ - **Remote execution responses**: secp256k1 ECDSA attestations by the MPC's per-client response key, stored unverified like the signature responses; the client contract verifies them in its own circuit.
7
7
  - **Request-notification registry**: how the MPC discovers new signature requests.
8
8
 
9
9
  ## What is in it
@@ -4,7 +4,7 @@
4
4
  "runtime-version": "0.18.0-rc.1",
5
5
  "circuits": [
6
6
  {
7
- "name": "signBidirectionalEvent",
7
+ "name": "signBidirectional",
8
8
  "pure": false,
9
9
  "proof": true,
10
10
  "arguments": [
@@ -69,7 +69,7 @@
69
69
  }
70
70
  },
71
71
  {
72
- "name": "postSignatureResponse",
72
+ "name": "respond",
73
73
  "pure": false,
74
74
  "proof": true,
75
75
  "arguments": [
@@ -91,31 +91,49 @@
91
91
  "name": "SignatureRespondedEvent",
92
92
  "elements": [
93
93
  {
94
- "name": "bigRx",
94
+ "name": "signature",
95
95
  "type": {
96
- "type-name": "Bytes",
97
- "length": 32
98
- }
99
- },
100
- {
101
- "name": "bigRy",
102
- "type": {
103
- "type-name": "Bytes",
104
- "length": 32
105
- }
106
- },
107
- {
108
- "name": "s",
109
- "type": {
110
- "type-name": "Bytes",
111
- "length": 32
112
- }
113
- },
114
- {
115
- "name": "recoveryId",
116
- "type": {
117
- "type-name": "Uint",
118
- "maxval": 255
96
+ "type-name": "Struct",
97
+ "name": "Signature",
98
+ "elements": [
99
+ {
100
+ "name": "bigR",
101
+ "type": {
102
+ "type-name": "Struct",
103
+ "name": "AffinePoint",
104
+ "elements": [
105
+ {
106
+ "name": "x",
107
+ "type": {
108
+ "type-name": "Bytes",
109
+ "length": 32
110
+ }
111
+ },
112
+ {
113
+ "name": "y",
114
+ "type": {
115
+ "type-name": "Bytes",
116
+ "length": 32
117
+ }
118
+ }
119
+ ]
120
+ }
121
+ },
122
+ {
123
+ "name": "s",
124
+ "type": {
125
+ "type-name": "Bytes",
126
+ "length": 32
127
+ }
128
+ },
129
+ {
130
+ "name": "recoveryId",
131
+ "type": {
132
+ "type-name": "Uint",
133
+ "maxval": 255
134
+ }
135
+ }
136
+ ]
119
137
  }
120
138
  }
121
139
  ]
@@ -129,7 +147,7 @@
129
147
  }
130
148
  },
131
149
  {
132
- "name": "postRespondBidirectional",
150
+ "name": "respondBidirectional",
133
151
  "pure": false,
134
152
  "proof": true,
135
153
  "arguments": [
@@ -165,24 +183,49 @@
165
183
  }
166
184
  },
167
185
  {
168
- "name": "r",
186
+ "name": "signature",
169
187
  "type": {
170
- "type-name": "Bytes",
171
- "length": 32
172
- }
173
- },
174
- {
175
- "name": "s",
176
- "type": {
177
- "type-name": "Bytes",
178
- "length": 32
179
- }
180
- },
181
- {
182
- "name": "recoveryId",
183
- "type": {
184
- "type-name": "Uint",
185
- "maxval": 255
188
+ "type-name": "Struct",
189
+ "name": "Signature",
190
+ "elements": [
191
+ {
192
+ "name": "bigR",
193
+ "type": {
194
+ "type-name": "Struct",
195
+ "name": "AffinePoint",
196
+ "elements": [
197
+ {
198
+ "name": "x",
199
+ "type": {
200
+ "type-name": "Bytes",
201
+ "length": 32
202
+ }
203
+ },
204
+ {
205
+ "name": "y",
206
+ "type": {
207
+ "type-name": "Bytes",
208
+ "length": 32
209
+ }
210
+ }
211
+ ]
212
+ }
213
+ },
214
+ {
215
+ "name": "s",
216
+ "type": {
217
+ "type-name": "Bytes",
218
+ "length": 32
219
+ }
220
+ },
221
+ {
222
+ "name": "recoveryId",
223
+ "type": {
224
+ "type-name": "Uint",
225
+ "maxval": 255
226
+ }
227
+ }
228
+ ]
186
229
  }
187
230
  }
188
231
  ]
@@ -269,7 +312,7 @@
269
312
  }
270
313
  },
271
314
  {
272
- "name": "signatureResponseCounterMap",
315
+ "name": "respondCounterMap",
273
316
  "index": 2,
274
317
  "exported": true,
275
318
  "storage": "Map",
@@ -286,7 +329,7 @@
286
329
  }
287
330
  },
288
331
  {
289
- "name": "signatureResponseMap",
332
+ "name": "respondMap",
290
333
  "index": 3,
291
334
  "exported": true,
292
335
  "storage": "Map",
@@ -319,31 +362,49 @@
319
362
  "name": "SignatureRespondedEvent",
320
363
  "elements": [
321
364
  {
322
- "name": "bigRx",
365
+ "name": "signature",
323
366
  "type": {
324
- "type-name": "Bytes",
325
- "length": 32
326
- }
327
- },
328
- {
329
- "name": "bigRy",
330
- "type": {
331
- "type-name": "Bytes",
332
- "length": 32
333
- }
334
- },
335
- {
336
- "name": "s",
337
- "type": {
338
- "type-name": "Bytes",
339
- "length": 32
340
- }
341
- },
342
- {
343
- "name": "recoveryId",
344
- "type": {
345
- "type-name": "Uint",
346
- "maxval": 255
367
+ "type-name": "Struct",
368
+ "name": "Signature",
369
+ "elements": [
370
+ {
371
+ "name": "bigR",
372
+ "type": {
373
+ "type-name": "Struct",
374
+ "name": "AffinePoint",
375
+ "elements": [
376
+ {
377
+ "name": "x",
378
+ "type": {
379
+ "type-name": "Bytes",
380
+ "length": 32
381
+ }
382
+ },
383
+ {
384
+ "name": "y",
385
+ "type": {
386
+ "type-name": "Bytes",
387
+ "length": 32
388
+ }
389
+ }
390
+ ]
391
+ }
392
+ },
393
+ {
394
+ "name": "s",
395
+ "type": {
396
+ "type-name": "Bytes",
397
+ "length": 32
398
+ }
399
+ },
400
+ {
401
+ "name": "recoveryId",
402
+ "type": {
403
+ "type-name": "Uint",
404
+ "maxval": 255
405
+ }
406
+ }
407
+ ]
347
408
  }
348
409
  }
349
410
  ]
@@ -414,24 +475,49 @@
414
475
  }
415
476
  },
416
477
  {
417
- "name": "r",
418
- "type": {
419
- "type-name": "Bytes",
420
- "length": 32
421
- }
422
- },
423
- {
424
- "name": "s",
425
- "type": {
426
- "type-name": "Bytes",
427
- "length": 32
428
- }
429
- },
430
- {
431
- "name": "recoveryId",
478
+ "name": "signature",
432
479
  "type": {
433
- "type-name": "Uint",
434
- "maxval": 255
480
+ "type-name": "Struct",
481
+ "name": "Signature",
482
+ "elements": [
483
+ {
484
+ "name": "bigR",
485
+ "type": {
486
+ "type-name": "Struct",
487
+ "name": "AffinePoint",
488
+ "elements": [
489
+ {
490
+ "name": "x",
491
+ "type": {
492
+ "type-name": "Bytes",
493
+ "length": 32
494
+ }
495
+ },
496
+ {
497
+ "name": "y",
498
+ "type": {
499
+ "type-name": "Bytes",
500
+ "length": 32
501
+ }
502
+ }
503
+ ]
504
+ }
505
+ },
506
+ {
507
+ "name": "s",
508
+ "type": {
509
+ "type-name": "Bytes",
510
+ "length": 32
511
+ }
512
+ },
513
+ {
514
+ "name": "recoveryId",
515
+ "type": {
516
+ "type-name": "Uint",
517
+ "maxval": 255
518
+ }
519
+ }
520
+ ]
435
521
  }
436
522
  }
437
523
  ]
@@ -7,56 +7,56 @@
7
7
  "type": "directory",
8
8
  "contract-info.json": {
9
9
  "type": "file",
10
- "size": 9940,
11
- "hash": "2bb608fe05b4a143193c286a8bf7cda7777350e82ae30e9bca5b9088c7f1d3bf"
10
+ "size": 13235,
11
+ "hash": "dd76fcf5b1f80f5d2033d905ff1144114096101f9fe8914c71af58d4a65a6810"
12
12
  }
13
13
  },
14
14
  "contract": {
15
15
  "type": "directory",
16
16
  "index.d.ts": {
17
17
  "type": "file",
18
- "size": 8450,
19
- "hash": "f02bccd41dc7a6c929faad7f3a0d68875481ea19f1869ca04d69f25f1fe723a8"
18
+ "size": 10094,
19
+ "hash": "6c2b225e3b84d2cbaa2c3d28f3bddbfccf6bd086fc134e00d93700f98a1e3ba5"
20
20
  },
21
21
  "index.js": {
22
22
  "type": "file",
23
- "size": 104652,
24
- "hash": "94e9c8454716f4b2cc6ada9e75e735693d9afbfcf956f83e319c5b745bad4a2a"
23
+ "size": 105394,
24
+ "hash": "68ebf9d9ea172b63f4cf3d64f02ba174aabfe69350b36a90f2e1effbcc82f77e"
25
25
  },
26
26
  "index.js.map": {
27
27
  "type": "file",
28
- "size": 3057,
29
- "hash": "93b50f8d99b21457b6ad34e2bc0c8afa366d10135668d46bd065315a10e7a450"
28
+ "size": 3082,
29
+ "hash": "0e1c413bad314030fea7e0e69dc2cf072f0cf3ef8c19402f80eaa7b3319db14a"
30
30
  }
31
31
  },
32
32
  "zkir": {
33
33
  "type": "directory",
34
- "postRespondBidirectional.bzkir": {
35
- "type": "file",
36
- "size": 1910,
37
- "hash": "0b70b24b36fc6ea5886a95b39d112f495a0eed34b18bde47d93f1c5110f75e99"
38
- },
39
- "postRespondBidirectional.zkir": {
40
- "type": "file",
41
- "size": 4646,
42
- "hash": "327dd3e13f92edd2fa6ec08e7dc0588dcfb0b40ce3f4f7c548465c14673ff2f5"
43
- },
44
- "postSignatureResponse.bzkir": {
34
+ "respond.bzkir": {
45
35
  "type": "file",
46
36
  "size": 1479,
47
37
  "hash": "f87e8441cc3489b1f7559f2d65445f2ea17fb3016ff15c3f58c4027f12a5fd7a"
48
38
  },
49
- "postSignatureResponse.zkir": {
39
+ "respond.zkir": {
50
40
  "type": "file",
51
41
  "size": 3813,
52
42
  "hash": "1f6e6a3c95d8fa3952c58e70588fc3661c9dd6115a1b01f530eb16f925bf4d2b"
53
43
  },
54
- "signBidirectionalEvent.bzkir": {
44
+ "respondBidirectional.bzkir": {
45
+ "type": "file",
46
+ "size": 2107,
47
+ "hash": "464c50f479f0ffc4b96c7f078cf17ed2c77aea02b39b9ff2f2e704afa1b1177a"
48
+ },
49
+ "respondBidirectional.zkir": {
50
+ "type": "file",
51
+ "size": 5044,
52
+ "hash": "f81004fe720567fc04ce27c6c173d12e5038e0924d1269636a69bdc2daa5e5f5"
53
+ },
54
+ "signBidirectional.bzkir": {
55
55
  "type": "file",
56
56
  "size": 1248,
57
57
  "hash": "df11c0f58df1650875608110fb3844bf6ba733fa1dc466f0faf7d52099ec47c5"
58
58
  },
59
- "signBidirectionalEvent.zkir": {
59
+ "signBidirectional.zkir": {
60
60
  "type": "file",
61
61
  "size": 3674,
62
62
  "hash": "72f63054869b9bb5ee895a3326ec10ff911e83523cf614a476d2b478b9152e11"
@@ -64,32 +64,32 @@
64
64
  },
65
65
  "keys": {
66
66
  "type": "directory",
67
- "postRespondBidirectional.prover": {
67
+ "respond.prover": {
68
68
  "type": "file",
69
- "size": 889414,
70
- "hash": "72beb2cfe9f8ec3266bcf96e495defbf427575f86d310602314177accb354aab"
69
+ "size": 446615,
70
+ "hash": "f43e6a128a257f06e6a19ea6ddceff5f94db81645460301c6d184ab4437c8169"
71
71
  },
72
- "postRespondBidirectional.verifier": {
72
+ "respond.verifier": {
73
73
  "type": "file",
74
74
  "size": 1353,
75
- "hash": "fa5fd5e2c04bf3553e601fb43482df5e0de872f2469216f6ac1b9f2b7e1248ee"
75
+ "hash": "22938eaebc029fd624db271e92857b132977c0373bf2f9ce823e21d011973e0d"
76
76
  },
77
- "postSignatureResponse.prover": {
77
+ "respondBidirectional.prover": {
78
78
  "type": "file",
79
- "size": 446615,
80
- "hash": "f43e6a128a257f06e6a19ea6ddceff5f94db81645460301c6d184ab4437c8169"
79
+ "size": 889611,
80
+ "hash": "fb6ce24c0e07a2d3b0d1829aa1d666d6c5d9842f84920a5758b0c05719f73792"
81
81
  },
82
- "postSignatureResponse.verifier": {
82
+ "respondBidirectional.verifier": {
83
83
  "type": "file",
84
84
  "size": 1353,
85
- "hash": "22938eaebc029fd624db271e92857b132977c0373bf2f9ce823e21d011973e0d"
85
+ "hash": "54cc1474465848c419a898730ce6351deff8586827f41022d24a29d627bece9d"
86
86
  },
87
- "signBidirectionalEvent.prover": {
87
+ "signBidirectional.prover": {
88
88
  "type": "file",
89
89
  "size": 888752,
90
90
  "hash": "3c3fb54421ac16821198a626fc2551d4f3201ebdc67995c61f0bcd8351f2e5de"
91
91
  },
92
- "signBidirectionalEvent.verifier": {
92
+ "signBidirectional.verifier": {
93
93
  "type": "file",
94
94
  "size": 1353,
95
95
  "hash": "3e603e64ac930b8e4e1412e0afb5b3769e3d9db62c3a0bace1fe367eb7dc868e"