@sig-net/midnight 0.21.0-rc.1 → 0.21.0-rc.2

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.
@@ -3,6 +3,8 @@ __compactRuntime.checkRuntimeVersion('0.18.0-rc.1');
3
3
 
4
4
  const _descriptor_0 = new __compactRuntime.CompactTypeBytes(32);
5
5
 
6
+ const _descriptor_1 = new __compactRuntime.CompactTypeBytes(100);
7
+
6
8
  class _AffinePoint_0 {
7
9
  alignment() {
8
10
  return _descriptor_0.alignment().concat(_descriptor_0.alignment());
@@ -18,49 +20,47 @@ class _AffinePoint_0 {
18
20
  }
19
21
  }
20
22
 
21
- const _descriptor_1 = new _AffinePoint_0();
23
+ const _descriptor_2 = new _AffinePoint_0();
22
24
 
23
- const _descriptor_2 = new __compactRuntime.CompactTypeUnsignedInteger(255n, 1);
25
+ const _descriptor_3 = new __compactRuntime.CompactTypeUnsignedInteger(255n, 1);
24
26
 
25
27
  class _Signature_0 {
26
28
  alignment() {
27
- return _descriptor_1.alignment().concat(_descriptor_0.alignment().concat(_descriptor_2.alignment()));
29
+ return _descriptor_2.alignment().concat(_descriptor_0.alignment().concat(_descriptor_3.alignment()));
28
30
  }
29
31
  fromValue(value_0) {
30
32
  return {
31
- bigR: _descriptor_1.fromValue(value_0),
33
+ bigR: _descriptor_2.fromValue(value_0),
32
34
  s: _descriptor_0.fromValue(value_0),
33
- recoveryId: _descriptor_2.fromValue(value_0)
35
+ recoveryId: _descriptor_3.fromValue(value_0)
34
36
  }
35
37
  }
36
38
  toValue(value_0) {
37
- return _descriptor_1.toValue(value_0.bigR).concat(_descriptor_0.toValue(value_0.s).concat(_descriptor_2.toValue(value_0.recoveryId)));
39
+ return _descriptor_2.toValue(value_0.bigR).concat(_descriptor_0.toValue(value_0.s).concat(_descriptor_3.toValue(value_0.recoveryId)));
38
40
  }
39
41
  }
40
42
 
41
- const _descriptor_3 = new _Signature_0();
43
+ const _descriptor_4 = new _Signature_0();
42
44
 
43
45
  class _RespondBidirectionalEvent_0 {
44
46
  alignment() {
45
- return _descriptor_3.alignment();
47
+ return _descriptor_4.alignment();
46
48
  }
47
49
  fromValue(value_0) {
48
50
  return {
49
- signature: _descriptor_3.fromValue(value_0)
51
+ signature: _descriptor_4.fromValue(value_0)
50
52
  }
51
53
  }
52
54
  toValue(value_0) {
53
- return _descriptor_3.toValue(value_0.signature);
55
+ return _descriptor_4.toValue(value_0.signature);
54
56
  }
55
57
  }
56
58
 
57
- const _descriptor_4 = new _RespondBidirectionalEvent_0();
58
-
59
- const _descriptor_5 = __compactRuntime.CompactTypeSecp256k1Point;
59
+ const _descriptor_5 = new _RespondBidirectionalEvent_0();
60
60
 
61
- const _descriptor_6 = __compactRuntime.CompactTypeBoolean;
61
+ const _descriptor_6 = __compactRuntime.CompactTypeSecp256k1Point;
62
62
 
63
- const _descriptor_7 = new __compactRuntime.CompactTypeBytes(100);
63
+ const _descriptor_7 = __compactRuntime.CompactTypeBoolean;
64
64
 
65
65
  const _descriptor_8 = new __compactRuntime.CompactTypeBytes(1);
66
66
 
@@ -68,8 +68,6 @@ const _descriptor_9 = new __compactRuntime.CompactTypeUnsignedInteger(3402823669
68
68
 
69
69
  const _descriptor_10 = new __compactRuntime.CompactTypeBytes(20);
70
70
 
71
- const _descriptor_11 = __compactRuntime.CompactTypeSecp256k1Scalar;
72
-
73
71
  class _ContractAddress_0 {
74
72
  alignment() {
75
73
  return _descriptor_0.alignment();
@@ -84,28 +82,30 @@ class _ContractAddress_0 {
84
82
  }
85
83
  }
86
84
 
87
- const _descriptor_12 = new _ContractAddress_0();
85
+ const _descriptor_11 = new _ContractAddress_0();
88
86
 
89
- const _descriptor_13 = new __compactRuntime.CompactTypeVector(4, _descriptor_2);
87
+ const _descriptor_12 = new __compactRuntime.CompactTypeVector(4, _descriptor_3);
90
88
 
91
- const _descriptor_14 = new __compactRuntime.CompactTypeBytes(128);
89
+ const _descriptor_13 = new __compactRuntime.CompactTypeBytes(128);
92
90
 
93
91
  class _SignBidirectionalEventNotification_0 {
94
92
  alignment() {
95
- return _descriptor_2.alignment().concat(_descriptor_14.alignment());
93
+ return _descriptor_3.alignment().concat(_descriptor_13.alignment());
96
94
  }
97
95
  fromValue(value_0) {
98
96
  return {
99
- version: _descriptor_2.fromValue(value_0),
100
- payload: _descriptor_14.fromValue(value_0)
97
+ version: _descriptor_3.fromValue(value_0),
98
+ payload: _descriptor_13.fromValue(value_0)
101
99
  }
102
100
  }
103
101
  toValue(value_0) {
104
- return _descriptor_2.toValue(value_0.version).concat(_descriptor_14.toValue(value_0.payload));
102
+ return _descriptor_3.toValue(value_0.version).concat(_descriptor_13.toValue(value_0.payload));
105
103
  }
106
104
  }
107
105
 
108
- const _descriptor_15 = new _SignBidirectionalEventNotification_0();
106
+ const _descriptor_14 = new _SignBidirectionalEventNotification_0();
107
+
108
+ const _descriptor_15 = __compactRuntime.CompactTypeSecp256k1Scalar;
109
109
 
110
110
  const _descriptor_16 = __compactRuntime.CompactTypeSecp256k1Base;
111
111
 
@@ -126,6 +126,8 @@ class _tuple_0 {
126
126
 
127
127
  const _descriptor_17 = new _tuple_0();
128
128
 
129
+ const _descriptor_18 = __compactRuntime.CompactTypeField;
130
+
129
131
  class _tuple_1 {
130
132
  alignment() {
131
133
  return _descriptor_0.alignment().concat(_descriptor_8.alignment());
@@ -141,63 +143,63 @@ class _tuple_1 {
141
143
  }
142
144
  }
143
145
 
144
- const _descriptor_18 = new _tuple_1();
146
+ const _descriptor_19 = new _tuple_1();
145
147
 
146
148
  class _tuple_2 {
147
149
  alignment() {
148
- return _descriptor_0.alignment().concat(_descriptor_7.alignment());
150
+ return _descriptor_0.alignment().concat(_descriptor_1.alignment());
149
151
  }
150
152
  fromValue(value_0) {
151
153
  return [
152
154
  _descriptor_0.fromValue(value_0),
153
- _descriptor_7.fromValue(value_0)
155
+ _descriptor_1.fromValue(value_0)
154
156
  ]
155
157
  }
156
158
  toValue(value_0) {
157
- return _descriptor_0.toValue(value_0[0]).concat(_descriptor_7.toValue(value_0[1]));
159
+ return _descriptor_0.toValue(value_0[0]).concat(_descriptor_1.toValue(value_0[1]));
158
160
  }
159
161
  }
160
162
 
161
- const _descriptor_19 = new _tuple_2();
163
+ const _descriptor_20 = new _tuple_2();
162
164
 
163
165
  class _Secp256k1EcdsaSignature_0 {
164
166
  alignment() {
165
- return _descriptor_11.alignment().concat(_descriptor_11.alignment());
167
+ return _descriptor_15.alignment().concat(_descriptor_15.alignment());
166
168
  }
167
169
  fromValue(value_0) {
168
170
  return {
169
- r: _descriptor_11.fromValue(value_0),
170
- s: _descriptor_11.fromValue(value_0)
171
+ r: _descriptor_15.fromValue(value_0),
172
+ s: _descriptor_15.fromValue(value_0)
171
173
  }
172
174
  }
173
175
  toValue(value_0) {
174
- return _descriptor_11.toValue(value_0.r).concat(_descriptor_11.toValue(value_0.s));
176
+ return _descriptor_15.toValue(value_0.r).concat(_descriptor_15.toValue(value_0.s));
175
177
  }
176
178
  }
177
179
 
178
- const _descriptor_20 = new _Secp256k1EcdsaSignature_0();
180
+ const _descriptor_21 = new _Secp256k1EcdsaSignature_0();
179
181
 
180
- const _descriptor_21 = new __compactRuntime.CompactTypeUnsignedInteger(18446744073709551615n, 8);
182
+ const _descriptor_22 = new __compactRuntime.CompactTypeUnsignedInteger(18446744073709551615n, 8);
181
183
 
182
184
  class _Either_0 {
183
185
  alignment() {
184
- return _descriptor_6.alignment().concat(_descriptor_0.alignment().concat(_descriptor_0.alignment()));
186
+ return _descriptor_7.alignment().concat(_descriptor_0.alignment().concat(_descriptor_0.alignment()));
185
187
  }
186
188
  fromValue(value_0) {
187
189
  return {
188
- is_left: _descriptor_6.fromValue(value_0),
190
+ is_left: _descriptor_7.fromValue(value_0),
189
191
  left: _descriptor_0.fromValue(value_0),
190
192
  right: _descriptor_0.fromValue(value_0)
191
193
  }
192
194
  }
193
195
  toValue(value_0) {
194
- return _descriptor_6.toValue(value_0.is_left).concat(_descriptor_0.toValue(value_0.left).concat(_descriptor_0.toValue(value_0.right)));
196
+ return _descriptor_7.toValue(value_0.is_left).concat(_descriptor_0.toValue(value_0.left).concat(_descriptor_0.toValue(value_0.right)));
195
197
  }
196
198
  }
197
199
 
198
- const _descriptor_22 = new _Either_0();
200
+ const _descriptor_23 = new _Either_0();
199
201
 
200
- const _descriptor_23 = new __compactRuntime.CompactTypeUnsignedInteger(4294967295n, 4);
202
+ const _descriptor_24 = new __compactRuntime.CompactTypeUnsignedInteger(4294967295n, 4);
201
203
 
202
204
  export class Contract {
203
205
  witnesses;
@@ -337,16 +339,20 @@ export class Contract {
337
339
  ===
338
340
  r_0;
339
341
  }
340
- _keccak256_0(value_0) {
341
- const result_0 = __compactRuntime.keccak256(_descriptor_18, value_0);
342
+ _transientHash_0(value_0) {
343
+ const result_0 = __compactRuntime.transientHash(_descriptor_19, value_0);
344
+ return result_0;
345
+ }
346
+ _transientHash_1(value_0) {
347
+ const result_0 = __compactRuntime.transientHash(_descriptor_20, value_0);
342
348
  return result_0;
343
349
  }
344
- _keccak256_1(value_0) {
345
- const result_0 = __compactRuntime.keccak256(_descriptor_19, value_0);
350
+ _transientHash_2(value_0) {
351
+ const result_0 = __compactRuntime.transientHash(_descriptor_17, value_0);
346
352
  return result_0;
347
353
  }
348
- _keccak256_2(value_0) {
349
- const result_0 = __compactRuntime.keccak256(_descriptor_17, value_0);
354
+ _upgradeFromTransient_0(x_0) {
355
+ const result_0 = __compactRuntime.upgradeFromTransient(x_0);
350
356
  return result_0;
351
357
  }
352
358
  _mul_0(x_0, y_0) {
@@ -389,13 +395,16 @@ export class Contract {
389
395
  Number) };
390
396
  }
391
397
  _calculateSignetAttestationDigest_0(requestId_0, serializedOutput_0) {
392
- return this._keccak256_0([requestId_0, serializedOutput_0]);
398
+ return this._upgradeFromTransient_0(this._transientHash_0([requestId_0,
399
+ serializedOutput_0]));
393
400
  }
394
401
  _calculateSignetAttestationDigest_1(requestId_0, serializedOutput_0) {
395
- return this._keccak256_1([requestId_0, serializedOutput_0]);
402
+ return this._upgradeFromTransient_0(this._transientHash_1([requestId_0,
403
+ serializedOutput_0]));
396
404
  }
397
405
  _calculateSignetAttestationDigest_2(requestId_0, serializedOutput_0) {
398
- return this._keccak256_2([requestId_0, serializedOutput_0]);
406
+ return this._upgradeFromTransient_0(this._transientHash_2([requestId_0,
407
+ serializedOutput_0]));
399
408
  }
400
409
  _verifyRespondBidirectionalEvent_0(requestId_0,
401
410
  serializedOutput_0,
@@ -410,13 +419,13 @@ export class Contract {
410
419
  32,
411
420
  respondBidirectionalEvent_0.signature.bigR.x,
412
421
  'Secp256k1Scalar',
413
- 'Signet.compact line 336 char 12'),
422
+ 'Signet.compact line 345 char 12'),
414
423
  s:
415
424
  __compactRuntime.convertBytesToField(115792089237316195423570985008687907852837564279074904382605163141518161494336n,
416
425
  32,
417
426
  respondBidirectionalEvent_0.signature.s,
418
427
  'Secp256k1Scalar',
419
- 'Signet.compact line 337 char 12') },
428
+ 'Signet.compact line 346 char 12') },
420
429
  mpcResponseKey_0);
421
430
  }
422
431
  _evmAddressAbiWord_0(addr_0) {
@@ -427,7 +436,7 @@ export class Contract {
427
436
  _numericAbiWord_0(value_0) {
428
437
  const le_0 = Array.from(__compactRuntime.convertBigintToBytes(16,
429
438
  value_0,
430
- 'Signet.compact line 415 char 17'),
439
+ 'Signet.compact line 424 char 17'),
431
440
  BigInt);
432
441
  return Uint8Array.from([...Array.from(new Uint8Array(16), BigInt),
433
442
  le_0[15],
@@ -509,7 +518,7 @@ export class Contract {
509
518
  v_0[31]);
510
519
  return ((t1) => {
511
520
  if (t1 > 340282366920938463463374607431768211455n) {
512
- throw new __compactRuntime.CompactError('Signet.compact line 467 char 12: cast from Field or Uint value to smaller Uint value failed: ' + t1 + ' is greater than 340282366920938463463374607431768211455');
521
+ throw new __compactRuntime.CompactError('Signet.compact line 476 char 12: cast from Field or Uint value to smaller Uint value failed: ' + t1 + ' is greater than 340282366920938463463374607431768211455');
513
522
  }
514
523
  return t1;
515
524
  })(b15_0);
@@ -520,7 +529,7 @@ export class Contract {
520
529
  ((e, i) => e.slice(i, i+31))(word_0,
521
530
  Number(0n)),
522
531
  'Field',
523
- 'Signet.compact line 473 char 12')
532
+ 'Signet.compact line 482 char 12')
524
533
  ===
525
534
  0n,
526
535
  'ABI word is not a canonical Boolean');
@@ -529,7 +538,7 @@ export class Contract {
529
538
  ((e, i) => e.slice(i, i+1))(word_0,
530
539
  Number(31n)),
531
540
  'Field',
532
- 'Signet.compact line 474 char 18');
541
+ 'Signet.compact line 483 char 18');
533
542
  __compactRuntime.assert(last_0 === 0n || last_0 === 1n,
534
543
  'ABI word is not a canonical Boolean');
535
544
  return last_0 === 1n;
@@ -588,21 +597,21 @@ export const pureCircuits = {
588
597
  if (!(typeof(callerAddress_0) === 'object' && callerAddress_0.bytes.buffer instanceof ArrayBuffer && callerAddress_0.bytes.BYTES_PER_ELEMENT === 1 && callerAddress_0.bytes.length === 32)) {
589
598
  __compactRuntime.typeError('constructSignBidirectionalEventNotificationV1',
590
599
  'argument 1',
591
- 'Signet.compact line 229 char 3',
600
+ 'Signet.compact line 238 char 3',
592
601
  'struct ContractAddress<bytes: Bytes<32>>',
593
602
  callerAddress_0)
594
603
  }
595
604
  if (!(typeof(requestsPathDepth_0) === 'bigint' && requestsPathDepth_0 >= 0n && requestsPathDepth_0 <= 255n)) {
596
605
  __compactRuntime.typeError('constructSignBidirectionalEventNotificationV1',
597
606
  'argument 2',
598
- 'Signet.compact line 229 char 3',
607
+ 'Signet.compact line 238 char 3',
599
608
  'Uint<0..256>',
600
609
  requestsPathDepth_0)
601
610
  }
602
611
  if (!(Array.isArray(requestsPath_0) && requestsPath_0.length === 4 && requestsPath_0.every((t) => typeof(t) === 'bigint' && t >= 0n && t <= 255n))) {
603
612
  __compactRuntime.typeError('constructSignBidirectionalEventNotificationV1',
604
613
  'argument 3',
605
- 'Signet.compact line 229 char 3',
614
+ 'Signet.compact line 238 char 3',
606
615
  'Vector<4, Uint<0..256>>',
607
616
  requestsPath_0)
608
617
  }
@@ -618,7 +627,7 @@ export const pureCircuits = {
618
627
  if (!(addr_0.buffer instanceof ArrayBuffer && addr_0.BYTES_PER_ELEMENT === 1 && addr_0.length === 20)) {
619
628
  __compactRuntime.typeError('evmAddressAbiWord',
620
629
  'argument 1',
621
- 'Signet.compact line 406 char 3',
630
+ 'Signet.compact line 415 char 3',
622
631
  'Bytes<20>',
623
632
  addr_0)
624
633
  }
@@ -632,7 +641,7 @@ export const pureCircuits = {
632
641
  if (!(typeof(value_0) === 'bigint' && value_0 >= 0n && value_0 <= 340282366920938463463374607431768211455n)) {
633
642
  __compactRuntime.typeError('numericAbiWord',
634
643
  'argument 1',
635
- 'Signet.compact line 412 char 3',
644
+ 'Signet.compact line 421 char 3',
636
645
  'Uint<0..340282366920938463463374607431768211456>',
637
646
  value_0)
638
647
  }
@@ -646,7 +655,7 @@ export const pureCircuits = {
646
655
  if (!(typeof(value_0) === 'boolean')) {
647
656
  __compactRuntime.typeError('boolAbiWord',
648
657
  'argument 1',
649
- 'Signet.compact line 425 char 3',
658
+ 'Signet.compact line 434 char 3',
650
659
  'Boolean',
651
660
  value_0)
652
661
  }
@@ -660,7 +669,7 @@ export const pureCircuits = {
660
669
  if (!(word_0.buffer instanceof ArrayBuffer && word_0.BYTES_PER_ELEMENT === 1 && word_0.length === 32)) {
661
670
  __compactRuntime.typeError('abiWordToUint128',
662
671
  'argument 1',
663
- 'Signet.compact line 433 char 3',
672
+ 'Signet.compact line 442 char 3',
664
673
  'Bytes<32>',
665
674
  word_0)
666
675
  }
@@ -674,7 +683,7 @@ export const pureCircuits = {
674
683
  if (!(word_0.buffer instanceof ArrayBuffer && word_0.BYTES_PER_ELEMENT === 1 && word_0.length === 32)) {
675
684
  __compactRuntime.typeError('abiWordToBool',
676
685
  'argument 1',
677
- 'Signet.compact line 472 char 3',
686
+ 'Signet.compact line 481 char 3',
678
687
  'Bytes<32>',
679
688
  word_0)
680
689
  }
@@ -4,5 +4,5 @@
4
4
  "sourceRoot": "../../../",
5
5
  "sources": ["src/circuits.compact", "src/./Signet.compact", "compiler/zkir-v3-library.compact"],
6
6
  "names": [],
7
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;;;;;MCoOE,MAAA,6CAsBC;;OAAA;MA2JD,MAAA,iBAEC;;OAAA;MAID,MAAA,cASC;;OAAA;MAID,MAAA,WAEC;;OAAA;MAMD,MAAA,gBAmCC;;OAAA;MAID,MAAA,aAKC;;OAAA;MDlcH,MAAA,iCAKC;;OAAA;MAED,MAAA,kCAKC;;OAAA;MAED,MAAA,mCAKC;;OAAA;MAED,MAAA,iCAYC;;OAAA;;;;GACA;EA5DD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DC;EEhCD,AAAA,yBAA8B;UACtB,iBAAI;UACJ,gCACQ;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;0CACA;;;;gDACP;;;;EAqBT,AAAA,wBACiB,WACA,OACA;UAET,oCAA2C;UAC3C,2BAAS;UAAT,MAAA;UAAA,MAAA;UACA,kBAAyB;UACzB,mBAA0B,KAAG;UAC7B,mBAA0B,KAAG;UAC7B,+CAA6C;gDAAW,MAAI;;;;8GAC1C;;;;;WAA2C;;EA/FrE,AAAA,aAAA;gEAAA;;;EAAA,AAAA,aAAA;gEAAA;;;EAAA,AAAA,aAAA;gEAAA;;;EAAA,AAAA,OAAA,KAAA;yDAAA,K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DAChB,2BAAyB;mDACzB,gBAAc;GAEjB;;;;;;;;;;;;;;;;;;;;;;;ECkLC,AAAA,6CAsBC;;;;UAnBC,eAA8B;UAG9B,mBAA0B;UAI1B,cAAgC;;;;;;;;;;;;;;;;;;;;;;2EAPhC,eAA8B;2EAG9B,mBAA0B;2EAI1B,cAAgC;GAYjC;EA2JD,AAAA,iBAEC;;;;UAFqC,MAAe;;;;;;;;+CAAf,MAAe;GAEpD;EAID,AAAA,cASC;;;;UATkC,OAAgB;;;;;;;;4CAAhB,OAAgB;GASlD;EAID,AAAA,WAEC;;;;UAF+B,OAAc;;;;;;;;yCAAd,OAAc;GAE7C;EAMD,AAAA,gBAmCC;;;;UAnCoC,MAAe;;;;;;;;8CAAf,MAAe;GAmCnD;EAID,AAAA,aAKC;;;;UALiC,MAAe;;;;;;;;2CAAf,MAAe;GAKhD;ED3cH,AAAA,iCAKC;;;;UAJC,WAAoB;UACpB,kBAA0B;;;;;;;;;;;;;;;+DAD1B,WAAoB;+DACpB,kBAA0B;GAG3B;EAED,AAAA,kCAKC;;;;UAJC,WAAoB;UACpB,kBAA2B;;;;;;;;;;;;;;;gEAD3B,WAAoB;gEACpB,kBAA2B;GAG5B;EAED,AAAA,mCAKC;;;;UAJC,WAAoB;UACpB,kBAA4B;;;;;;;;;;;;;;;iEAD5B,WAAoB;iEACpB,kBAA4B;GAG7B;EAED,AAAA,iCAYC;;;;UAXC,WAAoB;UACpB,kBAA2B;UAC3B,2BAAoD;UACpD,gBAA8B;;;;;;;;;;;;;;;;;;;;;;+DAH9B,WAAoB;+DACpB,kBAA2B;+DAC3B,2BAAoD;+DACpD,gBAA8B;GAQ/B;;;;;;"
8
8
  }
@@ -1,9 +1,7 @@
1
1
  import { type RequestId, type SignBidirectionalEvent } from "./signet-requests.ts";
2
2
  /**
3
- * Canonical id of a signet request: the keccak256 of the entire event
4
- * record, the sender address included, with no extra domain tag. Pass the
5
- * record exactly as the ledger stores it, unused slots included and schemas
6
- * at their declared widths.
3
+ * Canonical id of a signet request: the transientHash (Poseidon) of the
4
+ * entire event record over its field-aligned representation.
7
5
  *
8
6
  * @param request - The full event record (contract-shaped, all slots).
9
7
  * @returns The 32-byte request id, the record's ledger map key.
@@ -1 +1 @@
1
- {"version":3,"file":"signet-request-id.d.ts","sourceRoot":"","sources":["../src/signet-request-id.ts"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,sBAAsB,EAG5B,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,sBAAsB,GAAG,SAAS,CAe7E"}
1
+ {"version":3,"file":"signet-request-id.d.ts","sourceRoot":"","sources":["../src/signet-request-id.ts"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,sBAAsB,EAG5B,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,sBAAsB,GAAG,SAAS,CAiB7E"}
@@ -3,14 +3,12 @@
3
3
  // signet-requests.ts). Chain-agnostic entry point that resolves each
4
4
  // record's tx-params descriptor by its `txParamType` tag, so every
5
5
  // decomposition mints ids through this one function.
6
- import { keccak256 } from "@midnight-ntwrk/compact-runtime";
6
+ import { transientHash, upgradeFromTransient } from "@midnight-ntwrk/compact-runtime";
7
7
  import { evmType2TxParamsDescriptorOf } from "./signet-evtype2tx-requests.js";
8
8
  import { signBidirectionalEventDescriptorWith, TxParamType, } from "./signet-requests.js";
9
9
  /**
10
- * Canonical id of a signet request: the keccak256 of the entire event
11
- * record, the sender address included, with no extra domain tag. Pass the
12
- * record exactly as the ledger stores it, unused slots included and schemas
13
- * at their declared widths.
10
+ * Canonical id of a signet request: the transientHash (Poseidon) of the
11
+ * entire event record over its field-aligned representation.
14
12
  *
15
13
  * @param request - The full event record (contract-shaped, all slots).
16
14
  * @returns The 32-byte request id, the record's ledger map key.
@@ -22,6 +20,6 @@ export function calculateRequestId(request) {
22
20
  throw new Error(`unsupported txParamType ${String(request.txParamType)}: this id computation ` +
23
21
  `understands evmType2 (${String(TxParamType.evmType2)})`);
24
22
  }
25
- return keccak256(signBidirectionalEventDescriptorWith(evmType2TxParamsDescriptorOf(request.txParams), request.outputDeserializationSchema.length, request.respondSerializationSchema.length), request);
23
+ return upgradeFromTransient(transientHash(signBidirectionalEventDescriptorWith(evmType2TxParamsDescriptorOf(request.txParams), request.outputDeserializationSchema.length, request.respondSerializationSchema.length), request));
26
24
  }
27
25
  //# sourceMappingURL=signet-request-id.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"signet-request-id.js","sourceRoot":"","sources":["../src/signet-request-id.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,0DAA0D;AAC1D,qEAAqE;AACrE,mEAAmE;AACnE,qDAAqD;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAE5D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAGL,oCAAoC,EACpC,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAA+B;IAChE,IAAI,OAAO,CAAC,WAAW,KAAK,WAAW,CAAC,QAAQ,EAAE,CAAC;QACjD,MAAM,IAAI,KAAK,CACb,2BAA2B,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,wBAAwB;YAC5E,yBAAyB,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAC3D,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CACd,oCAAoC,CAClC,4BAA4B,CAAC,OAAO,CAAC,QAAQ,CAAC,EAC9C,OAAO,CAAC,2BAA2B,CAAC,MAAM,EAC1C,OAAO,CAAC,0BAA0B,CAAC,MAAM,CAC1C,EACD,OAAO,CACR,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"signet-request-id.js","sourceRoot":"","sources":["../src/signet-request-id.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,0DAA0D;AAC1D,qEAAqE;AACrE,mEAAmE;AACnE,qDAAqD;AAErD,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEtF,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAGL,oCAAoC,EACpC,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAA+B;IAChE,IAAI,OAAO,CAAC,WAAW,KAAK,WAAW,CAAC,QAAQ,EAAE,CAAC;QACjD,MAAM,IAAI,KAAK,CACb,2BAA2B,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,wBAAwB;YAC5E,yBAAyB,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAC3D,CAAC;IACJ,CAAC;IACD,OAAO,oBAAoB,CACzB,aAAa,CACX,oCAAoC,CAClC,4BAA4B,CAAC,OAAO,CAAC,QAAQ,CAAC,EAC9C,OAAO,CAAC,2BAA2B,CAAC,MAAM,EAC1C,OAAO,CAAC,0BAA0B,CAAC,MAAM,CAC1C,EACD,OAAO,CACR,CACF,CAAC;AACJ,CAAC"}
@@ -24,8 +24,8 @@ export declare const TxParamType: {
24
24
  readonly evmType2: 0;
25
25
  /**
26
26
  * Never emitted: the Compact-side padding variant that keeps the enum at
27
- * >= 2 variants (a 1-variant enum is a zero-byte value the proof server
28
- * cannot parse inside persistentHash preimages).
27
+ * >= 2 variants, so it compiles to a one-byte value rather than a
28
+ * zero-byte one the proof server cannot parse inside a hash preimage.
29
29
  */
30
30
  readonly reserved: 1;
31
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"signet-requests.d.ts","sourceRoot":"","sources":["../src/signet-requests.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAKL,KAA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/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAM7D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,YAAY,GAAG,SAAS,CAE1D;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,KAAK,CAAC;AAE7B;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE,QAAQ,CAAC,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC,GACzD,2BAA2B,CAM7B"}
@@ -28,8 +28,8 @@ export const TxParamType = {
28
28
  evmType2: 0,
29
29
  /**
30
30
  * Never emitted: the Compact-side padding variant that keeps the enum at
31
- * >= 2 variants (a 1-variant enum is a zero-byte value the proof server
32
- * cannot parse inside persistentHash preimages).
31
+ * >= 2 variants, so it compiles to a one-byte value rather than a
32
+ * zero-byte one the proof server cannot parse inside a hash preimage.
33
33
  */
34
34
  reserved: 1,
35
35
  };
@@ -60,16 +60,15 @@ export const MPCDestination = {
60
60
  // tx-params type and schema lengths, and the Compact compiler cannot export
61
61
  // type-parameterised circuits from the top level, so the record descriptor
62
62
  // (and `calculateRequestId` built on it, see signet-request-id.ts) gets a TS
63
- // twin here. Ids come from the same
64
- // `keccak256` runtime builtin compiled circuits call. Lockstep with
65
- // Signet.compact is enforced by test-caller-contract's
63
+ // twin here. Ids come from the same `transientHash` runtime builtin compiled
64
+ // circuits call. Lockstep with Signet.compact is enforced by test-caller-contract's
66
65
  // "submitSignatureRequest round-trip" test, which asserts the id computed
67
66
  // here equals the ledger map key minted by the compiled contract.
68
67
  // Runtime descriptors of the signet enums, at the literals the compiler
69
68
  // emits. NOTE: a 1-variant enum would compile to `CompactTypeEnum(0, 0)`,
70
- // zero bytes, which the proof server cannot parse inside persistentHash
71
- // preimages. Every enum therefore carries a padding `reserved` variant so it
72
- // stays at (1, 1). The Compact-generic base descriptors live in
69
+ // zero bytes, which the proof server cannot parse inside a hash preimage.
70
+ // Every enum therefore carries a padding `reserved` variant so it stays at
71
+ // (1, 1). The Compact-generic base descriptors live in
73
72
  // compact-descriptors.ts.
74
73
  const TX_PARAM_TYPE = new CompactTypeEnum(1, 1);
75
74
  const MPC_SIGNATURE_ALGORITHM = new CompactTypeEnum(1, 1);
@@ -1 +1 @@
1
- {"version":3,"file":"signet-requests.js","sourceRoot":"","sources":["../src/signet-requests.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,4EAA4E;AAC5E,4EAA4E;AAC5E,2EAA2E;AAC3E,qCAAqC;AACrC,EAAE;AACF,0EAA0E;AAC1E,6EAA6E;AAC7E,8CAA8C;AAC9C,yDAAyD;AAEzD,OAAO,EAEL,gBAAgB,EAChB,eAAe,GAChB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,uBAAuB,EACvB,gBAAgB,EAEhB,MAAM,EACN,OAAO,GACR,MAAM,0BAA0B,CAAC;AAYlC;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAA2B,QAAQ,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,sFAAsF;IACtF,QAAQ,EAAE,CAAC;IACX;;;;OAIG;IACH,QAAQ,EAAE,CAAC;CACH,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,4BAA4B;IAC5B,KAAK,EAAE,CAAC;IACR,0EAA0E;IAC1E,QAAQ,EAAE,CAAC;CACH,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,sCAAsC;IACtC,MAAM,EAAE,CAAC;IACT,0EAA0E;IAC1E,QAAQ,EAAE,CAAC;CACH,CAAC;AAqCX,+EAA+E;AAC/E,EAAE;AACF,0EAA0E;AAC1E,0EAA0E;AAC1E,4EAA4E;AAC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AAC;QAC3E,0BAA0B,EAAE,IAAI,gBAAgB,CAAC,uBAAuB,CAAC;KAC1E,CAAC,CAAC;AACL,CAAC;AA4CD;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,SAAoB;IAC/C,OAAO,UAAU,CAAC,SAAS,CAAiB,CAAC;AAC/C,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IACpD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,qCAAqC,KAAK,GAAG,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,GAAmB,CAAC;AAC7B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,EAAgB;IAC7C,OAAO,UAAU,CAAC,EAAE,CAAC,CAAC;AACxB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,CAAC;AAE7B;;;;;;;;GAQG;AACH,MAAM,UAAU,6BAA6B,CAC3C,WAA0D;IAE1D,MAAM,KAAK,GAAgC,IAAI,GAAG,EAAE,CAAC;IACrD,KAAK,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,WAAW,EAAE,CAAC;QAC/C,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sig-net/midnight",
3
- "version": "0.21.0-rc.1",
3
+ "version": "0.21.0-rc.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sig-net/midnight-integration",
@@ -48,7 +48,7 @@
48
48
  "@midnight-ntwrk/compact-runtime": "0.18.0-rc.1",
49
49
  "@midnight-ntwrk/midnight-js-types": "5.0.0-beta.6",
50
50
  "@noble/curves": "^2.2.0",
51
- "@sig-net/midnight-serde": "^0.21.0-rc.1",
51
+ "@sig-net/midnight-serde": "^0.21.0-rc.2",
52
52
  "ethers": "^6.17.0"
53
53
  },
54
54
  "devDependencies": {
@@ -19,7 +19,7 @@
19
19
  //
20
20
  // Key types at a glance (each declaration below carries the full contract):
21
21
  // - SignBidirectionalEvent: a client contract's structured request for a signature on a transaction.
22
- // - RequestId: 32-byte id of a request, the keccak256 of the whole SignBidirectionalEvent record.
22
+ // - RequestId: 32-byte id of a request, the transientHash of the whole SignBidirectionalEvent record.
23
23
  // - SignBidirectionalEventMap: the RequestId -> SignBidirectionalEvent map a client contract
24
24
  // declares in its own ledger for the MPC to read requests from.
25
25
  // - SignetSigner: the contract interface client contracts call to notify the Signet singleton.
@@ -166,17 +166,26 @@ module Signet {
166
166
 
167
167
  // ---- SignBidirectionalEvent RequestId --------------------------------------------------------------
168
168
 
169
- // 32 byte chain agnostic nominal id, calculated as keccak256 of the whole
169
+ // 32 byte chain agnostic nominal id, calculated as the transientHash of the whole
170
170
  // SignBidirectionalEvent record (see calculateRequestId).
171
171
  export new type RequestId = Bytes<32>;
172
172
 
173
- // keccak256 of the whole record: the id commits to every field, including the
174
- // sender, and carries no domain-separation tag. Off-chain twins must reproduce
175
- // the field-aligned binary layout exactly.
173
+ // transientHash (Poseidon over the record's field-aligned representation) upgraded
174
+ // to Bytes<32>: the id commits to every field, including the sender, and carries no
175
+ // domain-separation tag. Off-chain twins must reproduce the field-aligned layout
176
+ // exactly.
177
+ //
178
+ // Two properties follow from the field-aligned representation and matter to anyone
179
+ // reasoning about these ids:
180
+ // - byte 31 is always zero. upgradeFromTransient writes the field element's 31
181
+ // little-endian bytes into bytes 0..30, so an id carries ~248 bits of entropy.
182
+ // - a Bytes<N> field packs into ceil(N/31) field elements, so trailing zero bytes
183
+ // within a chunk do not change the hash. Widths here are fixed at compile time
184
+ // and every id commits to its sender, so requests cannot collide in practice.
176
185
  export pure circuit calculateRequestId<TxParams, #LenOutputDeserialization, #LenRespondSerialization>(
177
186
  request: SignBidirectionalEvent<TxParams, LenOutputDeserialization, LenRespondSerialization>
178
187
  ): RequestId {
179
- return keccak256<SignBidirectionalEvent<TxParams, LenOutputDeserialization, LenRespondSerialization>>(request) as RequestId;
188
+ return upgradeFromTransient(transientHash<SignBidirectionalEvent<TxParams, LenOutputDeserialization, LenRespondSerialization>>(request)) as RequestId;
180
189
  }
181
190
 
182
191
  // ---- Client Contract: SignBidirectionalEvent Map ---------------------------------------------------
@@ -278,7 +287,7 @@ module Signet {
278
287
  // RespondBidirectionalEvent: the MPC's attestation of a foreign execution, the
279
288
  // final step of the sign bidirectional flow.
280
289
  //
281
- // attestationDigest = keccak256(requestId + serializedOutput)
290
+ // attestationDigest = upgradeFromTransient(transientHash([requestId, serializedOutput]))
282
291
  // signature = signSECP256k1(mpcResponseKey, attestationDigest)
283
292
  //
284
293
  // mpcResponseKey is derived like request signing keys, with the path set to the
@@ -296,14 +305,14 @@ module Signet {
296
305
  }
297
306
 
298
307
  // The 32-byte attestation digest of a remote execution output:
299
- // attestationDigest = keccak256(requestId + serializedOutput)
300
- // Inputs are concatenated raw, no padding or length prefixes. Off-chain code
301
- // uses the TypeScript twin in `ecdsa-attestation.ts`.
308
+ // attestationDigest = upgradeFromTransient(transientHash([requestId, serializedOutput]))
309
+ // Off-chain code uses the TypeScript twin:
310
+ // import { calculateSignetAttestationDigest } from "@sig-net/midnight";
302
311
  export pure circuit calculateSignetAttestationDigest<#serializedOutputLength>(
303
312
  requestId: RequestId,
304
313
  serializedOutput: Bytes<serializedOutputLength>,
305
314
  ): Bytes<32> {
306
- return keccak256<[RequestId, Bytes<serializedOutputLength>]>([requestId, serializedOutput]);
315
+ return upgradeFromTransient(transientHash<[RequestId, Bytes<serializedOutputLength>]>([requestId, serializedOutput]));
307
316
  }
308
317
 
309
318
  // Verifies a RespondBidirectionalEvent against its execution output and MPC