@sig-net/midnight-contract 0.0.5 → 0.0.7

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.
@@ -1,155 +1,52 @@
1
1
  {
2
- "version": { "major": 2, "minor": 0 },
2
+ "version": { "major": 3, "minor": 0 },
3
3
  "do_communications_commitment": true,
4
- "num_inputs": 9,
4
+ "inputs": [
5
+ { "name": "%requestId.0", "type": "Scalar<BLS12-381>" },
6
+ { "name": "%requestId.1", "type": "Scalar<BLS12-381>" },
7
+ { "name": "%signatureRespondedEvent.2", "type": "Scalar<BLS12-381>" },
8
+ { "name": "%signatureRespondedEvent.3", "type": "Scalar<BLS12-381>" },
9
+ { "name": "%signatureRespondedEvent.4", "type": "Scalar<BLS12-381>" },
10
+ { "name": "%signatureRespondedEvent.5", "type": "Scalar<BLS12-381>" },
11
+ { "name": "%signatureRespondedEvent.6", "type": "Scalar<BLS12-381>" },
12
+ { "name": "%signatureRespondedEvent.7", "type": "Scalar<BLS12-381>" },
13
+ { "name": "%signatureRespondedEvent.8", "type": "Scalar<BLS12-381>" }
14
+ ],
15
+ "outputs": [
16
+ ],
5
17
  "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 }
18
+ { "op": "constrain_bits", "val": "%requestId.0", "bits": 8 },
19
+ { "op": "constrain_bits", "val": "%requestId.1", "bits": 248 },
20
+ { "op": "constrain_bits", "val": "%signatureRespondedEvent.2", "bits": 8 },
21
+ { "op": "constrain_bits", "val": "%signatureRespondedEvent.3", "bits": 248 },
22
+ { "op": "constrain_bits", "val": "%signatureRespondedEvent.4", "bits": 8 },
23
+ { "op": "constrain_bits", "val": "%signatureRespondedEvent.5", "bits": 248 },
24
+ { "op": "constrain_bits", "val": "%signatureRespondedEvent.6", "bits": 8 },
25
+ { "op": "constrain_bits", "val": "%signatureRespondedEvent.7", "bits": 248 },
26
+ { "op": "constrain_bits", "val": "%signatureRespondedEvent.8", "bits": 8 },
27
+ { "op": "public_input", "type": "Scalar<BLS12-381>", "output": "%t.9", "guard": null },
28
+ { "op": "impact", "guard": "0x01", "inputs": ["0x30"] },
29
+ { "op": "impact", "guard": "0x01", "inputs": ["0x50", "0x01", "0x01", "0x02"] },
30
+ { "op": "impact", "guard": "0x01", "inputs": ["0x10", "0x01", "0x01", "0x20", "%requestId.0", "%requestId.1"] },
31
+ { "op": "impact", "guard": "0x01", "inputs": ["0x18"] },
32
+ { "op": "impact", "guard": "0x01", "inputs": ["0x0d", "0x01", "0x01", "%t.9"] },
33
+ { "op": "cond_select", "output": "%t.10", "bit": "%t.9", "a": "0x00", "b": "0x01" },
34
+ { "op": "impact", "guard": "%t.10", "inputs": ["0x70", "0x01", "0x01", "0x02"] },
35
+ { "op": "impact", "guard": "%t.10", "inputs": ["0x10", "0x01", "0x01", "0x20", "%requestId.0", "%requestId.1"] },
36
+ { "op": "impact", "guard": "%t.10", "inputs": ["0x11", "0x01", "0x01", "0x08", "0x00"] },
37
+ { "op": "impact", "guard": "%t.10", "inputs": ["0x91"] },
38
+ { "op": "impact", "guard": "%t.10", "inputs": ["0xa1"] },
39
+ { "op": "public_input", "type": "Scalar<BLS12-381>", "output": "%count.11", "guard": null },
40
+ { "op": "impact", "guard": "0x01", "inputs": ["0x30"] },
41
+ { "op": "impact", "guard": "0x01", "inputs": ["0x51", "0x01", "0x01", "0x02", "0x01", "0x20", "%requestId.0", "%requestId.1"] },
42
+ { "op": "impact", "guard": "0x01", "inputs": ["0x0d", "0x01", "0x08", "%count.11"] },
43
+ { "op": "impact", "guard": "0x01", "inputs": ["0x71", "0x01", "0x01", "0x02", "0x01", "0x20", "%requestId.0", "%requestId.1"] },
44
+ { "op": "impact", "guard": "0x01", "inputs": ["0x0e", "0x01"] },
45
+ { "op": "impact", "guard": "0x01", "inputs": ["0xa2"] },
46
+ { "op": "impact", "guard": "0x01", "inputs": ["0x70", "0x01", "0x01", "0x03"] },
47
+ { "op": "impact", "guard": "0x01", "inputs": ["0x10", "0x01", "0x02", "0x08", "0x20", "%count.11", "%requestId.0", "%requestId.1"] },
48
+ { "op": "impact", "guard": "0x01", "inputs": ["0x11", "0x01", "0x04", "0x20", "0x20", "0x20", "0x01", "%signatureRespondedEvent.2", "%signatureRespondedEvent.3", "%signatureRespondedEvent.4", "%signatureRespondedEvent.5", "%signatureRespondedEvent.6", "%signatureRespondedEvent.7", "%signatureRespondedEvent.8"] },
49
+ { "op": "impact", "guard": "0x01", "inputs": ["0x91"] },
50
+ { "op": "impact", "guard": "0x01", "inputs": ["0xa1"] }
154
51
  ]
155
52
  }
@@ -0,0 +1,56 @@
1
+ {
2
+ "version": { "major": 3, "minor": 0 },
3
+ "do_communications_commitment": true,
4
+ "inputs": [
5
+ { "name": "%requestId.0", "type": "Scalar<BLS12-381>" },
6
+ { "name": "%requestId.1", "type": "Scalar<BLS12-381>" },
7
+ { "name": "%notification.2", "type": "Scalar<BLS12-381>" },
8
+ { "name": "%notification.3", "type": "Scalar<BLS12-381>" },
9
+ { "name": "%notification.4", "type": "Scalar<BLS12-381>" },
10
+ { "name": "%notification.5", "type": "Scalar<BLS12-381>" },
11
+ { "name": "%notification.6", "type": "Scalar<BLS12-381>" },
12
+ { "name": "%notification.7", "type": "Scalar<BLS12-381>" }
13
+ ],
14
+ "outputs": [
15
+ "Scalar<BLS12-381>",
16
+ "Scalar<BLS12-381>",
17
+ "Scalar<BLS12-381>"
18
+ ],
19
+ "instructions": [
20
+ { "op": "constrain_bits", "val": "%requestId.0", "bits": 8 },
21
+ { "op": "constrain_bits", "val": "%requestId.1", "bits": 248 },
22
+ { "op": "constrain_bits", "val": "%notification.2", "bits": 8 },
23
+ { "op": "constrain_bits", "val": "%notification.3", "bits": 32 },
24
+ { "op": "constrain_bits", "val": "%notification.4", "bits": 248 },
25
+ { "op": "constrain_bits", "val": "%notification.5", "bits": 248 },
26
+ { "op": "constrain_bits", "val": "%notification.6", "bits": 248 },
27
+ { "op": "constrain_bits", "val": "%notification.7", "bits": 248 },
28
+ { "op": "test_eq", "output": "%t.8", "a": "%notification.2", "b": "0x01" },
29
+ { "op": "assert", "cond": "%t.8" },
30
+ { "op": "public_input", "type": "Scalar<BLS12-381>", "output": "%t.9", "guard": null },
31
+ { "op": "impact", "guard": "0x01", "inputs": ["0x30"] },
32
+ { "op": "impact", "guard": "0x01", "inputs": ["0x50", "0x01", "0x01", "0x00"] },
33
+ { "op": "impact", "guard": "0x01", "inputs": ["0x10", "0x01", "0x01", "0x20", "%requestId.0", "%requestId.1"] },
34
+ { "op": "impact", "guard": "0x01", "inputs": ["0x18"] },
35
+ { "op": "impact", "guard": "0x01", "inputs": ["0x0d", "0x01", "0x01", "%t.9"] },
36
+ { "op": "cond_select", "output": "%t.10", "bit": "%t.9", "a": "0x00", "b": "0x01" },
37
+ { "op": "impact", "guard": "%t.10", "inputs": ["0x70", "0x01", "0x01", "0x00"] },
38
+ { "op": "impact", "guard": "%t.10", "inputs": ["0x10", "0x01", "0x01", "0x20", "%requestId.0", "%requestId.1"] },
39
+ { "op": "impact", "guard": "%t.10", "inputs": ["0x11", "0x01", "0x01", "0x08", "0x00"] },
40
+ { "op": "impact", "guard": "%t.10", "inputs": ["0x91"] },
41
+ { "op": "impact", "guard": "%t.10", "inputs": ["0xa1"] },
42
+ { "op": "public_input", "type": "Scalar<BLS12-381>", "output": "%t.11", "guard": null },
43
+ { "op": "impact", "guard": "0x01", "inputs": ["0x30"] },
44
+ { "op": "impact", "guard": "0x01", "inputs": ["0x51", "0x01", "0x01", "0x00", "0x01", "0x20", "%requestId.0", "%requestId.1"] },
45
+ { "op": "impact", "guard": "0x01", "inputs": ["0x0d", "0x01", "0x08", "%t.11"] },
46
+ { "op": "impact", "guard": "0x01", "inputs": ["0x71", "0x01", "0x01", "0x00", "0x01", "0x20", "%requestId.0", "%requestId.1"] },
47
+ { "op": "impact", "guard": "0x01", "inputs": ["0x0e", "0x01"] },
48
+ { "op": "impact", "guard": "0x01", "inputs": ["0xa2"] },
49
+ { "op": "impact", "guard": "0x01", "inputs": ["0x70", "0x01", "0x01", "0x01"] },
50
+ { "op": "impact", "guard": "0x01", "inputs": ["0x10", "0x01", "0x02", "0x08", "0x20", "%t.11", "%requestId.0", "%requestId.1"] },
51
+ { "op": "impact", "guard": "0x01", "inputs": ["0x11", "0x01", "0x02", "0x01", "0x80", "%notification.2", "%notification.3", "%notification.4", "%notification.5", "%notification.6", "%notification.7"] },
52
+ { "op": "impact", "guard": "0x01", "inputs": ["0x91"] },
53
+ { "op": "impact", "guard": "0x01", "inputs": ["0xa1"] },
54
+ { "op": "output", "vals": ["%t.11", "%requestId.0", "%requestId.1"] }
55
+ ]
56
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sig-net/midnight-contract",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sig-net/midnight-integration",
@@ -19,8 +19,8 @@
19
19
  "dist"
20
20
  ],
21
21
  "scripts": {
22
- "compile": "COMPACT_PATH=../../node_modules compact compile --skip-zk src/signet-contract.compact src/managed",
23
- "compile:zk": "COMPACT_PATH=../../node_modules compact compile src/signet-contract.compact src/managed",
22
+ "compile": "COMPACT_PATH=../../node_modules compact compile --skip-zk --feature-zkir-v3 src/signet-contract.compact src/managed",
23
+ "compile:zk": "COMPACT_PATH=../../node_modules compact compile --feature-zkir-v3 src/signet-contract.compact src/managed",
24
24
  "build": "rm -rf dist && ls src/managed/keys/*.prover >/dev/null 2>&1 || { echo 'signet-contract build: no prover keys in src/managed/keys — run `yarn compile:zk` first (compile uses --skip-zk)' >&2; exit 1; } && tsc -p tsconfig.json && tsc -p tsconfig.build.json && mkdir -p dist/managed && cp -R src/managed/contract src/managed/compiler src/managed/zkir src/managed/keys dist/managed/",
25
25
  "prepack": "yarn build",
26
26
  "test": "vitest run"
@@ -42,7 +42,7 @@
42
42
  "@midnight-ntwrk/midnight-js": "5.0.0-beta.4"
43
43
  },
44
44
  "devDependencies": {
45
- "@sig-net/midnight": "^0.0.5",
45
+ "@sig-net/midnight": "^0.0.7",
46
46
  "@types/node": "^26.1.0",
47
47
  "typescript": "^6.0.3",
48
48
  "vitest": "^4.1.9"
@@ -1,49 +0,0 @@
1
- {
2
- "version": { "major": 2, "minor": 0 },
3
- "do_communications_commitment": true,
4
- "num_inputs": 6,
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": 24 },
10
- { "op": "constrain_bits", "var": 4, "bits": 248 },
11
- { "op": "constrain_bits", "var": 5, "bits": 248 },
12
- { "op": "load_imm", "imm": "01" },
13
- { "op": "load_imm", "imm": "70" },
14
- { "op": "load_imm", "imm": "04" },
15
- { "op": "declare_pub_input", "var": 7 },
16
- { "op": "declare_pub_input", "var": 6 },
17
- { "op": "declare_pub_input", "var": 6 },
18
- { "op": "declare_pub_input", "var": 8 },
19
- { "op": "pi_skip", "guard": 6, "count": 4 },
20
- { "op": "load_imm", "imm": "10" },
21
- { "op": "load_imm", "imm": "20" },
22
- { "op": "declare_pub_input", "var": 9 },
23
- { "op": "declare_pub_input", "var": 6 },
24
- { "op": "declare_pub_input", "var": 6 },
25
- { "op": "declare_pub_input", "var": 10 },
26
- { "op": "declare_pub_input", "var": 0 },
27
- { "op": "declare_pub_input", "var": 1 },
28
- { "op": "pi_skip", "guard": 6, "count": 6 },
29
- { "op": "load_imm", "imm": "11" },
30
- { "op": "load_imm", "imm": "02" },
31
- { "op": "load_imm", "imm": "41" },
32
- { "op": "declare_pub_input", "var": 11 },
33
- { "op": "declare_pub_input", "var": 6 },
34
- { "op": "declare_pub_input", "var": 12 },
35
- { "op": "declare_pub_input", "var": 6 },
36
- { "op": "declare_pub_input", "var": 13 },
37
- { "op": "declare_pub_input", "var": 2 },
38
- { "op": "declare_pub_input", "var": 3 },
39
- { "op": "declare_pub_input", "var": 4 },
40
- { "op": "declare_pub_input", "var": 5 },
41
- { "op": "pi_skip", "guard": 6, "count": 9 },
42
- { "op": "load_imm", "imm": "91" },
43
- { "op": "declare_pub_input", "var": 14 },
44
- { "op": "pi_skip", "guard": 6, "count": 1 },
45
- { "op": "load_imm", "imm": "A1" },
46
- { "op": "declare_pub_input", "var": 15 },
47
- { "op": "pi_skip", "guard": 6, "count": 1 }
48
- ]
49
- }