@sig-net/midnight 0.24.1 → 0.25.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.
@@ -12,6 +12,8 @@ export {
12
12
  HashDomain,
13
13
  OutputKind,
14
14
  calculateRequestIdV1,
15
+ calculateSignetAttestationDigestV1,
16
+ verifyRespondBidirectionalAttestationV1,
15
17
  constructSignBidirectionalEventNotificationV1,
16
18
  ethereumCaip2Id,
17
19
  evmAddressAbiWord,
@@ -22,56 +24,62 @@ export {
22
24
  checkedTruncationU128
23
25
  };
24
26
 
25
- // ---- Fixed-width attestation oracles (tests only) --------------------------
26
- // The size-generic digest and verify circuits cannot appear in the export
27
- // list above. These fixed-width instantiations exist solely to pin the TS
28
- // twin in ecdsa-attestation.ts against the compiled circuits (widths 0, 1, 2,
29
- // 32 and 100, where 0 is the empty output of a failed or unviable execution).
30
- // Client contracts instantiate the generic circuits at their own width.
31
-
32
- export pure circuit calculateSignetAttestationDigest0(
33
- requestId: RequestId,
34
- blockHeight: Uint<64>,
35
- outputKind: OutputKind,
27
+ // ---- Fixed-width output hash oracles (tests only) --------------------------
28
+ // The size-generic output hash and verify circuits cannot appear in the
29
+ // export list above. These fixed-width instantiations exist solely to pin
30
+ // the TS twin in ecdsa-attestation.ts against the compiled circuits (widths
31
+ // 0, 1, 2, 32 and 100, where 0 is the empty output of a failed or unviable
32
+ // execution). Client contracts instantiate the generic circuits at their own
33
+ // width.
34
+
35
+ export pure circuit calculateAttestedOutputHash0(
36
36
  serializedOutput: Bytes<0>
37
37
  ): Bytes<32> {
38
- return calculateSignetAttestationDigestV1<0>(requestId, blockHeight, outputKind, serializedOutput);
38
+ return calculateAttestedOutputHashV1<0>(serializedOutput);
39
39
  }
40
40
 
41
- export pure circuit calculateSignetAttestationDigest1(
42
- requestId: RequestId,
43
- blockHeight: Uint<64>,
44
- outputKind: OutputKind,
41
+ export pure circuit calculateAttestedOutputHash1(
45
42
  serializedOutput: Bytes<1>
46
43
  ): Bytes<32> {
47
- return calculateSignetAttestationDigestV1<1>(requestId, blockHeight, outputKind, serializedOutput);
44
+ return calculateAttestedOutputHashV1<1>(serializedOutput);
48
45
  }
49
46
 
50
- export pure circuit calculateSignetAttestationDigest2(
51
- requestId: RequestId,
52
- blockHeight: Uint<64>,
53
- outputKind: OutputKind,
47
+ export pure circuit calculateAttestedOutputHash2(
54
48
  serializedOutput: Bytes<2>
55
49
  ): Bytes<32> {
56
- return calculateSignetAttestationDigestV1<2>(requestId, blockHeight, outputKind, serializedOutput);
50
+ return calculateAttestedOutputHashV1<2>(serializedOutput);
57
51
  }
58
52
 
59
- export pure circuit calculateSignetAttestationDigest32(
60
- requestId: RequestId,
61
- blockHeight: Uint<64>,
62
- outputKind: OutputKind,
53
+ export pure circuit calculateAttestedOutputHash32(
63
54
  serializedOutput: Bytes<32>
64
55
  ): Bytes<32> {
65
- return calculateSignetAttestationDigestV1<32>(requestId, blockHeight, outputKind, serializedOutput);
56
+ return calculateAttestedOutputHashV1<32>(serializedOutput);
66
57
  }
67
58
 
68
- export pure circuit calculateSignetAttestationDigest100(
69
- requestId: RequestId,
70
- blockHeight: Uint<64>,
71
- outputKind: OutputKind,
59
+ export pure circuit calculateAttestedOutputHash100(
72
60
  serializedOutput: Bytes<100>
73
61
  ): Bytes<32> {
74
- return calculateSignetAttestationDigestV1<100>(requestId, blockHeight, outputKind, serializedOutput);
62
+ return calculateAttestedOutputHashV1<100>(serializedOutput);
63
+ }
64
+
65
+ // Fixed-width instantiations of verifyAttestedOutputV1, pinning its TS twin
66
+ // verifyAttestedOutput, including the trailing-zero case the length check
67
+ // exists for (a 2-byte output against a 1-byte attestation).
68
+
69
+ export pure circuit verifyAttestedOutput1(
70
+ serializedOutput: Bytes<1>,
71
+ attestedOutputLength: Uint<64>,
72
+ attestedOutputHash: Bytes<32>
73
+ ): Boolean {
74
+ return verifyAttestedOutputV1<1>(serializedOutput, attestedOutputLength, attestedOutputHash);
75
+ }
76
+
77
+ export pure circuit verifyAttestedOutput2(
78
+ serializedOutput: Bytes<2>,
79
+ attestedOutputLength: Uint<64>,
80
+ attestedOutputHash: Bytes<32>
81
+ ): Boolean {
82
+ return verifyAttestedOutputV1<2>(serializedOutput, attestedOutputLength, attestedOutputHash);
75
83
  }
76
84
 
77
85
  // ---- Fixed-width transaction digest oracles (tests only) --------------------