@sig-net/midnight 0.23.0 → 0.24.0-rc.10
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.
- package/README.md +52 -24
- package/dist/abi-serde.d.ts +198 -57
- package/dist/abi-serde.d.ts.map +1 -1
- package/dist/abi-serde.js +478 -367
- package/dist/abi-serde.js.map +1 -1
- package/dist/compact-descriptors.d.ts +25 -8
- package/dist/compact-descriptors.d.ts.map +1 -1
- package/dist/compact-descriptors.js +42 -25
- package/dist/compact-descriptors.js.map +1 -1
- package/dist/constants.d.ts +3 -22
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +3 -25
- package/dist/constants.js.map +1 -1
- package/dist/ecdsa-attestation.d.ts +44 -14
- package/dist/ecdsa-attestation.d.ts.map +1 -1
- package/dist/ecdsa-attestation.js +50 -15
- package/dist/ecdsa-attestation.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/managed/compiler/contract-info.json +1808 -48
- package/dist/managed/compiler/contract-manifest.json +8 -8
- package/dist/managed/contract/index.d.ts +424 -5
- package/dist/managed/contract/index.js +1311 -171
- package/dist/managed/contract/index.js.map +1 -1
- package/dist/mpc-output-cache.js +2 -2
- package/dist/mpc-output-cache.js.map +1 -1
- package/dist/signature-requests-state-reader.d.ts +6 -13
- package/dist/signature-requests-state-reader.d.ts.map +1 -1
- package/dist/signature-requests-state-reader.js +10 -16
- package/dist/signature-requests-state-reader.js.map +1 -1
- package/dist/signet-contract-events.d.ts +52 -12
- package/dist/signet-contract-events.d.ts.map +1 -1
- package/dist/signet-contract-events.js +89 -34
- package/dist/signet-contract-events.js.map +1 -1
- package/dist/signet-evtype2tx-record-decoding.d.ts.map +1 -1
- package/dist/signet-evtype2tx-record-decoding.js +7 -6
- package/dist/signet-evtype2tx-record-decoding.js.map +1 -1
- package/dist/signet-evtype2tx-requests.d.ts +17 -12
- package/dist/signet-evtype2tx-requests.d.ts.map +1 -1
- package/dist/signet-evtype2tx-requests.js +92 -16
- package/dist/signet-evtype2tx-requests.js.map +1 -1
- package/dist/signet-request-id.d.ts +5 -2
- package/dist/signet-request-id.d.ts.map +1 -1
- package/dist/signet-request-id.js +27 -9
- package/dist/signet-request-id.js.map +1 -1
- package/dist/signet-request-response-reader.d.ts +8 -0
- package/dist/signet-request-response-reader.d.ts.map +1 -1
- package/dist/signet-request-response-reader.js +8 -7
- package/dist/signet-request-response-reader.js.map +1 -1
- package/dist/signet-requests.d.ts +48 -19
- package/dist/signet-requests.d.ts.map +1 -1
- package/dist/signet-requests.js +19 -8
- package/dist/signet-requests.js.map +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +3 -8
- package/dist/testing.js.map +1 -1
- package/package.json +2 -2
- package/src/Signet.compact +299 -101
- package/src/circuits.compact +92 -12
package/src/circuits.compact
CHANGED
|
@@ -9,60 +9,140 @@ import CompactStandardLibrary;
|
|
|
9
9
|
import "./Signet";
|
|
10
10
|
|
|
11
11
|
export {
|
|
12
|
+
HashDomain,
|
|
13
|
+
OutputKind,
|
|
14
|
+
calculateRequestIdV1,
|
|
12
15
|
constructSignBidirectionalEventNotificationV1,
|
|
13
16
|
ethereumCaip2Id,
|
|
14
17
|
evmAddressAbiWord,
|
|
15
18
|
numericAbiWord,
|
|
16
19
|
boolAbiWord,
|
|
17
20
|
abiWordToUint128,
|
|
18
|
-
abiWordToBool
|
|
21
|
+
abiWordToBool,
|
|
22
|
+
checkedTruncationU128
|
|
19
23
|
};
|
|
20
24
|
|
|
21
25
|
// ---- Fixed-width attestation oracles (tests only) --------------------------
|
|
22
26
|
// The size-generic digest and verify circuits cannot appear in the export
|
|
23
27
|
// list above. These fixed-width instantiations exist solely to pin the TS
|
|
24
|
-
// twin in ecdsa-attestation.ts against the compiled circuits (widths 1, 2,
|
|
25
|
-
// and 100
|
|
26
|
-
// width.
|
|
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,
|
|
36
|
+
serializedOutput: Bytes<0>
|
|
37
|
+
): Bytes<32> {
|
|
38
|
+
return calculateSignetAttestationDigestV1<0>(requestId, blockHeight, outputKind, serializedOutput);
|
|
39
|
+
}
|
|
27
40
|
|
|
28
41
|
export pure circuit calculateSignetAttestationDigest1(
|
|
29
42
|
requestId: RequestId,
|
|
43
|
+
blockHeight: Uint<64>,
|
|
44
|
+
outputKind: OutputKind,
|
|
30
45
|
serializedOutput: Bytes<1>
|
|
31
46
|
): Bytes<32> {
|
|
32
|
-
return
|
|
47
|
+
return calculateSignetAttestationDigestV1<1>(requestId, blockHeight, outputKind, serializedOutput);
|
|
33
48
|
}
|
|
34
49
|
|
|
35
50
|
export pure circuit calculateSignetAttestationDigest2(
|
|
36
51
|
requestId: RequestId,
|
|
52
|
+
blockHeight: Uint<64>,
|
|
53
|
+
outputKind: OutputKind,
|
|
37
54
|
serializedOutput: Bytes<2>
|
|
38
55
|
): Bytes<32> {
|
|
39
|
-
return
|
|
56
|
+
return calculateSignetAttestationDigestV1<2>(requestId, blockHeight, outputKind, serializedOutput);
|
|
40
57
|
}
|
|
41
58
|
|
|
42
59
|
export pure circuit calculateSignetAttestationDigest32(
|
|
43
60
|
requestId: RequestId,
|
|
61
|
+
blockHeight: Uint<64>,
|
|
62
|
+
outputKind: OutputKind,
|
|
44
63
|
serializedOutput: Bytes<32>
|
|
45
64
|
): Bytes<32> {
|
|
46
|
-
return
|
|
65
|
+
return calculateSignetAttestationDigestV1<32>(requestId, blockHeight, outputKind, serializedOutput);
|
|
47
66
|
}
|
|
48
67
|
|
|
49
68
|
export pure circuit calculateSignetAttestationDigest100(
|
|
50
69
|
requestId: RequestId,
|
|
70
|
+
blockHeight: Uint<64>,
|
|
71
|
+
outputKind: OutputKind,
|
|
51
72
|
serializedOutput: Bytes<100>
|
|
52
73
|
): Bytes<32> {
|
|
53
|
-
return
|
|
74
|
+
return calculateSignetAttestationDigestV1<100>(requestId, blockHeight, outputKind, serializedOutput);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// ---- Fixed-width transaction digest oracles (tests only) --------------------
|
|
78
|
+
// Pin the TS twin calculateEvmType2TxParamsDigest against the compiled circuit
|
|
79
|
+
// at the caller contracts' <1, 0, 0> shape and at a shape with unused
|
|
80
|
+
// capacity in every dimension.
|
|
81
|
+
|
|
82
|
+
export pure circuit calculateEvmType2TxParamsDigestV1_1_0_0(
|
|
83
|
+
txParams: EvmType2TxParams<1, 0, 0>
|
|
84
|
+
): Bytes<32> {
|
|
85
|
+
return calculateEvmType2TxParamsDigestV1<1, 0, 0>(txParams);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export pure circuit calculateEvmType2TxParamsDigestV1_2_1_2(
|
|
89
|
+
txParams: EvmType2TxParams<2, 1, 2>
|
|
90
|
+
): Bytes<32> {
|
|
91
|
+
return calculateEvmType2TxParamsDigestV1<2, 1, 2>(txParams);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Pin the TS twin calculateRequestId against the composed request id circuit
|
|
95
|
+
// at the same two shapes, and its tag assert.
|
|
96
|
+
|
|
97
|
+
export pure circuit calculateEvmType2RequestIdV1_1_0_0_34(
|
|
98
|
+
request: SignBidirectionalEventV1<EvmType2TxParams<1, 0, 0>, 34, 0>
|
|
99
|
+
): RequestId {
|
|
100
|
+
return calculateEvmType2RequestIdV1<1, 0, 0, 34>(request);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export pure circuit calculateEvmType2RequestIdV1_2_1_2_34(
|
|
104
|
+
request: SignBidirectionalEventV1<EvmType2TxParams<2, 1, 2>, 34, 0>
|
|
105
|
+
): RequestId {
|
|
106
|
+
return calculateEvmType2RequestIdV1<2, 1, 2, 34>(request);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export pure circuit verifyRespondBidirectionalEvent0(
|
|
110
|
+
serializedOutput: Bytes<0>,
|
|
111
|
+
respondBidirectionalEvent: RespondBidirectionalEventV1,
|
|
112
|
+
mpcResponseKey: Secp256k1Point
|
|
113
|
+
): Boolean {
|
|
114
|
+
return verifyRespondBidirectionalEventV1<0>(
|
|
115
|
+
serializedOutput,
|
|
116
|
+
respondBidirectionalEvent,
|
|
117
|
+
mpcResponseKey
|
|
118
|
+
);
|
|
54
119
|
}
|
|
55
120
|
|
|
56
121
|
export pure circuit verifyRespondBidirectionalEvent32(
|
|
57
|
-
requestId: RequestId,
|
|
58
122
|
serializedOutput: Bytes<32>,
|
|
59
|
-
respondBidirectionalEvent:
|
|
123
|
+
respondBidirectionalEvent: RespondBidirectionalEventV1,
|
|
60
124
|
mpcResponseKey: Secp256k1Point
|
|
61
125
|
): Boolean {
|
|
62
|
-
return
|
|
63
|
-
requestId,
|
|
126
|
+
return verifyRespondBidirectionalEventV1<32>(
|
|
64
127
|
serializedOutput,
|
|
65
128
|
respondBidirectionalEvent,
|
|
66
129
|
mpcResponseKey
|
|
67
130
|
);
|
|
68
131
|
}
|
|
132
|
+
|
|
133
|
+
export pure circuit constructSignBidirectionalEventV1_1_0_0_34(
|
|
134
|
+
request: SignBidirectionalEventV1<EvmType2TxParams<1, 0, 0>, 34, 0>
|
|
135
|
+
): SignBidirectionalEventV1<EvmType2TxParams<1, 0, 0>, 34, 0> {
|
|
136
|
+
return constructSignBidirectionalEventV1<EvmType2TxParams<1, 0, 0>, 34>(
|
|
137
|
+
request.keyVersion,
|
|
138
|
+
request.sender,
|
|
139
|
+
request.path,
|
|
140
|
+
request.algo,
|
|
141
|
+
request.txParamType,
|
|
142
|
+
request.txParams,
|
|
143
|
+
request.executionDest,
|
|
144
|
+
request.signatureDest,
|
|
145
|
+
request.params,
|
|
146
|
+
request.outputDeserializationSchema
|
|
147
|
+
);
|
|
148
|
+
}
|