@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
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
"sourceRoot": "../../../",
|
|
5
5
|
"sources": ["src/circuits.compact", "src/./Signet.compact", "compiler/zkir-v3-library.compact"],
|
|
6
6
|
"names": [],
|
|
7
|
-
"mappings": "
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;;;;;MCyNE,MAAA,oBAEC;;OAAA;MAiDD,MAAA,6CAsBC;;OAAA;MA6ID,MAAA,eAEC;;OAAA;MA2KD,MAAA,iBAEC;;OAAA;MAID,MAAA,cASC;;OAAA;MAID,MAAA,WAEC;;OAAA;MAMD,MAAA,gBAmCC;;OAAA;MAID,MAAA,aAKC;;OAAA;MDtoBH,MAAA,iCAOC;;OAAA;MAED,MAAA,iCAOC;;OAAA;MAED,MAAA,iCAOC;;OAAA;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AF9B,kBAA2B;+DAC3B,2BAAsD;+DACtD,gBAA8B;GAO/B;;;;;;"
|
|
8
8
|
}
|
package/dist/mpc-output-cache.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// MPC attests for a bidirectional request, stored as one object per request
|
|
3
3
|
// id in a public bucket BEFORE the attestation is posted on chain. A Compact
|
|
4
4
|
// circuit fixes its byte-payload width at compile time while serialised
|
|
5
|
-
// outputs vary in size across requests, so the
|
|
6
|
-
//
|
|
5
|
+
// outputs vary in size across requests, so the attestation event carries the
|
|
6
|
+
// output's digest and width and the cache carries the bytes. An object holds nothing
|
|
7
7
|
// but the packed output, and is UNTRUSTED until the attestation signature
|
|
8
8
|
// verifies over it (`verifyRespondBidirectionalSignature`).
|
|
9
9
|
import { getMpcOutputCacheUrl, MidnightNetwork } from "./constants.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mpc-output-cache.js","sourceRoot":"","sources":["../src/mpc-output-cache.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,4EAA4E;AAC5E,6EAA6E;AAC7E,wEAAwE;AACxE,
|
|
1
|
+
{"version":3,"file":"mpc-output-cache.js","sourceRoot":"","sources":["../src/mpc-output-cache.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,4EAA4E;AAC5E,6EAA6E;AAC7E,wEAAwE;AACxE,6EAA6E;AAC7E,qFAAqF;AACrF,0EAA0E;AAC1E,4DAA4D;AAE5D,OAAO,EAAwB,oBAAoB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAmB7F,sGAAsG;AACtG,MAAM,iBAAiB,GAAsB,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,MAAM,CAChF,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,eAAe,CAAC,UAAU,CACpD,CAAC;AAEF;;;;;;;GAOG;AACH,SAAS,iBAAiB,CAAC,SAAiB;IAC1C,IAAI,CAAC,iBAAiB,CAAC,QAAQ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AI,UAAU,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;IACtD,CAAC;CACF"}
|
|
@@ -14,10 +14,10 @@ import { decodeEvmType2SignBidirectionalEvent } from "./signet-evtype2tx-record-
|
|
|
14
14
|
import { calculateRequestId } from "./signet-request-id.js";
|
|
15
15
|
import { requestIdBytes, requestIdHex, requestIdType, TxParamType, } from "./signet-requests.js";
|
|
16
16
|
// Atom position of `txParamType` in a stored record: the chain-agnostic head
|
|
17
|
-
// of
|
|
18
|
-
//
|
|
17
|
+
// of SignBidirectionalEventV1 (keyVersion through txParamType) occupies the first
|
|
18
|
+
// 5 atoms whatever the decomposition, so the tag sits at the same index in
|
|
19
19
|
// every record.
|
|
20
|
-
const TX_PARAM_TYPE_ATOM =
|
|
20
|
+
const TX_PARAM_TYPE_ATOM = 4;
|
|
21
21
|
/**
|
|
22
22
|
* Decode a stored request record: read the `txParamType` tag and hand the
|
|
23
23
|
* cell to that decomposition's decoder, so a foreign param type fails by
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature-requests-state-reader.js","sourceRoot":"","sources":["../src/signature-requests-state-reader.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,yEAAyE;AACzE,yEAAyE;AACzE,0EAA0E;AAC1E,4EAA4E;AAC5E,EAAE;AACF,6DAA6D;AAC7D,4EAA4E;AAC5E,0EAA0E;AAC1E,2DAA2D;AAI3D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAyB,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAE,oCAAoC,EAAE,MAAM,uCAAuC,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EACL,cAAc,EAEd,YAAY,EACZ,aAAa,EAGb,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAE9B,6EAA6E;AAC7E,
|
|
1
|
+
{"version":3,"file":"signature-requests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AC;IACD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;IACzB,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,SAAS,CAAC,CAAC,yCAAyC;IAC7D,CAAC;IACD,sEAAsE;IACtE,iEAAiE;IACjE,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC;QACpB,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QACvD,SAAS,EAAE,aAAa,CAAC,SAAS,EAAE;KACrC,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,KAAK,EAAE,MAAM,EAAE,CAAC;IAC7B,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC,CAAC,wCAAwC;IAC5D,CAAC;IACD,IAAI,MAA8B,CAAC;IACnC,IAAI,CAAC;QACH,MAAM,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC,CAAC,gDAAgD;IACpE,CAAC;IACD,IAAI,YAAY,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;QAC3D,OAAO,SAAS,CAAC,CAAC,kCAAkC;IACtD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -154,7 +154,7 @@ export interface MpcSignature {
|
|
|
154
154
|
}
|
|
155
155
|
/**
|
|
156
156
|
* The MPC's signature over the requested EVM transaction (Compact
|
|
157
|
-
* `
|
|
157
|
+
* `SignatureRespondedEventV1`). Emitted UNVERIFIED: authenticity comes from
|
|
158
158
|
* `SignetRequestResponseReader.getVerifiedSignatureRespondedEvent`.
|
|
159
159
|
*/
|
|
160
160
|
export interface SignatureRespondedEvent {
|
|
@@ -165,11 +165,11 @@ export interface SignatureRespondedEvent {
|
|
|
165
165
|
}
|
|
166
166
|
/**
|
|
167
167
|
* The MPC's respond-bidirectional attestation of a request's remote EVM
|
|
168
|
-
* execution (Compact `
|
|
168
|
+
* execution (Compact `RespondBidirectionalEventV1`, in declaration order): the
|
|
169
169
|
* ECDSA signature over the attestation digest
|
|
170
170
|
* (`calculateSignetAttestationDigest`) with everything that digest commits to
|
|
171
171
|
* except the output, which travels off chain. Emitted UNVERIFIED: verify
|
|
172
|
-
* in-circuit via `
|
|
172
|
+
* in-circuit via `verifyRespondBidirectionalEventV1` or off chain via
|
|
173
173
|
* `verifyRespondBidirectionalSignature`. Mint one with the
|
|
174
174
|
* `@sig-net/midnight/testing` entry point's `attestRespondBidirectional`.
|
|
175
175
|
*/
|
|
@@ -278,7 +278,7 @@ export interface SignBidirectionalNotification {
|
|
|
278
278
|
*/
|
|
279
279
|
callerAddress: string;
|
|
280
280
|
/**
|
|
281
|
-
* Resolved ledger-tree path of the `
|
|
281
|
+
* Resolved ledger-tree path of the `SignBidirectionalEventMapV1` in
|
|
282
282
|
* {@link callerAddress}, as compactc records it in that contract's
|
|
283
283
|
* `contract-info.json` (`"index"`): `[4]` for a flat contract's field 4,
|
|
284
284
|
* `[1, 14]` once chunking applies. Followed node for node by
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signet-evtype2tx-record-decoding.d.ts","sourceRoot":"","sources":["../src/signet-evtype2tx-record-decoding.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAIpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"signet-evtype2tx-record-decoding.d.ts","sourceRoot":"","sources":["../src/signet-evtype2tx-record-decoding.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAIpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAsFnE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oCAAoC,CAClD,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,MAAM,GACX,sBAAsB,CAsBxB"}
|
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
import { declaredWidths, decodeExactly } from "./compact-descriptors.js";
|
|
9
9
|
import { signBidirectionalEventDescriptor } from "./signet-evtype2tx-requests.js";
|
|
10
10
|
// Atom layout of an evmType2 request record: the fixed atom count, the
|
|
11
|
-
// fixed head before the calldata words
|
|
12
|
-
//
|
|
11
|
+
// fixed head before the calldata words (keyVersion through calldata.noWords)
|
|
12
|
+
// and the fixed tail (executionDest, signatureDest, params and the two
|
|
13
|
+
// schemas). A stored cell holds
|
|
13
14
|
// EVM_TYPE2_FIXED_ATOMS + maxCalldataWords
|
|
14
15
|
// + maxAccessListEntries * (2 + maxStorageKeysPerEntry) atoms.
|
|
15
16
|
const EVM_TYPE2_FIXED_ATOMS = 21;
|
|
16
|
-
const EVM_TYPE2_HEAD_ATOMS =
|
|
17
|
-
const EVM_TYPE2_TAIL_ATOMS =
|
|
17
|
+
const EVM_TYPE2_HEAD_ATOMS = 15;
|
|
18
|
+
const EVM_TYPE2_TAIL_ATOMS = 5;
|
|
18
19
|
/**
|
|
19
20
|
* Recover the sizing parameters the requester's contract was compiled with
|
|
20
21
|
* (`#maxCalldataWords`, `#maxAccessListEntries`, `#maxStorageKeysPerEntry`)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signet-evtype2tx-record-decoding.js","sourceRoot":"","sources":["../src/signet-evtype2tx-record-decoding.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,2EAA2E;AAC3E,2EAA2E;AAC3E,6EAA6E;AAC7E,0EAA0E;AAC1E,yEAAyE;AACzE,uDAAuD;AAIvD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAGlF,uEAAuE;AACvE,
|
|
1
|
+
{"version":3,"file":"signet-evtype2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sB,GAAG,QAAQ,GAAG,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,CAAC;AAC5E,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oCAAoC,CAClD,IAAkB,EAClB,IAAY;IAEZ,MAAM,MAAM,GAAG,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1C,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACpD,MAAM,wBAAwB,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,MAAM,uBAAuB,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,IAAI,wBAAwB,KAAK,SAAS,IAAI,uBAAuB,KAAK,SAAS,EAAE,CAAC;QACpF,MAAM,IAAI,KAAK,CACb,GAAG,IAAI,QAAQ,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,oCAAoC;YACtE,mEAAmE,CACtE,CAAC;IACJ,CAAC;IACD,OAAO,aAAa,CAClB,gCAAgC,CAC9B,UAAU,CAAC,gBAAgB,EAC3B,UAAU,CAAC,oBAAoB,EAC/B,UAAU,CAAC,sBAAsB,EACjC,wBAAwB,EACxB,uBAAuB,CACxB,EACD,IAAI,CAAC,KAAK,EACV,IAAI,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -89,17 +89,6 @@ export declare function evmAccessListEntryDescriptor(maxStorageKeys: number): Co
|
|
|
89
89
|
* @returns The tx-params descriptor.
|
|
90
90
|
*/
|
|
91
91
|
export declare function evmType2TxParamsDescriptor(maxCalldataWords: number, maxAccessListEntries: number, maxStorageKeysPerEntry: number): CompactType<EvmType2TxParams>;
|
|
92
|
-
/**
|
|
93
|
-
* Descriptor of {@link EvmType2TxParams} at the capacity instantiation a
|
|
94
|
-
* stored value itself exhibits: vector capacities are read off the value's
|
|
95
|
-
* array lengths, which carry the contract's compile-time throttles. For
|
|
96
|
-
* hashing or re-encoding a record already decoded at full capacity (see
|
|
97
|
-
* `calculateRequestId` in signet-request-id.ts).
|
|
98
|
-
*
|
|
99
|
-
* @param txParams - The transaction decomposition to size against.
|
|
100
|
-
* @returns The tx-params descriptor at the value's capacities.
|
|
101
|
-
*/
|
|
102
|
-
export declare function evmType2TxParamsDescriptorOf(txParams: EvmType2TxParams): CompactType<EvmType2TxParams>;
|
|
103
92
|
/**
|
|
104
93
|
* Descriptor of {@link SignBidirectionalEvent} at one EVM Type-2 capacity
|
|
105
94
|
* instantiation.
|
|
@@ -164,6 +153,22 @@ export declare function abiWordToUint128(word: Uint8Array): bigint;
|
|
|
164
153
|
* @throws {Error} If the word is not 32 bytes or is not a canonical Boolean.
|
|
165
154
|
*/
|
|
166
155
|
export declare function abiWordToBool(word: Uint8Array): boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Digest of an {@link EvmType2TxParams} over the bytes that reach the signed
|
|
158
|
+
* transaction, the TS twin of the `calculateEvmType2TxParamsDigestV1` circuit
|
|
159
|
+
* (lockstep-tested against its fixed-width oracles): the scalar fields, then
|
|
160
|
+
* the calldata words, access-list entries and storage keys up to their
|
|
161
|
+
* declared counts, each count hashed beside its entries. Slots past a count
|
|
162
|
+
* are skipped and an absent calldata contributes only its absence, so one
|
|
163
|
+
* transaction has one digest whatever the capacities and whatever bytes sit
|
|
164
|
+
* in unused slots. This is what {@link calculateRequestId} hashes in place of
|
|
165
|
+
* the parameters.
|
|
166
|
+
*
|
|
167
|
+
* @param txParams - The transaction decomposition to digest, at any capacity.
|
|
168
|
+
* @returns The 32-byte digest.
|
|
169
|
+
* @throws {Error} When a count exceeds its capacity.
|
|
170
|
+
*/
|
|
171
|
+
export declare function calculateEvmType2TxParamsDigest(txParams: EvmType2TxParams): Uint8Array;
|
|
167
172
|
/**
|
|
168
173
|
* Assemble the raw calldata a request's words describe:
|
|
169
174
|
* `data = selector || words[0..noWords]`, VERBATIM (see {@link EvmCalldata}).
|
|
@@ -182,7 +187,7 @@ export declare function assembleCalldata(calldata: Maybe<EvmCalldata>): string;
|
|
|
182
187
|
* @param request - The on-ledger request record.
|
|
183
188
|
* @returns The unsigned ethers transaction (`unsignedHash` is the digest the
|
|
184
189
|
* MPC signs).
|
|
185
|
-
* @throws {Error} If a calldata
|
|
190
|
+
* @throws {Error} If a calldata count overruns its stored slots.
|
|
186
191
|
*/
|
|
187
192
|
export declare function signBidirectionalEventToUnsignedEvmTransaction(request: SignBidirectionalEvent): Transaction;
|
|
188
193
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signet-evtype2tx-requests.d.ts","sourceRoot":"","sources":["../src/signet-evtype2tx-requests.ts"],"names":[],"mappings":"AAUA,OAAO,
|
|
1
|
+
{"version":3,"file":"signet-evtype2tx-requests.d.ts","sourceRoot":"","sources":["../src/signet-evtype2tx-requests.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,WAAW,EAIjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAc,WAAW,EAAE,MAAM,QAAQ,CAAC;AAGjD,OAAO,EASL,KAAK,KAAK,EAKX,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,sBAAsB,CAAC;AAE9B;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,yDAAyD;IACzD,QAAQ,EAAE,UAAU,CAAC;IACrB,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,iEAAiE;IACjE,OAAO,EAAE,UAAU,CAAC;IACpB,qDAAqD;IACrD,eAAe,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,WAAW,EAAE,UAAU,EAAE,CA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QG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU,CAOjE;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAItD;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAYzD;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CASvD;AA4BD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU,CA2CtF;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,MAAM,CAUrE;AAoBD;;;;;;;;;;GAUG;AACH,wBAAgB,8CAA8C,CAC5D,OAAO,EAAE,sBAAsB,GAC9B,WAAW,CAcb;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,4CAA4C,CAC1D,OAAO,EAAE,sBAAsB,EAC/B,QAAQ,EAAE,uBAAuB,GAChC,WAAW,CAIb"}
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
// Words are stored ABI-ready: {@link assembleCalldata} concatenates
|
|
8
8
|
// `selector || words` VERBATIM, so the transaction the MPC signs carries the
|
|
9
9
|
// contract-stored bytes untouched.
|
|
10
|
-
import { CompactTypeVector } from "@midnight-ntwrk/compact-runtime";
|
|
10
|
+
import { CompactTypeVector, transientHash, upgradeFromTransient, } from "@midnight-ntwrk/compact-runtime";
|
|
11
11
|
import { getAddress, Transaction } from "ethers";
|
|
12
12
|
import { bigintToBytes32BE, bytesToHex } from "./byte-codecs.js";
|
|
13
|
-
import { BYTES_4, BYTES_20, BYTES_32, compactMaybeDescriptor, compactStructDescriptor, UINT_8, UINT_16, UINT_64, UINT_128, } from "./compact-descriptors.js";
|
|
13
|
+
import { BOOLEAN, BYTES_4, BYTES_20, BYTES_32, compactMaybeDescriptor, compactStructDescriptor, compactTupleDescriptor, FIELD, UINT_8, UINT_16, UINT_64, UINT_128, } from "./compact-descriptors.js";
|
|
14
14
|
import { signatureRespondedEventToSignature } from "./ecdsa-attestation.js";
|
|
15
15
|
import { signBidirectionalEventDescriptorWith, } from "./signet-requests.js";
|
|
16
16
|
// ---- Runtime descriptors (see the deviation note in signet-requests.ts) ----
|
|
@@ -69,19 +69,6 @@ export function evmType2TxParamsDescriptor(maxCalldataWords, maxAccessListEntrie
|
|
|
69
69
|
accessList: new CompactTypeVector(maxAccessListEntries, evmAccessListEntryDescriptor(maxStorageKeysPerEntry)),
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
/**
|
|
73
|
-
* Descriptor of {@link EvmType2TxParams} at the capacity instantiation a
|
|
74
|
-
* stored value itself exhibits: vector capacities are read off the value's
|
|
75
|
-
* array lengths, which carry the contract's compile-time throttles. For
|
|
76
|
-
* hashing or re-encoding a record already decoded at full capacity (see
|
|
77
|
-
* `calculateRequestId` in signet-request-id.ts).
|
|
78
|
-
*
|
|
79
|
-
* @param txParams - The transaction decomposition to size against.
|
|
80
|
-
* @returns The tx-params descriptor at the value's capacities.
|
|
81
|
-
*/
|
|
82
|
-
export function evmType2TxParamsDescriptorOf(txParams) {
|
|
83
|
-
return evmType2TxParamsDescriptor(txParams.calldata.value.words.length, txParams.accessList.length, txParams.accessList[0]?.storageKeys.length ?? 0);
|
|
84
|
-
}
|
|
85
72
|
/**
|
|
86
73
|
* Descriptor of {@link SignBidirectionalEvent} at one EVM Type-2 capacity
|
|
87
74
|
* instantiation.
|
|
@@ -183,6 +170,88 @@ export function abiWordToBool(word) {
|
|
|
183
170
|
}
|
|
184
171
|
return low === 1;
|
|
185
172
|
}
|
|
173
|
+
/** The digest's head tuple: the scalar fields, the calldata presence, selector and count, the entry count. */
|
|
174
|
+
const EVM_TYPE2_DIGEST_HEAD = compactTupleDescriptor([
|
|
175
|
+
UINT_64,
|
|
176
|
+
UINT_64,
|
|
177
|
+
UINT_128,
|
|
178
|
+
UINT_128,
|
|
179
|
+
UINT_64,
|
|
180
|
+
BYTES_20,
|
|
181
|
+
UINT_128,
|
|
182
|
+
BOOLEAN,
|
|
183
|
+
BYTES_4,
|
|
184
|
+
UINT_16,
|
|
185
|
+
UINT_8,
|
|
186
|
+
]);
|
|
187
|
+
/** One fold step over a calldata word or storage key. */
|
|
188
|
+
const FIELD_BYTES_32 = compactTupleDescriptor([FIELD, BYTES_32]);
|
|
189
|
+
/** One fold step over a used access-list entry with its keys' digest. */
|
|
190
|
+
const EVM_TYPE2_DIGEST_ENTRY = compactTupleDescriptor([
|
|
191
|
+
FIELD,
|
|
192
|
+
BYTES_20,
|
|
193
|
+
UINT_8,
|
|
194
|
+
FIELD,
|
|
195
|
+
]);
|
|
196
|
+
/**
|
|
197
|
+
* Digest of an {@link EvmType2TxParams} over the bytes that reach the signed
|
|
198
|
+
* transaction, the TS twin of the `calculateEvmType2TxParamsDigestV1` circuit
|
|
199
|
+
* (lockstep-tested against its fixed-width oracles): the scalar fields, then
|
|
200
|
+
* the calldata words, access-list entries and storage keys up to their
|
|
201
|
+
* declared counts, each count hashed beside its entries. Slots past a count
|
|
202
|
+
* are skipped and an absent calldata contributes only its absence, so one
|
|
203
|
+
* transaction has one digest whatever the capacities and whatever bytes sit
|
|
204
|
+
* in unused slots. This is what {@link calculateRequestId} hashes in place of
|
|
205
|
+
* the parameters.
|
|
206
|
+
*
|
|
207
|
+
* @param txParams - The transaction decomposition to digest, at any capacity.
|
|
208
|
+
* @returns The 32-byte digest.
|
|
209
|
+
* @throws {Error} When a count exceeds its capacity.
|
|
210
|
+
*/
|
|
211
|
+
export function calculateEvmType2TxParamsDigest(txParams) {
|
|
212
|
+
const { calldata, accessListEntryCount, accessList } = txParams;
|
|
213
|
+
const noWords = calldata.is_some ? calldata.value.noWords : 0n;
|
|
214
|
+
const selector = calldata.is_some ? calldata.value.selector : new Uint8Array(4);
|
|
215
|
+
if (noWords > BigInt(calldata.value.words.length)) {
|
|
216
|
+
throw new Error("calldata noWords exceeds capacity");
|
|
217
|
+
}
|
|
218
|
+
if (accessListEntryCount > BigInt(accessList.length)) {
|
|
219
|
+
throw new Error("accessListEntryCount exceeds capacity");
|
|
220
|
+
}
|
|
221
|
+
const head = transientHash(EVM_TYPE2_DIGEST_HEAD, [
|
|
222
|
+
txParams.chainId,
|
|
223
|
+
txParams.nonce,
|
|
224
|
+
txParams.maxPriorityFeePerGas,
|
|
225
|
+
txParams.maxFeePerGas,
|
|
226
|
+
txParams.gasLimit,
|
|
227
|
+
txParams.to,
|
|
228
|
+
txParams.value,
|
|
229
|
+
calldata.is_some,
|
|
230
|
+
selector,
|
|
231
|
+
noWords,
|
|
232
|
+
accessListEntryCount,
|
|
233
|
+
]);
|
|
234
|
+
let acc = head;
|
|
235
|
+
for (const word of calldata.value.words.slice(0, Number(noWords))) {
|
|
236
|
+
acc = transientHash(FIELD_BYTES_32, [acc, word]);
|
|
237
|
+
}
|
|
238
|
+
for (const entry of accessList.slice(0, Number(accessListEntryCount))) {
|
|
239
|
+
if (entry.storageKeyCount > BigInt(entry.storageKeys.length)) {
|
|
240
|
+
throw new Error("a used entry's storageKeyCount exceeds capacity");
|
|
241
|
+
}
|
|
242
|
+
let keysAcc = 0n;
|
|
243
|
+
for (const key of entry.storageKeys.slice(0, Number(entry.storageKeyCount))) {
|
|
244
|
+
keysAcc = transientHash(FIELD_BYTES_32, [keysAcc, key]);
|
|
245
|
+
}
|
|
246
|
+
acc = transientHash(EVM_TYPE2_DIGEST_ENTRY, [
|
|
247
|
+
acc,
|
|
248
|
+
entry.address,
|
|
249
|
+
entry.storageKeyCount,
|
|
250
|
+
keysAcc,
|
|
251
|
+
]);
|
|
252
|
+
}
|
|
253
|
+
return upgradeFromTransient(acc);
|
|
254
|
+
}
|
|
186
255
|
/**
|
|
187
256
|
* Assemble the raw calldata a request's words describe:
|
|
188
257
|
* `data = selector || words[0..noWords]`, VERBATIM (see {@link EvmCalldata}).
|
|
@@ -226,7 +295,7 @@ function decodeAccessList(txParams) {
|
|
|
226
295
|
* @param request - The on-ledger request record.
|
|
227
296
|
* @returns The unsigned ethers transaction (`unsignedHash` is the digest the
|
|
228
297
|
* MPC signs).
|
|
229
|
-
* @throws {Error} If a calldata
|
|
298
|
+
* @throws {Error} If a calldata count overruns its stored slots.
|
|
230
299
|
*/
|
|
231
300
|
export function signBidirectionalEventToUnsignedEvmTransaction(request) {
|
|
232
301
|
const { txParams } = request;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signet-evtype2tx-requests.js","sourceRoot":"","sources":["../src/signet-evtype2tx-requests.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,sEAAsE;AACtE,6EAA6E;AAC7E,sEAAsE;AACtE,wBAAwB;AACxB,EAAE;AACF,oEAAoE;AACpE,6EAA6E;AAC7E,mCAAmC;AAEnC,OAAO,
|
|
1
|
+
{"version":3,"file":"signet-evtype2tx-requests.js","sourceRoot":"","sources":["../src/signet-evtype2tx-requests.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,sEAAsE;AACtE,6EAA6E;AAC7E,sEAAsE;AACtE,wBAAwB;AACxB,EAAE;AACF,oEAAoE;AACpE,6EAA6E;AAC7E,mCAAmC;AAEnC,OAAO,EAEL,iBAAiB,EACjB,aAAa,EACb,oBAAoB,GACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAEjD,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EACL,OAAO,EACP,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,KAAK,EAEL,MAAM,EACN,OAAO,EACP,OAAO,EACP,QAAQ,GACT,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,kCAAkC,EAAE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CAAC,QAAQ,CAAC,QAAQ,CAAC;KAC1C,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,4CAA4C,CAC1D,OAA+B,EAC/B,QAAiC;IAEjC,MAAM,WAAW,GAAG,8CAA8C,CAAC,OAAO,CAAC,CAAC;IAC5E,WAAW,CAAC,SAAS,GAAG,kCAAkC,CAAC,QAAQ,CAAC,CAAC;IACrE,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { type RequestId, type SignBidirectionalEvent } from "./signet-requests.ts";
|
|
2
2
|
/**
|
|
3
3
|
* Canonical id of a signet request: the transientHash (Poseidon) of the
|
|
4
|
-
* record's {@link RequestIdPreimage}
|
|
5
|
-
*
|
|
4
|
+
* record's {@link RequestIdPreimage} over its field-aligned representation,
|
|
5
|
+
* with the transaction entering as its decomposition's digest
|
|
6
|
+
* ({@link calculateEvmType2TxParamsDigest} for evmType2), so the id ignores
|
|
7
|
+
* the record's capacities and unused slots.
|
|
6
8
|
*
|
|
7
9
|
* @param request - The full event record (contract-shaped, all slots).
|
|
8
10
|
* @returns The 32-byte request id, the record's ledger map key.
|
|
9
11
|
* @throws {Error} If the record's `txParamType` names a decomposition this
|
|
10
|
-
* computation has no
|
|
12
|
+
* computation has no digest for, or a count overruns its capacity.
|
|
11
13
|
*/
|
|
12
14
|
export declare function calculateRequestId(request: SignBidirectionalEvent): RequestId;
|
|
13
15
|
//# sourceMappingURL=signet-request-id.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signet-request-id.d.ts","sourceRoot":"","sources":["../src/signet-request-id.ts"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,SAAS,EAGd,KAAK,sBAAsB,EAE5B,MAAM,sBAAsB,CAAC;AAE9B
|
|
1
|
+
{"version":3,"file":"signet-request-id.d.ts","sourceRoot":"","sources":["../src/signet-request-id.ts"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,SAAS,EAGd,KAAK,sBAAsB,EAE5B,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,sBAAsB,GAAG,SAAS,CAiB7E"}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
// The signet request id computation: the TS twin of Signet.compact's
|
|
2
|
-
// `
|
|
3
|
-
// signet-requests.ts). Chain-agnostic entry point that
|
|
4
|
-
//
|
|
5
|
-
//
|
|
2
|
+
// `calculateEvmType2RequestIdV1` circuit (see the deviation note in
|
|
3
|
+
// signet-requests.ts). Chain-agnostic entry point that digests each record's
|
|
4
|
+
// transaction by its `txParamType` tag, so every decomposition mints ids
|
|
5
|
+
// through this one function.
|
|
6
6
|
import { transientHash, upgradeFromTransient } from "@midnight-ntwrk/compact-runtime";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { calculateEvmType2TxParamsDigest } from "./signet-evtype2tx-requests.js";
|
|
8
|
+
import { requestIdPreimageDescriptor, TxParamType, } from "./signet-requests.js";
|
|
9
9
|
/**
|
|
10
10
|
* Canonical id of a signet request: the transientHash (Poseidon) of the
|
|
11
|
-
* record's {@link RequestIdPreimage}
|
|
12
|
-
*
|
|
11
|
+
* record's {@link RequestIdPreimage} over its field-aligned representation,
|
|
12
|
+
* with the transaction entering as its decomposition's digest
|
|
13
|
+
* ({@link calculateEvmType2TxParamsDigest} for evmType2), so the id ignores
|
|
14
|
+
* the record's capacities and unused slots.
|
|
13
15
|
*
|
|
14
16
|
* @param request - The full event record (contract-shaped, all slots).
|
|
15
17
|
* @returns The 32-byte request id, the record's ledger map key.
|
|
16
18
|
* @throws {Error} If the record's `txParamType` names a decomposition this
|
|
17
|
-
* computation has no
|
|
19
|
+
* computation has no digest for, or a count overruns its capacity.
|
|
18
20
|
*/
|
|
19
21
|
export function calculateRequestId(request) {
|
|
20
22
|
if (request.txParamType !== TxParamType.evmType2) {
|
|
@@ -22,14 +24,14 @@ export function calculateRequestId(request) {
|
|
|
22
24
|
`understands evmType2 (${String(TxParamType.evmType2)})`);
|
|
23
25
|
}
|
|
24
26
|
const preimage = {
|
|
25
|
-
sender: request.sender,
|
|
26
27
|
keyVersion: request.keyVersion,
|
|
28
|
+
sender: request.sender,
|
|
27
29
|
path: request.path,
|
|
28
30
|
algo: request.algo,
|
|
29
31
|
txParamType: request.txParamType,
|
|
30
|
-
|
|
32
|
+
txParamsDigest: calculateEvmType2TxParamsDigest(request.txParams),
|
|
31
33
|
executionDest: request.executionDest,
|
|
32
34
|
};
|
|
33
|
-
return upgradeFromTransient(transientHash(
|
|
35
|
+
return upgradeFromTransient(transientHash(requestIdPreimageDescriptor, preimage));
|
|
34
36
|
}
|
|
35
37
|
//# sourceMappingURL=signet-request-id.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signet-request-id.js","sourceRoot":"","sources":["../src/signet-request-id.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"signet-request-id.js","sourceRoot":"","sources":["../src/signet-request-id.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,oEAAoE;AACpE,6EAA6E;AAC7E,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAGL,2BAA2B,EAE3B,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAA+B;IAChE,IAAI,OAAO,CAAC,WAAW,KAAK,WAAW,CAAC,QAAQ,EAAE,CAAC;QACjD,MAAM,IAAI,KAAK,CACb,2BAA2B,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,wBAAwB;YAC5E,yBAAyB,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAC3D,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAsB;QAClC,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,cAAc,EAAE,+BAA+B,CAAC,OAAO,CAAC,QAAQ,CAAC;QACjE,aAAa,EAAE,OAAO,CAAC,aAAa;KACrC,CAAC;IACF,OAAO,oBAAoB,CAAC,aAAa,CAAC,2BAA2B,EAAE,QAAQ,CAAC,CAAC,CAAC;AACpF,CAAC"}
|
|
@@ -62,76 +62,72 @@ export declare const MPCDestination: {
|
|
|
62
62
|
};
|
|
63
63
|
/**
|
|
64
64
|
* The fields of a {@link SignBidirectionalEvent} that mint its
|
|
65
|
-
* {@link RequestId} (Compact: `
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
sender: ContractAddress;
|
|
65
|
+
* {@link RequestId} (Compact: `RequestIdPreimageV1`), in Compact declaration
|
|
66
|
+
* order: the signing key, the requesting contract, a digest of the
|
|
67
|
+
* transaction and its execution destination. The transaction enters as the
|
|
68
|
+
* digest its decomposition's own function computes over the used entries
|
|
69
|
+
* only, so the id is the same whatever capacities the requester compiled its
|
|
70
|
+
* struct with and whatever bytes sit in unused slots. The serialisation
|
|
71
|
+
* schemas and the reserved MPC parameters stay out.
|
|
72
|
+
*/
|
|
73
|
+
export interface RequestIdPreimage {
|
|
75
74
|
/** MPC root-key version to derive from (>= 1). */
|
|
76
75
|
keyVersion: bigint;
|
|
76
|
+
/** Address of the client contract that stores this event (`kernel.self()`). */
|
|
77
|
+
sender: ContractAddress;
|
|
77
78
|
/** Key-derivation path: 32 opaque bytes of the client contract's choosing. */
|
|
78
79
|
path: Uint8Array;
|
|
79
80
|
/** An {@link MPCSignatureAlgorithm} value. */
|
|
80
81
|
algo: number;
|
|
81
82
|
/** A {@link TxParamType} value tagging the txParams decomposition. */
|
|
82
83
|
txParamType: number;
|
|
83
|
-
/** The transaction decomposition. */
|
|
84
|
-
|
|
84
|
+
/** The 32-byte digest of the transaction decomposition over its used entries. */
|
|
85
|
+
txParamsDigest: Uint8Array;
|
|
85
86
|
/** Execution destination: the target chain in CAIP-2 form (https://chainagnostic.org/CAIPs/caip-2), zero-padded, 32 bytes. */
|
|
86
87
|
executionDest: Uint8Array;
|
|
87
88
|
}
|
|
88
89
|
/**
|
|
89
90
|
* Canonical signet request record (Compact:
|
|
90
|
-
* `
|
|
91
|
+
* `SignBidirectionalEventV1<TxParams, #LenOutputDeserialization,
|
|
91
92
|
* #LenRespondSerialization>`), stored per {@link RequestId} in a requesting
|
|
92
|
-
* contract's `
|
|
93
|
-
* {@link RequestIdPreimage} fields mint its id
|
|
93
|
+
* contract's `SignBidirectionalEventMapV1`, in Compact declaration order. The
|
|
94
|
+
* {@link RequestIdPreimage} fields come first and mint its id, the
|
|
95
|
+
* protocol-only fields follow, and the schema fields carry their
|
|
94
96
|
* contract-declared byte widths in their array lengths.
|
|
95
97
|
*/
|
|
96
98
|
export interface SignBidirectionalEvent<TxParams = EvmType2TxParams> {
|
|
97
|
-
/** Address of the client contract that stores this event (`kernel.self()`). */
|
|
98
|
-
sender: ContractAddress;
|
|
99
99
|
/** MPC root-key version to derive from (>= 1). */
|
|
100
100
|
keyVersion: bigint;
|
|
101
|
+
/** Address of the client contract that stores this event (`kernel.self()`). */
|
|
102
|
+
sender: ContractAddress;
|
|
101
103
|
/** Key-derivation path: 32 opaque bytes of the client contract's choosing. */
|
|
102
104
|
path: Uint8Array;
|
|
103
105
|
/** An {@link MPCSignatureAlgorithm} value. */
|
|
104
106
|
algo: number;
|
|
105
|
-
/** An {@link MPCDestination} value: the signature destination, reserved. */
|
|
106
|
-
signatureDest: number;
|
|
107
|
-
/** Extra MPC parameters: 64 opaque bytes, reserved, zero-filled. */
|
|
108
|
-
params: Uint8Array;
|
|
109
107
|
/** A {@link TxParamType} value tagging the txParams decomposition. */
|
|
110
108
|
txParamType: number;
|
|
111
109
|
/** The transaction decomposition. */
|
|
112
110
|
txParams: TxParams;
|
|
113
111
|
/** Execution destination: the target chain in CAIP-2 form (https://chainagnostic.org/CAIPs/caip-2), zero-padded, 32 bytes. */
|
|
114
112
|
executionDest: Uint8Array;
|
|
113
|
+
/** An {@link MPCDestination} value: the signature destination, reserved. */
|
|
114
|
+
signatureDest: number;
|
|
115
|
+
/** Extra MPC parameters: 64 opaque bytes, reserved, zero-filled. */
|
|
116
|
+
params: Uint8Array;
|
|
115
117
|
/** MPC output_deserialization_schema (destination chain -> MPC), contract-declared width. */
|
|
116
118
|
outputDeserializationSchema: Uint8Array;
|
|
117
119
|
/** MPC respond_serialization_schema (MPC -> Midnight), contract-declared width. */
|
|
118
120
|
respondSerializationSchema: Uint8Array;
|
|
119
121
|
}
|
|
120
122
|
/**
|
|
121
|
-
* Descriptor of {@link RequestIdPreimage}
|
|
122
|
-
*
|
|
123
|
-
* `calculateRequestId` (signet-request-id.ts) hashes. Field order is the
|
|
124
|
-
* Compact struct's, a subsequence of {@link signBidirectionalEventDescriptorWith}'s.
|
|
125
|
-
*
|
|
126
|
-
* @param txParams - Descriptor of the tx-params decomposition, already at
|
|
127
|
-
* its capacity instantiation.
|
|
128
|
-
* @returns The preimage descriptor.
|
|
123
|
+
* Descriptor of {@link RequestIdPreimage}: what {@link calculateRequestId}
|
|
124
|
+
* hashes, in Compact declaration order.
|
|
129
125
|
*/
|
|
130
|
-
export declare
|
|
126
|
+
export declare const requestIdPreimageDescriptor: CompactType<RequestIdPreimage>;
|
|
131
127
|
/**
|
|
132
128
|
* Descriptor of {@link SignBidirectionalEvent} over ANY tx-params
|
|
133
129
|
* decomposition: the TS analogue of Compact's generic
|
|
134
|
-
* `
|
|
130
|
+
* `SignBidirectionalEventV1`. Each decomposition wraps this with its own
|
|
135
131
|
* capacity-parameterised convenience (see `signBidirectionalEventDescriptor`
|
|
136
132
|
* in signet-evtype2tx-requests.ts for the EVM Type-2 one).
|
|
137
133
|
*
|
|
@@ -145,9 +141,9 @@ export declare function requestIdPreimageDescriptorWith<TxParams>(txParams: Comp
|
|
|
145
141
|
*/
|
|
146
142
|
export declare function signBidirectionalEventDescriptorWith<TxParams>(txParams: CompactType<TxParams>, lenOutputDeserialization: number, lenRespondSerialization: number): CompactType<SignBidirectionalEvent<TxParams>>;
|
|
147
143
|
/**
|
|
148
|
-
* The generated ledger shape of `
|
|
149
|
-
*
|
|
150
|
-
* so any contract exposing
|
|
144
|
+
* The generated ledger shape of a `SignBidirectionalEventMapV1`: what a
|
|
145
|
+
* contract's `ledger(state).signBidirectionalEventMap` provides. Structural,
|
|
146
|
+
* so any contract exposing such a map satisfies it.
|
|
151
147
|
*/
|
|
152
148
|
export interface SignBidirectionalEventLedgerMap extends Iterable<[
|
|
153
149
|
RequestId,
|