@sig-net/midnight 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/managed/compiler/contract-info.json +57 -0
- package/dist/managed/compiler/contract-manifest.json +8 -8
- package/dist/managed/contract/index.d.ts +13 -0
- package/dist/managed/contract/index.js +138 -73
- package/dist/managed/contract/index.js.map +1 -1
- package/dist/signature-requests-state-reader.d.ts +5 -5
- package/dist/signature-requests-state-reader.js +5 -5
- package/dist/signet-contract-state-reader.d.ts +88 -2
- package/dist/signet-contract-state-reader.d.ts.map +1 -1
- package/dist/signet-contract-state-reader.js +106 -3
- package/dist/signet-contract-state-reader.js.map +1 -1
- package/dist/signet-request-feed.d.ts +40 -21
- package/dist/signet-request-feed.d.ts.map +1 -1
- package/dist/signet-request-feed.js +79 -34
- package/dist/signet-request-feed.js.map +1 -1
- package/dist/signet-request-resolver.d.ts +11 -11
- package/dist/signet-request-resolver.d.ts.map +1 -1
- package/dist/signet-request-resolver.js +22 -22
- package/dist/signet-request-resolver.js.map +1 -1
- package/dist/signet-requests.d.ts +18 -4
- package/dist/signet-requests.d.ts.map +1 -1
- package/dist/signet-requests.js +29 -6
- package/dist/signet-requests.js.map +1 -1
- package/package.json +1 -1
- package/src/Signet.compact +75 -99
- package/src/circuits.compact +5 -2
- package/src/index.ts +2 -4
- package/src/managed/compiler/contract-info.json +57 -0
- package/src/managed/compiler/contract-manifest.json +8 -8
- package/src/managed/contract/index.d.ts +13 -0
- package/src/managed/contract/index.js +138 -73
- package/src/managed/contract/index.js.map +1 -1
- package/src/signature-requests-state-reader.ts +5 -5
- package/src/signet-contract-state-reader.ts +200 -4
- package/src/signet-request-feed.ts +98 -48
- package/src/signet-request-resolver.ts +28 -28
- package/src/signet-requests.ts +31 -6
- package/dist/signet-event-observer.d.ts +0 -102
- package/dist/signet-event-observer.d.ts.map +0 -1
- package/dist/signet-event-observer.js +0 -127
- package/dist/signet-event-observer.js.map +0 -1
- package/dist/signet-events.d.ts +0 -175
- package/dist/signet-events.d.ts.map +0 -1
- package/dist/signet-events.js +0 -210
- package/dist/signet-events.js.map +0 -1
- package/dist/signet-response-feed.d.ts +0 -161
- package/dist/signet-response-feed.d.ts.map +0 -1
- package/dist/signet-response-feed.js +0 -234
- package/dist/signet-response-feed.js.map +0 -1
- package/src/signet-event-observer.ts +0 -186
- package/src/signet-events.ts +0 -337
- package/src/signet-response-feed.ts +0 -325
package/src/circuits.compact
CHANGED
|
@@ -8,8 +8,10 @@ pragma language_version >= 0.25;
|
|
|
8
8
|
// emits them as pureCircuits in managed/contract/index.js — giving the
|
|
9
9
|
// package an in-process, provable-logic-identical reference implementation:
|
|
10
10
|
// unit tests exercise the REAL circuits, and off-chain code (path checks,
|
|
11
|
-
// Schnorr challenges, attestation messages) reuses them
|
|
12
|
-
// hand-porting the algorithms.
|
|
11
|
+
// Schnorr challenges, attestation messages, notification packing) reuses them
|
|
12
|
+
// instead of hand-porting the algorithms. Off-chain code only ever DECODES a
|
|
13
|
+
// SignBidirectionalNotification (fixed-offset byte reads), but tests build
|
|
14
|
+
// fixtures with the compiled packer to pin the pack<->decode lockstep.
|
|
13
15
|
//
|
|
14
16
|
// ONLY the non-generic circuits are exported here. The request circuits
|
|
15
17
|
// (calculateRequestId, constructSignBidirectionalRequest) are generic over the
|
|
@@ -31,6 +33,7 @@ export {
|
|
|
31
33
|
signetAttestationMessage,
|
|
32
34
|
assertHexOf,
|
|
33
35
|
assertPathCommitment,
|
|
36
|
+
constructSignBidirectionalNotificationV1,
|
|
34
37
|
evmAddressAbiValue,
|
|
35
38
|
schnorrChallenge
|
|
36
39
|
};
|
package/src/index.ts
CHANGED
|
@@ -9,11 +9,8 @@ export * from "./signature-requests-state-reader.ts";
|
|
|
9
9
|
export * from "./signet-contract-state-reader.ts";
|
|
10
10
|
export * from "./signature-response-verification.ts";
|
|
11
11
|
export * from "./signet-request-response-reader.ts";
|
|
12
|
-
export * from "./signet-events.ts";
|
|
13
|
-
export * from "./signet-event-observer.ts";
|
|
14
12
|
export * from "./signet-request-resolver.ts";
|
|
15
13
|
export * from "./signet-request-feed.ts";
|
|
16
|
-
export * from "./signet-response-feed.ts";
|
|
17
14
|
export * from "./constants.ts";
|
|
18
15
|
export * from "./epsilon-derivation.ts";
|
|
19
16
|
export * from "./schnorr.ts";
|
|
@@ -21,7 +18,8 @@ export * from "./schnorr.ts";
|
|
|
21
18
|
/**
|
|
22
19
|
* Compiled pure circuits of Signet.compact (run `yarn compile` first): the
|
|
23
20
|
* executable reference implementation of the client-agnostic circuits —
|
|
24
|
-
* path<->identity checks, the attestation message,
|
|
21
|
+
* path<->identity checks, the attestation message, the notification packer
|
|
22
|
+
* (`constructSignBidirectionalNotificationV1`), and the Schnorr challenge.
|
|
25
23
|
* Off-chain code MUST use these instead of re-porting the algorithms — they
|
|
26
24
|
* are the same compiled logic the contracts prove. The generic request
|
|
27
25
|
* circuits cannot be compiled here (type-parameterized): request construction
|
|
@@ -3,6 +3,63 @@
|
|
|
3
3
|
"language-version": "0.25.0",
|
|
4
4
|
"runtime-version": "0.18.0-rc.0",
|
|
5
5
|
"circuits": [
|
|
6
|
+
{
|
|
7
|
+
"name": "constructSignBidirectionalNotificationV1",
|
|
8
|
+
"pure": true,
|
|
9
|
+
"proof": false,
|
|
10
|
+
"arguments": [
|
|
11
|
+
{
|
|
12
|
+
"name": "callerAddress",
|
|
13
|
+
"type": {
|
|
14
|
+
"type-name": "Struct",
|
|
15
|
+
"name": "ContractAddress",
|
|
16
|
+
"elements": [
|
|
17
|
+
{
|
|
18
|
+
"name": "bytes",
|
|
19
|
+
"type": {
|
|
20
|
+
"type-name": "Bytes",
|
|
21
|
+
"length": 32
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "requestId",
|
|
29
|
+
"type": {
|
|
30
|
+
"type-name": "Bytes",
|
|
31
|
+
"length": 32
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "requestsIndexField",
|
|
36
|
+
"type": {
|
|
37
|
+
"type-name": "Uint",
|
|
38
|
+
"maxval": 255
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"result-type": {
|
|
43
|
+
"type-name": "Struct",
|
|
44
|
+
"name": "SignBidirectionalNotification",
|
|
45
|
+
"elements": [
|
|
46
|
+
{
|
|
47
|
+
"name": "version",
|
|
48
|
+
"type": {
|
|
49
|
+
"type-name": "Uint",
|
|
50
|
+
"maxval": 255
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "payload",
|
|
55
|
+
"type": {
|
|
56
|
+
"type-name": "Bytes",
|
|
57
|
+
"length": 65
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
},
|
|
6
63
|
{
|
|
7
64
|
"name": "evmAddressAbiValue",
|
|
8
65
|
"pure": true,
|
|
@@ -7,26 +7,26 @@
|
|
|
7
7
|
"type": "directory",
|
|
8
8
|
"contract-info.json": {
|
|
9
9
|
"type": "file",
|
|
10
|
-
"size":
|
|
11
|
-
"hash": "
|
|
10
|
+
"size": 4406,
|
|
11
|
+
"hash": "d0757fe6d320a0d3162ab00faf3ebb74d28fa678f588b83957212086eb4b3080"
|
|
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": 3842,
|
|
19
|
+
"hash": "4edb5966c4b41a810691af9a12abcd359a517d95dcf6bb91faedef4da2d23019"
|
|
20
20
|
},
|
|
21
21
|
"index.js": {
|
|
22
22
|
"type": "file",
|
|
23
|
-
"size":
|
|
24
|
-
"hash": "
|
|
23
|
+
"size": 42888,
|
|
24
|
+
"hash": "de719f4711b4def77673f55b0b54c2b96a9039fdd001358d1be9a400a19aeb61"
|
|
25
25
|
},
|
|
26
26
|
"index.js.map": {
|
|
27
27
|
"type": "file",
|
|
28
|
-
"size":
|
|
29
|
-
"hash": "
|
|
28
|
+
"size": 3115,
|
|
29
|
+
"hash": "42d40aaf65da98f7b9df2e329b13fca3c0526418eb9697f64b6a562b12ed8b82"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -10,6 +10,12 @@ export type ProvableCircuits<PS> = {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export type PureCircuits = {
|
|
13
|
+
constructSignBidirectionalNotificationV1(callerAddress_0: { bytes: Uint8Array
|
|
14
|
+
},
|
|
15
|
+
requestId_0: Uint8Array,
|
|
16
|
+
requestsIndexField_0: bigint): { version: bigint,
|
|
17
|
+
payload: Uint8Array
|
|
18
|
+
};
|
|
13
19
|
evmAddressAbiValue(addr_0: Uint8Array): bigint;
|
|
14
20
|
signetAttestationMessage(requestId_0: Uint8Array,
|
|
15
21
|
serializedOutput_0: Uint8Array,
|
|
@@ -24,6 +30,13 @@ export type PureCircuits = {
|
|
|
24
30
|
}
|
|
25
31
|
|
|
26
32
|
export type Circuits<PS> = {
|
|
33
|
+
constructSignBidirectionalNotificationV1(context: __compactRuntime.CircuitContext<PS>,
|
|
34
|
+
callerAddress_0: { bytes: Uint8Array
|
|
35
|
+
},
|
|
36
|
+
requestId_0: Uint8Array,
|
|
37
|
+
requestsIndexField_0: bigint): Promise<__compactRuntime.CircuitResults<PS, { version: bigint,
|
|
38
|
+
payload: Uint8Array
|
|
39
|
+
}>>;
|
|
27
40
|
evmAddressAbiValue(context: __compactRuntime.CircuitContext<PS>,
|
|
28
41
|
addr_0: Uint8Array): Promise<__compactRuntime.CircuitResults<PS, bigint>>;
|
|
29
42
|
signetAttestationMessage(context: __compactRuntime.CircuitContext<PS>,
|