@sig-net/midnight-contract 0.11.0 → 0.13.0
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 +4 -4
- package/dist/managed/compiler/contract-info.json +4 -18
- package/dist/managed/compiler/contract-manifest.json +15 -15
- package/dist/managed/contract/index.d.ts +5 -10
- package/dist/managed/contract/index.js +32 -33
- package/dist/managed/contract/index.js.map +1 -1
- package/dist/managed/keys/respondBidirectional.prover +0 -0
- package/dist/managed/keys/respondBidirectional.verifier +0 -0
- package/dist/managed/zkir/respondBidirectional.bzkir +0 -0
- package/dist/managed/zkir/respondBidirectional.zkir +17 -25
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
The central [Sig Network](https://sig.network) signet contract on the [Midnight blockchain](https://midnight.network): the singleton that exposes the MPC's [sign bidirectional flow](https://docs.sig.network/architecture/sign-bidirectional) to other Midnight contracts. The MPC posts back to it and clients poll it:
|
|
4
4
|
|
|
5
|
-
- **Signature responses**: an unauthenticated counted log
|
|
6
|
-
- **Remote execution responses**: secp256k1 ECDSA attestations by the MPC's per-client response key, stored unverified like the signature responses
|
|
5
|
+
- **Signature responses**: an unauthenticated counted log. Callers verify the signatures off-chain or in their own circuits.
|
|
6
|
+
- **Remote execution responses**: secp256k1 ECDSA attestations by the MPC's per-client response key, stored unverified like the signature responses. The client contract verifies them in its own circuit.
|
|
7
7
|
- **Request-notification registry**: how the MPC discovers new signature requests.
|
|
8
8
|
|
|
9
9
|
## What is in it
|
|
@@ -11,7 +11,7 @@ The central [Sig Network](https://sig.network) signet contract on the [Midnight
|
|
|
11
11
|
- The curated export surface (package root): the generated contract module (`Contract`, the `ledger` state decoder, `pureCircuits`), the handwritten witnesses, and the platform-agnostic contract surface (circuit ids and the provider type).
|
|
12
12
|
- The `./managed/*` subpath export: the compiled contract assets (compiler output, `zkir/`, prover/verifier `keys/`) so runtimes can fetch them as files. The published package always carries the proving keys.
|
|
13
13
|
|
|
14
|
-
Consumers import the package root
|
|
14
|
+
Consumers import the package root. The `./managed/*` paths exist only for runtimes that load zk assets.
|
|
15
15
|
|
|
16
16
|
## Install
|
|
17
17
|
|
|
@@ -24,4 +24,4 @@ npm install @sig-net/midnight-contract
|
|
|
24
24
|
- [`@sig-net/midnight-contract-deploy`](https://www.npmjs.com/package/@sig-net/midnight-contract-deploy): deploys this contract (constructor argument: the MPC attestation key).
|
|
25
25
|
- [`@sig-net/midnight`](https://www.npmjs.com/package/@sig-net/midnight): the client-agnostic protocol library for reading this contract's state and verifying responses.
|
|
26
26
|
|
|
27
|
-
Developed in [sig-net/midnight-integration](https://github.com/sig-net/midnight-integration)
|
|
27
|
+
Developed in [sig-net/midnight-integration](https://github.com/sig-net/midnight-integration). Example applications live in [sig-net/midnight-examples](https://github.com/sig-net/midnight-examples).
|
|
@@ -169,17 +169,10 @@
|
|
|
169
169
|
"name": "RespondBidirectionalEvent",
|
|
170
170
|
"elements": [
|
|
171
171
|
{
|
|
172
|
-
"name": "
|
|
172
|
+
"name": "attestationDigest",
|
|
173
173
|
"type": {
|
|
174
174
|
"type-name": "Bytes",
|
|
175
|
-
"length":
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"name": "outputLen",
|
|
180
|
-
"type": {
|
|
181
|
-
"type-name": "Uint",
|
|
182
|
-
"maxval": 255
|
|
175
|
+
"length": 32
|
|
183
176
|
}
|
|
184
177
|
},
|
|
185
178
|
{
|
|
@@ -461,17 +454,10 @@
|
|
|
461
454
|
"name": "RespondBidirectionalEvent",
|
|
462
455
|
"elements": [
|
|
463
456
|
{
|
|
464
|
-
"name": "
|
|
457
|
+
"name": "attestationDigest",
|
|
465
458
|
"type": {
|
|
466
459
|
"type-name": "Bytes",
|
|
467
|
-
"length":
|
|
468
|
-
}
|
|
469
|
-
},
|
|
470
|
-
{
|
|
471
|
-
"name": "outputLen",
|
|
472
|
-
"type": {
|
|
473
|
-
"type-name": "Uint",
|
|
474
|
-
"maxval": 255
|
|
460
|
+
"length": 32
|
|
475
461
|
}
|
|
476
462
|
},
|
|
477
463
|
{
|
|
@@ -7,26 +7,26 @@
|
|
|
7
7
|
"type": "directory",
|
|
8
8
|
"contract-info.json": {
|
|
9
9
|
"type": "file",
|
|
10
|
-
"size":
|
|
11
|
-
"hash": "
|
|
10
|
+
"size": 12893,
|
|
11
|
+
"hash": "bcd4df22f8bbe7a284ad20c429a14e9d029b54a60968f9c70e5e9886b08364da"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"contract": {
|
|
15
15
|
"type": "directory",
|
|
16
16
|
"index.d.ts": {
|
|
17
17
|
"type": "file",
|
|
18
|
-
"size":
|
|
19
|
-
"hash": "
|
|
18
|
+
"size": 9777,
|
|
19
|
+
"hash": "aa8b30fda4740c37e47fd67708a59237953adab19cb041302bf990c4d6003629"
|
|
20
20
|
},
|
|
21
21
|
"index.js": {
|
|
22
22
|
"type": "file",
|
|
23
|
-
"size":
|
|
24
|
-
"hash": "
|
|
23
|
+
"size": 105081,
|
|
24
|
+
"hash": "e2a4aefec229a0820fcdee716079aebb64438bc8ce9910bf181114719046b7b9"
|
|
25
25
|
},
|
|
26
26
|
"index.js.map": {
|
|
27
27
|
"type": "file",
|
|
28
|
-
"size":
|
|
29
|
-
"hash": "
|
|
28
|
+
"size": 3081,
|
|
29
|
+
"hash": "1a7f2eeb450f4eedaac52f0890a5f7eee76ff9fcbfee0862f39a594b7b30d698"
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"zkir": {
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
},
|
|
44
44
|
"respondBidirectional.bzkir": {
|
|
45
45
|
"type": "file",
|
|
46
|
-
"size":
|
|
47
|
-
"hash": "
|
|
46
|
+
"size": 1718,
|
|
47
|
+
"hash": "93498ebcb78bf7c92a7215916538bf733a6d4c9b7173d20023f87b8ad3989b30"
|
|
48
48
|
},
|
|
49
49
|
"respondBidirectional.zkir": {
|
|
50
50
|
"type": "file",
|
|
51
|
-
"size":
|
|
52
|
-
"hash": "
|
|
51
|
+
"size": 4253,
|
|
52
|
+
"hash": "2e5669b61cd6842da5e037cc0d20f0408deb6b97d391dc0175342856540bc0ea"
|
|
53
53
|
},
|
|
54
54
|
"signBidirectional.bzkir": {
|
|
55
55
|
"type": "file",
|
|
@@ -76,13 +76,13 @@
|
|
|
76
76
|
},
|
|
77
77
|
"respondBidirectional.prover": {
|
|
78
78
|
"type": "file",
|
|
79
|
-
"size":
|
|
80
|
-
"hash": "
|
|
79
|
+
"size": 889222,
|
|
80
|
+
"hash": "b742e066a2dfb13212cffa0dfb46ad2cac913cde7d75453001aad9f64c054302"
|
|
81
81
|
},
|
|
82
82
|
"respondBidirectional.verifier": {
|
|
83
83
|
"type": "file",
|
|
84
84
|
"size": 1353,
|
|
85
|
-
"hash": "
|
|
85
|
+
"hash": "aa9b1666e95c9d66f4a8333f8cc72697afe7fd6359a850984e88743a6f667798"
|
|
86
86
|
},
|
|
87
87
|
"signBidirectional.prover": {
|
|
88
88
|
"type": "file",
|
|
@@ -20,8 +20,7 @@ export type ImpureCircuits<PS> = {
|
|
|
20
20
|
}): Promise<__compactRuntime.CircuitResults<PS, []>>;
|
|
21
21
|
respondBidirectional(context: __compactRuntime.CircuitContext<PS>,
|
|
22
22
|
requestId_0: Uint8Array,
|
|
23
|
-
respondBidirectionalEvent_0: {
|
|
24
|
-
outputLen: bigint,
|
|
23
|
+
respondBidirectionalEvent_0: { attestationDigest: Uint8Array,
|
|
25
24
|
signature: { bigR: { x: Uint8Array,
|
|
26
25
|
y: Uint8Array
|
|
27
26
|
},
|
|
@@ -48,8 +47,7 @@ export type ProvableCircuits<PS> = {
|
|
|
48
47
|
}): Promise<__compactRuntime.CircuitResults<PS, []>>;
|
|
49
48
|
respondBidirectional(context: __compactRuntime.CircuitContext<PS>,
|
|
50
49
|
requestId_0: Uint8Array,
|
|
51
|
-
respondBidirectionalEvent_0: {
|
|
52
|
-
outputLen: bigint,
|
|
50
|
+
respondBidirectionalEvent_0: { attestationDigest: Uint8Array,
|
|
53
51
|
signature: { bigR: { x: Uint8Array,
|
|
54
52
|
y: Uint8Array
|
|
55
53
|
},
|
|
@@ -79,8 +77,7 @@ export type Circuits<PS> = {
|
|
|
79
77
|
}): Promise<__compactRuntime.CircuitResults<PS, []>>;
|
|
80
78
|
respondBidirectional(context: __compactRuntime.CircuitContext<PS>,
|
|
81
79
|
requestId_0: Uint8Array,
|
|
82
|
-
respondBidirectionalEvent_0: {
|
|
83
|
-
outputLen: bigint,
|
|
80
|
+
respondBidirectionalEvent_0: { attestationDigest: Uint8Array,
|
|
84
81
|
signature: { bigR: { x: Uint8Array,
|
|
85
82
|
y: Uint8Array
|
|
86
83
|
},
|
|
@@ -139,8 +136,7 @@ export type Ledger = {
|
|
|
139
136
|
isEmpty(): boolean;
|
|
140
137
|
size(): bigint;
|
|
141
138
|
member(key_0: { count: bigint, requestId: Uint8Array }): boolean;
|
|
142
|
-
lookup(key_0: { count: bigint, requestId: Uint8Array }): {
|
|
143
|
-
outputLen: bigint,
|
|
139
|
+
lookup(key_0: { count: bigint, requestId: Uint8Array }): { attestationDigest: Uint8Array,
|
|
144
140
|
signature: { bigR: { x: Uint8Array,
|
|
145
141
|
y: Uint8Array
|
|
146
142
|
},
|
|
@@ -148,8 +144,7 @@ export type Ledger = {
|
|
|
148
144
|
recoveryId: bigint
|
|
149
145
|
}
|
|
150
146
|
};
|
|
151
|
-
[Symbol.iterator](): Iterator<[{ count: bigint, requestId: Uint8Array }, {
|
|
152
|
-
outputLen: bigint,
|
|
147
|
+
[Symbol.iterator](): Iterator<[{ count: bigint, requestId: Uint8Array }, { attestationDigest: Uint8Array,
|
|
153
148
|
signature: { bigR: { x: Uint8Array, y: Uint8Array },
|
|
154
149
|
s: Uint8Array,
|
|
155
150
|
recoveryId: bigint
|
|
@@ -26,10 +26,6 @@ class _SignetMapKey_0 {
|
|
|
26
26
|
|
|
27
27
|
const _descriptor_4 = new _SignetMapKey_0();
|
|
28
28
|
|
|
29
|
-
const _descriptor_5 = new __compactRuntime.CompactTypeBytes(128);
|
|
30
|
-
|
|
31
|
-
const _descriptor_6 = new __compactRuntime.CompactTypeUnsignedInteger(255n, 1);
|
|
32
|
-
|
|
33
29
|
class _AffinePoint_0 {
|
|
34
30
|
alignment() {
|
|
35
31
|
return _descriptor_0.alignment().concat(_descriptor_0.alignment());
|
|
@@ -45,56 +41,59 @@ class _AffinePoint_0 {
|
|
|
45
41
|
}
|
|
46
42
|
}
|
|
47
43
|
|
|
48
|
-
const
|
|
44
|
+
const _descriptor_5 = new _AffinePoint_0();
|
|
45
|
+
|
|
46
|
+
const _descriptor_6 = new __compactRuntime.CompactTypeUnsignedInteger(255n, 1);
|
|
49
47
|
|
|
50
48
|
class _Signature_0 {
|
|
51
49
|
alignment() {
|
|
52
|
-
return
|
|
50
|
+
return _descriptor_5.alignment().concat(_descriptor_0.alignment().concat(_descriptor_6.alignment()));
|
|
53
51
|
}
|
|
54
52
|
fromValue(value_0) {
|
|
55
53
|
return {
|
|
56
|
-
bigR:
|
|
54
|
+
bigR: _descriptor_5.fromValue(value_0),
|
|
57
55
|
s: _descriptor_0.fromValue(value_0),
|
|
58
56
|
recoveryId: _descriptor_6.fromValue(value_0)
|
|
59
57
|
}
|
|
60
58
|
}
|
|
61
59
|
toValue(value_0) {
|
|
62
|
-
return
|
|
60
|
+
return _descriptor_5.toValue(value_0.bigR).concat(_descriptor_0.toValue(value_0.s).concat(_descriptor_6.toValue(value_0.recoveryId)));
|
|
63
61
|
}
|
|
64
62
|
}
|
|
65
63
|
|
|
66
|
-
const
|
|
64
|
+
const _descriptor_7 = new _Signature_0();
|
|
67
65
|
|
|
68
66
|
class _RespondBidirectionalEvent_0 {
|
|
69
67
|
alignment() {
|
|
70
|
-
return
|
|
68
|
+
return _descriptor_0.alignment().concat(_descriptor_7.alignment());
|
|
71
69
|
}
|
|
72
70
|
fromValue(value_0) {
|
|
73
71
|
return {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
signature: _descriptor_8.fromValue(value_0)
|
|
72
|
+
attestationDigest: _descriptor_0.fromValue(value_0),
|
|
73
|
+
signature: _descriptor_7.fromValue(value_0)
|
|
77
74
|
}
|
|
78
75
|
}
|
|
79
76
|
toValue(value_0) {
|
|
80
|
-
return
|
|
77
|
+
return _descriptor_0.toValue(value_0.attestationDigest).concat(_descriptor_7.toValue(value_0.signature));
|
|
81
78
|
}
|
|
82
79
|
}
|
|
83
80
|
|
|
84
|
-
const
|
|
81
|
+
const _descriptor_8 = new _RespondBidirectionalEvent_0();
|
|
82
|
+
|
|
83
|
+
const _descriptor_9 = new __compactRuntime.CompactTypeBytes(128);
|
|
85
84
|
|
|
86
85
|
class _SignBidirectionalEventNotification_0 {
|
|
87
86
|
alignment() {
|
|
88
|
-
return _descriptor_6.alignment().concat(
|
|
87
|
+
return _descriptor_6.alignment().concat(_descriptor_9.alignment());
|
|
89
88
|
}
|
|
90
89
|
fromValue(value_0) {
|
|
91
90
|
return {
|
|
92
91
|
version: _descriptor_6.fromValue(value_0),
|
|
93
|
-
payload:
|
|
92
|
+
payload: _descriptor_9.fromValue(value_0)
|
|
94
93
|
}
|
|
95
94
|
}
|
|
96
95
|
toValue(value_0) {
|
|
97
|
-
return _descriptor_6.toValue(value_0.version).concat(
|
|
96
|
+
return _descriptor_6.toValue(value_0.version).concat(_descriptor_9.toValue(value_0.payload));
|
|
98
97
|
}
|
|
99
98
|
}
|
|
100
99
|
|
|
@@ -102,15 +101,15 @@ const _descriptor_10 = new _SignBidirectionalEventNotification_0();
|
|
|
102
101
|
|
|
103
102
|
class _SignatureRespondedEvent_0 {
|
|
104
103
|
alignment() {
|
|
105
|
-
return
|
|
104
|
+
return _descriptor_7.alignment();
|
|
106
105
|
}
|
|
107
106
|
fromValue(value_0) {
|
|
108
107
|
return {
|
|
109
|
-
signature:
|
|
108
|
+
signature: _descriptor_7.fromValue(value_0)
|
|
110
109
|
}
|
|
111
110
|
}
|
|
112
111
|
toValue(value_0) {
|
|
113
|
-
return
|
|
112
|
+
return _descriptor_7.toValue(value_0.signature);
|
|
114
113
|
}
|
|
115
114
|
}
|
|
116
115
|
|
|
@@ -268,29 +267,29 @@ export class Contract {
|
|
|
268
267
|
if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.callContext.currentQueryContext != undefined)) {
|
|
269
268
|
__compactRuntime.typeError('respondBidirectional',
|
|
270
269
|
'argument 1 (as invoked from Typescript)',
|
|
271
|
-
'signet-contract.compact line
|
|
270
|
+
'signet-contract.compact line 98 char 1',
|
|
272
271
|
'CircuitContext',
|
|
273
272
|
contextOrig_0)
|
|
274
273
|
}
|
|
275
274
|
if (!(requestId_0.buffer instanceof ArrayBuffer && requestId_0.BYTES_PER_ELEMENT === 1 && requestId_0.length === 32)) {
|
|
276
275
|
__compactRuntime.typeError('respondBidirectional',
|
|
277
276
|
'argument 1 (argument 2 as invoked from Typescript)',
|
|
278
|
-
'signet-contract.compact line
|
|
277
|
+
'signet-contract.compact line 98 char 1',
|
|
279
278
|
'Bytes<32>',
|
|
280
279
|
requestId_0)
|
|
281
280
|
}
|
|
282
|
-
if (!(typeof(respondBidirectionalEvent_0) === 'object' && respondBidirectionalEvent_0.
|
|
281
|
+
if (!(typeof(respondBidirectionalEvent_0) === 'object' && respondBidirectionalEvent_0.attestationDigest.buffer instanceof ArrayBuffer && respondBidirectionalEvent_0.attestationDigest.BYTES_PER_ELEMENT === 1 && respondBidirectionalEvent_0.attestationDigest.length === 32 && typeof(respondBidirectionalEvent_0.signature) === 'object' && typeof(respondBidirectionalEvent_0.signature.bigR) === 'object' && respondBidirectionalEvent_0.signature.bigR.x.buffer instanceof ArrayBuffer && respondBidirectionalEvent_0.signature.bigR.x.BYTES_PER_ELEMENT === 1 && respondBidirectionalEvent_0.signature.bigR.x.length === 32 && respondBidirectionalEvent_0.signature.bigR.y.buffer instanceof ArrayBuffer && respondBidirectionalEvent_0.signature.bigR.y.BYTES_PER_ELEMENT === 1 && respondBidirectionalEvent_0.signature.bigR.y.length === 32 && respondBidirectionalEvent_0.signature.s.buffer instanceof ArrayBuffer && respondBidirectionalEvent_0.signature.s.BYTES_PER_ELEMENT === 1 && respondBidirectionalEvent_0.signature.s.length === 32 && typeof(respondBidirectionalEvent_0.signature.recoveryId) === 'bigint' && respondBidirectionalEvent_0.signature.recoveryId >= 0n && respondBidirectionalEvent_0.signature.recoveryId <= 255n)) {
|
|
283
282
|
__compactRuntime.typeError('respondBidirectional',
|
|
284
283
|
'argument 2 (argument 3 as invoked from Typescript)',
|
|
285
|
-
'signet-contract.compact line
|
|
286
|
-
'struct RespondBidirectionalEvent<
|
|
284
|
+
'signet-contract.compact line 98 char 1',
|
|
285
|
+
'struct RespondBidirectionalEvent<attestationDigest: Bytes<32>, signature: struct Signature<bigR: struct AffinePoint<x: Bytes<32>, y: Bytes<32>>, s: Bytes<32>, recoveryId: Uint<0..256>>>',
|
|
287
286
|
respondBidirectionalEvent_0)
|
|
288
287
|
}
|
|
289
288
|
const context = __compactRuntime.copyCircuitContext(contextOrig_0);
|
|
290
289
|
const partialProofData = {
|
|
291
290
|
input: {
|
|
292
|
-
value: _descriptor_0.toValue(requestId_0).concat(
|
|
293
|
-
alignment: _descriptor_0.alignment().concat(
|
|
291
|
+
value: _descriptor_0.toValue(requestId_0).concat(_descriptor_8.toValue(respondBidirectionalEvent_0)),
|
|
292
|
+
alignment: _descriptor_0.alignment().concat(_descriptor_8.alignment())
|
|
294
293
|
},
|
|
295
294
|
output: undefined,
|
|
296
295
|
publicTranscript: [],
|
|
@@ -703,8 +702,8 @@ export class Contract {
|
|
|
703
702
|
value: __compactRuntime.StateValue.newCell({ value: _descriptor_4.toValue(tmp_1),
|
|
704
703
|
alignment: _descriptor_4.alignment() }).encode() } },
|
|
705
704
|
{ push: { storage: true,
|
|
706
|
-
value: __compactRuntime.StateValue.newCell({ value:
|
|
707
|
-
alignment:
|
|
705
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_8.toValue(respondBidirectionalEvent_0),
|
|
706
|
+
alignment: _descriptor_8.alignment() }).encode() } },
|
|
708
707
|
{ ins: { cached: false, n: 1 } },
|
|
709
708
|
{ ins: { cached: true, n: 1 } }]);
|
|
710
709
|
return [];
|
|
@@ -1354,7 +1353,7 @@ export function ledger(stateOrChargedState) {
|
|
|
1354
1353
|
'struct SignetMapKey<count: Uint<0..18446744073709551616>, requestId: Bytes<32>>',
|
|
1355
1354
|
key_0)
|
|
1356
1355
|
}
|
|
1357
|
-
return
|
|
1356
|
+
return _descriptor_8.fromValue(__compactRuntime.queryLedgerState(context,
|
|
1358
1357
|
partialProofData,
|
|
1359
1358
|
[
|
|
1360
1359
|
{ dup: { n: 0 } },
|
|
@@ -1378,7 +1377,7 @@ export function ledger(stateOrChargedState) {
|
|
|
1378
1377
|
throw new __compactRuntime.CompactError(`iter: expected 0 arguments, received ${args_0.length}`);
|
|
1379
1378
|
}
|
|
1380
1379
|
const self_0 = state.asArray()[5];
|
|
1381
|
-
return self_0.asMap().keys().map( (key) => { const value = self_0.asMap().get(key).asCell(); return [ _descriptor_4.fromValue(key.value),
|
|
1380
|
+
return self_0.asMap().keys().map( (key) => { const value = self_0.asMap().get(key).asCell(); return [ _descriptor_4.fromValue(key.value), _descriptor_8.fromValue(value.value) ]; })[Symbol.iterator]();
|
|
1382
1381
|
}
|
|
1383
1382
|
}
|
|
1384
1383
|
};
|
|
@@ -1392,7 +1391,7 @@ export const contractReferenceLocations =
|
|
|
1392
1391
|
{ tag: 'publicLedgerArray', indices: { } };
|
|
1393
1392
|
export const expectedVk = {
|
|
1394
1393
|
'respond': '22938eaebc029fd624db271e92857b132977c0373bf2f9ce823e21d011973e0d',
|
|
1395
|
-
'respondBidirectional': '
|
|
1394
|
+
'respondBidirectional': 'aa9b1666e95c9d66f4a8333f8cc72697afe7fd6359a850984e88743a6f667798',
|
|
1396
1395
|
'signBidirectional': '3e603e64ac930b8e4e1412e0afb5b3769e3d9db62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binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -12,52 +12,44 @@
|
|
|
12
12
|
{ "name": "%respondBidirectionalEvent.7", "type": "Scalar<BLS12-381>" },
|
|
13
13
|
{ "name": "%respondBidirectionalEvent.8", "type": "Scalar<BLS12-381>" },
|
|
14
14
|
{ "name": "%respondBidirectionalEvent.9", "type": "Scalar<BLS12-381>" },
|
|
15
|
-
{ "name": "%respondBidirectionalEvent.10", "type": "Scalar<BLS12-381>" }
|
|
16
|
-
{ "name": "%respondBidirectionalEvent.11", "type": "Scalar<BLS12-381>" },
|
|
17
|
-
{ "name": "%respondBidirectionalEvent.12", "type": "Scalar<BLS12-381>" },
|
|
18
|
-
{ "name": "%respondBidirectionalEvent.13", "type": "Scalar<BLS12-381>" },
|
|
19
|
-
{ "name": "%respondBidirectionalEvent.14", "type": "Scalar<BLS12-381>" }
|
|
15
|
+
{ "name": "%respondBidirectionalEvent.10", "type": "Scalar<BLS12-381>" }
|
|
20
16
|
],
|
|
21
17
|
"outputs": [
|
|
22
18
|
],
|
|
23
19
|
"instructions": [
|
|
24
20
|
{ "op": "constrain_bits", "val": "%requestId.0", "bits": 8 },
|
|
25
21
|
{ "op": "constrain_bits", "val": "%requestId.1", "bits": 248 },
|
|
26
|
-
{ "op": "constrain_bits", "val": "%respondBidirectionalEvent.2", "bits":
|
|
22
|
+
{ "op": "constrain_bits", "val": "%respondBidirectionalEvent.2", "bits": 8 },
|
|
27
23
|
{ "op": "constrain_bits", "val": "%respondBidirectionalEvent.3", "bits": 248 },
|
|
28
|
-
{ "op": "constrain_bits", "val": "%respondBidirectionalEvent.4", "bits":
|
|
24
|
+
{ "op": "constrain_bits", "val": "%respondBidirectionalEvent.4", "bits": 8 },
|
|
29
25
|
{ "op": "constrain_bits", "val": "%respondBidirectionalEvent.5", "bits": 248 },
|
|
30
|
-
{ "op": "constrain_bits", "val": "%respondBidirectionalEvent.6", "bits":
|
|
31
|
-
{ "op": "constrain_bits", "val": "%respondBidirectionalEvent.7", "bits":
|
|
26
|
+
{ "op": "constrain_bits", "val": "%respondBidirectionalEvent.6", "bits": 8 },
|
|
27
|
+
{ "op": "constrain_bits", "val": "%respondBidirectionalEvent.7", "bits": 248 },
|
|
32
28
|
{ "op": "constrain_bits", "val": "%respondBidirectionalEvent.8", "bits": 8 },
|
|
33
29
|
{ "op": "constrain_bits", "val": "%respondBidirectionalEvent.9", "bits": 248 },
|
|
34
30
|
{ "op": "constrain_bits", "val": "%respondBidirectionalEvent.10", "bits": 8 },
|
|
35
|
-
{ "op": "
|
|
36
|
-
{ "op": "constrain_bits", "val": "%respondBidirectionalEvent.12", "bits": 8 },
|
|
37
|
-
{ "op": "constrain_bits", "val": "%respondBidirectionalEvent.13", "bits": 248 },
|
|
38
|
-
{ "op": "constrain_bits", "val": "%respondBidirectionalEvent.14", "bits": 8 },
|
|
39
|
-
{ "op": "public_input", "type": "Scalar<BLS12-381>", "output": "%t.15", "guard": null },
|
|
31
|
+
{ "op": "public_input", "type": "Scalar<BLS12-381>", "output": "%t.11", "guard": null },
|
|
40
32
|
{ "op": "impact", "guard": "0x01", "inputs": ["0x30"] },
|
|
41
33
|
{ "op": "impact", "guard": "0x01", "inputs": ["0x50", "0x01", "0x01", "0x04"] },
|
|
42
34
|
{ "op": "impact", "guard": "0x01", "inputs": ["0x10", "0x01", "0x01", "0x20", "%requestId.0", "%requestId.1"] },
|
|
43
35
|
{ "op": "impact", "guard": "0x01", "inputs": ["0x18"] },
|
|
44
|
-
{ "op": "impact", "guard": "0x01", "inputs": ["0x0d", "0x01", "0x01", "%t.
|
|
45
|
-
{ "op": "cond_select", "output": "%t.
|
|
46
|
-
{ "op": "impact", "guard": "%t.
|
|
47
|
-
{ "op": "impact", "guard": "%t.
|
|
48
|
-
{ "op": "impact", "guard": "%t.
|
|
49
|
-
{ "op": "impact", "guard": "%t.
|
|
50
|
-
{ "op": "impact", "guard": "%t.
|
|
51
|
-
{ "op": "public_input", "type": "Scalar<BLS12-381>", "output": "%count.
|
|
36
|
+
{ "op": "impact", "guard": "0x01", "inputs": ["0x0d", "0x01", "0x01", "%t.11"] },
|
|
37
|
+
{ "op": "cond_select", "output": "%t.12", "bit": "%t.11", "a": "0x00", "b": "0x01" },
|
|
38
|
+
{ "op": "impact", "guard": "%t.12", "inputs": ["0x70", "0x01", "0x01", "0x04"] },
|
|
39
|
+
{ "op": "impact", "guard": "%t.12", "inputs": ["0x10", "0x01", "0x01", "0x20", "%requestId.0", "%requestId.1"] },
|
|
40
|
+
{ "op": "impact", "guard": "%t.12", "inputs": ["0x11", "0x01", "0x01", "0x08", "0x00"] },
|
|
41
|
+
{ "op": "impact", "guard": "%t.12", "inputs": ["0x91"] },
|
|
42
|
+
{ "op": "impact", "guard": "%t.12", "inputs": ["0xa1"] },
|
|
43
|
+
{ "op": "public_input", "type": "Scalar<BLS12-381>", "output": "%count.13", "guard": null },
|
|
52
44
|
{ "op": "impact", "guard": "0x01", "inputs": ["0x30"] },
|
|
53
45
|
{ "op": "impact", "guard": "0x01", "inputs": ["0x51", "0x01", "0x01", "0x04", "0x01", "0x20", "%requestId.0", "%requestId.1"] },
|
|
54
|
-
{ "op": "impact", "guard": "0x01", "inputs": ["0x0d", "0x01", "0x08", "%count.
|
|
46
|
+
{ "op": "impact", "guard": "0x01", "inputs": ["0x0d", "0x01", "0x08", "%count.13"] },
|
|
55
47
|
{ "op": "impact", "guard": "0x01", "inputs": ["0x71", "0x01", "0x01", "0x04", "0x01", "0x20", "%requestId.0", "%requestId.1"] },
|
|
56
48
|
{ "op": "impact", "guard": "0x01", "inputs": ["0x0e", "0x01"] },
|
|
57
49
|
{ "op": "impact", "guard": "0x01", "inputs": ["0xa2"] },
|
|
58
50
|
{ "op": "impact", "guard": "0x01", "inputs": ["0x70", "0x01", "0x01", "0x05"] },
|
|
59
|
-
{ "op": "impact", "guard": "0x01", "inputs": ["0x10", "0x01", "0x02", "0x08", "0x20", "%count.
|
|
60
|
-
{ "op": "impact", "guard": "0x01", "inputs": ["0x11", "0x01", "
|
|
51
|
+
{ "op": "impact", "guard": "0x01", "inputs": ["0x10", "0x01", "0x02", "0x08", "0x20", "%count.13", "%requestId.0", "%requestId.1"] },
|
|
52
|
+
{ "op": "impact", "guard": "0x01", "inputs": ["0x11", "0x01", "0x05", "0x20", "0x20", "0x20", "0x20", "0x01", "%respondBidirectionalEvent.2", "%respondBidirectionalEvent.3", "%respondBidirectionalEvent.4", "%respondBidirectionalEvent.5", "%respondBidirectionalEvent.6", "%respondBidirectionalEvent.7", "%respondBidirectionalEvent.8", "%respondBidirectionalEvent.9", "%respondBidirectionalEvent.10"] },
|
|
61
53
|
{ "op": "impact", "guard": "0x01", "inputs": ["0x91"] },
|
|
62
54
|
{ "op": "impact", "guard": "0x01", "inputs": ["0xa1"] }
|
|
63
55
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sig-net/midnight-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/sig-net/midnight-integration",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"scripts": {
|
|
22
22
|
"compile": "COMPACT_PATH=../../node_modules compact compile --skip-zk --feature-zkir-v3 src/signet-contract.compact src/managed",
|
|
23
23
|
"compile:zk": "COMPACT_PATH=../../node_modules compact compile --feature-zkir-v3 src/signet-contract.compact src/managed",
|
|
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
|
|
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"
|
|
27
27
|
},
|
|
@@ -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.
|
|
45
|
+
"@sig-net/midnight": "^0.13.0",
|
|
46
46
|
"@types/node": "^26.1.0",
|
|
47
47
|
"typescript": "^6.0.3",
|
|
48
48
|
"vitest": "^4.1.9"
|