@sig-net/midnight 0.24.0-rc.2 → 0.24.0-rc.3
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 +13 -21
- package/dist/compact-descriptors.d.ts +17 -4
- package/dist/compact-descriptors.d.ts.map +1 -1
- package/dist/compact-descriptors.js +29 -29
- package/dist/compact-descriptors.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/ecdsa-attestation.d.ts +3 -3
- package/dist/ecdsa-attestation.js +4 -4
- package/dist/ecdsa-attestation.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/managed/compiler/contract-info.json +952 -2
- package/dist/managed/compiler/contract-manifest.json +8 -8
- package/dist/managed/contract/index.d.ts +221 -0
- package/dist/managed/contract/index.js +915 -201
- package/dist/managed/contract/index.js.map +1 -1
- package/dist/mpc-output-cache.js +2 -2
- package/dist/mpc-output-cache.js.map +1 -1
- package/dist/signature-requests-state-reader.js +3 -3
- package/dist/signature-requests-state-reader.js.map +1 -1
- package/dist/signet-contract-events.d.ts +4 -4
- package/dist/signet-evtype2tx-record-decoding.d.ts.map +1 -1
- package/dist/signet-evtype2tx-record-decoding.js +5 -4
- package/dist/signet-evtype2tx-record-decoding.js.map +1 -1
- package/dist/signet-evtype2tx-requests.d.ts +17 -12
- package/dist/signet-evtype2tx-requests.d.ts.map +1 -1
- package/dist/signet-evtype2tx-requests.js +85 -16
- package/dist/signet-evtype2tx-requests.js.map +1 -1
- package/dist/signet-request-id.d.ts +5 -3
- package/dist/signet-request-id.d.ts.map +1 -1
- package/dist/signet-request-id.js +14 -12
- package/dist/signet-request-id.js.map +1 -1
- package/dist/signet-requests.d.ts +30 -34
- package/dist/signet-requests.d.ts.map +1 -1
- package/dist/signet-requests.js +15 -23
- package/dist/signet-requests.js.map +1 -1
- package/package.json +2 -2
- package/src/Signet.compact +181 -72
- package/src/circuits.compact +42 -9
package/README.md
CHANGED
|
@@ -51,11 +51,11 @@ What your contract imports with `import "@sig-net/midnight/src/Signet"`:
|
|
|
51
51
|
|
|
52
52
|
| Task | Exports |
|
|
53
53
|
|---|---|
|
|
54
|
-
| Declare the protocol ledger state (setup step 3) | `
|
|
55
|
-
| Build and store a signature request (runtime step 1) | `
|
|
54
|
+
| Declare the protocol ledger state (setup step 3) | `SignBidirectionalEventMapV1` (the request map the MPC reads) and `SignetSigner` (the Signet singleton's cross-contract-call interface, pinned at deploy). |
|
|
55
|
+
| Build and store a signature request (runtime step 1) | `constructSignBidirectionalEventV1` and `calculateEvmType2RequestIdV1`, over the request structs `EvmType2TxParams`, `EvmCalldata` and `EvmAccessListEntry`. The id hashes `calculateEvmType2TxParamsDigestV1`, a digest over the transaction's used entries only, so it ignores your struct's capacities and unused slots. |
|
|
56
56
|
| Notify the MPC of the request (runtime step 1) | `constructSignBidirectionalEventNotificationV1`: packs your contract's address and the request map's ledger-tree path. |
|
|
57
57
|
| Build and read calldata words in-circuit | The builders `evmAddressAbiWord`, `numericAbiWord` and `boolAbiWord`, and the readers `abiWordToUint128` and `abiWordToBool` (see [EVM Type 2 transactions and ABI calldata words](https://github.com/sig-net/midnight-integration/blob/main/README.md#evm-type-2-transactions-and-abi-calldata-words)). |
|
|
58
|
-
| Verify the execution attestation (runtime step 5) | `
|
|
58
|
+
| Verify the execution attestation (runtime step 5) | `verifyRespondBidirectionalEventV1`: recomputes the attestation digest from the output bytes and the posted request id, output kind and block height, and checks the MPC's signature against your pinned response key. |
|
|
59
59
|
|
|
60
60
|
### TypeScript library
|
|
61
61
|
|
|
@@ -72,9 +72,11 @@ What clients import from `@sig-net/midnight`:
|
|
|
72
72
|
| Read a text field of a request record | `asciiUnpadded`: the inverse of `asciiPadded`, for the zero-padded text fields (`executionDest`, the two schemas). |
|
|
73
73
|
| Compute a request id off chain | `calculateRequestId`: the TS twin of the on-chain circuit, plus `requestIdHex` and `parseRequestIdHex` for the hex form. |
|
|
74
74
|
| Compose expected calldata words off chain (UIs, expected-record builders, tests) | The builders `numericAbiWord`, `evmAddressAbiWord` and `boolAbiWord`, and the readers `abiWordToUint128` and `abiWordToBool`: TS twins of the circuits under identical names. |
|
|
75
|
+
| Digest a transaction decomposition off chain | `calculateEvmType2TxParamsDigest`: the TS twin of the circuit, what `calculateRequestId` hashes in place of the parameters. |
|
|
75
76
|
| Convert a foreign execution output into respond bytes | `deserializeEvmOutput` (raw EVM return data to named values) and `serializeRespondOutput` (named values to the packed respond payload the MPC attests): together they rebuild the `serializedOutput` of steps 4 and 5. |
|
|
76
77
|
| Recognise a failed remote execution | `OutputKind` on the verified `RespondBidirectionalEvent`: `failed` or `unviable` beside an empty output (see [Handling Failure](https://github.com/sig-net/midnight-integration/blob/main/README.md#handling-failure)). |
|
|
77
78
|
| Read the attested output bytes from the MPC's output cache | `MpcOutputCacheReader`: one reader per network and Signet singleton pair, over the public bucket an MPC configured with output storage writes each request's exact attested bytes to before posting, defaulting to the bucket `getMpcOutputCacheUrl` publishes for the network. `fetchSerializedOutput` yields the bytes step 5 verifies, `undefined` while the object is not written yet. |
|
|
79
|
+
| Hand a verified attestation to your verify circuit (runtime step 5) | `respondBidirectionalEventToCircuitInput`: flips the wire event's big-endian `bigR.x` and `s` into the little-endian record `verifyRespondBidirectionalEventV1` reads. |
|
|
78
80
|
| Verify attestations without the reader | `verifyRespondBidirectionalSignature`: the check the reader runs internally, exposed for custom pipelines. |
|
|
79
81
|
| Mint attestations in your contract's unit tests | The `@sig-net/midnight/testing` entry point, see [Testing entry point](#testing-entry-point). |
|
|
80
82
|
| Discover requests MPC-side (responders, background workers) | The discovery primitives: decode the signet contract's emitted notification events with `decodeSignetEventNamed(event, SignetEventName.SignBidirectionalEvent)` (or every kind at once with `decodeSignetEvent`, which throws on an undecodable payload anyone can emit, or its non-throwing sibling `tryDecodeSignetEvent`), then resolve each pointer against the named caller's own request map with `lookupSignetRequestAt` (the authenticated read). The polling loop belongs to the responder. |
|
|
@@ -96,26 +98,16 @@ stack and no MPC:
|
|
|
96
98
|
|
|
97
99
|
```ts
|
|
98
100
|
import { verifyRespondBidirectionalSignature } from "@sig-net/midnight"; // runtime
|
|
99
|
-
import {
|
|
100
|
-
calculateSignetAttestationDigest,
|
|
101
|
-
ecdsaSignatureToMpcSignature,
|
|
102
|
-
secp256k1PublicKeyOf,
|
|
103
|
-
signAttestationDigest,
|
|
104
|
-
} from "@sig-net/midnight/testing"; // tests only
|
|
101
|
+
import { attestRespondBidirectional, secp256k1PublicKeyOf } from "@sig-net/midnight/testing"; // tests only
|
|
105
102
|
|
|
106
103
|
// A real RespondBidirectionalEvent for (requestId, blockHeight, outputKind,
|
|
107
|
-
//
|
|
108
|
-
//
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
),
|
|
115
|
-
),
|
|
116
|
-
outputKind,
|
|
117
|
-
blockHeight,
|
|
118
|
-
};
|
|
104
|
+
// serializedOutput), signed by secretKey: the request id, block height, kind,
|
|
105
|
+
// output width, attestation digest and signature the MPC would post. It
|
|
106
|
+
// verifies, in-circuit and off chain, against secp256k1PublicKeyOf(secretKey).
|
|
107
|
+
const event = attestRespondBidirectional(
|
|
108
|
+
{ requestId, blockHeight, outputKind, serializedOutput },
|
|
109
|
+
secretKey,
|
|
110
|
+
);
|
|
119
111
|
```
|
|
120
112
|
|
|
121
113
|
## Related packages
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type AlignedValue, type CompactType, CompactTypeBytes, CompactTypeUnsignedInteger } from "@midnight-ntwrk/compact-runtime";
|
|
2
|
-
/**
|
|
2
|
+
/** `Boolean`. */
|
|
3
|
+
export declare const BOOLEAN: CompactType<boolean>;
|
|
4
|
+
/** `Field`: the accumulator of the transaction digest folds. */
|
|
5
|
+
export declare const FIELD: CompactType<bigint>;
|
|
6
|
+
/** `Bytes<4>`. */
|
|
3
7
|
export declare const BYTES_4: CompactTypeBytes;
|
|
4
8
|
/** Descriptor of a Compact `Bytes<20>`. */
|
|
5
9
|
export declare const BYTES_20: CompactTypeBytes;
|
|
@@ -86,13 +90,22 @@ export declare function decodeExactly<T>(type: CompactType<T>, atoms: readonly U
|
|
|
86
90
|
* not a `Bytes` atom.
|
|
87
91
|
*/
|
|
88
92
|
export declare function declaredWidths(cell: AlignedValue, what: string): number[];
|
|
93
|
+
/**
|
|
94
|
+
* Descriptor of a Compact tuple, composed the way the compiler composes one:
|
|
95
|
+
* the elements' alignments and values concatenated in order.
|
|
96
|
+
*
|
|
97
|
+
* @param elements - One descriptor per tuple element, in order.
|
|
98
|
+
* @returns The tuple's descriptor.
|
|
99
|
+
*/
|
|
100
|
+
export declare function compactTupleDescriptor<T extends unknown[]>(elements: {
|
|
101
|
+
[K in keyof T]: CompactType<T[K]>;
|
|
102
|
+
}): CompactType<T>;
|
|
89
103
|
/**
|
|
90
104
|
* Descriptor of the Compact tuple
|
|
91
105
|
* `[RequestId, Uint<64>, OutputKind, Uint<64>, Bytes<serializedOutputLength>]`
|
|
92
106
|
* the attestation digest hashes (request id, block height, output kind,
|
|
93
|
-
* output length, output)
|
|
94
|
-
*
|
|
95
|
-
* width enters the descriptor, so it is built per call.
|
|
107
|
+
* output length, output). The output width enters the descriptor, so it is
|
|
108
|
+
* built per call.
|
|
96
109
|
*
|
|
97
110
|
* @param serializedOutputLength - Declared width of the output element, in bytes.
|
|
98
111
|
* @returns The tuple descriptor for {@link calculateSignetAttestationDigest}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compact-descriptors.d.ts","sourceRoot":"","sources":["../src/compact-descriptors.ts"],"names":[],"mappings":"AA4BA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAEhB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"compact-descriptors.d.ts","sourceRoot":"","sources":["../src/compact-descriptors.ts"],"names":[],"mappings":"AA4BA,OAAO,EACL,KAAK,YAA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AC,KAAK,CAAC,CAAC,CAAC,CAAC,CAKtF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EACpB,KAAK,EAAE,SAAS,UAAU,EAAE,EAC5B,IAAI,EAAE,MAAM,GACX,CAAC,CASH;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAoBzE;AASD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,OAAO,EAAE,EAAE,QAAQ,EAAE;KACnE,CAAC,IAAI,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC,CAAC,CAAC,CAOjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAC3C,sBAAsB,EAAE,MAAM,GAC7B,WAAW,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAQ/D"}
|
|
@@ -25,10 +25,14 @@
|
|
|
25
25
|
// (that package describes the `serialize<T, N>` wire format, a different
|
|
26
26
|
// layer). Package-internal: consumers use the reader/request functions built
|
|
27
27
|
// on top, never these directly.
|
|
28
|
-
import { CompactTypeBoolean, CompactTypeBytes, CompactTypeEnum, CompactTypeUnsignedInteger, } from "@midnight-ntwrk/compact-runtime";
|
|
28
|
+
import { CompactTypeBoolean, CompactTypeBytes, CompactTypeEnum, CompactTypeField, CompactTypeUnsignedInteger, } from "@midnight-ntwrk/compact-runtime";
|
|
29
29
|
// Runtime descriptors of the Compact base types, at the same literals the
|
|
30
30
|
// compiler emits.
|
|
31
|
-
/**
|
|
31
|
+
/** `Boolean`. */
|
|
32
|
+
export const BOOLEAN = CompactTypeBoolean;
|
|
33
|
+
/** `Field`: the accumulator of the transaction digest folds. */
|
|
34
|
+
export const FIELD = CompactTypeField;
|
|
35
|
+
/** `Bytes<4>`. */
|
|
32
36
|
export const BYTES_4 = new CompactTypeBytes(4);
|
|
33
37
|
/** Descriptor of a Compact `Bytes<20>`. */
|
|
34
38
|
export const BYTES_20 = new CompactTypeBytes(20);
|
|
@@ -145,41 +149,37 @@ export function declaredWidths(cell, what) {
|
|
|
145
149
|
* variant to the Compact enum means raising the index here in lockstep.
|
|
146
150
|
*/
|
|
147
151
|
const OUTPUT_KIND = new CompactTypeEnum(2, 1);
|
|
152
|
+
/**
|
|
153
|
+
* Descriptor of a Compact tuple, composed the way the compiler composes one:
|
|
154
|
+
* the elements' alignments and values concatenated in order.
|
|
155
|
+
*
|
|
156
|
+
* @param elements - One descriptor per tuple element, in order.
|
|
157
|
+
* @returns The tuple's descriptor.
|
|
158
|
+
*/
|
|
159
|
+
export function compactTupleDescriptor(elements) {
|
|
160
|
+
return {
|
|
161
|
+
alignment: () => elements.flatMap((element) => element.alignment()),
|
|
162
|
+
toValue: (values) => elements.flatMap((element, index) => element.toValue(values[index])),
|
|
163
|
+
fromValue: (value) => elements.map((element) => element.fromValue(value)),
|
|
164
|
+
};
|
|
165
|
+
}
|
|
148
166
|
/**
|
|
149
167
|
* Descriptor of the Compact tuple
|
|
150
168
|
* `[RequestId, Uint<64>, OutputKind, Uint<64>, Bytes<serializedOutputLength>]`
|
|
151
169
|
* the attestation digest hashes (request id, block height, output kind,
|
|
152
|
-
* output length, output)
|
|
153
|
-
*
|
|
154
|
-
* width enters the descriptor, so it is built per call.
|
|
170
|
+
* output length, output). The output width enters the descriptor, so it is
|
|
171
|
+
* built per call.
|
|
155
172
|
*
|
|
156
173
|
* @param serializedOutputLength - Declared width of the output element, in bytes.
|
|
157
174
|
* @returns The tuple descriptor for {@link calculateSignetAttestationDigest}.
|
|
158
175
|
*/
|
|
159
176
|
export function attestationPreimageDescriptor(serializedOutputLength) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
...output.alignment(),
|
|
168
|
-
],
|
|
169
|
-
toValue: ([requestId, blockHeight, outputKind, outputLength, serializedOutput]) => [
|
|
170
|
-
...BYTES_32.toValue(requestId),
|
|
171
|
-
...UINT_64.toValue(blockHeight),
|
|
172
|
-
...OUTPUT_KIND.toValue(outputKind),
|
|
173
|
-
...UINT_64.toValue(outputLength),
|
|
174
|
-
...output.toValue(serializedOutput),
|
|
175
|
-
],
|
|
176
|
-
fromValue: (value) => [
|
|
177
|
-
BYTES_32.fromValue(value),
|
|
178
|
-
UINT_64.fromValue(value),
|
|
179
|
-
OUTPUT_KIND.fromValue(value),
|
|
180
|
-
UINT_64.fromValue(value),
|
|
181
|
-
output.fromValue(value),
|
|
182
|
-
],
|
|
183
|
-
};
|
|
177
|
+
return compactTupleDescriptor([
|
|
178
|
+
BYTES_32,
|
|
179
|
+
UINT_64,
|
|
180
|
+
OUTPUT_KIND,
|
|
181
|
+
UINT_64,
|
|
182
|
+
new CompactTypeBytes(serializedOutputLength),
|
|
183
|
+
]);
|
|
184
184
|
}
|
|
185
185
|
//# sourceMappingURL=compact-descriptors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compact-descriptors.js","sourceRoot":"","sources":["../src/compact-descriptors.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,yEAAyE;AACzE,6EAA6E;AAC7E,0CAA0C;AAC1C,mFAAmF;AACnF,gFAAgF;AAChF,oFAAoF;AACpF,eAAe;AACf,uFAAuF;AACvF,2EAA2E;AAC3E,2EAA2E;AAC3E,4EAA4E;AAC5E,yEAAyE;AACzE,8BAA8B;AAC9B,2EAA2E;AAC3E,2EAA2E;AAC3E,yEAAyE;AACzE,0EAA0E;AAC1E,4CAA4C;AAC5C,EAAE;AACF,sEAAsE;AACtE,wBAAwB;AACxB,EAAE;AACF,0EAA0E;AAC1E,yEAAyE;AACzE,6EAA6E;AAC7E,gCA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AAE,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAM;KAC/E,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,6BAA6B,CAC3C,sBAA8B;IAE9B,OAAO,sBAAsB,CAAmD;QAC9E,QAAQ;QACR,OAAO;QACP,WAAW;QACX,OAAO;QACP,IAAI,gBAAgB,CAAC,sBAAsB,CAAC;KAC7C,CAAC,CAAC;AACL,CAAC"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const MPC_PARAMS_BYTES = 64;
|
|
|
6
6
|
export declare const SELECTOR_BYTES = 4;
|
|
7
7
|
/**
|
|
8
8
|
* Default MPC key version (`keyVersion` field value). The canonical MPC
|
|
9
|
-
* (and `
|
|
9
|
+
* (and `constructSignBidirectionalEventV1`) requires `keyVersion >= 1`.
|
|
10
10
|
*/
|
|
11
11
|
export declare const SIGNET_DEFAULT_KEY_VERSION = 1n;
|
|
12
12
|
/**
|
package/dist/constants.js
CHANGED
|
@@ -14,7 +14,7 @@ export const MPC_PARAMS_BYTES = 64;
|
|
|
14
14
|
export const SELECTOR_BYTES = 4;
|
|
15
15
|
/**
|
|
16
16
|
* Default MPC key version (`keyVersion` field value). The canonical MPC
|
|
17
|
-
* (and `
|
|
17
|
+
* (and `constructSignBidirectionalEventV1`) requires `keyVersion >= 1`.
|
|
18
18
|
*/
|
|
19
19
|
export const SIGNET_DEFAULT_KEY_VERSION = 1n;
|
|
20
20
|
/**
|
|
@@ -136,7 +136,7 @@ export declare function secp256k1PublicKeyOf(secretKey: Uint8Array): Secp256k1Po
|
|
|
136
136
|
* The attestation digest of a respond-bidirectional response:
|
|
137
137
|
* `upgradeFromTransient(transientHash([requestId, blockHeight, outputKind, outputLength, serializedOutput]))`,
|
|
138
138
|
* the 32-byte digest the MPC ECDSA-signs to attest a remote execution. TS
|
|
139
|
-
* twin of the size-generic Compact circuit
|
|
139
|
+
* twin of the size-generic Compact circuit `calculateSignetAttestationDigestV1`.
|
|
140
140
|
*
|
|
141
141
|
* @param requestId - The 32-byte request id the response answers.
|
|
142
142
|
* @param blockHeight - Height of the finalised destination block holding the
|
|
@@ -174,7 +174,7 @@ export declare function attestRespondBidirectional(attestation: RespondBidirecti
|
|
|
174
174
|
* Produce the circuit-input form of a posted respond-bidirectional
|
|
175
175
|
* attestation: `signature.bigR.x` and `signature.s` byte-reversed into
|
|
176
176
|
* little-endian, everything else verbatim. The in-circuit
|
|
177
|
-
* `
|
|
177
|
+
* `verifyRespondBidirectionalEventV1` reads those two scalars through
|
|
178
178
|
* little-endian casts (the reversal is free off-chain and costly
|
|
179
179
|
* in-circuit), while the wire and ledger records stay big-endian: pass every
|
|
180
180
|
* event through this exactly once, at the circuit call. A record passed
|
|
@@ -186,7 +186,7 @@ export declare function attestRespondBidirectional(attestation: RespondBidirecti
|
|
|
186
186
|
*/
|
|
187
187
|
export declare function respondBidirectionalEventToCircuitInput(event: RespondBidirectionalEvent): RespondBidirectionalEvent;
|
|
188
188
|
/**
|
|
189
|
-
* Off-chain twin of the in-circuit `
|
|
189
|
+
* Off-chain twin of the in-circuit `verifyRespondBidirectionalEventV1`: checks
|
|
190
190
|
* a posted respond-bidirectional attestation against the execution output
|
|
191
191
|
* and the contract's pinned MPC response key, over the request id, block
|
|
192
192
|
* height and output kind the post declares. Clients run it to sift candidate posts
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// parsing/formatting, the signature-record codecs both respond events
|
|
4
4
|
// share, and the attestation digest's TS twin.
|
|
5
5
|
// Everything provable stays in Compact where possible: in-circuit
|
|
6
|
-
// verification is `
|
|
6
|
+
// verification is `verifyRespondBidirectionalEventV1`. The digest circuit is
|
|
7
7
|
// size-generic and the compiler cannot export size-generic circuits
|
|
8
8
|
// top-level, so the digest is
|
|
9
9
|
// the ONE sanctioned TS twin here, pinned byte-for-byte against the
|
|
@@ -272,7 +272,7 @@ export function secp256k1PublicKeyOf(secretKey) {
|
|
|
272
272
|
* The attestation digest of a respond-bidirectional response:
|
|
273
273
|
* `upgradeFromTransient(transientHash([requestId, blockHeight, outputKind, outputLength, serializedOutput]))`,
|
|
274
274
|
* the 32-byte digest the MPC ECDSA-signs to attest a remote execution. TS
|
|
275
|
-
* twin of the size-generic Compact circuit
|
|
275
|
+
* twin of the size-generic Compact circuit `calculateSignetAttestationDigestV1`.
|
|
276
276
|
*
|
|
277
277
|
* @param requestId - The 32-byte request id the response answers.
|
|
278
278
|
* @param blockHeight - Height of the finalised destination block holding the
|
|
@@ -331,7 +331,7 @@ function reverseBytes32(bytes) {
|
|
|
331
331
|
* Produce the circuit-input form of a posted respond-bidirectional
|
|
332
332
|
* attestation: `signature.bigR.x` and `signature.s` byte-reversed into
|
|
333
333
|
* little-endian, everything else verbatim. The in-circuit
|
|
334
|
-
* `
|
|
334
|
+
* `verifyRespondBidirectionalEventV1` reads those two scalars through
|
|
335
335
|
* little-endian casts (the reversal is free off-chain and costly
|
|
336
336
|
* in-circuit), while the wire and ledger records stay big-endian: pass every
|
|
337
337
|
* event through this exactly once, at the circuit call. A record passed
|
|
@@ -352,7 +352,7 @@ export function respondBidirectionalEventToCircuitInput(event) {
|
|
|
352
352
|
};
|
|
353
353
|
}
|
|
354
354
|
/**
|
|
355
|
-
* Off-chain twin of the in-circuit `
|
|
355
|
+
* Off-chain twin of the in-circuit `verifyRespondBidirectionalEventV1`: checks
|
|
356
356
|
* a posted respond-bidirectional attestation against the execution output
|
|
357
357
|
* and the contract's pinned MPC response key, over the request id, block
|
|
358
358
|
* height and output kind the post declares. Clients run it to sift candidate posts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ecdsa-attestation.js","sourceRoot":"","sources":["../src/ecdsa-attestation.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,0EAA0E;AAC1E,sEAAsE;AACtE,+CAA+C;AAC/C,kEAAkE;AAClE,
|
|
1
|
+
{"version":3,"file":"ecdsa-attestation.js","sourceRoot":"","sources":["../src/ecd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KAAK,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,MAAM,GAAG,gCAAgC,CAC7C,KAAK,CAAC,SAAS,EACf,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,UAAU,EAChB,gBAAgB,CACjB,CAAC;IACF,qEAAqE;IACrE,sCAAsC;IACtC,MAAM,gBAAgB,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IAC5C,gBAAgB,CAAC,GAAG,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxD,gBAAgB,CAAC,GAAG,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACzD,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IACrC,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IACpB,SAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACtD,SAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACvD,IAAI,CAAC;QACH,OAAO,SAAS,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE;YAC3D,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,KAAK;SACZ,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export * from "./signature-requests-state-reader.ts";
|
|
|
8
8
|
export * from "./signature-response-verification.ts";
|
|
9
9
|
export * from "./signet-contract-events.ts";
|
|
10
10
|
export { decodeEvmType2SignBidirectionalEvent } from "./signet-evtype2tx-record-decoding.ts";
|
|
11
|
-
export { abiWordToBool, abiWordToUint128, assembleCalldata, boolAbiWord, type EvmAccessListEntry, evmAddressAbiWord, type EvmCalldata, type EvmType2TxParams, numericAbiWord, signBidirectionalEventToSignedEvmTransaction, signBidirectionalEventToUnsignedEvmTransaction, } from "./signet-evtype2tx-requests.ts";
|
|
11
|
+
export { abiWordToBool, abiWordToUint128, assembleCalldata, boolAbiWord, calculateEvmType2TxParamsDigest, type EvmAccessListEntry, evmAddressAbiWord, type EvmCalldata, type EvmType2TxParams, numericAbiWord, signBidirectionalEventToSignedEvmTransaction, signBidirectionalEventToUnsignedEvmTransaction, } from "./signet-evtype2tx-requests.ts";
|
|
12
12
|
export { calculateRequestId } from "./signet-request-id.ts";
|
|
13
13
|
export * from "./signet-request-response-reader.ts";
|
|
14
14
|
export { type ContractAddress, contractAddressFromHex, type Maybe, MPCDestination, MPCSignatureAlgorithm, parseRequestIdHex, PATH_BYTES, type RequestId, requestIdBytes, type RequestIdHex, requestIdHex, type RequestIdPreimage, type SignBidirectionalEvent, type SignBidirectionalEventIndex, type SignBidirectionalEventLedgerMap, toSignBidirectionalEventIndex, TxParamType, } from "./signet-requests.ts";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,eAAe,EACf,UAAU,EACV,UAAU,EACV,cAAc,GACf,MAAM,kBAAkB,CAAC;AAI1B,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,+BAA+B,EAC/B,yBAAyB,EACzB,4CAA4C,EAC5C,sCAAsC,EACtC,yBAAyB,EACzB,iBAAiB,EACjB,mCAAmC,EACnC,KAAK,iCAAiC,GACvC,MAAM,yBAAyB,CAAC;AACjC,cAAc,uBAA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mCAAmC,GACpC,MAAM,wBAAwB,CAAC;AAEhC;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ export * from "./signature-requests-state-reader.js";
|
|
|
16
16
|
export * from "./signature-response-verification.js";
|
|
17
17
|
export * from "./signet-contract-events.js";
|
|
18
18
|
export { decodeEvmType2SignBidirectionalEvent } from "./signet-evtype2tx-record-decoding.js";
|
|
19
|
-
export { abiWordToBool, abiWordToUint128, assembleCalldata, boolAbiWord, evmAddressAbiWord, numericAbiWord, signBidirectionalEventToSignedEvmTransaction, signBidirectionalEventToUnsignedEvmTransaction, } from "./signet-evtype2tx-requests.js";
|
|
19
|
+
export { abiWordToBool, abiWordToUint128, assembleCalldata, boolAbiWord, calculateEvmType2TxParamsDigest, evmAddressAbiWord, numericAbiWord, signBidirectionalEventToSignedEvmTransaction, signBidirectionalEventToUnsignedEvmTransaction, } from "./signet-evtype2tx-requests.js";
|
|
20
20
|
export { calculateRequestId } from "./signet-request-id.js";
|
|
21
21
|
export * from "./signet-request-response-reader.js";
|
|
22
22
|
export { contractAddressFromHex, MPCDestination, MPCSignatureAlgorithm, parseRequestIdHex, PATH_BYTES, requestIdBytes, requestIdHex, toSignBidirectionalEventIndex, TxParamType, } from "./signet-requests.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,sEAAsE;AACtE,wEAAwE;AAExE,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,eAAe,EACf,UAAU,EACV,UAAU,EACV,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,uEAAuE;AACvE,4EAA4E;AAC5E,4EAA4E;AAC5E,cAAc,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