@sig-net/midnight 0.21.0-rc.8 → 0.21.0
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 +5 -3
- package/dist/constants.d.ts +5 -4
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +12 -7
- package/dist/constants.js.map +1 -1
- package/dist/ecdsa-attestation.d.ts +37 -8
- package/dist/ecdsa-attestation.d.ts.map +1 -1
- package/dist/ecdsa-attestation.js +88 -15
- package/dist/ecdsa-attestation.js.map +1 -1
- package/dist/epsilon-derivation.d.ts +21 -17
- package/dist/epsilon-derivation.d.ts.map +1 -1
- package/dist/epsilon-derivation.js +32 -29
- package/dist/epsilon-derivation.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/managed/compiler/contract-info.json +20 -4
- package/dist/managed/compiler/contract-manifest.json +11 -11
- package/dist/managed/contract/index.d.ts +2 -0
- package/dist/managed/contract/index.js +55 -46
- package/dist/managed/contract/index.js.map +1 -1
- package/dist/signet-evtype2tx-requests.d.ts +1 -1
- package/dist/signet-evtype2tx-requests.d.ts.map +1 -1
- package/package.json +7 -6
- package/src/Signet.compact +16 -3
- package/src/circuits.compact +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./abi-serde.ts";
|
|
2
2
|
export { bigintToBytes32, bigintToBytes32BE, BLS_ORDER, bytesToBigint, bytesToBigintBE, bytesToHex, hexToBytes, stripHexPrefix, } from "./byte-codecs.ts";
|
|
3
3
|
export * from "./constants.ts";
|
|
4
|
-
export { deriveEpsilon, deriveEvmAddress, deriveMidnightResponseKey, EPSILON_DERIVATION_PREFIX,
|
|
4
|
+
export { deriveEpsilon, deriveEvmAddress, deriveMidnightResponseKey, EPSILON_DERIVATION_PREFIX, MIDNIGHT_CAIP2_ID, MIDNIGHT_RESPOND_BIDIRECTIONAL_PATH, } from "./epsilon-derivation.ts";
|
|
5
5
|
export { type RawContractState, signetFieldNodeByPath } from "./raw-contract-state.ts";
|
|
6
6
|
export * from "./signature-requests-state-reader.ts";
|
|
7
7
|
export * from "./signature-response-verification.ts";
|
|
@@ -10,7 +10,7 @@ export { abiWordToBool, abiWordToUint128, assembleCalldata, boolAbiWord, type Ev
|
|
|
10
10
|
export { calculateRequestId } from "./signet-request-id.ts";
|
|
11
11
|
export * from "./signet-request-response-reader.ts";
|
|
12
12
|
export { type ContractAddress, contractAddressFromHex, type Maybe, MPCDestination, MPCSignatureAlgorithm, parseRequestIdHex, PATH_BYTES, type RequestId, requestIdBytes, type RequestIdHex, requestIdHex, type SignBidirectionalEvent, type SignBidirectionalEventIndex, type SignBidirectionalEventLedgerMap, toSignBidirectionalEventIndex, TxParamType, } from "./signet-requests.ts";
|
|
13
|
-
export { formatSecp256k1PublicKey, parseSecp256k1PublicKey, respondBidirectionalEventToCircuitInput, SECP256K1_ORDER, type Secp256k1Point, signatureRespondedEventToSignature, verifyRespondBidirectionalSignature, } from "./ecdsa-attestation.ts";
|
|
13
|
+
export { formatSecp256k1PublicKey, normaliseSecp256k1PublicKey, parseSecp256k1PublicKey, respondBidirectionalEventToCircuitInput, SECP256K1_ORDER, type Secp256k1Point, signatureRespondedEventToSignature, verifyRespondBidirectionalSignature, } from "./ecdsa-attestation.ts";
|
|
14
14
|
/**
|
|
15
15
|
* Compiled pure circuits of Signet.compact (run `yarn compile` first).
|
|
16
16
|
* Off-chain code MUST use these instead of re-porting the algorithms:
|
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,yBAAyB,EACzB,yBAAyB,EACzB,
|
|
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,yBAAyB,EACzB,yBAAyB,EACzB,iBAAiB,EACjB,mCAAmC,GACpC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACvF,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,cAAc,EACd,4CAA4C,EAC5C,8CAA8C,GAC/C,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,cAAc,qCAAqC,CAAC;AACpD,OAAO,EACL,KAAK,eAAe,EACpB,sBAAsB,EACtB,KAAK,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,UAAU,EACV,KAAK,SAAS,EACd,cAAc,EACd,KAAK,YAAY,EACjB,YAAY,EACZ,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,+BAA+B,EACpC,6BAA6B,EAC7B,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,uBAAuB,EACvB,uCAAuC,EACvC,eAAe,EACf,KAAK,cAAc,EACnB,kCAAkC,EAClC,mCAAmC,GACpC,MAAM,wBAAwB,CAAC;AAEhC;;;;GAIG;AACH,OAAO,EAAE,KAAK,YAAY,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ export { bigintToBytes32, bigintToBytes32BE, BLS_ORDER, bytesToBigint, bytesToBi
|
|
|
9
9
|
export * from "./constants.js";
|
|
10
10
|
// Selective: deriveMidnightResponseSecretKey takes the MPC root secret, so
|
|
11
11
|
// it is exported through ./testing with the other secret-taking helpers.
|
|
12
|
-
export { deriveEpsilon, deriveEvmAddress, deriveMidnightResponseKey, EPSILON_DERIVATION_PREFIX,
|
|
12
|
+
export { deriveEpsilon, deriveEvmAddress, deriveMidnightResponseKey, EPSILON_DERIVATION_PREFIX, MIDNIGHT_CAIP2_ID, MIDNIGHT_RESPOND_BIDIRECTIONAL_PATH, } from "./epsilon-derivation.js";
|
|
13
13
|
export { signetFieldNodeByPath } from "./raw-contract-state.js";
|
|
14
14
|
export * from "./signature-requests-state-reader.js";
|
|
15
15
|
export * from "./signature-response-verification.js";
|
|
@@ -20,8 +20,9 @@ export * from "./signet-request-response-reader.js";
|
|
|
20
20
|
export { contractAddressFromHex, MPCDestination, MPCSignatureAlgorithm, parseRequestIdHex, PATH_BYTES, requestIdBytes, requestIdHex, toSignBidirectionalEventIndex, TxParamType, } from "./signet-requests.js";
|
|
21
21
|
// Explicit list: ecdsa-attestation.ts also backs the ./testing entry point
|
|
22
22
|
// (the attestation-minting helpers that take a secret key live THERE), and
|
|
23
|
-
// its record decoder (mpcSignatureToEcdsaSignature)
|
|
24
|
-
|
|
23
|
+
// its record decoder (mpcSignatureToEcdsaSignature) and noble-point parser
|
|
24
|
+
// (parseSecp256k1PublicKeyToNoblePoint) are package-internal.
|
|
25
|
+
export { formatSecp256k1PublicKey, normaliseSecp256k1PublicKey, parseSecp256k1PublicKey, respondBidirectionalEventToCircuitInput, SECP256K1_ORDER, signatureRespondedEventToSignature, verifyRespondBidirectionalSignature, } from "./ecdsa-attestation.js";
|
|
25
26
|
/**
|
|
26
27
|
* Compiled pure circuits of Signet.compact (run `yarn compile` first).
|
|
27
28
|
* Off-chain code MUST use these instead of re-porting the algorithms:
|
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,gBAAgB,CAAC;AAC/B,2EAA2E;AAC3E,yEAAyE;AACzE,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,yBAAyB,EACzB,yBAAyB,EACzB,
|
|
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,gBAAgB,CAAC;AAC/B,2EAA2E;AAC3E,yEAAyE;AACzE,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,yBAAyB,EACzB,yBAAyB,EACzB,iBAAiB,EACjB,mCAAmC,GACpC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAyB,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACvF,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EAEX,iBAAiB,EAGjB,cAAc,EACd,4CAA4C,EAC5C,8CAA8C,GAC/C,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,cAAc,qCAAqC,CAAC;AACpD,OAAO,EAEL,sBAAsB,EAEtB,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,UAAU,EAEV,cAAc,EAEd,YAAY,EAIZ,6BAA6B,EAC7B,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,2EAA2E;AAC3E,2EAA2E;AAC3E,2EAA2E;AAC3E,8DAA8D;AAC9D,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,uBAAuB,EACvB,uCAAuC,EACvC,eAAe,EAEf,kCAAkC,EAClC,mCAAmC,GACpC,MAAM,wBAAwB,CAAC;AAEhC;;;;GAIG;AACH,OAAO,EAAqB,YAAY,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"compiler-version": "0.
|
|
3
|
-
"language-version": "0.
|
|
4
|
-
"runtime-version": "0.
|
|
2
|
+
"compiler-version": "0.33.0",
|
|
3
|
+
"language-version": "0.25.0",
|
|
4
|
+
"runtime-version": "0.18.0-rc.1",
|
|
5
5
|
"circuits": [
|
|
6
6
|
{
|
|
7
7
|
"name": "constructSignBidirectionalEventNotificationV1",
|
|
@@ -64,6 +64,17 @@
|
|
|
64
64
|
]
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
+
{
|
|
68
|
+
"name": "ethereumCaip2Id",
|
|
69
|
+
"pure": true,
|
|
70
|
+
"proof": false,
|
|
71
|
+
"arguments": [
|
|
72
|
+
],
|
|
73
|
+
"result-type": {
|
|
74
|
+
"type-name": "Bytes",
|
|
75
|
+
"length": 32
|
|
76
|
+
}
|
|
77
|
+
},
|
|
67
78
|
{
|
|
68
79
|
"name": "evmAddressAbiWord",
|
|
69
80
|
"pure": true,
|
|
@@ -320,7 +331,12 @@
|
|
|
320
331
|
{
|
|
321
332
|
"name": "mpcResponseKey",
|
|
322
333
|
"type": {
|
|
323
|
-
"type-name": "
|
|
334
|
+
"type-name": "Alias",
|
|
335
|
+
"name": "Secp256k1Point",
|
|
336
|
+
"type": {
|
|
337
|
+
"type-name": "Opaque",
|
|
338
|
+
"tsType": "Secp256k1Point"
|
|
339
|
+
}
|
|
324
340
|
}
|
|
325
341
|
}
|
|
326
342
|
],
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest-version": "1",
|
|
3
|
-
"compiler-version": "0.
|
|
4
|
-
"language-version": "0.
|
|
5
|
-
"runtime-version": "0.
|
|
3
|
+
"compiler-version": "0.33.0",
|
|
4
|
+
"language-version": "0.25.0",
|
|
5
|
+
"runtime-version": "0.18.0-rc.1",
|
|
6
6
|
"compiler": {
|
|
7
7
|
"type": "directory",
|
|
8
8
|
"contract-info.json": {
|
|
9
9
|
"type": "file",
|
|
10
|
-
"size":
|
|
11
|
-
"hash": "
|
|
10
|
+
"size": 7940,
|
|
11
|
+
"hash": "ddb43aa351cab8b4e6a93df7d97efc0a13c71995b3371f18d2f42ee153babe41"
|
|
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": 6430,
|
|
19
|
+
"hash": "defcd9964cb7d9cb1f4819717538eeca53c9c6bbca6706091ce5cf861d6c1a49"
|
|
20
20
|
},
|
|
21
21
|
"index.js": {
|
|
22
22
|
"type": "file",
|
|
23
|
-
"size":
|
|
24
|
-
"hash": "
|
|
23
|
+
"size": 39549,
|
|
24
|
+
"hash": "4620859c4a17c1188e4c5a665b292181a1cc2547d609abe5562b677d9ef8e99d"
|
|
25
25
|
},
|
|
26
26
|
"index.js.map": {
|
|
27
27
|
"type": "file",
|
|
28
|
-
"size":
|
|
29
|
-
"hash": "
|
|
28
|
+
"size": 4395,
|
|
29
|
+
"hash": "a9ec65ad9479d1d2546caf2c3957e7694d5cfb522afc7f143253d68f08682b79"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -16,6 +16,7 @@ export type PureCircuits = {
|
|
|
16
16
|
requestsPath_0: bigint[]): { version: bigint,
|
|
17
17
|
payload: Uint8Array
|
|
18
18
|
};
|
|
19
|
+
ethereumCaip2Id(): Uint8Array;
|
|
19
20
|
evmAddressAbiWord(addr_0: Uint8Array): Uint8Array;
|
|
20
21
|
numericAbiWord(value_0: bigint): Uint8Array;
|
|
21
22
|
boolAbiWord(value_0: boolean): Uint8Array;
|
|
@@ -47,6 +48,7 @@ export type Circuits<PS> = {
|
|
|
47
48
|
requestsPath_0: bigint[]): Promise<__compactRuntime.CircuitResults<PS, { version: bigint,
|
|
48
49
|
payload: Uint8Array
|
|
49
50
|
}>>;
|
|
51
|
+
ethereumCaip2Id(context: __compactRuntime.CircuitContext<PS>): Promise<__compactRuntime.CircuitResults<PS, Uint8Array>>;
|
|
50
52
|
evmAddressAbiWord(context: __compactRuntime.CircuitContext<PS>,
|
|
51
53
|
addr_0: Uint8Array): Promise<__compactRuntime.CircuitResults<PS, Uint8Array>>;
|
|
52
54
|
numericAbiWord(context: __compactRuntime.CircuitContext<PS>, value_0: bigint): Promise<__compactRuntime.CircuitResults<PS, Uint8Array>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as __compactRuntime from '@midnight-ntwrk/compact-runtime';
|
|
2
|
-
__compactRuntime.checkRuntimeVersion('0.
|
|
2
|
+
__compactRuntime.checkRuntimeVersion('0.18.0-rc.1');
|
|
3
3
|
|
|
4
4
|
const _descriptor_0 = new __compactRuntime.CompactTypeBytes(32);
|
|
5
5
|
|
|
@@ -68,8 +68,6 @@ const _descriptor_9 = new __compactRuntime.CompactTypeUnsignedInteger(3402823669
|
|
|
68
68
|
|
|
69
69
|
const _descriptor_10 = new __compactRuntime.CompactTypeBytes(20);
|
|
70
70
|
|
|
71
|
-
const _descriptor_11 = __compactRuntime.CompactTypeSecp256k1Scalar;
|
|
72
|
-
|
|
73
71
|
class _ContractAddress_0 {
|
|
74
72
|
alignment() {
|
|
75
73
|
return _descriptor_0.alignment();
|
|
@@ -84,28 +82,30 @@ class _ContractAddress_0 {
|
|
|
84
82
|
}
|
|
85
83
|
}
|
|
86
84
|
|
|
87
|
-
const
|
|
85
|
+
const _descriptor_11 = new _ContractAddress_0();
|
|
88
86
|
|
|
89
|
-
const
|
|
87
|
+
const _descriptor_12 = new __compactRuntime.CompactTypeVector(4, _descriptor_2);
|
|
90
88
|
|
|
91
|
-
const
|
|
89
|
+
const _descriptor_13 = new __compactRuntime.CompactTypeBytes(128);
|
|
92
90
|
|
|
93
91
|
class _SignBidirectionalEventNotification_0 {
|
|
94
92
|
alignment() {
|
|
95
|
-
return _descriptor_2.alignment().concat(
|
|
93
|
+
return _descriptor_2.alignment().concat(_descriptor_13.alignment());
|
|
96
94
|
}
|
|
97
95
|
fromValue(value_0) {
|
|
98
96
|
return {
|
|
99
97
|
version: _descriptor_2.fromValue(value_0),
|
|
100
|
-
payload:
|
|
98
|
+
payload: _descriptor_13.fromValue(value_0)
|
|
101
99
|
}
|
|
102
100
|
}
|
|
103
101
|
toValue(value_0) {
|
|
104
|
-
return _descriptor_2.toValue(value_0.version).concat(
|
|
102
|
+
return _descriptor_2.toValue(value_0.version).concat(_descriptor_13.toValue(value_0.payload));
|
|
105
103
|
}
|
|
106
104
|
}
|
|
107
105
|
|
|
108
|
-
const
|
|
106
|
+
const _descriptor_14 = new _SignBidirectionalEventNotification_0();
|
|
107
|
+
|
|
108
|
+
const _descriptor_15 = __compactRuntime.CompactTypeSecp256k1Scalar;
|
|
109
109
|
|
|
110
110
|
const _descriptor_16 = __compactRuntime.CompactTypeSecp256k1Base;
|
|
111
111
|
|
|
@@ -164,16 +164,16 @@ const _descriptor_20 = new _tuple_2();
|
|
|
164
164
|
|
|
165
165
|
class _Secp256k1EcdsaSignature_0 {
|
|
166
166
|
alignment() {
|
|
167
|
-
return
|
|
167
|
+
return _descriptor_15.alignment().concat(_descriptor_15.alignment());
|
|
168
168
|
}
|
|
169
169
|
fromValue(value_0) {
|
|
170
170
|
return {
|
|
171
|
-
r:
|
|
172
|
-
s:
|
|
171
|
+
r: _descriptor_15.fromValue(value_0),
|
|
172
|
+
s: _descriptor_15.fromValue(value_0)
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
toValue(value_0) {
|
|
176
|
-
return
|
|
176
|
+
return _descriptor_15.toValue(value_0.r).concat(_descriptor_15.toValue(value_0.s));
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
|
|
@@ -216,6 +216,9 @@ export class Contract {
|
|
|
216
216
|
async constructSignBidirectionalEventNotificationV1(context, ...args_1) {
|
|
217
217
|
return { result: pureCircuits.constructSignBidirectionalEventNotificationV1(...args_1), context };
|
|
218
218
|
},
|
|
219
|
+
async ethereumCaip2Id(context, ...args_1) {
|
|
220
|
+
return { result: pureCircuits.ethereumCaip2Id(...args_1), context };
|
|
221
|
+
},
|
|
219
222
|
async evmAddressAbiWord(context, ...args_1) {
|
|
220
223
|
return { result: pureCircuits.evmAddressAbiWord(...args_1), context };
|
|
221
224
|
},
|
|
@@ -325,8 +328,8 @@ export class Contract {
|
|
|
325
328
|
const r_0 = __compact_pattern_tmp1_0.r;
|
|
326
329
|
const s_0 = __compact_pattern_tmp1_0.s;
|
|
327
330
|
const w_0 = this._inv_0(s_0);
|
|
328
|
-
const u1_0 =
|
|
329
|
-
const u2_0 =
|
|
331
|
+
const u1_0 = this._mul_0(z_0, w_0);
|
|
332
|
+
const u2_0 = this._mul_0(r_0, w_0);
|
|
330
333
|
const point_0 = this._ecAdd_0(this._ecMulGenerator_0(u1_0),
|
|
331
334
|
this._ecMul_0(pk_0, u2_0));
|
|
332
335
|
return __compactRuntime.convertBytesToField(115792089237316195423570985008687907852837564279074904382605163141518161494336n,
|
|
@@ -355,6 +358,10 @@ export class Contract {
|
|
|
355
358
|
const result_0 = __compactRuntime.upgradeFromTransient(x_0);
|
|
356
359
|
return result_0;
|
|
357
360
|
}
|
|
361
|
+
_mul_0(x_0, y_0) {
|
|
362
|
+
const result_0 = __compactRuntime.secp256k1ScalarMul(x_0, y_0);
|
|
363
|
+
return result_0;
|
|
364
|
+
}
|
|
358
365
|
_inv_0(s_0) {
|
|
359
366
|
const result_0 = __compactRuntime.secp256k1ScalarInv(s_0);
|
|
360
367
|
return result_0;
|
|
@@ -415,15 +422,18 @@ export class Contract {
|
|
|
415
422
|
32,
|
|
416
423
|
respondBidirectionalEvent_0.signature.bigR.x,
|
|
417
424
|
'Secp256k1Scalar',
|
|
418
|
-
'Signet.compact line
|
|
425
|
+
'Signet.compact line 347 char 12'),
|
|
419
426
|
s:
|
|
420
427
|
__compactRuntime.convertBytesToField(115792089237316195423570985008687907852837564279074904382605163141518161494336n,
|
|
421
428
|
32,
|
|
422
429
|
respondBidirectionalEvent_0.signature.s,
|
|
423
430
|
'Secp256k1Scalar',
|
|
424
|
-
'Signet.compact line
|
|
431
|
+
'Signet.compact line 348 char 12') },
|
|
425
432
|
mpcResponseKey_0);
|
|
426
433
|
}
|
|
434
|
+
_ethereumCaip2Id_0() {
|
|
435
|
+
return new Uint8Array([101, 105, 112, 49, 53, 53, 58, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
|
436
|
+
}
|
|
427
437
|
_evmAddressAbiWord_0(addr_0) {
|
|
428
438
|
return Uint8Array.from([...Array.from(new Uint8Array(12), BigInt),
|
|
429
439
|
...Array.from(addr_0, BigInt)],
|
|
@@ -432,7 +442,7 @@ export class Contract {
|
|
|
432
442
|
_numericAbiWord_0(value_0) {
|
|
433
443
|
const le_0 = Array.from(__compactRuntime.convertBigintToBytes(16,
|
|
434
444
|
value_0,
|
|
435
|
-
'Signet.compact line
|
|
445
|
+
'Signet.compact line 437 char 17'),
|
|
436
446
|
BigInt);
|
|
437
447
|
return Uint8Array.from([...Array.from(new Uint8Array(16), BigInt),
|
|
438
448
|
le_0[15],
|
|
@@ -514,7 +524,7 @@ export class Contract {
|
|
|
514
524
|
v_0[31]);
|
|
515
525
|
return ((t1) => {
|
|
516
526
|
if (t1 > 340282366920938463463374607431768211455n) {
|
|
517
|
-
throw new __compactRuntime.CompactError('Signet.compact line
|
|
527
|
+
throw new __compactRuntime.CompactError('Signet.compact line 489 char 12: cast from Field or Uint value to smaller Uint value failed: ' + t1 + ' is greater than 340282366920938463463374607431768211455');
|
|
518
528
|
}
|
|
519
529
|
return t1;
|
|
520
530
|
})(b15_0);
|
|
@@ -525,7 +535,7 @@ export class Contract {
|
|
|
525
535
|
((e, i) => e.slice(i, i+31))(word_0,
|
|
526
536
|
Number(0n)),
|
|
527
537
|
'Field',
|
|
528
|
-
'Signet.compact line
|
|
538
|
+
'Signet.compact line 495 char 12')
|
|
529
539
|
===
|
|
530
540
|
0n,
|
|
531
541
|
'ABI word is not a canonical Boolean');
|
|
@@ -534,7 +544,7 @@ export class Contract {
|
|
|
534
544
|
((e, i) => e.slice(i, i+1))(word_0,
|
|
535
545
|
Number(31n)),
|
|
536
546
|
'Field',
|
|
537
|
-
'Signet.compact line
|
|
547
|
+
'Signet.compact line 496 char 18');
|
|
538
548
|
__compactRuntime.assert(last_0 === 0n || last_0 === 1n,
|
|
539
549
|
'ABI word is not a canonical Boolean');
|
|
540
550
|
return last_0 === 1n;
|
|
@@ -593,21 +603,21 @@ export const pureCircuits = {
|
|
|
593
603
|
if (!(typeof(callerAddress_0) === 'object' && callerAddress_0.bytes.buffer instanceof ArrayBuffer && callerAddress_0.bytes.BYTES_PER_ELEMENT === 1 && callerAddress_0.bytes.length === 32)) {
|
|
594
604
|
__compactRuntime.typeError('constructSignBidirectionalEventNotificationV1',
|
|
595
605
|
'argument 1',
|
|
596
|
-
'Signet.compact line
|
|
606
|
+
'Signet.compact line 240 char 3',
|
|
597
607
|
'struct ContractAddress<bytes: Bytes<32>>',
|
|
598
608
|
callerAddress_0)
|
|
599
609
|
}
|
|
600
610
|
if (!(typeof(requestsPathDepth_0) === 'bigint' && requestsPathDepth_0 >= 0n && requestsPathDepth_0 <= 255n)) {
|
|
601
611
|
__compactRuntime.typeError('constructSignBidirectionalEventNotificationV1',
|
|
602
612
|
'argument 2',
|
|
603
|
-
'Signet.compact line
|
|
613
|
+
'Signet.compact line 240 char 3',
|
|
604
614
|
'Uint<0..256>',
|
|
605
615
|
requestsPathDepth_0)
|
|
606
616
|
}
|
|
607
617
|
if (!(Array.isArray(requestsPath_0) && requestsPath_0.length === 4 && requestsPath_0.every((t) => typeof(t) === 'bigint' && t >= 0n && t <= 255n))) {
|
|
608
618
|
__compactRuntime.typeError('constructSignBidirectionalEventNotificationV1',
|
|
609
619
|
'argument 3',
|
|
610
|
-
'Signet.compact line
|
|
620
|
+
'Signet.compact line 240 char 3',
|
|
611
621
|
'Vector<4, Uint<0..256>>',
|
|
612
622
|
requestsPath_0)
|
|
613
623
|
}
|
|
@@ -615,6 +625,12 @@ export const pureCircuits = {
|
|
|
615
625
|
requestsPathDepth_0,
|
|
616
626
|
requestsPath_0);
|
|
617
627
|
},
|
|
628
|
+
ethereumCaip2Id: (...args_0) => {
|
|
629
|
+
if (args_0.length !== 0) {
|
|
630
|
+
throw new __compactRuntime.CompactError(`ethereumCaip2Id: expected 0 arguments (as invoked from Typescript), received ${args_0.length}`);
|
|
631
|
+
}
|
|
632
|
+
return _dummyContract._ethereumCaip2Id_0();
|
|
633
|
+
},
|
|
618
634
|
evmAddressAbiWord: (...args_0) => {
|
|
619
635
|
if (args_0.length !== 1) {
|
|
620
636
|
throw new __compactRuntime.CompactError(`evmAddressAbiWord: expected 1 argument (as invoked from Typescript), received ${args_0.length}`);
|
|
@@ -623,7 +639,7 @@ export const pureCircuits = {
|
|
|
623
639
|
if (!(addr_0.buffer instanceof ArrayBuffer && addr_0.BYTES_PER_ELEMENT === 1 && addr_0.length === 20)) {
|
|
624
640
|
__compactRuntime.typeError('evmAddressAbiWord',
|
|
625
641
|
'argument 1',
|
|
626
|
-
'Signet.compact line
|
|
642
|
+
'Signet.compact line 428 char 3',
|
|
627
643
|
'Bytes<20>',
|
|
628
644
|
addr_0)
|
|
629
645
|
}
|
|
@@ -637,7 +653,7 @@ export const pureCircuits = {
|
|
|
637
653
|
if (!(typeof(value_0) === 'bigint' && value_0 >= 0n && value_0 <= 340282366920938463463374607431768211455n)) {
|
|
638
654
|
__compactRuntime.typeError('numericAbiWord',
|
|
639
655
|
'argument 1',
|
|
640
|
-
'Signet.compact line
|
|
656
|
+
'Signet.compact line 434 char 3',
|
|
641
657
|
'Uint<0..340282366920938463463374607431768211456>',
|
|
642
658
|
value_0)
|
|
643
659
|
}
|
|
@@ -651,7 +667,7 @@ export const pureCircuits = {
|
|
|
651
667
|
if (!(typeof(value_0) === 'boolean')) {
|
|
652
668
|
__compactRuntime.typeError('boolAbiWord',
|
|
653
669
|
'argument 1',
|
|
654
|
-
'Signet.compact line
|
|
670
|
+
'Signet.compact line 447 char 3',
|
|
655
671
|
'Boolean',
|
|
656
672
|
value_0)
|
|
657
673
|
}
|
|
@@ -665,7 +681,7 @@ export const pureCircuits = {
|
|
|
665
681
|
if (!(word_0.buffer instanceof ArrayBuffer && word_0.BYTES_PER_ELEMENT === 1 && word_0.length === 32)) {
|
|
666
682
|
__compactRuntime.typeError('abiWordToUint128',
|
|
667
683
|
'argument 1',
|
|
668
|
-
'Signet.compact line
|
|
684
|
+
'Signet.compact line 455 char 3',
|
|
669
685
|
'Bytes<32>',
|
|
670
686
|
word_0)
|
|
671
687
|
}
|
|
@@ -679,7 +695,7 @@ export const pureCircuits = {
|
|
|
679
695
|
if (!(word_0.buffer instanceof ArrayBuffer && word_0.BYTES_PER_ELEMENT === 1 && word_0.length === 32)) {
|
|
680
696
|
__compactRuntime.typeError('abiWordToBool',
|
|
681
697
|
'argument 1',
|
|
682
|
-
'Signet.compact line
|
|
698
|
+
'Signet.compact line 494 char 3',
|
|
683
699
|
'Bytes<32>',
|
|
684
700
|
word_0)
|
|
685
701
|
}
|
|
@@ -694,14 +710,14 @@ export const pureCircuits = {
|
|
|
694
710
|
if (!(requestId_0.buffer instanceof ArrayBuffer && requestId_0.BYTES_PER_ELEMENT === 1 && requestId_0.length === 32)) {
|
|
695
711
|
__compactRuntime.typeError('calculateSignetAttestationDigest1',
|
|
696
712
|
'argument 1',
|
|
697
|
-
'circuits.compact line
|
|
713
|
+
'circuits.compact line 28 char 1',
|
|
698
714
|
'Bytes<32>',
|
|
699
715
|
requestId_0)
|
|
700
716
|
}
|
|
701
717
|
if (!(serializedOutput_0.buffer instanceof ArrayBuffer && serializedOutput_0.BYTES_PER_ELEMENT === 1 && serializedOutput_0.length === 1)) {
|
|
702
718
|
__compactRuntime.typeError('calculateSignetAttestationDigest1',
|
|
703
719
|
'argument 2',
|
|
704
|
-
'circuits.compact line
|
|
720
|
+
'circuits.compact line 28 char 1',
|
|
705
721
|
'Bytes<1>',
|
|
706
722
|
serializedOutput_0)
|
|
707
723
|
}
|
|
@@ -717,14 +733,14 @@ export const pureCircuits = {
|
|
|
717
733
|
if (!(requestId_0.buffer instanceof ArrayBuffer && requestId_0.BYTES_PER_ELEMENT === 1 && requestId_0.length === 32)) {
|
|
718
734
|
__compactRuntime.typeError('calculateSignetAttestationDigest32',
|
|
719
735
|
'argument 1',
|
|
720
|
-
'circuits.compact line
|
|
736
|
+
'circuits.compact line 35 char 1',
|
|
721
737
|
'Bytes<32>',
|
|
722
738
|
requestId_0)
|
|
723
739
|
}
|
|
724
740
|
if (!(serializedOutput_0.buffer instanceof ArrayBuffer && serializedOutput_0.BYTES_PER_ELEMENT === 1 && serializedOutput_0.length === 32)) {
|
|
725
741
|
__compactRuntime.typeError('calculateSignetAttestationDigest32',
|
|
726
742
|
'argument 2',
|
|
727
|
-
'circuits.compact line
|
|
743
|
+
'circuits.compact line 35 char 1',
|
|
728
744
|
'Bytes<32>',
|
|
729
745
|
serializedOutput_0)
|
|
730
746
|
}
|
|
@@ -740,14 +756,14 @@ export const pureCircuits = {
|
|
|
740
756
|
if (!(requestId_0.buffer instanceof ArrayBuffer && requestId_0.BYTES_PER_ELEMENT === 1 && requestId_0.length === 32)) {
|
|
741
757
|
__compactRuntime.typeError('calculateSignetAttestationDigest100',
|
|
742
758
|
'argument 1',
|
|
743
|
-
'circuits.compact line
|
|
759
|
+
'circuits.compact line 42 char 1',
|
|
744
760
|
'Bytes<32>',
|
|
745
761
|
requestId_0)
|
|
746
762
|
}
|
|
747
763
|
if (!(serializedOutput_0.buffer instanceof ArrayBuffer && serializedOutput_0.BYTES_PER_ELEMENT === 1 && serializedOutput_0.length === 100)) {
|
|
748
764
|
__compactRuntime.typeError('calculateSignetAttestationDigest100',
|
|
749
765
|
'argument 2',
|
|
750
|
-
'circuits.compact line
|
|
766
|
+
'circuits.compact line 42 char 1',
|
|
751
767
|
'Bytes<100>',
|
|
752
768
|
serializedOutput_0)
|
|
753
769
|
}
|
|
@@ -765,31 +781,24 @@ export const pureCircuits = {
|
|
|
765
781
|
if (!(requestId_0.buffer instanceof ArrayBuffer && requestId_0.BYTES_PER_ELEMENT === 1 && requestId_0.length === 32)) {
|
|
766
782
|
__compactRuntime.typeError('verifyRespondBidirectionalEvent32',
|
|
767
783
|
'argument 1',
|
|
768
|
-
'circuits.compact line
|
|
784
|
+
'circuits.compact line 49 char 1',
|
|
769
785
|
'Bytes<32>',
|
|
770
786
|
requestId_0)
|
|
771
787
|
}
|
|
772
788
|
if (!(serializedOutput_0.buffer instanceof ArrayBuffer && serializedOutput_0.BYTES_PER_ELEMENT === 1 && serializedOutput_0.length === 32)) {
|
|
773
789
|
__compactRuntime.typeError('verifyRespondBidirectionalEvent32',
|
|
774
790
|
'argument 2',
|
|
775
|
-
'circuits.compact line
|
|
791
|
+
'circuits.compact line 49 char 1',
|
|
776
792
|
'Bytes<32>',
|
|
777
793
|
serializedOutput_0)
|
|
778
794
|
}
|
|
779
795
|
if (!(typeof(respondBidirectionalEvent_0) === 'object' && 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)) {
|
|
780
796
|
__compactRuntime.typeError('verifyRespondBidirectionalEvent32',
|
|
781
797
|
'argument 3',
|
|
782
|
-
'circuits.compact line
|
|
798
|
+
'circuits.compact line 49 char 1',
|
|
783
799
|
'struct RespondBidirectionalEvent<signature: struct Signature<bigR: struct AffinePoint<x: Bytes<32>, y: Bytes<32>>, s: Bytes<32>, recoveryId: Uint<0..256>>>',
|
|
784
800
|
respondBidirectionalEvent_0)
|
|
785
801
|
}
|
|
786
|
-
if (!(typeof(mpcResponseKey_0.x) === 'bigint' && typeof(mpcResponseKey_0.y) === 'bigint' && typeof(mpcResponseKey_0.identity) == 'boolean')) {
|
|
787
|
-
__compactRuntime.typeError('verifyRespondBidirectionalEvent32',
|
|
788
|
-
'argument 4',
|
|
789
|
-
'circuits.compact line 48 char 1',
|
|
790
|
-
'Secp256k1Point',
|
|
791
|
-
mpcResponseKey_0)
|
|
792
|
-
}
|
|
793
802
|
return _dummyContract._verifyRespondBidirectionalEvent32_0(requestId_0,
|
|
794
803
|
serializedOutput_0,
|
|
795
804
|
respondBidirectionalEvent_0,
|
|
@@ -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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;;;;;
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;;;;;MC+OE,MAAA,6CAsBC;;OAAA;MAqGD,MAAA,eAEC;;OAAA;MA+DD,MAAA,iBAEC;;OAAA;MAID,MAAA,cASC;;OAAA;MAID,MAAA,WAEC;;OAAA;MAMD,MAAA,gBAmCC;;OAAA;MAID,MAAA,aAKC;;OAAA;MDvdH,MAAA,iCAKC;;OAAA;MAED,MAAA,kCAKC;;OAAA;MAED,MAAA,mCA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+B,OAAc;;;;;;;;yCAAd,OAAc;GAE7C;EAMD,AAAA,gBAmCC;;;;UAnCoC,MAAe;;;;;;;;8CAAf,MAAe;GAmCnD;EAID,AAAA,aAKC;;;;UALiC,MAAe;;;;;;;;2CAAf,MAAe;GAKhD;EDvdH,AAAA,iCAKC;;;;UAJC,WAAoB;UACpB,kBAA0B;;;;;;;;;;;;;;;+DAD1B,WAAoB;+DACpB,kBAA0B;GAG3B;EAED,AAAA,kCAKC;;;;UAJC,WAAoB;UACpB,kBAA2B;;;;;;;;;;;;;;;gEAD3B,WAAoB;gEACpB,kBAA2B;GAG5B;EAED,AAAA,mCAKC;;;;UAJC,WAAoB;UACpB,kBAA4B;;;;;;;;;;;;;;;iEAD5B,WAAoB;iEACpB,kBAA4B;GAG7B;EAED,AAAA,iCAYC;;;;UAXC,WAAoB;UACpB,kBAA2B;UAC3B,2BAAoD;UACpD,gBAA8B;;;;;;;;;;;;;;;;;;;;;;+DAH9B,WAAoB;+DACpB,kBAA2B;+DAC3B,2BAAoD;+DACpD,gBAA8B;GAQ/B;;;;;;"
|
|
8
8
|
}
|
|
@@ -41,7 +41,7 @@ export interface EvmAccessListEntry {
|
|
|
41
41
|
* leading slots are real.
|
|
42
42
|
*/
|
|
43
43
|
export interface EvmType2TxParams {
|
|
44
|
-
/**
|
|
44
|
+
/** EIP-155 chain id of the network the signed transaction is valid on. */
|
|
45
45
|
chainId: bigint;
|
|
46
46
|
/** Account nonce of the MPC-derived sender address. */
|
|
47
47
|
nonce: bigint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signet-evtype2tx-requests.d.ts","sourceRoot":"","sources":["../src/signet-evtype2tx-requests.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAc,WAAW,EAAE,MAAM,QAAQ,CAAC;AAGjD,OAAO,EAML,KAAK,KAAK,EAKX,MAAM,0BAA0B,CAAC;AAElC,OA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uBAAuB,EAAE,MAAM,GAC9B,WAAW,CAAC,sBAAsB,CAAC,CAMrC;AAID;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAExD;AAED;;;;;;;;GAQG;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;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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sig-net/midnight",
|
|
3
|
-
"version": "0.21.0
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/sig-net/midnight-integration",
|
|
@@ -46,18 +46,19 @@
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@midnight-ntwrk/compact-runtime": "0.
|
|
50
|
-
"@midnight-ntwrk/midnight-js-types": "5.0.0-beta.
|
|
49
|
+
"@midnight-ntwrk/compact-runtime": "0.18.0-rc.1",
|
|
50
|
+
"@midnight-ntwrk/midnight-js-types": "5.0.0-beta.6",
|
|
51
51
|
"@noble/curves": "^2.2.0",
|
|
52
|
-
"@sig-net/midnight-serde": "^0.21.0
|
|
52
|
+
"@sig-net/midnight-serde": "^0.21.0",
|
|
53
53
|
"ethers": "^6.17.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/node": "^26.1.0",
|
|
57
|
-
"@vitest/coverage-v8": "^
|
|
57
|
+
"@vitest/coverage-v8": "^5.0.0",
|
|
58
58
|
"tsx": "^4.23.0",
|
|
59
59
|
"typescript": "^7.0.2",
|
|
60
|
-
"
|
|
60
|
+
"vite": "^8.2.2",
|
|
61
|
+
"vitest": "^5.0.0"
|
|
61
62
|
},
|
|
62
63
|
"main": "./dist/index.js",
|
|
63
64
|
"types": "./dist/index.d.ts"
|
package/src/Signet.compact
CHANGED
|
@@ -96,8 +96,10 @@ module Signet {
|
|
|
96
96
|
// Specific destination chain Transaction parameters.
|
|
97
97
|
txParamType: TxParamType; // Off-chain tag indicating what type txParams is set to.
|
|
98
98
|
txParams: TxParams; // The generic transaction-param payload
|
|
99
|
-
caip2Id: Bytes<32>; //
|
|
100
|
-
// (https://chainagnostic.org/CAIPs/caip-2)
|
|
99
|
+
caip2Id: Bytes<32>; // The MPC's routing key for the target chain, in CAIP-2 form
|
|
100
|
+
// (https://chainagnostic.org/CAIPs/caip-2). An Ethereum target
|
|
101
|
+
// (mainnet, Sepolia or a local anvil) uses ethereumCaip2Id():
|
|
102
|
+
// the network itself is txParams' chainId.
|
|
101
103
|
|
|
102
104
|
// Serialisation Schemas.
|
|
103
105
|
// outputDeserializationSchema tells the MPC how to deserialise the destination chain's
|
|
@@ -351,6 +353,17 @@ module Signet {
|
|
|
351
353
|
|
|
352
354
|
// ---- EVM Type2 Transaction Parameters --------------------------------------------------------------
|
|
353
355
|
|
|
356
|
+
// The caip2Id of every request targeting Ethereum, whichever Ethereum network the
|
|
357
|
+
// MPC node watches (mainnet, Sepolia or a local anvil: node configuration picks it).
|
|
358
|
+
// The MPC routes on this exact string (Chain::Ethereum in sig-net/mpc
|
|
359
|
+
// signet-primitives/src/chain.rs) and rejects the request for any other value,
|
|
360
|
+
// the network's own CAIP-2 id included. EvmType2TxParams.chainId is what binds
|
|
361
|
+
// the signed transaction to one network. Ethereum only: another EVM chain, such as
|
|
362
|
+
// BNB Smart Chain, is a separate chain to the MPC, never one of Ethereum's networks.
|
|
363
|
+
export pure circuit ethereumCaip2Id(): Bytes<32> {
|
|
364
|
+
return pad(32, "eip155:1");
|
|
365
|
+
}
|
|
366
|
+
|
|
354
367
|
// The EVM transaction to be signed, decomposed into typed fields
|
|
355
368
|
// (EIP-1559 / type-2: https://eips.ethereum.org/EIPS/eip-1559) so the
|
|
356
369
|
// requesting contract can enforce invariants field by field. The MPC
|
|
@@ -366,7 +379,7 @@ module Signet {
|
|
|
366
379
|
// KEY: texual order of the fields in this structure must remain fixed as is as their order
|
|
367
380
|
// is relied upon for consistent hashing and decoding from ledger state.
|
|
368
381
|
export struct EvmType2TxParams<#maxCalldataWords, #maxAccessListEntries, #maxStorageKeysPerEntry> {
|
|
369
|
-
chainId: Uint<64>; //
|
|
382
|
+
chainId: Uint<64>; // EIP-155 chain id of the network the signed tx is valid on
|
|
370
383
|
nonce: Uint<64>; // account nonce of the derived sender
|
|
371
384
|
maxPriorityFeePerGas: Uint<128>; // wei
|
|
372
385
|
maxFeePerGas: Uint<128>; // wei
|