@sig-net/midnight-contract 0.0.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.
- package/dist/contract-surface.d.ts +20 -0
- package/dist/contract-surface.d.ts.map +1 -0
- package/dist/contract-surface.js +17 -0
- package/dist/contract-surface.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/managed/compiler/contract-info.json +335 -0
- package/dist/managed/compiler/contract-manifest.json +98 -0
- package/dist/managed/contract/index.d.ts +129 -0
- package/dist/managed/contract/index.js +1188 -0
- package/dist/managed/contract/index.js.map +8 -0
- package/dist/managed/keys/emitSignBidirectionalEvent.verifier +0 -0
- package/dist/managed/keys/postRespondBidirectional.verifier +0 -0
- package/dist/managed/keys/postSignatureResponse.verifier +0 -0
- package/dist/managed/zkir/emitSignBidirectionalEvent.bzkir +0 -0
- package/dist/managed/zkir/emitSignBidirectionalEvent.zkir +965 -0
- package/dist/managed/zkir/postRespondBidirectional.bzkir +0 -0
- package/dist/managed/zkir/postRespondBidirectional.zkir +666 -0
- package/dist/managed/zkir/postSignatureResponse.bzkir +0 -0
- package/dist/managed/zkir/postSignatureResponse.zkir +383 -0
- package/dist/witnesses.d.ts +15 -0
- package/dist/witnesses.d.ts.map +1 -0
- package/dist/witnesses.js +15 -0
- package/dist/witnesses.js.map +1 -0
- package/package.json +49 -0
- package/src/contract-surface.ts +40 -0
- package/src/index.ts +9 -0
- package/src/signet-contract.compact +135 -0
- package/src/witnesses.ts +22 -0
|
Binary file
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": { "major": 2, "minor": 0 },
|
|
3
|
+
"do_communications_commitment": true,
|
|
4
|
+
"num_inputs": 9,
|
|
5
|
+
"instructions": [
|
|
6
|
+
{ "op": "constrain_bits", "var": 0, "bits": 8 },
|
|
7
|
+
{ "op": "constrain_bits", "var": 1, "bits": 248 },
|
|
8
|
+
{ "op": "constrain_bits", "var": 2, "bits": 8 },
|
|
9
|
+
{ "op": "constrain_bits", "var": 3, "bits": 248 },
|
|
10
|
+
{ "op": "constrain_bits", "var": 4, "bits": 8 },
|
|
11
|
+
{ "op": "constrain_bits", "var": 5, "bits": 248 },
|
|
12
|
+
{ "op": "constrain_bits", "var": 6, "bits": 8 },
|
|
13
|
+
{ "op": "constrain_bits", "var": 7, "bits": 248 },
|
|
14
|
+
{ "op": "constrain_bits", "var": 8, "bits": 8 },
|
|
15
|
+
{ "op": "load_imm", "imm": "01" },
|
|
16
|
+
{ "op": "load_imm", "imm": "30" },
|
|
17
|
+
{ "op": "declare_pub_input", "var": 10 },
|
|
18
|
+
{ "op": "pi_skip", "guard": 9, "count": 1 },
|
|
19
|
+
{ "op": "load_imm", "imm": "50" },
|
|
20
|
+
{ "op": "load_imm", "imm": "00" },
|
|
21
|
+
{ "op": "declare_pub_input", "var": 11 },
|
|
22
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
23
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
24
|
+
{ "op": "declare_pub_input", "var": 12 },
|
|
25
|
+
{ "op": "pi_skip", "guard": 9, "count": 4 },
|
|
26
|
+
{ "op": "load_imm", "imm": "10" },
|
|
27
|
+
{ "op": "load_imm", "imm": "20" },
|
|
28
|
+
{ "op": "declare_pub_input", "var": 13 },
|
|
29
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
30
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
31
|
+
{ "op": "declare_pub_input", "var": 14 },
|
|
32
|
+
{ "op": "declare_pub_input", "var": 0 },
|
|
33
|
+
{ "op": "declare_pub_input", "var": 1 },
|
|
34
|
+
{ "op": "pi_skip", "guard": 9, "count": 6 },
|
|
35
|
+
{ "op": "load_imm", "imm": "18" },
|
|
36
|
+
{ "op": "declare_pub_input", "var": 15 },
|
|
37
|
+
{ "op": "pi_skip", "guard": 9, "count": 1 },
|
|
38
|
+
{ "op": "public_input", "guard": null },
|
|
39
|
+
{ "op": "load_imm", "imm": "0D" },
|
|
40
|
+
{ "op": "declare_pub_input", "var": 17 },
|
|
41
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
42
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
43
|
+
{ "op": "declare_pub_input", "var": 16 },
|
|
44
|
+
{ "op": "pi_skip", "guard": 9, "count": 4 },
|
|
45
|
+
{ "op": "cond_select", "bit": 16, "a": 12, "b": 9 },
|
|
46
|
+
{ "op": "load_imm", "imm": "70" },
|
|
47
|
+
{ "op": "cond_select", "bit": 18, "a": 19, "b": 12 },
|
|
48
|
+
{ "op": "declare_pub_input", "var": 20 },
|
|
49
|
+
{ "op": "declare_pub_input", "var": 18 },
|
|
50
|
+
{ "op": "declare_pub_input", "var": 18 },
|
|
51
|
+
{ "op": "cond_select", "bit": 18, "a": 12, "b": 12 },
|
|
52
|
+
{ "op": "declare_pub_input", "var": 21 },
|
|
53
|
+
{ "op": "pi_skip", "guard": 18, "count": 4 },
|
|
54
|
+
{ "op": "cond_select", "bit": 18, "a": 13, "b": 12 },
|
|
55
|
+
{ "op": "declare_pub_input", "var": 22 },
|
|
56
|
+
{ "op": "declare_pub_input", "var": 18 },
|
|
57
|
+
{ "op": "declare_pub_input", "var": 18 },
|
|
58
|
+
{ "op": "cond_select", "bit": 18, "a": 14, "b": 12 },
|
|
59
|
+
{ "op": "declare_pub_input", "var": 23 },
|
|
60
|
+
{ "op": "cond_select", "bit": 18, "a": 0, "b": 12 },
|
|
61
|
+
{ "op": "declare_pub_input", "var": 24 },
|
|
62
|
+
{ "op": "cond_select", "bit": 18, "a": 1, "b": 12 },
|
|
63
|
+
{ "op": "declare_pub_input", "var": 25 },
|
|
64
|
+
{ "op": "pi_skip", "guard": 18, "count": 6 },
|
|
65
|
+
{ "op": "load_imm", "imm": "11" },
|
|
66
|
+
{ "op": "load_imm", "imm": "08" },
|
|
67
|
+
{ "op": "cond_select", "bit": 18, "a": 26, "b": 12 },
|
|
68
|
+
{ "op": "declare_pub_input", "var": 28 },
|
|
69
|
+
{ "op": "declare_pub_input", "var": 18 },
|
|
70
|
+
{ "op": "declare_pub_input", "var": 18 },
|
|
71
|
+
{ "op": "cond_select", "bit": 18, "a": 27, "b": 12 },
|
|
72
|
+
{ "op": "declare_pub_input", "var": 29 },
|
|
73
|
+
{ "op": "cond_select", "bit": 18, "a": 12, "b": 12 },
|
|
74
|
+
{ "op": "declare_pub_input", "var": 30 },
|
|
75
|
+
{ "op": "pi_skip", "guard": 18, "count": 5 },
|
|
76
|
+
{ "op": "load_imm", "imm": "91" },
|
|
77
|
+
{ "op": "cond_select", "bit": 18, "a": 31, "b": 12 },
|
|
78
|
+
{ "op": "declare_pub_input", "var": 32 },
|
|
79
|
+
{ "op": "pi_skip", "guard": 18, "count": 1 },
|
|
80
|
+
{ "op": "load_imm", "imm": "A1" },
|
|
81
|
+
{ "op": "cond_select", "bit": 18, "a": 33, "b": 12 },
|
|
82
|
+
{ "op": "declare_pub_input", "var": 34 },
|
|
83
|
+
{ "op": "pi_skip", "guard": 18, "count": 1 },
|
|
84
|
+
{ "op": "declare_pub_input", "var": 10 },
|
|
85
|
+
{ "op": "pi_skip", "guard": 9, "count": 1 },
|
|
86
|
+
{ "op": "load_imm", "imm": "51" },
|
|
87
|
+
{ "op": "declare_pub_input", "var": 35 },
|
|
88
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
89
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
90
|
+
{ "op": "declare_pub_input", "var": 12 },
|
|
91
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
92
|
+
{ "op": "declare_pub_input", "var": 14 },
|
|
93
|
+
{ "op": "declare_pub_input", "var": 0 },
|
|
94
|
+
{ "op": "declare_pub_input", "var": 1 },
|
|
95
|
+
{ "op": "pi_skip", "guard": 9, "count": 8 },
|
|
96
|
+
{ "op": "public_input", "guard": null },
|
|
97
|
+
{ "op": "declare_pub_input", "var": 17 },
|
|
98
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
99
|
+
{ "op": "declare_pub_input", "var": 27 },
|
|
100
|
+
{ "op": "declare_pub_input", "var": 36 },
|
|
101
|
+
{ "op": "pi_skip", "guard": 9, "count": 4 },
|
|
102
|
+
{ "op": "load_imm", "imm": "71" },
|
|
103
|
+
{ "op": "declare_pub_input", "var": 37 },
|
|
104
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
105
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
106
|
+
{ "op": "declare_pub_input", "var": 12 },
|
|
107
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
108
|
+
{ "op": "declare_pub_input", "var": 14 },
|
|
109
|
+
{ "op": "declare_pub_input", "var": 0 },
|
|
110
|
+
{ "op": "declare_pub_input", "var": 1 },
|
|
111
|
+
{ "op": "pi_skip", "guard": 9, "count": 8 },
|
|
112
|
+
{ "op": "load_imm", "imm": "0E" },
|
|
113
|
+
{ "op": "declare_pub_input", "var": 38 },
|
|
114
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
115
|
+
{ "op": "pi_skip", "guard": 9, "count": 2 },
|
|
116
|
+
{ "op": "load_imm", "imm": "A2" },
|
|
117
|
+
{ "op": "declare_pub_input", "var": 39 },
|
|
118
|
+
{ "op": "pi_skip", "guard": 9, "count": 1 },
|
|
119
|
+
{ "op": "declare_pub_input", "var": 19 },
|
|
120
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
121
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
122
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
123
|
+
{ "op": "pi_skip", "guard": 9, "count": 4 },
|
|
124
|
+
{ "op": "load_imm", "imm": "02" },
|
|
125
|
+
{ "op": "declare_pub_input", "var": 13 },
|
|
126
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
127
|
+
{ "op": "declare_pub_input", "var": 40 },
|
|
128
|
+
{ "op": "declare_pub_input", "var": 27 },
|
|
129
|
+
{ "op": "declare_pub_input", "var": 14 },
|
|
130
|
+
{ "op": "declare_pub_input", "var": 36 },
|
|
131
|
+
{ "op": "declare_pub_input", "var": 0 },
|
|
132
|
+
{ "op": "declare_pub_input", "var": 1 },
|
|
133
|
+
{ "op": "pi_skip", "guard": 9, "count": 8 },
|
|
134
|
+
{ "op": "load_imm", "imm": "04" },
|
|
135
|
+
{ "op": "declare_pub_input", "var": 26 },
|
|
136
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
137
|
+
{ "op": "declare_pub_input", "var": 41 },
|
|
138
|
+
{ "op": "declare_pub_input", "var": 14 },
|
|
139
|
+
{ "op": "declare_pub_input", "var": 14 },
|
|
140
|
+
{ "op": "declare_pub_input", "var": 14 },
|
|
141
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
142
|
+
{ "op": "declare_pub_input", "var": 2 },
|
|
143
|
+
{ "op": "declare_pub_input", "var": 3 },
|
|
144
|
+
{ "op": "declare_pub_input", "var": 4 },
|
|
145
|
+
{ "op": "declare_pub_input", "var": 5 },
|
|
146
|
+
{ "op": "declare_pub_input", "var": 6 },
|
|
147
|
+
{ "op": "declare_pub_input", "var": 7 },
|
|
148
|
+
{ "op": "declare_pub_input", "var": 8 },
|
|
149
|
+
{ "op": "pi_skip", "guard": 9, "count": 14 },
|
|
150
|
+
{ "op": "declare_pub_input", "var": 31 },
|
|
151
|
+
{ "op": "pi_skip", "guard": 9, "count": 1 },
|
|
152
|
+
{ "op": "declare_pub_input", "var": 33 },
|
|
153
|
+
{ "op": "pi_skip", "guard": 9, "count": 1 },
|
|
154
|
+
{ "op": "div_mod_power_of_two", "var": 1, "bits": 8 },
|
|
155
|
+
{ "op": "div_mod_power_of_two", "var": 42, "bits": 8 },
|
|
156
|
+
{ "op": "div_mod_power_of_two", "var": 44, "bits": 8 },
|
|
157
|
+
{ "op": "div_mod_power_of_two", "var": 46, "bits": 8 },
|
|
158
|
+
{ "op": "div_mod_power_of_two", "var": 48, "bits": 8 },
|
|
159
|
+
{ "op": "div_mod_power_of_two", "var": 50, "bits": 8 },
|
|
160
|
+
{ "op": "div_mod_power_of_two", "var": 52, "bits": 8 },
|
|
161
|
+
{ "op": "div_mod_power_of_two", "var": 54, "bits": 8 },
|
|
162
|
+
{ "op": "div_mod_power_of_two", "var": 56, "bits": 8 },
|
|
163
|
+
{ "op": "div_mod_power_of_two", "var": 58, "bits": 8 },
|
|
164
|
+
{ "op": "div_mod_power_of_two", "var": 60, "bits": 8 },
|
|
165
|
+
{ "op": "div_mod_power_of_two", "var": 62, "bits": 8 },
|
|
166
|
+
{ "op": "div_mod_power_of_two", "var": 64, "bits": 8 },
|
|
167
|
+
{ "op": "div_mod_power_of_two", "var": 66, "bits": 8 },
|
|
168
|
+
{ "op": "div_mod_power_of_two", "var": 68, "bits": 8 },
|
|
169
|
+
{ "op": "div_mod_power_of_two", "var": 70, "bits": 8 },
|
|
170
|
+
{ "op": "div_mod_power_of_two", "var": 72, "bits": 8 },
|
|
171
|
+
{ "op": "div_mod_power_of_two", "var": 74, "bits": 8 },
|
|
172
|
+
{ "op": "div_mod_power_of_two", "var": 76, "bits": 8 },
|
|
173
|
+
{ "op": "div_mod_power_of_two", "var": 78, "bits": 8 },
|
|
174
|
+
{ "op": "div_mod_power_of_two", "var": 80, "bits": 8 },
|
|
175
|
+
{ "op": "div_mod_power_of_two", "var": 82, "bits": 8 },
|
|
176
|
+
{ "op": "div_mod_power_of_two", "var": 84, "bits": 8 },
|
|
177
|
+
{ "op": "div_mod_power_of_two", "var": 86, "bits": 8 },
|
|
178
|
+
{ "op": "div_mod_power_of_two", "var": 88, "bits": 8 },
|
|
179
|
+
{ "op": "div_mod_power_of_two", "var": 90, "bits": 8 },
|
|
180
|
+
{ "op": "div_mod_power_of_two", "var": 92, "bits": 8 },
|
|
181
|
+
{ "op": "div_mod_power_of_two", "var": 94, "bits": 8 },
|
|
182
|
+
{ "op": "div_mod_power_of_two", "var": 96, "bits": 8 },
|
|
183
|
+
{ "op": "div_mod_power_of_two", "var": 98, "bits": 8 },
|
|
184
|
+
{ "op": "constrain_bits", "var": 36, "bits": 64 },
|
|
185
|
+
{ "op": "div_mod_power_of_two", "var": 36, "bits": 8 },
|
|
186
|
+
{ "op": "div_mod_power_of_two", "var": 102, "bits": 8 },
|
|
187
|
+
{ "op": "div_mod_power_of_two", "var": 104, "bits": 8 },
|
|
188
|
+
{ "op": "div_mod_power_of_two", "var": 106, "bits": 8 },
|
|
189
|
+
{ "op": "div_mod_power_of_two", "var": 108, "bits": 8 },
|
|
190
|
+
{ "op": "div_mod_power_of_two", "var": 110, "bits": 8 },
|
|
191
|
+
{ "op": "div_mod_power_of_two", "var": 112, "bits": 8 },
|
|
192
|
+
{ "op": "reconstitute_field", "divisor": 114, "modulus": 115, "bits": 8 },
|
|
193
|
+
{ "op": "reconstitute_field", "divisor": 116, "modulus": 113, "bits": 8 },
|
|
194
|
+
{ "op": "reconstitute_field", "divisor": 117, "modulus": 111, "bits": 8 },
|
|
195
|
+
{ "op": "reconstitute_field", "divisor": 118, "modulus": 109, "bits": 8 },
|
|
196
|
+
{ "op": "reconstitute_field", "divisor": 119, "modulus": 107, "bits": 8 },
|
|
197
|
+
{ "op": "reconstitute_field", "divisor": 120, "modulus": 105, "bits": 8 },
|
|
198
|
+
{ "op": "reconstitute_field", "divisor": 121, "modulus": 103, "bits": 8 },
|
|
199
|
+
{ "op": "reconstitute_field", "divisor": 122, "modulus": 0, "bits": 8 },
|
|
200
|
+
{ "op": "reconstitute_field", "divisor": 100, "modulus": 101, "bits": 8 },
|
|
201
|
+
{ "op": "reconstitute_field", "divisor": 124, "modulus": 99, "bits": 8 },
|
|
202
|
+
{ "op": "reconstitute_field", "divisor": 125, "modulus": 97, "bits": 8 },
|
|
203
|
+
{ "op": "reconstitute_field", "divisor": 126, "modulus": 95, "bits": 8 },
|
|
204
|
+
{ "op": "reconstitute_field", "divisor": 127, "modulus": 93, "bits": 8 },
|
|
205
|
+
{ "op": "reconstitute_field", "divisor": 128, "modulus": 91, "bits": 8 },
|
|
206
|
+
{ "op": "reconstitute_field", "divisor": 129, "modulus": 89, "bits": 8 },
|
|
207
|
+
{ "op": "reconstitute_field", "divisor": 130, "modulus": 87, "bits": 8 },
|
|
208
|
+
{ "op": "reconstitute_field", "divisor": 131, "modulus": 85, "bits": 8 },
|
|
209
|
+
{ "op": "reconstitute_field", "divisor": 132, "modulus": 83, "bits": 8 },
|
|
210
|
+
{ "op": "reconstitute_field", "divisor": 133, "modulus": 81, "bits": 8 },
|
|
211
|
+
{ "op": "reconstitute_field", "divisor": 134, "modulus": 79, "bits": 8 },
|
|
212
|
+
{ "op": "reconstitute_field", "divisor": 135, "modulus": 77, "bits": 8 },
|
|
213
|
+
{ "op": "reconstitute_field", "divisor": 136, "modulus": 75, "bits": 8 },
|
|
214
|
+
{ "op": "reconstitute_field", "divisor": 137, "modulus": 73, "bits": 8 },
|
|
215
|
+
{ "op": "reconstitute_field", "divisor": 138, "modulus": 71, "bits": 8 },
|
|
216
|
+
{ "op": "reconstitute_field", "divisor": 139, "modulus": 69, "bits": 8 },
|
|
217
|
+
{ "op": "reconstitute_field", "divisor": 140, "modulus": 67, "bits": 8 },
|
|
218
|
+
{ "op": "reconstitute_field", "divisor": 141, "modulus": 65, "bits": 8 },
|
|
219
|
+
{ "op": "reconstitute_field", "divisor": 142, "modulus": 63, "bits": 8 },
|
|
220
|
+
{ "op": "reconstitute_field", "divisor": 143, "modulus": 61, "bits": 8 },
|
|
221
|
+
{ "op": "reconstitute_field", "divisor": 144, "modulus": 59, "bits": 8 },
|
|
222
|
+
{ "op": "reconstitute_field", "divisor": 145, "modulus": 57, "bits": 8 },
|
|
223
|
+
{ "op": "reconstitute_field", "divisor": 146, "modulus": 55, "bits": 8 },
|
|
224
|
+
{ "op": "reconstitute_field", "divisor": 147, "modulus": 53, "bits": 8 },
|
|
225
|
+
{ "op": "reconstitute_field", "divisor": 148, "modulus": 51, "bits": 8 },
|
|
226
|
+
{ "op": "reconstitute_field", "divisor": 149, "modulus": 49, "bits": 8 },
|
|
227
|
+
{ "op": "reconstitute_field", "divisor": 150, "modulus": 47, "bits": 8 },
|
|
228
|
+
{ "op": "reconstitute_field", "divisor": 151, "modulus": 45, "bits": 8 },
|
|
229
|
+
{ "op": "reconstitute_field", "divisor": 152, "modulus": 43, "bits": 8 },
|
|
230
|
+
{ "op": "div_mod_power_of_two", "var": 123, "bits": 8 },
|
|
231
|
+
{ "op": "div_mod_power_of_two", "var": 154, "bits": 8 },
|
|
232
|
+
{ "op": "div_mod_power_of_two", "var": 156, "bits": 8 },
|
|
233
|
+
{ "op": "div_mod_power_of_two", "var": 158, "bits": 8 },
|
|
234
|
+
{ "op": "div_mod_power_of_two", "var": 160, "bits": 8 },
|
|
235
|
+
{ "op": "div_mod_power_of_two", "var": 162, "bits": 8 },
|
|
236
|
+
{ "op": "div_mod_power_of_two", "var": 164, "bits": 8 },
|
|
237
|
+
{ "op": "div_mod_power_of_two", "var": 166, "bits": 8 },
|
|
238
|
+
{ "op": "div_mod_power_of_two", "var": 168, "bits": 8 },
|
|
239
|
+
{ "op": "div_mod_power_of_two", "var": 170, "bits": 8 },
|
|
240
|
+
{ "op": "div_mod_power_of_two", "var": 172, "bits": 8 },
|
|
241
|
+
{ "op": "div_mod_power_of_two", "var": 174, "bits": 8 },
|
|
242
|
+
{ "op": "div_mod_power_of_two", "var": 176, "bits": 8 },
|
|
243
|
+
{ "op": "div_mod_power_of_two", "var": 178, "bits": 8 },
|
|
244
|
+
{ "op": "div_mod_power_of_two", "var": 180, "bits": 8 },
|
|
245
|
+
{ "op": "div_mod_power_of_two", "var": 182, "bits": 8 },
|
|
246
|
+
{ "op": "div_mod_power_of_two", "var": 184, "bits": 8 },
|
|
247
|
+
{ "op": "div_mod_power_of_two", "var": 186, "bits": 8 },
|
|
248
|
+
{ "op": "div_mod_power_of_two", "var": 188, "bits": 8 },
|
|
249
|
+
{ "op": "div_mod_power_of_two", "var": 190, "bits": 8 },
|
|
250
|
+
{ "op": "div_mod_power_of_two", "var": 192, "bits": 8 },
|
|
251
|
+
{ "op": "div_mod_power_of_two", "var": 194, "bits": 8 },
|
|
252
|
+
{ "op": "div_mod_power_of_two", "var": 196, "bits": 8 },
|
|
253
|
+
{ "op": "div_mod_power_of_two", "var": 198, "bits": 8 },
|
|
254
|
+
{ "op": "div_mod_power_of_two", "var": 200, "bits": 8 },
|
|
255
|
+
{ "op": "div_mod_power_of_two", "var": 202, "bits": 8 },
|
|
256
|
+
{ "op": "div_mod_power_of_two", "var": 204, "bits": 8 },
|
|
257
|
+
{ "op": "div_mod_power_of_two", "var": 206, "bits": 8 },
|
|
258
|
+
{ "op": "div_mod_power_of_two", "var": 208, "bits": 8 },
|
|
259
|
+
{ "op": "div_mod_power_of_two", "var": 210, "bits": 8 },
|
|
260
|
+
{ "op": "div_mod_power_of_two", "var": 153, "bits": 8 },
|
|
261
|
+
{ "op": "div_mod_power_of_two", "var": 214, "bits": 8 },
|
|
262
|
+
{ "op": "div_mod_power_of_two", "var": 216, "bits": 8 },
|
|
263
|
+
{ "op": "div_mod_power_of_two", "var": 218, "bits": 8 },
|
|
264
|
+
{ "op": "div_mod_power_of_two", "var": 220, "bits": 8 },
|
|
265
|
+
{ "op": "div_mod_power_of_two", "var": 222, "bits": 8 },
|
|
266
|
+
{ "op": "div_mod_power_of_two", "var": 224, "bits": 8 },
|
|
267
|
+
{ "op": "div_mod_power_of_two", "var": 226, "bits": 8 },
|
|
268
|
+
{ "op": "div_mod_power_of_two", "var": 228, "bits": 8 },
|
|
269
|
+
{ "op": "div_mod_power_of_two", "var": 230, "bits": 8 },
|
|
270
|
+
{ "op": "div_mod_power_of_two", "var": 232, "bits": 8 },
|
|
271
|
+
{ "op": "div_mod_power_of_two", "var": 234, "bits": 8 },
|
|
272
|
+
{ "op": "div_mod_power_of_two", "var": 236, "bits": 8 },
|
|
273
|
+
{ "op": "div_mod_power_of_two", "var": 238, "bits": 8 },
|
|
274
|
+
{ "op": "div_mod_power_of_two", "var": 240, "bits": 8 },
|
|
275
|
+
{ "op": "div_mod_power_of_two", "var": 242, "bits": 8 },
|
|
276
|
+
{ "op": "div_mod_power_of_two", "var": 244, "bits": 8 },
|
|
277
|
+
{ "op": "div_mod_power_of_two", "var": 246, "bits": 8 },
|
|
278
|
+
{ "op": "div_mod_power_of_two", "var": 248, "bits": 8 },
|
|
279
|
+
{ "op": "div_mod_power_of_two", "var": 250, "bits": 8 },
|
|
280
|
+
{ "op": "div_mod_power_of_two", "var": 252, "bits": 8 },
|
|
281
|
+
{ "op": "div_mod_power_of_two", "var": 254, "bits": 8 },
|
|
282
|
+
{ "op": "div_mod_power_of_two", "var": 256, "bits": 8 },
|
|
283
|
+
{ "op": "div_mod_power_of_two", "var": 258, "bits": 8 },
|
|
284
|
+
{ "op": "div_mod_power_of_two", "var": 260, "bits": 8 },
|
|
285
|
+
{ "op": "div_mod_power_of_two", "var": 262, "bits": 8 },
|
|
286
|
+
{ "op": "div_mod_power_of_two", "var": 264, "bits": 8 },
|
|
287
|
+
{ "op": "div_mod_power_of_two", "var": 266, "bits": 8 },
|
|
288
|
+
{ "op": "div_mod_power_of_two", "var": 268, "bits": 8 },
|
|
289
|
+
{ "op": "div_mod_power_of_two", "var": 270, "bits": 8 },
|
|
290
|
+
{ "op": "copy", "var": 212 },
|
|
291
|
+
{ "op": "reconstitute_field", "divisor": 213, "modulus": 211, "bits": 8 },
|
|
292
|
+
{ "op": "reconstitute_field", "divisor": 275, "modulus": 209, "bits": 8 },
|
|
293
|
+
{ "op": "reconstitute_field", "divisor": 276, "modulus": 207, "bits": 8 },
|
|
294
|
+
{ "op": "reconstitute_field", "divisor": 277, "modulus": 205, "bits": 8 },
|
|
295
|
+
{ "op": "reconstitute_field", "divisor": 278, "modulus": 203, "bits": 8 },
|
|
296
|
+
{ "op": "reconstitute_field", "divisor": 279, "modulus": 201, "bits": 8 },
|
|
297
|
+
{ "op": "reconstitute_field", "divisor": 280, "modulus": 199, "bits": 8 },
|
|
298
|
+
{ "op": "reconstitute_field", "divisor": 281, "modulus": 197, "bits": 8 },
|
|
299
|
+
{ "op": "reconstitute_field", "divisor": 282, "modulus": 195, "bits": 8 },
|
|
300
|
+
{ "op": "reconstitute_field", "divisor": 283, "modulus": 193, "bits": 8 },
|
|
301
|
+
{ "op": "reconstitute_field", "divisor": 284, "modulus": 191, "bits": 8 },
|
|
302
|
+
{ "op": "reconstitute_field", "divisor": 285, "modulus": 189, "bits": 8 },
|
|
303
|
+
{ "op": "reconstitute_field", "divisor": 286, "modulus": 187, "bits": 8 },
|
|
304
|
+
{ "op": "reconstitute_field", "divisor": 287, "modulus": 185, "bits": 8 },
|
|
305
|
+
{ "op": "reconstitute_field", "divisor": 288, "modulus": 183, "bits": 8 },
|
|
306
|
+
{ "op": "reconstitute_field", "divisor": 289, "modulus": 181, "bits": 8 },
|
|
307
|
+
{ "op": "reconstitute_field", "divisor": 290, "modulus": 179, "bits": 8 },
|
|
308
|
+
{ "op": "reconstitute_field", "divisor": 291, "modulus": 177, "bits": 8 },
|
|
309
|
+
{ "op": "reconstitute_field", "divisor": 292, "modulus": 175, "bits": 8 },
|
|
310
|
+
{ "op": "reconstitute_field", "divisor": 293, "modulus": 173, "bits": 8 },
|
|
311
|
+
{ "op": "reconstitute_field", "divisor": 294, "modulus": 171, "bits": 8 },
|
|
312
|
+
{ "op": "reconstitute_field", "divisor": 295, "modulus": 169, "bits": 8 },
|
|
313
|
+
{ "op": "reconstitute_field", "divisor": 296, "modulus": 167, "bits": 8 },
|
|
314
|
+
{ "op": "reconstitute_field", "divisor": 297, "modulus": 165, "bits": 8 },
|
|
315
|
+
{ "op": "reconstitute_field", "divisor": 298, "modulus": 163, "bits": 8 },
|
|
316
|
+
{ "op": "reconstitute_field", "divisor": 299, "modulus": 161, "bits": 8 },
|
|
317
|
+
{ "op": "reconstitute_field", "divisor": 300, "modulus": 159, "bits": 8 },
|
|
318
|
+
{ "op": "reconstitute_field", "divisor": 301, "modulus": 157, "bits": 8 },
|
|
319
|
+
{ "op": "reconstitute_field", "divisor": 302, "modulus": 155, "bits": 8 },
|
|
320
|
+
{ "op": "reconstitute_field", "divisor": 303, "modulus": 272, "bits": 8 },
|
|
321
|
+
{ "op": "reconstitute_field", "divisor": 273, "modulus": 271, "bits": 8 },
|
|
322
|
+
{ "op": "reconstitute_field", "divisor": 305, "modulus": 269, "bits": 8 },
|
|
323
|
+
{ "op": "reconstitute_field", "divisor": 306, "modulus": 267, "bits": 8 },
|
|
324
|
+
{ "op": "reconstitute_field", "divisor": 307, "modulus": 265, "bits": 8 },
|
|
325
|
+
{ "op": "reconstitute_field", "divisor": 308, "modulus": 263, "bits": 8 },
|
|
326
|
+
{ "op": "reconstitute_field", "divisor": 309, "modulus": 261, "bits": 8 },
|
|
327
|
+
{ "op": "reconstitute_field", "divisor": 310, "modulus": 259, "bits": 8 },
|
|
328
|
+
{ "op": "reconstitute_field", "divisor": 311, "modulus": 257, "bits": 8 },
|
|
329
|
+
{ "op": "reconstitute_field", "divisor": 312, "modulus": 255, "bits": 8 },
|
|
330
|
+
{ "op": "reconstitute_field", "divisor": 313, "modulus": 253, "bits": 8 },
|
|
331
|
+
{ "op": "reconstitute_field", "divisor": 314, "modulus": 251, "bits": 8 },
|
|
332
|
+
{ "op": "reconstitute_field", "divisor": 315, "modulus": 249, "bits": 8 },
|
|
333
|
+
{ "op": "reconstitute_field", "divisor": 316, "modulus": 247, "bits": 8 },
|
|
334
|
+
{ "op": "reconstitute_field", "divisor": 317, "modulus": 245, "bits": 8 },
|
|
335
|
+
{ "op": "reconstitute_field", "divisor": 318, "modulus": 243, "bits": 8 },
|
|
336
|
+
{ "op": "reconstitute_field", "divisor": 319, "modulus": 241, "bits": 8 },
|
|
337
|
+
{ "op": "reconstitute_field", "divisor": 320, "modulus": 239, "bits": 8 },
|
|
338
|
+
{ "op": "reconstitute_field", "divisor": 321, "modulus": 237, "bits": 8 },
|
|
339
|
+
{ "op": "reconstitute_field", "divisor": 322, "modulus": 235, "bits": 8 },
|
|
340
|
+
{ "op": "reconstitute_field", "divisor": 323, "modulus": 233, "bits": 8 },
|
|
341
|
+
{ "op": "reconstitute_field", "divisor": 324, "modulus": 231, "bits": 8 },
|
|
342
|
+
{ "op": "reconstitute_field", "divisor": 325, "modulus": 229, "bits": 8 },
|
|
343
|
+
{ "op": "reconstitute_field", "divisor": 326, "modulus": 227, "bits": 8 },
|
|
344
|
+
{ "op": "reconstitute_field", "divisor": 327, "modulus": 225, "bits": 8 },
|
|
345
|
+
{ "op": "reconstitute_field", "divisor": 328, "modulus": 223, "bits": 8 },
|
|
346
|
+
{ "op": "reconstitute_field", "divisor": 329, "modulus": 221, "bits": 8 },
|
|
347
|
+
{ "op": "reconstitute_field", "divisor": 330, "modulus": 219, "bits": 8 },
|
|
348
|
+
{ "op": "reconstitute_field", "divisor": 331, "modulus": 217, "bits": 8 },
|
|
349
|
+
{ "op": "reconstitute_field", "divisor": 332, "modulus": 215, "bits": 8 },
|
|
350
|
+
{ "op": "reconstitute_field", "divisor": 333, "modulus": 12, "bits": 8 },
|
|
351
|
+
{ "op": "load_imm", "imm": "5369676E6174757265526573706F6E6465644576656E74" },
|
|
352
|
+
{ "op": "load_imm", "imm": "33" },
|
|
353
|
+
{ "op": "load_imm", "imm": "0A" },
|
|
354
|
+
{ "op": "load_imm", "imm": "2001" },
|
|
355
|
+
{ "op": "declare_pub_input", "var": 13 },
|
|
356
|
+
{ "op": "declare_pub_input", "var": 336 },
|
|
357
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
358
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
359
|
+
{ "op": "declare_pub_input", "var": 41 },
|
|
360
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
361
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
362
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
363
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
364
|
+
{ "op": "declare_pub_input", "var": 337 },
|
|
365
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
366
|
+
{ "op": "declare_pub_input", "var": 9 },
|
|
367
|
+
{ "op": "declare_pub_input", "var": 338 },
|
|
368
|
+
{ "op": "declare_pub_input", "var": 12 },
|
|
369
|
+
{ "op": "declare_pub_input", "var": 12 },
|
|
370
|
+
{ "op": "declare_pub_input", "var": 12 },
|
|
371
|
+
{ "op": "declare_pub_input", "var": 12 },
|
|
372
|
+
{ "op": "declare_pub_input", "var": 12 },
|
|
373
|
+
{ "op": "declare_pub_input", "var": 12 },
|
|
374
|
+
{ "op": "declare_pub_input", "var": 274 },
|
|
375
|
+
{ "op": "declare_pub_input", "var": 304 },
|
|
376
|
+
{ "op": "declare_pub_input", "var": 334 },
|
|
377
|
+
{ "op": "declare_pub_input", "var": 335 },
|
|
378
|
+
{ "op": "pi_skip", "guard": 9, "count": 23 },
|
|
379
|
+
{ "op": "load_imm", "imm": "09" },
|
|
380
|
+
{ "op": "declare_pub_input", "var": 339 },
|
|
381
|
+
{ "op": "pi_skip", "guard": 9, "count": 1 }
|
|
382
|
+
]
|
|
383
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Witnesses } from "./managed/contract/index.js";
|
|
2
|
+
/** Private state carried through signet-contract circuit calls: none. */
|
|
3
|
+
export type SignetContractPrivateState = Record<string, never>;
|
|
4
|
+
/**
|
|
5
|
+
* Build the contract's (empty) private state.
|
|
6
|
+
*
|
|
7
|
+
* @returns A fresh, empty private state.
|
|
8
|
+
*/
|
|
9
|
+
export declare const createSignetContractPrivateState: () => SignetContractPrivateState;
|
|
10
|
+
/**
|
|
11
|
+
* Witness implementations, typed against the generated `Witnesses` shape:
|
|
12
|
+
* the contract declares none.
|
|
13
|
+
*/
|
|
14
|
+
export declare const witnesses: Witnesses<SignetContractPrivateState>;
|
|
15
|
+
//# sourceMappingURL=witnesses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"witnesses.d.ts","sourceRoot":"","sources":["../src/witnesses.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAE7D,yEAAyE;AACzE,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,QACvC,0BAAkC,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,SAAS,CAAC,0BAA0B,CAAM,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// The signet contract has no witnesses: Schnorr verification is
|
|
2
|
+
// CompactStandardLibrary's `jubjubSchnorrVerify` (fully in-circuit), and
|
|
3
|
+
// there is no private state — posting carries no caller secrets.
|
|
4
|
+
/**
|
|
5
|
+
* Build the contract's (empty) private state.
|
|
6
|
+
*
|
|
7
|
+
* @returns A fresh, empty private state.
|
|
8
|
+
*/
|
|
9
|
+
export const createSignetContractPrivateState = () => ({});
|
|
10
|
+
/**
|
|
11
|
+
* Witness implementations, typed against the generated `Witnesses` shape:
|
|
12
|
+
* the contract declares none.
|
|
13
|
+
*/
|
|
14
|
+
export const witnesses = {};
|
|
15
|
+
//# sourceMappingURL=witnesses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"witnesses.js","sourceRoot":"","sources":["../src/witnesses.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,iEAAiE;AAOjE;;;;GAIG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAC3C,GAA+B,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AAEzC;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAA0C,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sig-net/midnight-contract",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "The central signet Compact contract on Midnight: the MPC posts signature responses (unauthenticated counted log, verified off-chain) and remote execution responses (Schnorr attestations, verified in-circuit at post time) here; clients poll it. src/index.ts is the curated export surface.",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"default": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"./managed/*": "./dist/managed/*"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"src",
|
|
16
|
+
"!src/managed"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"compile": "COMPACT_PATH=../../node_modules compact compile --skip-zk src/signet-contract.compact src/managed",
|
|
20
|
+
"compile:zk": "COMPACT_PATH=../../node_modules compact compile src/signet-contract.compact src/managed",
|
|
21
|
+
"build": "rm -rf dist && tsc -p tsconfig.json && tsc -p tsconfig.build.json && mkdir -p dist/managed/keys && cp -R src/managed/contract src/managed/compiler src/managed/zkir dist/managed/ && cp src/managed/keys/*.verifier dist/managed/keys/",
|
|
22
|
+
"prepack": "yarn build",
|
|
23
|
+
"test": "vitest run"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public",
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"default": "./dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./managed/*": "./dist/managed/*"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@midnight-ntwrk/compact-runtime": "0.18.0-rc.0",
|
|
39
|
+
"@midnight-ntwrk/midnight-js": "5.0.0-beta.3"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@sig-net/midnight": "^0.0.1",
|
|
43
|
+
"@types/node": "^26.1.0",
|
|
44
|
+
"typescript": "^6.0.3",
|
|
45
|
+
"vitest": "^4.1.9"
|
|
46
|
+
},
|
|
47
|
+
"main": "./dist/index.js",
|
|
48
|
+
"types": "./dist/index.d.ts"
|
|
49
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// The contract's platform-agnostic client surface: the circuit-id union, the
|
|
2
|
+
// private-state store key, and the provider-set TYPE. Deliberately nothing
|
|
3
|
+
// runnable — no wallet flavor, no zk-config source, no state store, no proof
|
|
4
|
+
// provider. Composing a live midnight-js provider set is CONSUMER territory
|
|
5
|
+
// (it differs per environment: Node fs vs browser fetch, LevelDB vs
|
|
6
|
+
// IndexedDB, WalletFacade vs a connector API), so each consumer declares its
|
|
7
|
+
// own — see this monorepo's signet-contract-deploy package for the Node
|
|
8
|
+
// operator composition, and the fakenet response server for a consumer's.
|
|
9
|
+
|
|
10
|
+
import type { MidnightProviders } from "@midnight-ntwrk/midnight-js/types";
|
|
11
|
+
|
|
12
|
+
import { Contract } from "./managed/contract/index.js";
|
|
13
|
+
import { type SignetContractPrivateState } from "./witnesses.ts";
|
|
14
|
+
|
|
15
|
+
/** The contract's provable circuit ids, straight from the generated contract. */
|
|
16
|
+
export type SignetContractCircuitId = keyof InstanceType<typeof Contract>["provableCircuits"] & string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Literal of the private-state storage key. Just a string, but a single-value
|
|
20
|
+
* union so the providers/`findDeployedContract` pairing is enforced by the
|
|
21
|
+
* type system.
|
|
22
|
+
*/
|
|
23
|
+
export type SignetContractPrivateStateId = "signet-contract";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Key under which midnight-js persists this contract's private state locally
|
|
27
|
+
* (in whatever private-state store the consumer's provider set uses).
|
|
28
|
+
* Distinct per contract so two clients don't share an entry.
|
|
29
|
+
*/
|
|
30
|
+
export const SIGNET_CONTRACT_PRIVATE_STATE_ID: SignetContractPrivateStateId = "signet-contract";
|
|
31
|
+
|
|
32
|
+
/** The full midnight-js provider set, typed to the signet contract. */
|
|
33
|
+
export type SignetContractProviders = MidnightProviders<
|
|
34
|
+
// PCK: the union of the contract's provable circuit names.
|
|
35
|
+
SignetContractCircuitId,
|
|
36
|
+
// PSI: the private-state storage key literal.
|
|
37
|
+
SignetContractPrivateStateId,
|
|
38
|
+
// PS: the shape of the contract's (empty) private state object.
|
|
39
|
+
SignetContractPrivateState
|
|
40
|
+
>;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Curated export surface — this IS the "sdk" face of the package.
|
|
2
|
+
// Everything the compiler emitted, the handwritten witnesses, and the
|
|
3
|
+
// platform-agnostic contract surface (ids + provider TYPE). Environment
|
|
4
|
+
// bindings (zk-config source, state store, wallet adapter) deliberately
|
|
5
|
+
// live with each consumer, not here.
|
|
6
|
+
|
|
7
|
+
export * from "./managed/contract/index.js";
|
|
8
|
+
export * from "./witnesses.ts";
|
|
9
|
+
export * from "./contract-surface.ts";
|