@sig-net/midnight 0.24.0 → 0.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/abi-serde.d.ts +7 -5
- package/dist/abi-serde.d.ts.map +1 -1
- package/dist/abi-serde.js +9 -6
- package/dist/abi-serde.js.map +1 -1
- package/dist/compact-descriptors.js +1 -1
- package/dist/compact-descriptors.js.map +1 -1
- package/dist/constants.d.ts +2 -2
- package/dist/constants.js +2 -2
- package/dist/ecdsa-attestation.d.ts +8 -3
- package/dist/ecdsa-attestation.d.ts.map +1 -1
- package/dist/ecdsa-attestation.js +3 -2
- package/dist/ecdsa-attestation.js.map +1 -1
- package/dist/epsilon-derivation.d.ts +9 -7
- package/dist/epsilon-derivation.d.ts.map +1 -1
- package/dist/epsilon-derivation.js +6 -5
- package/dist/epsilon-derivation.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/managed/compiler/contract-manifest.json +2 -2
- package/dist/managed/contract/index.js +27 -27
- package/dist/managed/contract/index.js.map +1 -1
- package/dist/mpc-output-cache.d.ts +7 -5
- package/dist/mpc-output-cache.d.ts.map +1 -1
- package/dist/mpc-output-cache.js +5 -4
- package/dist/mpc-output-cache.js.map +1 -1
- package/dist/signet-contract-events.d.ts +5 -3
- package/dist/signet-contract-events.d.ts.map +1 -1
- package/dist/signet-contract-events.js +2 -2
- package/dist/signet-contract-events.js.map +1 -1
- package/dist/signet-evtype2tx-requests.d.ts +3 -5
- package/dist/signet-evtype2tx-requests.d.ts.map +1 -1
- package/dist/signet-evtype2tx-requests.js +2 -4
- package/dist/signet-evtype2tx-requests.js.map +1 -1
- package/dist/signet-requests.d.ts +5 -4
- package/dist/signet-requests.d.ts.map +1 -1
- package/dist/signet-requests.js.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/testing.js.map +1 -1
- package/package.json +2 -2
- package/src/Signet.compact +29 -25
|
@@ -63,8 +63,9 @@ export declare const MPCDestination: {
|
|
|
63
63
|
/**
|
|
64
64
|
* The fields of a {@link SignBidirectionalEvent} that mint its
|
|
65
65
|
* {@link RequestId} (Compact: `RequestIdPreimageV1`), in Compact declaration
|
|
66
|
-
* order: the
|
|
67
|
-
*
|
|
66
|
+
* order: the key version and the requesting contract, the path and
|
|
67
|
+
* algorithm (with those two, the signing key), the transaction-parameter type
|
|
68
|
+
* tag, a digest of the transaction and its execution destination. The transaction enters as the
|
|
68
69
|
* digest its decomposition's own function computes over the used entries
|
|
69
70
|
* only, so the id is the same whatever capacities the requester compiled its
|
|
70
71
|
* struct with and whatever bytes sit in unused slots. The serialisation
|
|
@@ -114,9 +115,9 @@ export interface SignBidirectionalEvent<TxParams = EvmType2TxParams> {
|
|
|
114
115
|
signatureDest: number;
|
|
115
116
|
/** Extra MPC parameters: 64 opaque bytes, reserved, zero-filled. */
|
|
116
117
|
params: Uint8Array;
|
|
117
|
-
/** MPC output_deserialization_schema (
|
|
118
|
+
/** MPC output_deserialization_schema (target chain -> MPC), contract-declared width. */
|
|
118
119
|
outputDeserializationSchema: Uint8Array;
|
|
119
|
-
/**
|
|
120
|
+
/** Reserved and ignored by the MPC, contract-declared width (zero in the V1 helper). */
|
|
120
121
|
respondSerializationSchema: Uint8Array;
|
|
121
122
|
}
|
|
122
123
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signet-requests.d.ts","sourceRoot":"","sources":["../src/signet-requests.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAGvE,YAAY,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEvE;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAMnE;AA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// attestRespondBidirectional({ requestId, blockHeight, outputKind, serializedOutput }, secretKey)
|
|
11
|
+
// respondBidirectionalEventToCircuitInput(attestRespondBidirectional({ requestId, blockHeight, outputKind, serializedOutput }, secretKey))
|
|
12
12
|
// verifies in-circuit against secp256k1PublicKeyOf(secretKey).
|
|
13
13
|
export { attestRespondBidirectional, calculateSignetAttestationDigest, ecdsaSignatureToMpcSignature, secp256k1PublicKeyOf, signAttestationDigest, signatureToSignatureRespondedEvent, } from "./ecdsa-attestation.js";
|
|
14
14
|
export { deriveMidnightResponseSecretKey } from "./epsilon-derivation.js";
|
package/dist/testing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,qEAAqE;AACrE,yEAAyE;AACzE,2EAA2E;AAC3E,4DAA4D;AAC5D,4EAA4E;AAC5E,6EAA6E;AAC7E,qCAAqC;AACrC,EAAE;AACF,yBAAyB;AACzB,
|
|
1
|
+
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,qEAAqE;AACrE,yEAAyE;AACzE,2EAA2E;AAC3E,4DAA4D;AAC5D,4EAA4E;AAC5E,6EAA6E;AAC7E,qCAAqC;AACrC,EAAE;AACF,yBAAyB;AACzB,6IAA6I;AAC7I,+DAA+D;AAE/D,OAAO,EACL,0BAA0B,EAC1B,gCAAgC,EAEhC,4BAA4B,EAE5B,oBAAoB,EACpB,qBAAqB,EACrB,kCAAkC,GACnC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sig-net/midnight",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/sig-net/midnight-integration",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@midnight-ntwrk/compact-runtime": "0.18.0-rc.1",
|
|
50
50
|
"@midnight-ntwrk/midnight-js-types": "5.0.0-beta.6",
|
|
51
51
|
"@noble/curves": "^2.2.0",
|
|
52
|
-
"@sig-net/midnight-serde": "^0.24.
|
|
52
|
+
"@sig-net/midnight-serde": "^0.24.1",
|
|
53
53
|
"ethers": "^6.17.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
package/src/Signet.compact
CHANGED
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
// - SignBidirectionalEventNotification: the notification delivered through that call, versioned by
|
|
27
27
|
// the version byte it carries.
|
|
28
28
|
// - SignatureRespondedEventV1: the MPC's posted signature answering a request.
|
|
29
|
-
// - RespondBidirectionalEventV1: the MPC's posted attestation
|
|
30
|
-
//
|
|
29
|
+
// - RespondBidirectionalEventV1: the MPC's posted attestation of the signed transaction's outcome
|
|
30
|
+
// (executed, failed or unviable).
|
|
31
31
|
//
|
|
32
32
|
// The V1 suffix marks the wire and hash-domain artefacts of protocol version 1 (the structs the
|
|
33
|
-
// ledger stores and the singleton emits, and the circuits that hash or
|
|
34
|
-
// shared across versions (RequestId, OutputKind, Signature, the enums, the transaction
|
|
35
|
-
// structs, which TxParamType tags) and the version-tagged notification carry no suffix.
|
|
33
|
+
// ledger stores and the singleton emits, and the circuits that hash, verify or construct them).
|
|
34
|
+
// Vocabulary shared across versions (RequestId, OutputKind, Signature, the enums, the transaction
|
|
35
|
+
// parameter structs, which TxParamType tags) and the version-tagged notification carry no suffix.
|
|
36
36
|
//
|
|
37
37
|
// These key types are best understood within the sign bidirectional flow that they enable:
|
|
38
38
|
// 1. Client contract stores a SignBidirectionalEvent in a SignBidirectionalEventMap in its own ledger
|
|
@@ -45,18 +45,21 @@
|
|
|
45
45
|
// signature) through the Signet singleton, which emits it as a contract event.
|
|
46
46
|
// 3. Client polls the Signet singleton contract's SignatureRespondedEvent events, identifying the response
|
|
47
47
|
// associated with their request by RequestId. Clients validate the signature is correct by checking with
|
|
48
|
-
// the requested signing key. Then it broadcasts the signed txn to the
|
|
49
|
-
// 4. MPC observes txn
|
|
50
|
-
//
|
|
48
|
+
// the requested signing key. Then it broadcasts the signed txn to the target chain.
|
|
49
|
+
// 4. MPC observes the txn's outcome in a final block on the target chain (executed, failed,
|
|
50
|
+
// or unviable when another request's transaction took its nonce) and posts a
|
|
51
|
+
// RespondBidirectionalEvent attestation through the Signet singleton, which emits it as a
|
|
52
|
+
// contract event beside the request id.
|
|
51
53
|
// The client polls its request's posts and takes the first one that verifies over the request id,
|
|
52
54
|
// block height, output kind and output. The client obtains the execution output off chain (for EVM: the mined
|
|
53
|
-
// call's return data via debug_traceTransaction,
|
|
54
|
-
// MPC's output cache) and hands
|
|
55
|
-
//
|
|
55
|
+
// call's return data via debug_traceTransaction, re-serialised exactly as the MPC did with
|
|
56
|
+
// executedEvmRespondOutput, or the exact attested bytes from the MPC's output cache) and hands the
|
|
57
|
+
// serialised output plus attestation to its verify circuit. See
|
|
58
|
+
// "Output Recovery and Serialisation" in the repository README.
|
|
56
59
|
//
|
|
57
60
|
// Read more:
|
|
58
|
-
// - The sign bidirectional flow and key derivation:
|
|
59
|
-
// ("Sign
|
|
61
|
+
// - The sign bidirectional flow and key derivation: the repository README
|
|
62
|
+
// ("Sign Bidirectional Protocol Flow", "Derived Keys").
|
|
60
63
|
// - For full integration examples (such as an ERC20 cross chain vault example) see
|
|
61
64
|
// the Midnight Examples repository at: https://github.com/sig-net/midnight-examples.
|
|
62
65
|
// - Compact language reference (modules, types):
|
|
@@ -92,7 +95,8 @@ module Signet {
|
|
|
92
95
|
// variant for requests made from Midnight contracts), not this record's target
|
|
93
96
|
// executionDest. The path is 32 opaque bytes of the client contract's choosing (e.g. a
|
|
94
97
|
// fixed literal for a contract-owned account or a hash of a caller's secret for
|
|
95
|
-
// per-user accounts): no format is enforced, any 32 bytes are valid
|
|
98
|
+
// per-user accounts): no format is enforced, and any 32 bytes are valid except
|
|
99
|
+
// pad(32, "midnight response key"), which is reserved for the MPC response key and refused.
|
|
96
100
|
// CRITICAL: the MPC renders the path as hex::encode(path) for key derivation (lowercase hex
|
|
97
101
|
// of the full 32 bytes, no trimming, no 0x prefix). The sender is always part
|
|
98
102
|
// of the derivation, so no contract can reach another contract's derived keys.
|
|
@@ -104,7 +108,7 @@ module Signet {
|
|
|
104
108
|
// MPC Parameters.
|
|
105
109
|
algo: MPCSignatureAlgorithm; // Signature algorithm scheme, e.g. ecdsa
|
|
106
110
|
|
|
107
|
-
//
|
|
111
|
+
// Target chain transaction parameters.
|
|
108
112
|
txParamType: TxParamType; // Off-chain tag indicating what type txParams is set to.
|
|
109
113
|
txParams: TxParams; // The generic transaction-param payload
|
|
110
114
|
executionDest: Bytes<32>; // The MPC's routing key for the target chain, in CAIP-2 form
|
|
@@ -119,8 +123,8 @@ module Signet {
|
|
|
119
123
|
|
|
120
124
|
// ---- Serialisation Schemas ----
|
|
121
125
|
|
|
122
|
-
// outputDeserializationSchema tells the MPC how to decode the
|
|
123
|
-
// execution output (
|
|
126
|
+
// outputDeserializationSchema tells the MPC how to decode the target chain's
|
|
127
|
+
// execution output (target chain -> MPC).
|
|
124
128
|
// The value is execution chain specific and sized per client contract:
|
|
125
129
|
// - Ethereum: an ABI JSON schema string (see https://docs.soliditylang.org/en/v0.8.30/abi-spec.html#json)
|
|
126
130
|
// in canonical form: `[{"name":"<identifier>","type":"<abi type>"},...]` with no
|
|
@@ -346,8 +350,8 @@ module Signet {
|
|
|
346
350
|
// post settles exactly the request it names, so a client consumes this id
|
|
347
351
|
// and never one taken from elsewhere.
|
|
348
352
|
requestId: RequestId;
|
|
349
|
-
// Height of the finalised
|
|
350
|
-
// attestation describes, in the
|
|
353
|
+
// Height of the finalised target-chain block holding the transaction the
|
|
354
|
+
// attestation describes, in the target chain's own numbering (a slot
|
|
351
355
|
// on Solana). Signed into the digest.
|
|
352
356
|
blockHeight: Uint<64>;
|
|
353
357
|
// The MPC's verdict on the execution, signed into the digest.
|
|
@@ -366,17 +370,17 @@ module Signet {
|
|
|
366
370
|
|
|
367
371
|
// OutputKind is the MPC's verdict on a request's execution, the kind half of
|
|
368
372
|
// the protocol's outcome (kind, data). The block height the attestation
|
|
369
|
-
// commits to is the finalised
|
|
373
|
+
// commits to is the finalised target-chain block that settled the verdict.
|
|
370
374
|
export enum OutputKind {
|
|
371
375
|
executed, // finalised and succeeded: the attested output is the decoded return data, Borsh-serialised by the MPC (empty when the call returns nothing)
|
|
372
376
|
failed, // finalised and reverted: the attested output is empty (Bytes<0>)
|
|
373
|
-
unviable, // a finalised transaction
|
|
377
|
+
unviable, // a finalised transaction of another request from the same account took the nonce: the attested output is empty (Bytes<0>)
|
|
374
378
|
}
|
|
375
379
|
|
|
376
380
|
// The 32-byte attestation digest of a remote execution output:
|
|
377
381
|
// attestationDigest = upgradeFromTransient(transientHash([HashDomain.attestationDigest, requestId, blockHeight, outputKind, serializedOutputLength, serializedOutput]))
|
|
378
|
-
// blockHeight is the height of the finalised
|
|
379
|
-
// transaction the attestation describes, in the
|
|
382
|
+
// blockHeight is the height of the finalised target-chain block holding the
|
|
383
|
+
// transaction the attestation describes, in the target chain's own
|
|
380
384
|
// numbering (a slot on Solana).
|
|
381
385
|
// Off-chain code uses the TypeScript twin:
|
|
382
386
|
// import { calculateSignetAttestationDigest } from "@sig-net/midnight/testing";
|
|
@@ -431,7 +435,7 @@ module Signet {
|
|
|
431
435
|
// ---- EVM Type2 Transaction Parameters --------------------------------------------------------------
|
|
432
436
|
|
|
433
437
|
// The caip2Id of every request targeting Ethereum, whichever Ethereum network the
|
|
434
|
-
// MPC
|
|
438
|
+
// MPC deployment watches (mainnet, Sepolia or a local anvil: set per deployment).
|
|
435
439
|
// The MPC routes on this exact string (Chain::Ethereum in sig-net/mpc
|
|
436
440
|
// signet-primitives/src/chain.rs) and rejects the request for any other value,
|
|
437
441
|
// the network's own CAIP-2 id included. EvmType2TxParams.chainId is what binds
|
|
@@ -462,7 +466,7 @@ module Signet {
|
|
|
462
466
|
maxPriorityFeePerGas: Uint<128>; // wei
|
|
463
467
|
maxFeePerGas: Uint<128>; // wei
|
|
464
468
|
gasLimit: Uint<64>; // gas ceiling for the call
|
|
465
|
-
to: Bytes<20>; //
|
|
469
|
+
to: Bytes<20>; // recipient (e.g. the ERC20 contract)
|
|
466
470
|
value: Uint<128>; // ETH sent with the call, in wei
|
|
467
471
|
calldata: Maybe<EvmCalldata<maxCalldataWords>>; // none = plain ETH transfer ("0x" data)
|
|
468
472
|
accessListEntryCount: Uint<8>; // how many leading accessList entries are real
|