@sig-net/midnight-responder 0.0.0-stage → 0.26.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 +39 -2
- package/dist/contract-surface.d.ts +20 -0
- package/dist/contract-surface.d.ts.map +1 -0
- package/dist/contract-surface.js +12 -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 +8 -0
- package/dist/index.js.map +1 -0
- package/dist/managed/compiler/contract-info.json +210 -0
- package/dist/managed/compiler/contract-manifest.json +79 -0
- package/dist/managed/contract/index.d.ts +103 -0
- package/dist/managed/contract/index.js +423 -0
- package/dist/managed/contract/index.js.map +8 -0
- package/dist/managed/keys/respond.prover +0 -0
- package/dist/managed/keys/respond.verifier +0 -0
- package/dist/managed/keys/respondBidirectional.prover +0 -0
- package/dist/managed/keys/respondBidirectional.verifier +0 -0
- package/dist/managed/zkir/respond.bzkir +0 -0
- package/dist/managed/zkir/respond.zkir +1 -0
- package/dist/managed/zkir/respondBidirectional.bzkir +0 -0
- package/dist/managed/zkir/respondBidirectional.zkir +1 -0
- package/dist/witnesses.d.ts +15 -0
- package/dist/witnesses.d.ts.map +1 -0
- package/dist/witnesses.js +14 -0
- package/dist/witnesses.js.map +1 -0
- package/package.json +51 -3
package/README.md
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @sig-net/midnight-responder
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The [Sig Network](https://sig.network) response contract on the [Midnight blockchain](https://midnight.network): the two circuits the MPC posts its responses through, each emitting them as contract events, which clients poll:
|
|
4
|
+
|
|
5
|
+
- `respond`: a signature response, as a `SignatureRespondedEvent`.
|
|
6
|
+
- `respondBidirectional`: a remote execution attestation, as a `RespondBidirectionalEvent`.
|
|
7
|
+
|
|
8
|
+
Both circuits emit unverified posts. Clients verify each one themselves, as the root README's [Integrator Guide](https://github.com/sig-net/midnight-integration/blob/main/README.md#integrator-guide) shows.
|
|
9
|
+
|
|
10
|
+
## What is in it
|
|
11
|
+
|
|
12
|
+
- The curated export surface (package root): the generated contract module (`Contract`), the handwritten witnesses, and the platform-agnostic contract surface (circuit ids and the provider type).
|
|
13
|
+
- 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.
|
|
14
|
+
|
|
15
|
+
## Where the proving artifacts come from
|
|
16
|
+
|
|
17
|
+
[`src/signet-responder.compact`](src/signet-responder.compact) is the specification and the source of the JS executor. The `zkir/` and `keys/` the package ships are compiled from [`minocrab/`](minocrab), the same two circuits written in [MinoCrab](https://github.com/sig-net/minocrab), which prove at k=10/11 instead of compactc's k=17. The fee and the proof size are the same.
|
|
18
|
+
|
|
19
|
+
`yarn compile:zk` builds that bundle:
|
|
20
|
+
|
|
21
|
+
1. `yarn compile` writes compactc's `--skip-zk` output to `src/managed/`.
|
|
22
|
+
2. `cargo run` in `minocrab/` checks each MinoCrab circuit against compactc's `.zkir` of it: both must accept the call the MPC makes and derive the same public inputs.
|
|
23
|
+
3. It replaces compactc's `.zkir` with MinoCrab's, generates the `.bzkir` and the keys with the `zkir-v3` that ships beside compactc, and rewrites `compiler/contract-manifest.json` to list them, which midnight-js checks every artifact against.
|
|
24
|
+
4. It fails if any artifact's hash differs from [`minocrab/artifacts.sha256`](minocrab/artifacts.sha256). New hashes mean new verifier keys, which only a new deployment carries. To accept them, run `yarn compile:signet-responder`, then `cargo run --locked -- ../src/managed --update-lock` in `minocrab/`, and commit the lock.
|
|
25
|
+
|
|
26
|
+
`yarn compile:zk` needs a Rust toolchain; [`minocrab/rust-toolchain.toml`](minocrab/rust-toolchain.toml) pins it. `cargo test` in `minocrab/` runs the same parity checks after `yarn compile`.
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
npm install @sig-net/midnight-responder
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Related packages
|
|
35
|
+
|
|
36
|
+
- [`@sig-net/midnight-signer`](https://www.npmjs.com/package/@sig-net/midnight-signer): the signet signer, which integrating contracts notify of their requests.
|
|
37
|
+
- [`@sig-net/midnight`](https://www.npmjs.com/package/@sig-net/midnight): the client-agnostic protocol library for decoding these events and verifying responses, and the published per-network responder addresses (`getResponderContractAddress`).
|
|
38
|
+
- [`@sig-net/midnight-contract-deploy`](https://www.npmjs.com/package/@sig-net/midnight-contract-deploy): the operator deploy flow (`deploySignetResponder`).
|
|
39
|
+
|
|
40
|
+
Developed in [sig-net/midnight-integration](https://github.com/sig-net/midnight-integration).
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { MidnightProviders } from "@midnight-ntwrk/midnight-js/types";
|
|
2
|
+
import type { Contract } from "./managed/contract/index.js";
|
|
3
|
+
import type { SignetResponderPrivateState } from "./witnesses.ts";
|
|
4
|
+
/** The contract's provable circuit ids, straight from the generated contract. */
|
|
5
|
+
export type SignetResponderCircuitId = keyof InstanceType<typeof Contract>["provableCircuits"];
|
|
6
|
+
/**
|
|
7
|
+
* Literal of the private-state storage key. Just a string, but a single-value
|
|
8
|
+
* union so the providers/`findDeployedContract` pairing is enforced by the
|
|
9
|
+
* type system.
|
|
10
|
+
*/
|
|
11
|
+
export type SignetResponderPrivateStateId = "signet-responder";
|
|
12
|
+
/**
|
|
13
|
+
* Key under which midnight-js persists this contract's private state locally
|
|
14
|
+
* (in whatever private-state store the consumer's provider set uses).
|
|
15
|
+
* Distinct per contract so two clients don't share an entry.
|
|
16
|
+
*/
|
|
17
|
+
export declare const SIGNET_RESPONDER_PRIVATE_STATE_ID: SignetResponderPrivateStateId;
|
|
18
|
+
/** The full midnight-js provider set, typed to the signet responder. */
|
|
19
|
+
export type SignetResponderProviders = MidnightProviders<SignetResponderCircuitId, SignetResponderPrivateStateId, SignetResponderPrivateState>;
|
|
20
|
+
//# sourceMappingURL=contract-surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-surface.d.ts","sourceRoot":"","sources":["../src/contract-surface.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAElE,iFAAiF;AACjF,MAAM,MAAM,wBAAwB,GAAG,MAAM,YAAY,CAAC,OAAO,QAAQ,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAE/F;;;;GAIG;AACH,MAAM,MAAM,6BAA6B,GAAG,kBAAkB,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,EAAE,6BAAkD,CAAC;AAEnG,wEAAwE;AACxE,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,CAEtD,wBAAwB,EAExB,6BAA6B,EAE7B,2BAA2B,CAC5B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
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: composing a live midnight-js provider set differs per environment
|
|
4
|
+
// (Node fs vs browser fetch, LevelDB vs IndexedDB, WalletFacade vs a connector
|
|
5
|
+
// API), so each consumer declares its own.
|
|
6
|
+
/**
|
|
7
|
+
* Key under which midnight-js persists this contract's private state locally
|
|
8
|
+
* (in whatever private-state store the consumer's provider set uses).
|
|
9
|
+
* Distinct per contract so two clients don't share an entry.
|
|
10
|
+
*/
|
|
11
|
+
export const SIGNET_RESPONDER_PRIVATE_STATE_ID = "signet-responder";
|
|
12
|
+
//# sourceMappingURL=contract-surface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-surface.js","sourceRoot":"","sources":["../src/contract-surface.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,+EAA+E;AAC/E,2CAA2C;AAiB3C;;;;GAIG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAkC,kBAAkB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Curated export surface: everything the compiler emitted, the handwritten
|
|
2
|
+
// witnesses, and the platform-agnostic contract surface (ids + provider TYPE).
|
|
3
|
+
// Environment bindings (zk-config source, state store, wallet adapter) live
|
|
4
|
+
// with each consumer, not here.
|
|
5
|
+
export * from "./contract-surface.js";
|
|
6
|
+
export * from "./managed/contract/index.js";
|
|
7
|
+
export * from "./witnesses.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,+EAA+E;AAC/E,4EAA4E;AAC5E,gCAAgC;AAEhC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compiler-version": "0.36.0",
|
|
3
|
+
"compiler-commit": "b5d9e4dfc532fe47011c4f6296e254f4853eb469",
|
|
4
|
+
"language-version": "0.28.0",
|
|
5
|
+
"runtime-version": "0.21.0",
|
|
6
|
+
"circuits": [
|
|
7
|
+
{
|
|
8
|
+
"name": "respond",
|
|
9
|
+
"pure": false,
|
|
10
|
+
"proof": true,
|
|
11
|
+
"arguments": [
|
|
12
|
+
{
|
|
13
|
+
"name": "signatureRespondedEvent",
|
|
14
|
+
"type": {
|
|
15
|
+
"type-name": "Struct",
|
|
16
|
+
"name": "SignatureRespondedEventV1",
|
|
17
|
+
"elements": [
|
|
18
|
+
{
|
|
19
|
+
"name": "requestId",
|
|
20
|
+
"type": {
|
|
21
|
+
"type-name": "Alias",
|
|
22
|
+
"name": "RequestId",
|
|
23
|
+
"type": {
|
|
24
|
+
"type-name": "Bytes",
|
|
25
|
+
"length": 32
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "signature",
|
|
31
|
+
"type": {
|
|
32
|
+
"type-name": "Struct",
|
|
33
|
+
"name": "Signature",
|
|
34
|
+
"elements": [
|
|
35
|
+
{
|
|
36
|
+
"name": "bigR",
|
|
37
|
+
"type": {
|
|
38
|
+
"type-name": "Struct",
|
|
39
|
+
"name": "AffinePoint",
|
|
40
|
+
"elements": [
|
|
41
|
+
{
|
|
42
|
+
"name": "x",
|
|
43
|
+
"type": {
|
|
44
|
+
"type-name": "Bytes",
|
|
45
|
+
"length": 32
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "y",
|
|
50
|
+
"type": {
|
|
51
|
+
"type-name": "Bytes",
|
|
52
|
+
"length": 32
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "s",
|
|
60
|
+
"type": {
|
|
61
|
+
"type-name": "Bytes",
|
|
62
|
+
"length": 32
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "recoveryId",
|
|
67
|
+
"type": {
|
|
68
|
+
"type-name": "Uint",
|
|
69
|
+
"maxval": 255
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"result-type": {
|
|
80
|
+
"type-name": "Tuple",
|
|
81
|
+
"types": [
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "respondBidirectional",
|
|
87
|
+
"pure": false,
|
|
88
|
+
"proof": true,
|
|
89
|
+
"arguments": [
|
|
90
|
+
{
|
|
91
|
+
"name": "respondBidirectionalEvent",
|
|
92
|
+
"type": {
|
|
93
|
+
"type-name": "Struct",
|
|
94
|
+
"name": "RespondBidirectionalEventV1",
|
|
95
|
+
"elements": [
|
|
96
|
+
{
|
|
97
|
+
"name": "requestId",
|
|
98
|
+
"type": {
|
|
99
|
+
"type-name": "Alias",
|
|
100
|
+
"name": "RequestId",
|
|
101
|
+
"type": {
|
|
102
|
+
"type-name": "Bytes",
|
|
103
|
+
"length": 32
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "blockHeight",
|
|
109
|
+
"type": {
|
|
110
|
+
"type-name": "Uint",
|
|
111
|
+
"maxval": 18446744073709551615
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "outputKind",
|
|
116
|
+
"type": {
|
|
117
|
+
"type-name": "Enum",
|
|
118
|
+
"name": "OutputKind",
|
|
119
|
+
"elements": [
|
|
120
|
+
"executed",
|
|
121
|
+
"failed",
|
|
122
|
+
"unviable"
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "serializedOutputLength",
|
|
128
|
+
"type": {
|
|
129
|
+
"type-name": "Uint",
|
|
130
|
+
"maxval": 18446744073709551615
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "outputHash",
|
|
135
|
+
"type": {
|
|
136
|
+
"type-name": "Bytes",
|
|
137
|
+
"length": 32
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "digest",
|
|
142
|
+
"type": {
|
|
143
|
+
"type-name": "Bytes",
|
|
144
|
+
"length": 32
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"name": "signature",
|
|
149
|
+
"type": {
|
|
150
|
+
"type-name": "Struct",
|
|
151
|
+
"name": "Signature",
|
|
152
|
+
"elements": [
|
|
153
|
+
{
|
|
154
|
+
"name": "bigR",
|
|
155
|
+
"type": {
|
|
156
|
+
"type-name": "Struct",
|
|
157
|
+
"name": "AffinePoint",
|
|
158
|
+
"elements": [
|
|
159
|
+
{
|
|
160
|
+
"name": "x",
|
|
161
|
+
"type": {
|
|
162
|
+
"type-name": "Bytes",
|
|
163
|
+
"length": 32
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"name": "y",
|
|
168
|
+
"type": {
|
|
169
|
+
"type-name": "Bytes",
|
|
170
|
+
"length": 32
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"name": "s",
|
|
178
|
+
"type": {
|
|
179
|
+
"type-name": "Bytes",
|
|
180
|
+
"length": 32
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"name": "recoveryId",
|
|
185
|
+
"type": {
|
|
186
|
+
"type-name": "Uint",
|
|
187
|
+
"maxval": 255
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
"result-type": {
|
|
198
|
+
"type-name": "Tuple",
|
|
199
|
+
"types": [
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
"witnesses": [
|
|
205
|
+
],
|
|
206
|
+
"contracts": [
|
|
207
|
+
],
|
|
208
|
+
"ledger": [
|
|
209
|
+
]
|
|
210
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest-version": "1",
|
|
3
|
+
"compiler-version": "0.36.0",
|
|
4
|
+
"compiler-commit": "b5d9e4dfc532fe47011c4f6296e254f4853eb469",
|
|
5
|
+
"language-version": "0.28.0",
|
|
6
|
+
"runtime-version": "0.21.0",
|
|
7
|
+
"compiler": {
|
|
8
|
+
"type": "directory",
|
|
9
|
+
"contract-info.json": {
|
|
10
|
+
"type": "file",
|
|
11
|
+
"size": 5881,
|
|
12
|
+
"hash": "311ec9b75bce25b0b5f237c5353a28b54006b83021b20d46f6005f0e38589d07"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"contract": {
|
|
16
|
+
"type": "directory",
|
|
17
|
+
"index.d.ts": {
|
|
18
|
+
"type": "file",
|
|
19
|
+
"size": 6210,
|
|
20
|
+
"hash": "b927010b3b1242f62fbe150860053ce3f7fe1b5f643ae495b99510a618feed4f"
|
|
21
|
+
},
|
|
22
|
+
"index.js": {
|
|
23
|
+
"type": "file",
|
|
24
|
+
"size": 41625,
|
|
25
|
+
"hash": "46b2832359b49cccdd0ca97655d3f5aefa81187ae610f03739403edb0c97865a"
|
|
26
|
+
},
|
|
27
|
+
"index.js.map": {
|
|
28
|
+
"type": "file",
|
|
29
|
+
"size": 1030,
|
|
30
|
+
"hash": "ae886e4dc854a3a4d8dbcec2ce2e42470412b25eff1e2c92274932f5b6e3e28b"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"zkir": {
|
|
34
|
+
"type": "directory",
|
|
35
|
+
"respond.bzkir": {
|
|
36
|
+
"type": "file",
|
|
37
|
+
"size": 2047,
|
|
38
|
+
"hash": "2d89c680b0a14eb3431a94aa1d46db93a52ecf385dccfba10452b6b93491af46"
|
|
39
|
+
},
|
|
40
|
+
"respond.zkir": {
|
|
41
|
+
"type": "file",
|
|
42
|
+
"size": 3726,
|
|
43
|
+
"hash": "92fec1230b89036c7ce55fe36ceb8d537cbf7f26da17ca1332de4ed7ba162143"
|
|
44
|
+
},
|
|
45
|
+
"respondBidirectional.bzkir": {
|
|
46
|
+
"type": "file",
|
|
47
|
+
"size": 3901,
|
|
48
|
+
"hash": "0191f5af62beac6d7d35333f54c683a5f3c400eb22dcd5cf3afb797f0f2f9052"
|
|
49
|
+
},
|
|
50
|
+
"respondBidirectional.zkir": {
|
|
51
|
+
"type": "file",
|
|
52
|
+
"size": 6716,
|
|
53
|
+
"hash": "9e17a811e844615e807015c4a429a45225f6b5af22deafda8f52bd35e351c200"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"keys": {
|
|
57
|
+
"type": "directory",
|
|
58
|
+
"respond.prover": {
|
|
59
|
+
"type": "file",
|
|
60
|
+
"size": 889551,
|
|
61
|
+
"hash": "66c5ac1b84e56dbd7955e4cb97b3dabda5dd390ba7e50c7307dcc9917fb77e70"
|
|
62
|
+
},
|
|
63
|
+
"respond.verifier": {
|
|
64
|
+
"type": "file",
|
|
65
|
+
"size": 1353,
|
|
66
|
+
"hash": "15954f5769161352510f237304e2cf44a74fc72403ccb07936f353a593834cd8"
|
|
67
|
+
},
|
|
68
|
+
"respondBidirectional.prover": {
|
|
69
|
+
"type": "file",
|
|
70
|
+
"size": 1776141,
|
|
71
|
+
"hash": "01723a372196a2132a6dcd0f9c6b75fb366634241206d5f847d6d811990ca3c5"
|
|
72
|
+
},
|
|
73
|
+
"respondBidirectional.verifier": {
|
|
74
|
+
"type": "file",
|
|
75
|
+
"size": 1353,
|
|
76
|
+
"hash": "9778599e8a43b71a69d1889ad866c48e0c794b83d4c7f8c74d56f8179b135b5a"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type * as __compactRuntime from '@midnight-ntwrk/compact-runtime';
|
|
2
|
+
|
|
3
|
+
export type Witnesses<PS> = {
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export type ImpureCircuits<PS> = {
|
|
7
|
+
respond(context: __compactRuntime.CircuitContext<PS>,
|
|
8
|
+
signatureRespondedEvent_0: { requestId: Uint8Array,
|
|
9
|
+
signature: { bigR: { x: Uint8Array,
|
|
10
|
+
y: Uint8Array
|
|
11
|
+
},
|
|
12
|
+
s: Uint8Array,
|
|
13
|
+
recoveryId: bigint
|
|
14
|
+
}
|
|
15
|
+
}): Promise<__compactRuntime.CircuitResults<PS, []>>;
|
|
16
|
+
respondBidirectional(context: __compactRuntime.CircuitContext<PS>,
|
|
17
|
+
respondBidirectionalEvent_0: { requestId: Uint8Array,
|
|
18
|
+
blockHeight: bigint,
|
|
19
|
+
outputKind: number,
|
|
20
|
+
serializedOutputLength: bigint,
|
|
21
|
+
outputHash: Uint8Array,
|
|
22
|
+
digest: Uint8Array,
|
|
23
|
+
signature: { bigR: { x: Uint8Array,
|
|
24
|
+
y: Uint8Array
|
|
25
|
+
},
|
|
26
|
+
s: Uint8Array,
|
|
27
|
+
recoveryId: bigint
|
|
28
|
+
}
|
|
29
|
+
}): Promise<__compactRuntime.CircuitResults<PS, []>>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type ProvableCircuits<PS> = {
|
|
33
|
+
respond(context: __compactRuntime.CircuitContext<PS>,
|
|
34
|
+
signatureRespondedEvent_0: { requestId: Uint8Array,
|
|
35
|
+
signature: { bigR: { x: Uint8Array,
|
|
36
|
+
y: Uint8Array
|
|
37
|
+
},
|
|
38
|
+
s: Uint8Array,
|
|
39
|
+
recoveryId: bigint
|
|
40
|
+
}
|
|
41
|
+
}): Promise<__compactRuntime.CircuitResults<PS, []>>;
|
|
42
|
+
respondBidirectional(context: __compactRuntime.CircuitContext<PS>,
|
|
43
|
+
respondBidirectionalEvent_0: { requestId: Uint8Array,
|
|
44
|
+
blockHeight: bigint,
|
|
45
|
+
outputKind: number,
|
|
46
|
+
serializedOutputLength: bigint,
|
|
47
|
+
outputHash: Uint8Array,
|
|
48
|
+
digest: Uint8Array,
|
|
49
|
+
signature: { bigR: { x: Uint8Array,
|
|
50
|
+
y: Uint8Array
|
|
51
|
+
},
|
|
52
|
+
s: Uint8Array,
|
|
53
|
+
recoveryId: bigint
|
|
54
|
+
}
|
|
55
|
+
}): Promise<__compactRuntime.CircuitResults<PS, []>>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type PureCircuits = {
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export type Circuits<PS> = {
|
|
62
|
+
respond(context: __compactRuntime.CircuitContext<PS>,
|
|
63
|
+
signatureRespondedEvent_0: { requestId: Uint8Array,
|
|
64
|
+
signature: { bigR: { x: Uint8Array,
|
|
65
|
+
y: Uint8Array
|
|
66
|
+
},
|
|
67
|
+
s: Uint8Array,
|
|
68
|
+
recoveryId: bigint
|
|
69
|
+
}
|
|
70
|
+
}): Promise<__compactRuntime.CircuitResults<PS, []>>;
|
|
71
|
+
respondBidirectional(context: __compactRuntime.CircuitContext<PS>,
|
|
72
|
+
respondBidirectionalEvent_0: { requestId: Uint8Array,
|
|
73
|
+
blockHeight: bigint,
|
|
74
|
+
outputKind: number,
|
|
75
|
+
serializedOutputLength: bigint,
|
|
76
|
+
outputHash: Uint8Array,
|
|
77
|
+
digest: Uint8Array,
|
|
78
|
+
signature: { bigR: { x: Uint8Array,
|
|
79
|
+
y: Uint8Array
|
|
80
|
+
},
|
|
81
|
+
s: Uint8Array,
|
|
82
|
+
recoveryId: bigint
|
|
83
|
+
}
|
|
84
|
+
}): Promise<__compactRuntime.CircuitResults<PS, []>>;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export type Ledger = {
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export declare class Contract<PS = any, W extends Witnesses<PS> = Witnesses<PS>> {
|
|
91
|
+
witnesses: W;
|
|
92
|
+
circuits: Circuits<PS>;
|
|
93
|
+
impureCircuits: ImpureCircuits<PS>;
|
|
94
|
+
provableCircuits: ProvableCircuits<PS>;
|
|
95
|
+
constructor(witnesses: W);
|
|
96
|
+
initialState(context: __compactRuntime.ConstructorContext<PS>): Promise<__compactRuntime.ConstructorResult<PS>>;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export declare function ledger(state: __compactRuntime.StateValue | __compactRuntime.ChargedState): Ledger;
|
|
100
|
+
export declare const pureCircuits: PureCircuits;
|
|
101
|
+
export declare const expectedVk: Record<string, string>;
|
|
102
|
+
export declare const circuitSignatures: __compactRuntime.CircuitSignatures;
|
|
103
|
+
export declare const declaredInterfaces: __compactRuntime.DeclaredInterfaces;
|
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
import * as __compactRuntime from '@midnight-ntwrk/compact-runtime';
|
|
2
|
+
__compactRuntime.checkRuntimeVersion('0.21.0');
|
|
3
|
+
|
|
4
|
+
const _descriptor_0 = new __compactRuntime.CompactTypeBytes(288);
|
|
5
|
+
|
|
6
|
+
const _descriptor_1 = new __compactRuntime.CompactTypeBytes(32);
|
|
7
|
+
|
|
8
|
+
class _AffinePoint_0 {
|
|
9
|
+
alignment() {
|
|
10
|
+
return _descriptor_1.alignment().concat(_descriptor_1.alignment());
|
|
11
|
+
}
|
|
12
|
+
fromValue(value_0) {
|
|
13
|
+
return {
|
|
14
|
+
x: _descriptor_1.fromValue(value_0),
|
|
15
|
+
y: _descriptor_1.fromValue(value_0)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
toValue(value_0) {
|
|
19
|
+
return _descriptor_1.toValue(value_0.x).concat(_descriptor_1.toValue(value_0.y));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const _descriptor_2 = new _AffinePoint_0();
|
|
24
|
+
|
|
25
|
+
const _descriptor_3 = new __compactRuntime.CompactTypeUnsignedInteger(255n, 1);
|
|
26
|
+
|
|
27
|
+
class _Signature_0 {
|
|
28
|
+
alignment() {
|
|
29
|
+
return _descriptor_2.alignment().concat(_descriptor_1.alignment().concat(_descriptor_3.alignment()));
|
|
30
|
+
}
|
|
31
|
+
fromValue(value_0) {
|
|
32
|
+
return {
|
|
33
|
+
bigR: _descriptor_2.fromValue(value_0),
|
|
34
|
+
s: _descriptor_1.fromValue(value_0),
|
|
35
|
+
recoveryId: _descriptor_3.fromValue(value_0)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
toValue(value_0) {
|
|
39
|
+
return _descriptor_2.toValue(value_0.bigR).concat(_descriptor_1.toValue(value_0.s).concat(_descriptor_3.toValue(value_0.recoveryId)));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const _descriptor_4 = new _Signature_0();
|
|
44
|
+
|
|
45
|
+
class _SignatureRespondedEventV1_0 {
|
|
46
|
+
alignment() {
|
|
47
|
+
return _descriptor_1.alignment().concat(_descriptor_4.alignment());
|
|
48
|
+
}
|
|
49
|
+
fromValue(value_0) {
|
|
50
|
+
return {
|
|
51
|
+
requestId: _descriptor_1.fromValue(value_0),
|
|
52
|
+
signature: _descriptor_4.fromValue(value_0)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
toValue(value_0) {
|
|
56
|
+
return _descriptor_1.toValue(value_0.requestId).concat(_descriptor_4.toValue(value_0.signature));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const _descriptor_5 = new _SignatureRespondedEventV1_0();
|
|
61
|
+
|
|
62
|
+
const _descriptor_6 = new __compactRuntime.CompactTypeUnsignedInteger(18446744073709551615n, 8);
|
|
63
|
+
|
|
64
|
+
const _descriptor_7 = new __compactRuntime.CompactTypeEnum(2, 1);
|
|
65
|
+
|
|
66
|
+
class _RespondBidirectionalEventV1_0 {
|
|
67
|
+
alignment() {
|
|
68
|
+
return _descriptor_1.alignment().concat(_descriptor_6.alignment().concat(_descriptor_7.alignment().concat(_descriptor_6.alignment().concat(_descriptor_1.alignment().concat(_descriptor_1.alignment().concat(_descriptor_4.alignment()))))));
|
|
69
|
+
}
|
|
70
|
+
fromValue(value_0) {
|
|
71
|
+
return {
|
|
72
|
+
requestId: _descriptor_1.fromValue(value_0),
|
|
73
|
+
blockHeight: _descriptor_6.fromValue(value_0),
|
|
74
|
+
outputKind: _descriptor_7.fromValue(value_0),
|
|
75
|
+
serializedOutputLength: _descriptor_6.fromValue(value_0),
|
|
76
|
+
outputHash: _descriptor_1.fromValue(value_0),
|
|
77
|
+
digest: _descriptor_1.fromValue(value_0),
|
|
78
|
+
signature: _descriptor_4.fromValue(value_0)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
toValue(value_0) {
|
|
82
|
+
return _descriptor_1.toValue(value_0.requestId).concat(_descriptor_6.toValue(value_0.blockHeight).concat(_descriptor_7.toValue(value_0.outputKind).concat(_descriptor_6.toValue(value_0.serializedOutputLength).concat(_descriptor_1.toValue(value_0.outputHash).concat(_descriptor_1.toValue(value_0.digest).concat(_descriptor_4.toValue(value_0.signature)))))));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const _descriptor_8 = new _RespondBidirectionalEventV1_0();
|
|
87
|
+
|
|
88
|
+
const _descriptor_9 = __compactRuntime.CompactTypeBoolean;
|
|
89
|
+
|
|
90
|
+
class _Either_0 {
|
|
91
|
+
alignment() {
|
|
92
|
+
return _descriptor_9.alignment().concat(_descriptor_1.alignment().concat(_descriptor_1.alignment()));
|
|
93
|
+
}
|
|
94
|
+
fromValue(value_0) {
|
|
95
|
+
return {
|
|
96
|
+
is_left: _descriptor_9.fromValue(value_0),
|
|
97
|
+
left: _descriptor_1.fromValue(value_0),
|
|
98
|
+
right: _descriptor_1.fromValue(value_0)
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
toValue(value_0) {
|
|
102
|
+
return _descriptor_9.toValue(value_0.is_left).concat(_descriptor_1.toValue(value_0.left).concat(_descriptor_1.toValue(value_0.right)));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const _descriptor_10 = new _Either_0();
|
|
107
|
+
|
|
108
|
+
const _descriptor_11 = new __compactRuntime.CompactTypeUnsignedInteger(340282366920938463463374607431768211455n, 16);
|
|
109
|
+
|
|
110
|
+
class _ContractAddress_0 {
|
|
111
|
+
alignment() {
|
|
112
|
+
return _descriptor_1.alignment();
|
|
113
|
+
}
|
|
114
|
+
fromValue(value_0) {
|
|
115
|
+
return {
|
|
116
|
+
bytes: _descriptor_1.fromValue(value_0)
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
toValue(value_0) {
|
|
120
|
+
return _descriptor_1.toValue(value_0.bytes);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const _descriptor_12 = new _ContractAddress_0();
|
|
125
|
+
|
|
126
|
+
class _UserAddress_0 {
|
|
127
|
+
alignment() {
|
|
128
|
+
return _descriptor_1.alignment();
|
|
129
|
+
}
|
|
130
|
+
fromValue(value_0) {
|
|
131
|
+
return {
|
|
132
|
+
bytes: _descriptor_1.fromValue(value_0)
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
toValue(value_0) {
|
|
136
|
+
return _descriptor_1.toValue(value_0.bytes);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const _descriptor_13 = new _UserAddress_0();
|
|
141
|
+
|
|
142
|
+
class _Either_1 {
|
|
143
|
+
alignment() {
|
|
144
|
+
return _descriptor_9.alignment().concat(_descriptor_12.alignment().concat(_descriptor_13.alignment()));
|
|
145
|
+
}
|
|
146
|
+
fromValue(value_0) {
|
|
147
|
+
return {
|
|
148
|
+
is_left: _descriptor_9.fromValue(value_0),
|
|
149
|
+
left: _descriptor_12.fromValue(value_0),
|
|
150
|
+
right: _descriptor_13.fromValue(value_0)
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
toValue(value_0) {
|
|
154
|
+
return _descriptor_9.toValue(value_0.is_left).concat(_descriptor_12.toValue(value_0.left).concat(_descriptor_13.toValue(value_0.right)));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const _descriptor_14 = new _Either_1();
|
|
159
|
+
|
|
160
|
+
class _Maybe_0 {
|
|
161
|
+
alignment() {
|
|
162
|
+
return _descriptor_9.alignment().concat(_descriptor_14.alignment());
|
|
163
|
+
}
|
|
164
|
+
fromValue(value_0) {
|
|
165
|
+
return {
|
|
166
|
+
is_some: _descriptor_9.fromValue(value_0),
|
|
167
|
+
value: _descriptor_14.fromValue(value_0)
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
toValue(value_0) {
|
|
171
|
+
return _descriptor_9.toValue(value_0.is_some).concat(_descriptor_14.toValue(value_0.value));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const _descriptor_15 = new _Maybe_0();
|
|
176
|
+
|
|
177
|
+
const _descriptor_16 = new __compactRuntime.CompactTypeUnsignedInteger(4294967295n, 4);
|
|
178
|
+
|
|
179
|
+
export class Contract {
|
|
180
|
+
witnesses;
|
|
181
|
+
constructor(...args_0) {
|
|
182
|
+
if (args_0.length !== 1) {
|
|
183
|
+
throw new __compactRuntime.CompactError(`Contract constructor: expected 1 argument, received ${args_0.length}`);
|
|
184
|
+
}
|
|
185
|
+
const witnesses_0 = args_0[0];
|
|
186
|
+
if (typeof(witnesses_0) !== 'object') {
|
|
187
|
+
throw new __compactRuntime.CompactError('first (witnesses) argument to Contract constructor is not an object');
|
|
188
|
+
}
|
|
189
|
+
this.witnesses = witnesses_0;
|
|
190
|
+
this.circuits = {
|
|
191
|
+
respond: async (...args_1) => {
|
|
192
|
+
if (args_1.length !== 2) {
|
|
193
|
+
throw new __compactRuntime.CompactError(`respond: expected 2 arguments (as invoked from Typescript), received ${args_1.length}`);
|
|
194
|
+
}
|
|
195
|
+
const contextOrig_0 = args_1[0];
|
|
196
|
+
const signatureRespondedEvent_0 = args_1[1];
|
|
197
|
+
if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.callContext.currentQueryContext != undefined)) {
|
|
198
|
+
__compactRuntime.typeError('respond',
|
|
199
|
+
'argument 1 (as invoked from Typescript)',
|
|
200
|
+
'signet-responder.compact line 27 char 1',
|
|
201
|
+
'CircuitContext',
|
|
202
|
+
contextOrig_0)
|
|
203
|
+
}
|
|
204
|
+
if (!(typeof(signatureRespondedEvent_0) === 'object' && signatureRespondedEvent_0.requestId.buffer instanceof ArrayBuffer && signatureRespondedEvent_0.requestId.BYTES_PER_ELEMENT === 1 && signatureRespondedEvent_0.requestId.length === 32 && typeof(signatureRespondedEvent_0.signature) === 'object' && typeof(signatureRespondedEvent_0.signature.bigR) === 'object' && signatureRespondedEvent_0.signature.bigR.x.buffer instanceof ArrayBuffer && signatureRespondedEvent_0.signature.bigR.x.BYTES_PER_ELEMENT === 1 && signatureRespondedEvent_0.signature.bigR.x.length === 32 && signatureRespondedEvent_0.signature.bigR.y.buffer instanceof ArrayBuffer && signatureRespondedEvent_0.signature.bigR.y.BYTES_PER_ELEMENT === 1 && signatureRespondedEvent_0.signature.bigR.y.length === 32 && signatureRespondedEvent_0.signature.s.buffer instanceof ArrayBuffer && signatureRespondedEvent_0.signature.s.BYTES_PER_ELEMENT === 1 && signatureRespondedEvent_0.signature.s.length === 32 && typeof(signatureRespondedEvent_0.signature.recoveryId) === 'bigint' && signatureRespondedEvent_0.signature.recoveryId >= 0n && signatureRespondedEvent_0.signature.recoveryId <= 255n)) {
|
|
205
|
+
__compactRuntime.typeError('respond',
|
|
206
|
+
'argument 1 (argument 2 as invoked from Typescript)',
|
|
207
|
+
'signet-responder.compact line 27 char 1',
|
|
208
|
+
'struct SignatureRespondedEventV1<requestId: Bytes<32>, signature: struct Signature<bigR: struct AffinePoint<x: Bytes<32>, y: Bytes<32>>, s: Bytes<32>, recoveryId: Uint<0..256>>>',
|
|
209
|
+
signatureRespondedEvent_0)
|
|
210
|
+
}
|
|
211
|
+
const context = __compactRuntime.copyCircuitContext(contextOrig_0);
|
|
212
|
+
const partialProofData = {
|
|
213
|
+
input: {
|
|
214
|
+
value: _descriptor_5.toValue(signatureRespondedEvent_0),
|
|
215
|
+
alignment: _descriptor_5.alignment()
|
|
216
|
+
},
|
|
217
|
+
output: undefined,
|
|
218
|
+
publicTranscript: [],
|
|
219
|
+
privateTranscriptOutputs: []
|
|
220
|
+
};
|
|
221
|
+
const result_0 = await this._respond_0(context,
|
|
222
|
+
partialProofData,
|
|
223
|
+
signatureRespondedEvent_0);
|
|
224
|
+
partialProofData.output = { value: [], alignment: [] };
|
|
225
|
+
__compactRuntime.finalizeCallProofData(context, partialProofData);
|
|
226
|
+
return { result: result_0, context: context, gasCost: context.callContext.currentGasCost };
|
|
227
|
+
},
|
|
228
|
+
respondBidirectional: async (...args_1) => {
|
|
229
|
+
if (args_1.length !== 2) {
|
|
230
|
+
throw new __compactRuntime.CompactError(`respondBidirectional: expected 2 arguments (as invoked from Typescript), received ${args_1.length}`);
|
|
231
|
+
}
|
|
232
|
+
const contextOrig_0 = args_1[0];
|
|
233
|
+
const respondBidirectionalEvent_0 = args_1[1];
|
|
234
|
+
if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.callContext.currentQueryContext != undefined)) {
|
|
235
|
+
__compactRuntime.typeError('respondBidirectional',
|
|
236
|
+
'argument 1 (as invoked from Typescript)',
|
|
237
|
+
'signet-responder.compact line 54 char 1',
|
|
238
|
+
'CircuitContext',
|
|
239
|
+
contextOrig_0)
|
|
240
|
+
}
|
|
241
|
+
if (!(typeof(respondBidirectionalEvent_0) === 'object' && respondBidirectionalEvent_0.requestId.buffer instanceof ArrayBuffer && respondBidirectionalEvent_0.requestId.BYTES_PER_ELEMENT === 1 && respondBidirectionalEvent_0.requestId.length === 32 && typeof(respondBidirectionalEvent_0.blockHeight) === 'bigint' && respondBidirectionalEvent_0.blockHeight >= 0n && respondBidirectionalEvent_0.blockHeight <= 18446744073709551615n && typeof(respondBidirectionalEvent_0.outputKind) === 'number' && respondBidirectionalEvent_0.outputKind >= 0 && respondBidirectionalEvent_0.outputKind <= 2 && typeof(respondBidirectionalEvent_0.serializedOutputLength) === 'bigint' && respondBidirectionalEvent_0.serializedOutputLength >= 0n && respondBidirectionalEvent_0.serializedOutputLength <= 18446744073709551615n && respondBidirectionalEvent_0.outputHash.buffer instanceof ArrayBuffer && respondBidirectionalEvent_0.outputHash.BYTES_PER_ELEMENT === 1 && respondBidirectionalEvent_0.outputHash.length === 32 && respondBidirectionalEvent_0.digest.buffer instanceof ArrayBuffer && respondBidirectionalEvent_0.digest.BYTES_PER_ELEMENT === 1 && respondBidirectionalEvent_0.digest.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)) {
|
|
242
|
+
__compactRuntime.typeError('respondBidirectional',
|
|
243
|
+
'argument 1 (argument 2 as invoked from Typescript)',
|
|
244
|
+
'signet-responder.compact line 54 char 1',
|
|
245
|
+
'struct RespondBidirectionalEventV1<requestId: Bytes<32>, blockHeight: Uint<0..18446744073709551616>, outputKind: Enum<OutputKind, executed, failed, unviable>, serializedOutputLength: Uint<0..18446744073709551616>, outputHash: Bytes<32>, digest: Bytes<32>, signature: struct Signature<bigR: struct AffinePoint<x: Bytes<32>, y: Bytes<32>>, s: Bytes<32>, recoveryId: Uint<0..256>>>',
|
|
246
|
+
respondBidirectionalEvent_0)
|
|
247
|
+
}
|
|
248
|
+
const context = __compactRuntime.copyCircuitContext(contextOrig_0);
|
|
249
|
+
const partialProofData = {
|
|
250
|
+
input: {
|
|
251
|
+
value: _descriptor_8.toValue(respondBidirectionalEvent_0),
|
|
252
|
+
alignment: _descriptor_8.alignment()
|
|
253
|
+
},
|
|
254
|
+
output: undefined,
|
|
255
|
+
publicTranscript: [],
|
|
256
|
+
privateTranscriptOutputs: []
|
|
257
|
+
};
|
|
258
|
+
const result_0 = await this._respondBidirectional_0(context,
|
|
259
|
+
partialProofData,
|
|
260
|
+
respondBidirectionalEvent_0);
|
|
261
|
+
partialProofData.output = { value: [], alignment: [] };
|
|
262
|
+
__compactRuntime.finalizeCallProofData(context, partialProofData);
|
|
263
|
+
return { result: result_0, context: context, gasCost: context.callContext.currentGasCost };
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
this.impureCircuits = {
|
|
267
|
+
respond: this.circuits.respond,
|
|
268
|
+
respondBidirectional: this.circuits.respondBidirectional
|
|
269
|
+
};
|
|
270
|
+
this.provableCircuits = {
|
|
271
|
+
respond: this.circuits.respond,
|
|
272
|
+
respondBidirectional: this.circuits.respondBidirectional
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
async initialState(...args_0) {
|
|
276
|
+
if (args_0.length !== 1) {
|
|
277
|
+
throw new __compactRuntime.CompactError(`Contract state constructor: expected 1 argument (as invoked from Typescript), received ${args_0.length}`);
|
|
278
|
+
}
|
|
279
|
+
const constructorContext_0 = args_0[0];
|
|
280
|
+
if (typeof(constructorContext_0) !== 'object') {
|
|
281
|
+
throw new __compactRuntime.CompactError(`Contract state constructor: expected 'constructorContext' in argument 1 (as invoked from Typescript) to be an object`);
|
|
282
|
+
}
|
|
283
|
+
if (!('initialZswapLocalState' in constructorContext_0)) {
|
|
284
|
+
throw new __compactRuntime.CompactError(`Contract state constructor: expected 'initialZswapLocalState' in argument 1 (as invoked from Typescript)`);
|
|
285
|
+
}
|
|
286
|
+
if (typeof(constructorContext_0.initialZswapLocalState) !== 'object') {
|
|
287
|
+
throw new __compactRuntime.CompactError(`Contract state constructor: expected 'initialZswapLocalState' in argument 1 (as invoked from Typescript) to be an object`);
|
|
288
|
+
}
|
|
289
|
+
const state_0 = new __compactRuntime.ContractState();
|
|
290
|
+
let stateValue_0 = __compactRuntime.StateValue.newArray();
|
|
291
|
+
state_0.data = new __compactRuntime.ChargedState(stateValue_0);
|
|
292
|
+
state_0.setOperation('respond', new __compactRuntime.ContractOperation());
|
|
293
|
+
state_0.setOperation('respondBidirectional', new __compactRuntime.ContractOperation());
|
|
294
|
+
const context = __compactRuntime.createCircuitContext({circuitId: 'constructor', contractAddress: __compactRuntime.dummyContractAddress(), coinPublicKeyOrZswapState: constructorContext_0.initialZswapLocalState.coinPublicKey, contractState: state_0.data, privateState: constructorContext_0.initialPrivateState});
|
|
295
|
+
const partialProofData = {
|
|
296
|
+
input: { value: [], alignment: [] },
|
|
297
|
+
output: undefined,
|
|
298
|
+
publicTranscript: [],
|
|
299
|
+
privateTranscriptOutputs: []
|
|
300
|
+
};
|
|
301
|
+
state_0.data = new __compactRuntime.ChargedState(context.callContext.currentQueryContext.state.state);
|
|
302
|
+
return {
|
|
303
|
+
currentContractState: state_0,
|
|
304
|
+
currentPrivateState: context.callContext.currentPrivateState,
|
|
305
|
+
currentZswapLocalState: context.callContext.currentZswapLocalState
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
async _respond_0(context, partialProofData, signatureRespondedEvent_0) {
|
|
309
|
+
let t_0;
|
|
310
|
+
__compactRuntime.queryLedgerState(context,
|
|
311
|
+
partialProofData,
|
|
312
|
+
[
|
|
313
|
+
{ push: { storage: false,
|
|
314
|
+
value: __compactRuntime.StateValue.newArray()
|
|
315
|
+
.arrayPush(__compactRuntime.StateValue.newCell({ value: _descriptor_16.toValue(1n),
|
|
316
|
+
alignment: _descriptor_16.alignment() })).arrayPush(__compactRuntime.StateValue.newCell({ value: _descriptor_3.toValue(10n),
|
|
317
|
+
alignment: _descriptor_3.alignment() })).arrayPush(__compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue((t_0 = { name:
|
|
318
|
+
new Uint8Array([83, 105, 103, 110, 97, 116, 117, 114, 101, 82, 101, 115, 112, 111, 110, 100, 101, 100, 69, 118, 101, 110, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0]),
|
|
319
|
+
payload:
|
|
320
|
+
Uint8Array.from([...Array.from(signatureRespondedEvent_0.requestId,
|
|
321
|
+
BigInt),
|
|
322
|
+
...Array.from(signatureRespondedEvent_0.signature.bigR.x,
|
|
323
|
+
BigInt),
|
|
324
|
+
...Array.from(signatureRespondedEvent_0.signature.bigR.y,
|
|
325
|
+
BigInt),
|
|
326
|
+
...Array.from(signatureRespondedEvent_0.signature.s,
|
|
327
|
+
BigInt),
|
|
328
|
+
signatureRespondedEvent_0.signature.recoveryId,
|
|
329
|
+
...Array.from(new Uint8Array(127),
|
|
330
|
+
BigInt)],
|
|
331
|
+
Number) },
|
|
332
|
+
Uint8Array.from([...Array.from(t_0.name,
|
|
333
|
+
BigInt),
|
|
334
|
+
...Array.from(t_0.payload,
|
|
335
|
+
BigInt)],
|
|
336
|
+
Number))),
|
|
337
|
+
alignment: _descriptor_0.alignment() }))
|
|
338
|
+
.encode() } },
|
|
339
|
+
'log']);
|
|
340
|
+
return [];
|
|
341
|
+
}
|
|
342
|
+
async _respondBidirectional_0(context,
|
|
343
|
+
partialProofData,
|
|
344
|
+
respondBidirectionalEvent_0)
|
|
345
|
+
{
|
|
346
|
+
let t_0;
|
|
347
|
+
__compactRuntime.queryLedgerState(context,
|
|
348
|
+
partialProofData,
|
|
349
|
+
[
|
|
350
|
+
{ push: { storage: false,
|
|
351
|
+
value: __compactRuntime.StateValue.newArray()
|
|
352
|
+
.arrayPush(__compactRuntime.StateValue.newCell({ value: _descriptor_16.toValue(1n),
|
|
353
|
+
alignment: _descriptor_16.alignment() })).arrayPush(__compactRuntime.StateValue.newCell({ value: _descriptor_3.toValue(10n),
|
|
354
|
+
alignment: _descriptor_3.alignment() })).arrayPush(__compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue((t_0 = { name:
|
|
355
|
+
new Uint8Array([82, 101, 115, 112, 111, 110, 100, 66, 105, 100, 105, 114, 101, 99, 116, 105, 111, 110, 97, 108, 69, 118, 101, 110, 116, 0, 0, 0, 0, 0, 0, 0]),
|
|
356
|
+
payload:
|
|
357
|
+
Uint8Array.from([...Array.from(respondBidirectionalEvent_0.requestId,
|
|
358
|
+
BigInt),
|
|
359
|
+
...Array.from(__compactRuntime.convertBigintToBytes(8,
|
|
360
|
+
respondBidirectionalEvent_0.blockHeight,
|
|
361
|
+
'signet-responder.compact line 61 char 17'),
|
|
362
|
+
BigInt),
|
|
363
|
+
BigInt(respondBidirectionalEvent_0.outputKind),
|
|
364
|
+
...Array.from(__compactRuntime.convertBigintToBytes(8,
|
|
365
|
+
respondBidirectionalEvent_0.serializedOutputLength,
|
|
366
|
+
'signet-responder.compact line 63 char 17'),
|
|
367
|
+
BigInt),
|
|
368
|
+
...Array.from(respondBidirectionalEvent_0.outputHash,
|
|
369
|
+
BigInt),
|
|
370
|
+
...Array.from(respondBidirectionalEvent_0.digest,
|
|
371
|
+
BigInt),
|
|
372
|
+
...Array.from(respondBidirectionalEvent_0.signature.bigR.x,
|
|
373
|
+
BigInt),
|
|
374
|
+
...Array.from(respondBidirectionalEvent_0.signature.bigR.y,
|
|
375
|
+
BigInt),
|
|
376
|
+
...Array.from(respondBidirectionalEvent_0.signature.s,
|
|
377
|
+
BigInt),
|
|
378
|
+
respondBidirectionalEvent_0.signature.recoveryId,
|
|
379
|
+
...Array.from(new Uint8Array(46),
|
|
380
|
+
BigInt)],
|
|
381
|
+
Number) },
|
|
382
|
+
Uint8Array.from([...Array.from(t_0.name,
|
|
383
|
+
BigInt),
|
|
384
|
+
...Array.from(t_0.payload,
|
|
385
|
+
BigInt)],
|
|
386
|
+
Number))),
|
|
387
|
+
alignment: _descriptor_0.alignment() }))
|
|
388
|
+
.encode() } },
|
|
389
|
+
'log']);
|
|
390
|
+
return [];
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
export function ledger(stateOrChargedState) {
|
|
394
|
+
const state = stateOrChargedState instanceof __compactRuntime.StateValue ? stateOrChargedState : stateOrChargedState.state;
|
|
395
|
+
const chargedState = stateOrChargedState instanceof __compactRuntime.StateValue ? new __compactRuntime.ChargedState(stateOrChargedState) : stateOrChargedState;
|
|
396
|
+
const context = {
|
|
397
|
+
callContext: { currentQueryContext: new __compactRuntime.QueryContext(chargedState, __compactRuntime.dummyContractAddress()), currentGasCost: __compactRuntime.emptyRunningCost() },
|
|
398
|
+
costModel: __compactRuntime.CostModel.initialCostModel()
|
|
399
|
+
};
|
|
400
|
+
const partialProofData = {
|
|
401
|
+
input: { value: [], alignment: [] },
|
|
402
|
+
output: undefined,
|
|
403
|
+
publicTranscript: [],
|
|
404
|
+
privateTranscriptOutputs: []
|
|
405
|
+
};
|
|
406
|
+
return {
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
const _emptyContext = {
|
|
410
|
+
callContext: { currentQueryContext: new __compactRuntime.QueryContext(new __compactRuntime.ContractState().data, __compactRuntime.dummyContractAddress()), currentGasCost: __compactRuntime.emptyRunningCost() }
|
|
411
|
+
};
|
|
412
|
+
const _dummyContract = new Contract({ });
|
|
413
|
+
export const pureCircuits = {};
|
|
414
|
+
export const expectedVk = {};
|
|
415
|
+
|
|
416
|
+
export const circuitSignatures = {
|
|
417
|
+
'respond': {pure: false, provable: true, argumentTypes: [{tag: 'Struct', name: 'SignatureRespondedEventV1', elements: [{name: 'requestId', type: {tag: 'Alias', name: 'RequestId', type: {tag: 'Bytes', length: 32}}}, {name: 'signature', type: {tag: 'Struct', name: 'Signature', elements: [{name: 'bigR', type: {tag: 'Struct', name: 'AffinePoint', elements: [{name: 'x', type: {tag: 'Bytes', length: 32}}, {name: 'y', type: {tag: 'Bytes', length: 32}}]}}, {name: 's', type: {tag: 'Bytes', length: 32}}, {name: 'recoveryId', type: {tag: 'Uint', maxval: '255'}}]}}]}], resultType: {tag: 'Tuple', types: []}},
|
|
418
|
+
'respondBidirectional': {pure: false, provable: true, argumentTypes: [{tag: 'Struct', name: 'RespondBidirectionalEventV1', elements: [{name: 'requestId', type: {tag: 'Alias', name: 'RequestId', type: {tag: 'Bytes', length: 32}}}, {name: 'blockHeight', type: {tag: 'Uint', maxval: '18446744073709551615'}}, {name: 'outputKind', type: {tag: 'Enum', name: 'OutputKind', elements: ['executed', 'failed', 'unviable']}}, {name: 'serializedOutputLength', type: {tag: 'Uint', maxval: '18446744073709551615'}}, {name: 'outputHash', type: {tag: 'Bytes', length: 32}}, {name: 'digest', type: {tag: 'Bytes', length: 32}}, {name: 'signature', type: {tag: 'Struct', name: 'Signature', elements: [{name: 'bigR', type: {tag: 'Struct', name: 'AffinePoint', elements: [{name: 'x', type: {tag: 'Bytes', length: 32}}, {name: 'y', type: {tag: 'Bytes', length: 32}}]}}, {name: 's', type: {tag: 'Bytes', length: 32}}, {name: 'recoveryId', type: {tag: 'Uint', maxval: '255'}}]}}]}], resultType: {tag: 'Tuple', types: []}},
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
export const declaredInterfaces = {};
|
|
422
|
+
|
|
423
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"file": "index.js",
|
|
4
|
+
"sourceRoot": "../../../",
|
|
5
|
+
"sources": ["src/signet-responder.compact"],
|
|
6
|
+
"names": [],
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;;;;;MA0BA,AAAA,OAcC;;;;;cAbG,yBAAkD;;;;;;;;;;;;;;;;;;yCAAlD,yBAAkD;;;;;;;;;+CAAlD,yBAAkD;;;;OAarD;MAaD,AAAA,oBAmBC;;;;;cAlBG,2BAAsD;;;;;;;;;;;;;;;;;;yCAAtD,2BAAsD;;;;;;;;;4DAAtD,2BAAsD;;;;OAkBzD;;;;;;;;;;GACA;EAzED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEC;EA/CD,AAAA,gBAcC,4BAbG,yBAAkD;QAElD,GAUE;;;;;;;;;;;qWAPkB,yBAAuB;;qWACvB,yBAAuB;;qWACvB,yBAAuB;;qWACvB,yBAAuB;;uVAC1B,yBAAuB;;;;2VAPxC,GAUE;;2VAVF,GAUE;;;;;;;GACL;EAaD,AAAA,6BAmBC;;gCAlBG,2BAAsD;;QAEtD,GAeE;;;;;;;;;;;qWAZkB,2BAAyB;;;2YACxB,2BAAyB;;;8VAC7B,2BAAyB;;2YACrB,2BAAyB;;;qWAC1B,2BAAyB;;qWACzB,2BAAyB;;qWACzB,2BAAyB;;qWACzB,2BAAyB;;qWACzB,2BAAyB;;uVAC5B,2BAAyB;;;;2VAZ1C,GAeE;;2VAfF,GAeE;;;;;;;GACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"
|
|
8
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"do_communications_commitment":true,"inputs":[{"name":"%signatureRespondedEvent_requestId_hi.0","type":"Scalar<BLS12-381>"},{"name":"%signatureRespondedEvent_requestId_lo.1","type":"Scalar<BLS12-381>"},{"name":"%signatureRespondedEvent_signature_bigR_x_hi.2","type":"Scalar<BLS12-381>"},{"name":"%signatureRespondedEvent_signature_bigR_x_lo.3","type":"Scalar<BLS12-381>"},{"name":"%signatureRespondedEvent_signature_bigR_y_hi.4","type":"Scalar<BLS12-381>"},{"name":"%signatureRespondedEvent_signature_bigR_y_lo.5","type":"Scalar<BLS12-381>"},{"name":"%signatureRespondedEvent_signature_s_hi.6","type":"Scalar<BLS12-381>"},{"name":"%signatureRespondedEvent_signature_s_lo.7","type":"Scalar<BLS12-381>"},{"name":"%signatureRespondedEvent_signature_recoveryId.8","type":"Scalar<BLS12-381>"}],"instructions":[{"bits":8,"op":"constrain_bits","val":"%signatureRespondedEvent_requestId_hi.0"},{"bits":248,"op":"constrain_bits","val":"%signatureRespondedEvent_requestId_lo.1"},{"bits":8,"op":"constrain_bits","val":"%signatureRespondedEvent_signature_bigR_x_hi.2"},{"bits":248,"op":"constrain_bits","val":"%signatureRespondedEvent_signature_bigR_x_lo.3"},{"bits":8,"op":"constrain_bits","val":"%signatureRespondedEvent_signature_bigR_y_hi.4"},{"bits":248,"op":"constrain_bits","val":"%signatureRespondedEvent_signature_bigR_y_lo.5"},{"bits":8,"op":"constrain_bits","val":"%signatureRespondedEvent_signature_s_hi.6"},{"bits":248,"op":"constrain_bits","val":"%signatureRespondedEvent_signature_s_lo.7"},{"bits":8,"op":"constrain_bits","val":"%signatureRespondedEvent_signature_recoveryId.8"},{"bits":240,"op":"div_mod_power_of_two","outputs":["%div.13","%mod.14"],"val":"%signatureRespondedEvent_requestId_lo.1"},{"a":"%mod.14","b":"0x0001","op":"mul","output":"%mul.16"},{"a":"0x00","b":"%mul.16","op":"add","output":"%add.17"},{"a":"%signatureRespondedEvent_requestId_hi.0","b":"0x0001","op":"mul","output":"%mul.19"},{"a":"%div.13","b":"%mul.19","op":"add","output":"%add.20"},{"bits":232,"op":"div_mod_power_of_two","outputs":["%div.21","%mod.22"],"val":"%signatureRespondedEvent_signature_bigR_x_lo.3"},{"a":"%mod.22","b":"0x000001","op":"mul","output":"%mul.24"},{"a":"%add.20","b":"%mul.24","op":"add","output":"%add.25"},{"a":"%signatureRespondedEvent_signature_bigR_x_hi.2","b":"0x000001","op":"mul","output":"%mul.27"},{"a":"%div.21","b":"%mul.27","op":"add","output":"%add.28"},{"bits":224,"op":"div_mod_power_of_two","outputs":["%div.29","%mod.30"],"val":"%signatureRespondedEvent_signature_bigR_y_lo.5"},{"a":"%mod.30","b":"0x00000001","op":"mul","output":"%mul.32"},{"a":"%add.28","b":"%mul.32","op":"add","output":"%add.33"},{"a":"%signatureRespondedEvent_signature_bigR_y_hi.4","b":"0x00000001","op":"mul","output":"%mul.35"},{"a":"%div.29","b":"%mul.35","op":"add","output":"%add.36"},{"bits":216,"op":"div_mod_power_of_two","outputs":["%div.37","%mod.38"],"val":"%signatureRespondedEvent_signature_s_lo.7"},{"a":"%mod.38","b":"0x0000000001","op":"mul","output":"%mul.40"},{"a":"%add.36","b":"%mul.40","op":"add","output":"%add.41"},{"a":"%signatureRespondedEvent_signature_s_hi.6","b":"0x0000000001","op":"mul","output":"%mul.43"},{"a":"%div.37","b":"%mul.43","op":"add","output":"%add.44"},{"a":"%signatureRespondedEvent_signature_recoveryId.8","b":"0x000000000001","op":"mul","output":"%mul.46"},{"a":"%add.44","b":"%mul.46","op":"add","output":"%add.47"},{"guard":"0x01","inputs":["0x10","0x33","0x01","0x01","0x04","0x01","0x01","0x01","0x01","0x0a","0x01","0x01","0x2001","0x00","0x00","0x00","0x00","%add.47","%add.41","%add.33","%add.25","%add.17","0x5369676e6174757265526573706f6e6465644576656e74"],"op":"impact"},{"guard":"0x01","inputs":["0x09"],"op":"impact"}],"outputs":[],"version":{"major":3,"minor":1}}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"do_communications_commitment":true,"inputs":[{"name":"%respondBidirectionalEvent_requestId_hi.0","type":"Scalar<BLS12-381>"},{"name":"%respondBidirectionalEvent_requestId_lo.1","type":"Scalar<BLS12-381>"},{"name":"%respondBidirectionalEvent_blockHeight.2","type":"Scalar<BLS12-381>"},{"name":"%respondBidirectionalEvent_outputKind.3","type":"Scalar<BLS12-381>"},{"name":"%respondBidirectionalEvent_serializedOutputLength.4","type":"Scalar<BLS12-381>"},{"name":"%respondBidirectionalEvent_outputHash_hi.5","type":"Scalar<BLS12-381>"},{"name":"%respondBidirectionalEvent_outputHash_lo.6","type":"Scalar<BLS12-381>"},{"name":"%respondBidirectionalEvent_digest_hi.7","type":"Scalar<BLS12-381>"},{"name":"%respondBidirectionalEvent_digest_lo.8","type":"Scalar<BLS12-381>"},{"name":"%respondBidirectionalEvent_signature_bigR_x_hi.9","type":"Scalar<BLS12-381>"},{"name":"%respondBidirectionalEvent_signature_bigR_x_lo.10","type":"Scalar<BLS12-381>"},{"name":"%respondBidirectionalEvent_signature_bigR_y_hi.11","type":"Scalar<BLS12-381>"},{"name":"%respondBidirectionalEvent_signature_bigR_y_lo.12","type":"Scalar<BLS12-381>"},{"name":"%respondBidirectionalEvent_signature_s_hi.13","type":"Scalar<BLS12-381>"},{"name":"%respondBidirectionalEvent_signature_s_lo.14","type":"Scalar<BLS12-381>"},{"name":"%respondBidirectionalEvent_signature_recoveryId.15","type":"Scalar<BLS12-381>"}],"instructions":[{"bits":8,"op":"constrain_bits","val":"%respondBidirectionalEvent_requestId_hi.0"},{"bits":248,"op":"constrain_bits","val":"%respondBidirectionalEvent_requestId_lo.1"},{"bits":64,"op":"constrain_bits","val":"%respondBidirectionalEvent_blockHeight.2"},{"a":"%respondBidirectionalEvent_outputKind.3","b":"0x03","bits":2,"op":"less_than","output":"%lt.16"},{"cond":"%lt.16","op":"assert"},{"bits":64,"op":"constrain_bits","val":"%respondBidirectionalEvent_serializedOutputLength.4"},{"bits":8,"op":"constrain_bits","val":"%respondBidirectionalEvent_outputHash_hi.5"},{"bits":248,"op":"constrain_bits","val":"%respondBidirectionalEvent_outputHash_lo.6"},{"bits":8,"op":"constrain_bits","val":"%respondBidirectionalEvent_digest_hi.7"},{"bits":248,"op":"constrain_bits","val":"%respondBidirectionalEvent_digest_lo.8"},{"bits":8,"op":"constrain_bits","val":"%respondBidirectionalEvent_signature_bigR_x_hi.9"},{"bits":248,"op":"constrain_bits","val":"%respondBidirectionalEvent_signature_bigR_x_lo.10"},{"bits":8,"op":"constrain_bits","val":"%respondBidirectionalEvent_signature_bigR_y_hi.11"},{"bits":248,"op":"constrain_bits","val":"%respondBidirectionalEvent_signature_bigR_y_lo.12"},{"bits":8,"op":"constrain_bits","val":"%respondBidirectionalEvent_signature_s_hi.13"},{"bits":248,"op":"constrain_bits","val":"%respondBidirectionalEvent_signature_s_lo.14"},{"bits":8,"op":"constrain_bits","val":"%respondBidirectionalEvent_signature_recoveryId.15"},{"bits":240,"op":"div_mod_power_of_two","outputs":["%div.21","%mod.22"],"val":"%respondBidirectionalEvent_requestId_lo.1"},{"a":"%mod.22","b":"0x0001","op":"mul","output":"%mul.24"},{"a":"0x00","b":"%mul.24","op":"add","output":"%add.25"},{"a":"%respondBidirectionalEvent_requestId_hi.0","b":"0x0001","op":"mul","output":"%mul.27"},{"a":"%div.21","b":"%mul.27","op":"add","output":"%add.28"},{"a":"%respondBidirectionalEvent_blockHeight.2","b":"0x000001","op":"mul","output":"%mul.30"},{"a":"%add.28","b":"%mul.30","op":"add","output":"%add.31"},{"a":"%respondBidirectionalEvent_outputKind.3","b":"0x0000000000000000000001","op":"mul","output":"%mul.33"},{"a":"%add.31","b":"%mul.33","op":"add","output":"%add.34"},{"a":"%respondBidirectionalEvent_serializedOutputLength.4","b":"0x000000000000000000000001","op":"mul","output":"%mul.36"},{"a":"%add.34","b":"%mul.36","op":"add","output":"%add.37"},{"bits":96,"op":"div_mod_power_of_two","outputs":["%div.38","%mod.39"],"val":"%respondBidirectionalEvent_outputHash_lo.6"},{"a":"%mod.39","b":"0x0000000000000000000000000000000000000001","op":"mul","output":"%mul.41"},{"a":"%add.37","b":"%mul.41","op":"add","output":"%add.42"},{"a":"%respondBidirectionalEvent_outputHash_hi.5","b":"0x0000000000000000000000000000000000000001","op":"mul","output":"%mul.44"},{"a":"%div.38","b":"%mul.44","op":"add","output":"%add.45"},{"bits":88,"op":"div_mod_power_of_two","outputs":["%div.46","%mod.47"],"val":"%respondBidirectionalEvent_digest_lo.8"},{"a":"%mod.47","b":"0x000000000000000000000000000000000000000001","op":"mul","output":"%mul.49"},{"a":"%add.45","b":"%mul.49","op":"add","output":"%add.50"},{"a":"%respondBidirectionalEvent_digest_hi.7","b":"0x000000000000000000000000000000000000000001","op":"mul","output":"%mul.52"},{"a":"%div.46","b":"%mul.52","op":"add","output":"%add.53"},{"bits":80,"op":"div_mod_power_of_two","outputs":["%div.54","%mod.55"],"val":"%respondBidirectionalEvent_signature_bigR_x_lo.10"},{"a":"%mod.55","b":"0x00000000000000000000000000000000000000000001","op":"mul","output":"%mul.57"},{"a":"%add.53","b":"%mul.57","op":"add","output":"%add.58"},{"a":"%respondBidirectionalEvent_signature_bigR_x_hi.9","b":"0x00000000000000000000000000000000000000000001","op":"mul","output":"%mul.60"},{"a":"%div.54","b":"%mul.60","op":"add","output":"%add.61"},{"bits":72,"op":"div_mod_power_of_two","outputs":["%div.62","%mod.63"],"val":"%respondBidirectionalEvent_signature_bigR_y_lo.12"},{"a":"%mod.63","b":"0x0000000000000000000000000000000000000000000001","op":"mul","output":"%mul.65"},{"a":"%add.61","b":"%mul.65","op":"add","output":"%add.66"},{"a":"%respondBidirectionalEvent_signature_bigR_y_hi.11","b":"0x0000000000000000000000000000000000000000000001","op":"mul","output":"%mul.68"},{"a":"%div.62","b":"%mul.68","op":"add","output":"%add.69"},{"bits":64,"op":"div_mod_power_of_two","outputs":["%div.70","%mod.71"],"val":"%respondBidirectionalEvent_signature_s_lo.14"},{"a":"%mod.71","b":"0x000000000000000000000000000000000000000000000001","op":"mul","output":"%mul.73"},{"a":"%add.69","b":"%mul.73","op":"add","output":"%add.74"},{"a":"%respondBidirectionalEvent_signature_s_hi.13","b":"0x000000000000000000000000000000000000000000000001","op":"mul","output":"%mul.76"},{"a":"%div.70","b":"%mul.76","op":"add","output":"%add.77"},{"a":"%respondBidirectionalEvent_signature_recoveryId.15","b":"0x00000000000000000000000000000000000000000000000001","op":"mul","output":"%mul.79"},{"a":"%add.77","b":"%mul.79","op":"add","output":"%add.80"},{"guard":"0x01","inputs":["0x10","0x33","0x01","0x01","0x04","0x01","0x01","0x01","0x01","0x0a","0x01","0x01","0x2001","0x00","0x00","%add.80","%add.74","%add.66","%add.58","%add.50","%add.42","%add.25","0x526573706f6e644269646972656374696f6e616c4576656e74"],"op":"impact"},{"guard":"0x01","inputs":["0x09"],"op":"impact"}],"outputs":[],"version":{"major":3,"minor":1}}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Witnesses } from "./managed/contract/index.js";
|
|
2
|
+
/** Private state carried through signet-responder circuit calls: none. */
|
|
3
|
+
export type SignetResponderPrivateState = 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 createSignetResponderPrivateState: () => SignetResponderPrivateState;
|
|
10
|
+
/**
|
|
11
|
+
* Witness implementations, typed against the generated `Witnesses` shape:
|
|
12
|
+
* the contract declares none.
|
|
13
|
+
*/
|
|
14
|
+
export declare const witnesses: Witnesses<SignetResponderPrivateState>;
|
|
15
|
+
//# sourceMappingURL=witnesses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"witnesses.d.ts","sourceRoot":"","sources":["../src/witnesses.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAE7D,0EAA0E;AAC1E,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,QAAO,2BAAmC,CAAC;AAEzF;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,SAAS,CAAC,2BAA2B,CAAM,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// The signet responder has no witnesses: it emits posts without verifying
|
|
2
|
+
// them, and posting carries no caller secrets, so there is no private state.
|
|
3
|
+
/**
|
|
4
|
+
* Build the contract's (empty) private state.
|
|
5
|
+
*
|
|
6
|
+
* @returns A fresh, empty private state.
|
|
7
|
+
*/
|
|
8
|
+
export const createSignetResponderPrivateState = () => ({});
|
|
9
|
+
/**
|
|
10
|
+
* Witness implementations, typed against the generated `Witnesses` shape:
|
|
11
|
+
* the contract declares none.
|
|
12
|
+
*/
|
|
13
|
+
export const witnesses = {};
|
|
14
|
+
//# sourceMappingURL=witnesses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"witnesses.js","sourceRoot":"","sources":["../src/witnesses.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,6EAA6E;AAO7E;;;;GAIG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,GAAgC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AAEzF;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAA2C,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sig-net/midnight-responder",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
|
|
3
|
+
"version": "0.26.0-rc.10",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/sig-net/midnight-integration",
|
|
7
|
+
"directory": "packages/signet-responder"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"description": "The Sig Network response contract on Midnight: the circuits the MPC posts signature responses and remote execution attestations through, as contract events clients poll. Its proving artifacts are MinoCrab-compiled. src/index.ts is the curated export surface.",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./managed/*": "./dist/managed/*"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"compile": "COMPACT_PATH=../../node_modules compact compile --skip-zk src/signet-responder.compact src/managed",
|
|
23
|
+
"compile:zk": "yarn compile && cd minocrab && cargo run --locked -- ../src/managed",
|
|
24
|
+
"build": "rm -rf dist && ls src/managed/keys/*.prover >/dev/null 2>&1 || { echo 'signet-responder 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
|
+
"prepack": "yarn build",
|
|
26
|
+
"test": "vitest run"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public",
|
|
30
|
+
"main": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"default": "./dist/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./managed/*": "./dist/managed/*"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@midnight-ntwrk/compact-runtime": "0.21.0",
|
|
42
|
+
"@midnight-ntwrk/midnight-js": "5.0.0"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@sig-net/midnight": "^0.26.0-rc.10",
|
|
46
|
+
"@types/node": "^26.1.0",
|
|
47
|
+
"@vitest/coverage-v8": "^5.0.0",
|
|
48
|
+
"typescript": "^7.0.2",
|
|
49
|
+
"vite": "^8.2.2",
|
|
50
|
+
"vitest": "^5.0.0"
|
|
51
|
+
},
|
|
52
|
+
"main": "./dist/index.js",
|
|
53
|
+
"types": "./dist/index.d.ts"
|
|
6
54
|
}
|