@sig-net/midnight 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/managed/compiler/contract-info.json +57 -0
- package/dist/managed/compiler/contract-manifest.json +8 -8
- package/dist/managed/contract/index.d.ts +13 -0
- package/dist/managed/contract/index.js +138 -73
- package/dist/managed/contract/index.js.map +1 -1
- package/dist/signature-requests-state-reader.d.ts +5 -5
- package/dist/signature-requests-state-reader.js +5 -5
- package/dist/signet-contract-state-reader.d.ts +88 -2
- package/dist/signet-contract-state-reader.d.ts.map +1 -1
- package/dist/signet-contract-state-reader.js +106 -3
- package/dist/signet-contract-state-reader.js.map +1 -1
- package/dist/signet-request-feed.d.ts +40 -21
- package/dist/signet-request-feed.d.ts.map +1 -1
- package/dist/signet-request-feed.js +79 -34
- package/dist/signet-request-feed.js.map +1 -1
- package/dist/signet-request-resolver.d.ts +11 -11
- package/dist/signet-request-resolver.d.ts.map +1 -1
- package/dist/signet-request-resolver.js +22 -22
- package/dist/signet-request-resolver.js.map +1 -1
- package/dist/signet-requests.d.ts +18 -4
- package/dist/signet-requests.d.ts.map +1 -1
- package/dist/signet-requests.js +29 -6
- package/dist/signet-requests.js.map +1 -1
- package/package.json +1 -1
- package/src/Signet.compact +75 -99
- package/src/circuits.compact +5 -2
- package/src/index.ts +2 -4
- package/src/managed/compiler/contract-info.json +57 -0
- package/src/managed/compiler/contract-manifest.json +8 -8
- package/src/managed/contract/index.d.ts +13 -0
- package/src/managed/contract/index.js +138 -73
- package/src/managed/contract/index.js.map +1 -1
- package/src/signature-requests-state-reader.ts +5 -5
- package/src/signet-contract-state-reader.ts +200 -4
- package/src/signet-request-feed.ts +98 -48
- package/src/signet-request-resolver.ts +28 -28
- package/src/signet-requests.ts +31 -6
- package/dist/signet-event-observer.d.ts +0 -102
- package/dist/signet-event-observer.d.ts.map +0 -1
- package/dist/signet-event-observer.js +0 -127
- package/dist/signet-event-observer.js.map +0 -1
- package/dist/signet-events.d.ts +0 -175
- package/dist/signet-events.d.ts.map +0 -1
- package/dist/signet-events.js +0 -210
- package/dist/signet-events.js.map +0 -1
- package/dist/signet-response-feed.d.ts +0 -161
- package/dist/signet-response-feed.d.ts.map +0 -1
- package/dist/signet-response-feed.js +0 -234
- package/dist/signet-response-feed.js.map +0 -1
- package/src/signet-event-observer.ts +0 -186
- package/src/signet-events.ts +0 -337
- package/src/signet-response-feed.ts +0 -325
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SignBidirectionalNotification } from "./signet-contract-state-reader.ts";
|
|
2
2
|
import type { SignetPublicStateSource } from "./signet-request-response-reader.ts";
|
|
3
3
|
import type { RequestIdHex, SignBidirectionalRequest } from "./signet-requests.ts";
|
|
4
4
|
/**
|
|
5
|
-
* A {@link
|
|
6
|
-
* refers to: the request record read from `callerAddress`'s own
|
|
7
|
-
* `requestId` confirmed to be a member of that contract's index.
|
|
5
|
+
* A {@link SignBidirectionalNotification} resolved to the authenticated
|
|
6
|
+
* request it refers to: the request record read from `callerAddress`'s own
|
|
7
|
+
* ledger, with `requestId` confirmed to be a member of that contract's index.
|
|
8
8
|
*/
|
|
9
9
|
export interface ResolvedSignetRequest {
|
|
10
10
|
/**
|
|
11
11
|
* The contract whose authenticated state the request was read from — the
|
|
12
12
|
* epsilon-derivation predecessor. Key derivation keys off THIS, never off a
|
|
13
|
-
* field taken from the
|
|
13
|
+
* field taken from the notification on faith.
|
|
14
14
|
*/
|
|
15
15
|
callerAddress: string;
|
|
16
16
|
/** The request id, confirmed to be a member of `callerAddress`'s index. */
|
|
@@ -24,7 +24,7 @@ export interface SignetRequestResolverConfig {
|
|
|
24
24
|
readonly source: SignetPublicStateSource;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
* Resolves {@link
|
|
27
|
+
* Resolves {@link SignBidirectionalNotification}s to authenticated
|
|
28
28
|
* {@link ResolvedSignetRequest}s by reading the named caller's ledger and
|
|
29
29
|
* enforcing the membership check. Construct once and reuse: resolved records
|
|
30
30
|
* are immutable (their ledger key is their hash), so they are cached by request
|
|
@@ -47,12 +47,12 @@ export declare class SignetRequestResolver {
|
|
|
47
47
|
* Resolve a notification to its authenticated request, or `undefined` when it
|
|
48
48
|
* cannot be trusted: the caller contract has no state, or `requestId` is not
|
|
49
49
|
* a member of the index at `requestsIndexField` (forged, stale, wrong field,
|
|
50
|
-
* or not yet indexed — poll again). Never throws on an untrusted
|
|
51
|
-
* notification is dropped, not surfaced as an error.
|
|
50
|
+
* or not yet indexed — poll again). Never throws on an untrusted
|
|
51
|
+
* notification; a bad one is dropped, not surfaced as an error.
|
|
52
52
|
*
|
|
53
|
-
* @param
|
|
54
|
-
* @returns The authenticated request, or `undefined` to drop the
|
|
53
|
+
* @param notification - The decoded notification.
|
|
54
|
+
* @returns The authenticated request, or `undefined` to drop the notification.
|
|
55
55
|
*/
|
|
56
|
-
resolve(
|
|
56
|
+
resolve(notification: SignBidirectionalNotification): Promise<ResolvedSignetRequest | undefined>;
|
|
57
57
|
}
|
|
58
58
|
//# sourceMappingURL=signet-request-resolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signet-request-resolver.d.ts","sourceRoot":"","sources":["../src/signet-request-resolver.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"signet-request-resolver.d.ts","sourceRoot":"","sources":["../src/signet-request-resolver.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,KAAK,EACV,YAAY,EACZ,wBAAwB,EACzB,MAAM,sBAAsB,CAAC;AAE9B;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,SAAS,EAAE,YAAY,CAAC;IACxB,gDAAgD;IAChD,OAAO,EAAE,wBAAwB,CAAC;CACnC;AAED,wDAAwD;AACxD,MAAM,WAAW,2BAA2B;IAC1C,oFAAoF;IACpF,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC;CAC1C;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0B;IAIjD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAkD;IAEhF;;OAEG;gBACS,MAAM,EAAE,2BAA2B;IAI/C;;;;;;;;;OASG;IACG,OAAO,CACX,YAAY,EAAE,6BAA6B,GAC1C,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;CA8B9C"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
// Turn a
|
|
2
|
-
//
|
|
3
|
-
// knowledge-base/caller-attribution.md
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
1
|
+
// Turn a SignBidirectionalNotification into an AUTHENTICATED request record.
|
|
2
|
+
// This is the security core of the discovery flow (see
|
|
3
|
+
// knowledge-base/caller-attribution.md): the notification says only WHERE to
|
|
4
|
+
// look; the request that gets signed is read from the named caller's own
|
|
5
|
+
// authenticated ledger, and the notification's `requestId` must be a member
|
|
6
|
+
// of that contract's request index. An attacker cannot write into a contract
|
|
7
|
+
// it does not control, so a forged notification can at most re-point at a
|
|
8
|
+
// legitimate request that already exists — never inject one.
|
|
9
9
|
//
|
|
10
10
|
// Key derivation stays f(callerAddress, path), keyed off the contract whose
|
|
11
|
-
// authenticated state was actually read —
|
|
12
|
-
//
|
|
11
|
+
// authenticated state was actually read — the notification registry is a
|
|
12
|
+
// pointer board, never an authority.
|
|
13
13
|
import { lookupSignetRequestAt } from "./signature-requests-state-reader.js";
|
|
14
14
|
/**
|
|
15
|
-
* Resolves {@link
|
|
15
|
+
* Resolves {@link SignBidirectionalNotification}s to authenticated
|
|
16
16
|
* {@link ResolvedSignetRequest}s by reading the named caller's ledger and
|
|
17
17
|
* enforcing the membership check. Construct once and reuse: resolved records
|
|
18
18
|
* are immutable (their ledger key is their hash), so they are cached by request
|
|
@@ -39,20 +39,20 @@ export class SignetRequestResolver {
|
|
|
39
39
|
* Resolve a notification to its authenticated request, or `undefined` when it
|
|
40
40
|
* cannot be trusted: the caller contract has no state, or `requestId` is not
|
|
41
41
|
* a member of the index at `requestsIndexField` (forged, stale, wrong field,
|
|
42
|
-
* or not yet indexed — poll again). Never throws on an untrusted
|
|
43
|
-
* notification is dropped, not surfaced as an error.
|
|
42
|
+
* or not yet indexed — poll again). Never throws on an untrusted
|
|
43
|
+
* notification; a bad one is dropped, not surfaced as an error.
|
|
44
44
|
*
|
|
45
|
-
* @param
|
|
46
|
-
* @returns The authenticated request, or `undefined` to drop the
|
|
45
|
+
* @param notification - The decoded notification.
|
|
46
|
+
* @returns The authenticated request, or `undefined` to drop the notification.
|
|
47
47
|
*/
|
|
48
|
-
async resolve(
|
|
49
|
-
const cached = this.resolvedCache.get(
|
|
48
|
+
async resolve(notification) {
|
|
49
|
+
const cached = this.resolvedCache.get(notification.requestId);
|
|
50
50
|
if (cached !== undefined) {
|
|
51
51
|
return cached;
|
|
52
52
|
}
|
|
53
53
|
let state;
|
|
54
54
|
try {
|
|
55
|
-
state = await this.source.queryContractState(
|
|
55
|
+
state = await this.source.queryContractState(notification.callerAddress);
|
|
56
56
|
}
|
|
57
57
|
catch {
|
|
58
58
|
return undefined; // caller address not a contract / transient read error
|
|
@@ -60,16 +60,16 @@ export class SignetRequestResolver {
|
|
|
60
60
|
if (!state?.data) {
|
|
61
61
|
return undefined; // no state at the named caller — cannot authenticate
|
|
62
62
|
}
|
|
63
|
-
const request = lookupSignetRequestAt(state.data,
|
|
63
|
+
const request = lookupSignetRequestAt(state.data, notification.requestsIndexField, notification.requestId);
|
|
64
64
|
if (request === undefined) {
|
|
65
65
|
return undefined; // membership check failed — drop the notification
|
|
66
66
|
}
|
|
67
67
|
const resolved = {
|
|
68
|
-
callerAddress:
|
|
69
|
-
requestId:
|
|
68
|
+
callerAddress: notification.callerAddress,
|
|
69
|
+
requestId: notification.requestId,
|
|
70
70
|
request,
|
|
71
71
|
};
|
|
72
|
-
this.resolvedCache.set(
|
|
72
|
+
this.resolvedCache.set(notification.requestId, resolved);
|
|
73
73
|
return resolved;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signet-request-resolver.js","sourceRoot":"","sources":["../src/signet-request-resolver.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"signet-request-resolver.js","sourceRoot":"","sources":["../src/signet-request-resolver.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,uDAAuD;AACvD,6EAA6E;AAC7E,yEAAyE;AACzE,4EAA4E;AAC5E,6EAA6E;AAC7E,0EAA0E;AAC1E,6DAA6D;AAC7D,EAAE;AACF,4EAA4E;AAC5E,yEAAyE;AACzE,qCAAqC;AAErC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAiC7E;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,qBAAqB;IACf,MAAM,CAA0B;IAEjD,8EAA8E;IAC9E,4DAA4D;IAC3C,aAAa,GAAG,IAAI,GAAG,EAAuC,CAAC;IAEhF;;OAEG;IACH,YAAY,MAAmC;QAC7C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9B,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,OAAO,CACX,YAA2C;QAE3C,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAC9D,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,IAAI,KAAwC,CAAC;QAC7C,IAAI,CAAC;YACH,KAAK,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QAC3E,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,SAAS,CAAC,CAAC,uDAAuD;QAC3E,CAAC;QACD,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC;YACjB,OAAO,SAAS,CAAC,CAAC,qDAAqD;QACzE,CAAC;QACD,MAAM,OAAO,GAAG,qBAAqB,CACnC,KAAK,CAAC,IAAI,EACV,YAAY,CAAC,kBAAkB,EAC/B,YAAY,CAAC,SAAS,CACvB,CAAC;QACF,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,SAAS,CAAC,CAAC,kDAAkD;QACtE,CAAC;QACD,MAAM,QAAQ,GAA0B;YACtC,aAAa,EAAE,YAAY,CAAC,aAAa;YACzC,SAAS,EAAE,YAAY,CAAC,SAAS;YACjC,OAAO;SACR,CAAC;QACF,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACzD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -212,12 +212,12 @@ export declare function assembleCalldata(calldata: Maybe<EVMCalldata>): string;
|
|
|
212
212
|
* below both go through it, so the transaction a client broadcasts is
|
|
213
213
|
* provably the one the MPC put its signature over.
|
|
214
214
|
*
|
|
215
|
-
* @param
|
|
215
|
+
* @param request - The on-ledger request record.
|
|
216
216
|
* @returns The unsigned ethers transaction (`unsignedHash` is the digest the
|
|
217
217
|
* MPC signs).
|
|
218
218
|
* @throws Error if a calldata word carries an unknown kind.
|
|
219
219
|
*/
|
|
220
|
-
export declare function signBidirectionalRequestToUnsignedEVMTransaction(
|
|
220
|
+
export declare function signBidirectionalRequestToUnsignedEVMTransaction(request: SignBidirectionalRequest): Transaction;
|
|
221
221
|
/**
|
|
222
222
|
* Decode a response signature record (as posted to the signet contract's
|
|
223
223
|
* signature response log — the canonical MPC `Signature { big_r, s,
|
|
@@ -255,7 +255,7 @@ export declare function signatureToSignatureResponse(signature: Pick<Signature,
|
|
|
255
255
|
* requester's derived address — the response log is unauthenticated, so
|
|
256
256
|
* verify first with `verifySignatureResponse`.
|
|
257
257
|
*
|
|
258
|
-
* @param
|
|
258
|
+
* @param request - The on-ledger request record.
|
|
259
259
|
* @param response - The posted signature record answering it.
|
|
260
260
|
* @returns The signed ethers transaction; `serialized` is the raw payload for
|
|
261
261
|
* `eth_sendRawTransaction`, `hash` its on-chain hash, `from` the recovered
|
|
@@ -264,7 +264,7 @@ export declare function signatureToSignatureResponse(signature: Pick<Signature,
|
|
|
264
264
|
* {@link signBidirectionalRequestToUnsignedEVMTransaction}) or the response
|
|
265
265
|
* is not a decodable signature.
|
|
266
266
|
*/
|
|
267
|
-
export declare function signBidirectionalRequestToSignedEVMTransaction(
|
|
267
|
+
export declare function signBidirectionalRequestToSignedEVMTransaction(request: SignBidirectionalRequest, response: SignatureResponse): Transaction;
|
|
268
268
|
/**
|
|
269
269
|
* The generated ledger shape of `Map<RequestId, SignBidirectionalRequest>`:
|
|
270
270
|
* what a contract's `ledger(state).signetRequestsIndex` provides. Structural,
|
|
@@ -310,6 +310,20 @@ export type SignBidirectionalRequestIndex = Map<RequestIdHex, SignBidirectionalR
|
|
|
310
310
|
* @returns Lowercase hex, two chars per byte.
|
|
311
311
|
*/
|
|
312
312
|
export declare function bytesToHex(bytes: Uint8Array): string;
|
|
313
|
+
/**
|
|
314
|
+
* Strip an optional `0x`/`0X` prefix from a hex string.
|
|
315
|
+
*
|
|
316
|
+
* @param hex - A hex string, with or without a `0x` prefix.
|
|
317
|
+
* @returns The bare hex digits.
|
|
318
|
+
*/
|
|
319
|
+
export declare function stripHexPrefix(hex: string): string;
|
|
320
|
+
/**
|
|
321
|
+
* Decode a hex string into bytes — the inverse of {@link bytesToHex}.
|
|
322
|
+
*
|
|
323
|
+
* @param hex - Hex digits, with or without a `0x` prefix.
|
|
324
|
+
* @returns The decoded bytes.
|
|
325
|
+
*/
|
|
326
|
+
export declare function hexToBytes(hex: string): Uint8Array;
|
|
313
327
|
/**
|
|
314
328
|
* Render a request id in its canonical TS form (see
|
|
315
329
|
* {@link RequestIdHex}) — also usable as a JS `Map` key, which raw
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signet-requests.d.ts","sourceRoot":"","sources":["../src/signet-requests.ts"],"names":[],"mappings":"AAgBA,OAAO,EAOL,KAAK,WAAW,EACjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAwB,SAAS,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAItE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC;AAEnC;;;;;GAKG;AACH,eAAO,MAAM,WAAW;IACtB,6DAA6D;;IAE7D;;;;OAIG;;CAEK,CAAC;AAEX;;;;GAIG;AACH,MAAM,WAAW,KAAK,CAAC,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,CAAC,CAAC;CACV;AAED;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,qEAAqE;IACrE,QAAQ,EAAE,UAAU,CAAC;IACrB,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,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,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uDA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,UAAU,CAOlD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,YAAY,CAE/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAM7D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,YAAY,GAAG,SAAS,CAM1D;AAED,2DAA2D;AAC3D,eAAO,MAAM,UAAU,MAAM,CAAC;AAE9B;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAIzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,CAC7C,WAAW,EAAE,QAAQ,CAAC,CAAC,SAAS,EAAE,wBAAwB,CAAC,CAAC,GAC3D,6BAA6B,CAM/B"}
|
package/dist/signet-requests.js
CHANGED
|
@@ -289,13 +289,13 @@ function decodeAccessList(txParams) {
|
|
|
289
289
|
* below both go through it, so the transaction a client broadcasts is
|
|
290
290
|
* provably the one the MPC put its signature over.
|
|
291
291
|
*
|
|
292
|
-
* @param
|
|
292
|
+
* @param request - The on-ledger request record.
|
|
293
293
|
* @returns The unsigned ethers transaction (`unsignedHash` is the digest the
|
|
294
294
|
* MPC signs).
|
|
295
295
|
* @throws Error if a calldata word carries an unknown kind.
|
|
296
296
|
*/
|
|
297
|
-
export function signBidirectionalRequestToUnsignedEVMTransaction(
|
|
298
|
-
const { txParams } =
|
|
297
|
+
export function signBidirectionalRequestToUnsignedEVMTransaction(request) {
|
|
298
|
+
const { txParams } = request;
|
|
299
299
|
return Transaction.from({
|
|
300
300
|
type: 2,
|
|
301
301
|
chainId: txParams.chainId,
|
|
@@ -398,7 +398,7 @@ export function signatureToSignatureResponse(signature) {
|
|
|
398
398
|
* requester's derived address — the response log is unauthenticated, so
|
|
399
399
|
* verify first with `verifySignatureResponse`.
|
|
400
400
|
*
|
|
401
|
-
* @param
|
|
401
|
+
* @param request - The on-ledger request record.
|
|
402
402
|
* @param response - The posted signature record answering it.
|
|
403
403
|
* @returns The signed ethers transaction; `serialized` is the raw payload for
|
|
404
404
|
* `eth_sendRawTransaction`, `hash` its on-chain hash, `from` the recovered
|
|
@@ -407,8 +407,8 @@ export function signatureToSignatureResponse(signature) {
|
|
|
407
407
|
* {@link signBidirectionalRequestToUnsignedEVMTransaction}) or the response
|
|
408
408
|
* is not a decodable signature.
|
|
409
409
|
*/
|
|
410
|
-
export function signBidirectionalRequestToSignedEVMTransaction(
|
|
411
|
-
const transaction = signBidirectionalRequestToUnsignedEVMTransaction(
|
|
410
|
+
export function signBidirectionalRequestToSignedEVMTransaction(request, response) {
|
|
411
|
+
const transaction = signBidirectionalRequestToUnsignedEVMTransaction(request);
|
|
412
412
|
transaction.signature = signatureResponseToSignature(response);
|
|
413
413
|
return transaction;
|
|
414
414
|
}
|
|
@@ -421,6 +421,29 @@ export function signBidirectionalRequestToSignedEVMTransaction(event, response)
|
|
|
421
421
|
export function bytesToHex(bytes) {
|
|
422
422
|
return Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
|
|
423
423
|
}
|
|
424
|
+
/**
|
|
425
|
+
* Strip an optional `0x`/`0X` prefix from a hex string.
|
|
426
|
+
*
|
|
427
|
+
* @param hex - A hex string, with or without a `0x` prefix.
|
|
428
|
+
* @returns The bare hex digits.
|
|
429
|
+
*/
|
|
430
|
+
export function stripHexPrefix(hex) {
|
|
431
|
+
return hex.startsWith("0x") || hex.startsWith("0X") ? hex.slice(2) : hex;
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Decode a hex string into bytes — the inverse of {@link bytesToHex}.
|
|
435
|
+
*
|
|
436
|
+
* @param hex - Hex digits, with or without a `0x` prefix.
|
|
437
|
+
* @returns The decoded bytes.
|
|
438
|
+
*/
|
|
439
|
+
export function hexToBytes(hex) {
|
|
440
|
+
const digits = stripHexPrefix(hex);
|
|
441
|
+
const out = new Uint8Array(digits.length >> 1);
|
|
442
|
+
for (let i = 0; i < out.length; i++) {
|
|
443
|
+
out[i] = Number.parseInt(digits.slice(2 * i, 2 * i + 2), 16);
|
|
444
|
+
}
|
|
445
|
+
return out;
|
|
446
|
+
}
|
|
424
447
|
/**
|
|
425
448
|
* Render a request id in its canonical TS form (see
|
|
426
449
|
* {@link RequestIdHex}) — also usable as a JS `Map` key, which raw
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signet-requests.js","sourceRoot":"","sources":["../src/signet-requests.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,oGAAoG;AACpG,2EAA2E;AAC3E,8EAA8E;AAC9E,gDAAgD;AAChD,EAAE;AACF,6EAA6E;AAC7E,oEAAoE;AACpE,+EAA+E;AAC/E,4EAA4E;AAC5E,6EAA6E;AAC7E,mEAAmE;AACnE,EAAE;AACF,wEAAwE;AACxE,8DAA8D;AAE9D,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,0BAA0B,EAC1B,iBAAiB,EACjB,cAAc,GAEf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAW9D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,6DAA6D;IAC7D,QAAQ,EAAE,CAAC;IACX;;;;OAIG;IACH,QAAQ,EAAE,CAAC;CACH,CAAC;AAyGX,+EAA+E;AAC/E,EAAE;AACF,0EAA0E;AAC1E,wEAAwE;AACxE,wEAAwE;AACxE,oEAAoE;AACpE,2EAA2E;AAC3E,wEAAwE;AACxE,qCAAqC;AACrC,EAAE;AACF,iEAAiE;AACjE,6EAA6E;AAC7E,sEAAsE;AACtE,sDAAsD;AACtD,6EAA6E;AAC7E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AgB;IAC7C,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5B,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,2DAA2D;AAC3D,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAC;AAE9B;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,UAAsB;IAC3D,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC;IACxC,IAAI,CAAC,GAAG,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC3D,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,+BAA+B,CAC7C,WAA4D;IAE5D,MAAM,KAAK,GAAkC,IAAI,GAAG,EAAE,CAAC;IACvD,KAAK,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,WAAW,EAAE,CAAC;QAC/C,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sig-net/midnight",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Midnight-side sig-net integration — the seed of a future signet.js Midnight adapter.",
|
|
6
6
|
"//exports": "Local dev consumes raw TS source. `publishConfig.exports` below swaps this to the emitted ./dist at publish time, so npm consumers get JS + .d.ts while the monorepo keeps resolving to src.",
|
package/src/Signet.compact
CHANGED
|
@@ -3,29 +3,31 @@
|
|
|
3
3
|
// requests and responses on Midnight.
|
|
4
4
|
// ============================================================================
|
|
5
5
|
// A signet compliant contract records "please sign this EVM transaction" requests
|
|
6
|
-
// in its public ledger
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
6
|
+
// in its public ledger and registers a notification in the CENTRAL signet
|
|
7
|
+
// contract's notification registry. The sig-net MPC network polls that one
|
|
8
|
+
// registry: each notification names the requesting contract, so the MPC reads
|
|
9
|
+
// the authenticated request from the requester's ledger field 0 (the signet
|
|
10
|
+
// layout convention), re-assembles and signs the EVM transaction with the
|
|
11
|
+
// caller's derived key, and posts its responses back to the central signet
|
|
12
|
+
// contract — first the signature (the client broadcasts the signed
|
|
13
|
+
// transaction), then, after watching the remote execution, the Schnorr-signed
|
|
14
|
+
// respond-bidirectional attestation of its result. Clients poll the central
|
|
15
|
+
// contract's response indexes by request id. Requests and both response kinds
|
|
16
|
+
// are counterparts and are defined side by side here; the pure circuits that
|
|
17
|
+
// operate on them follow below.
|
|
15
18
|
//
|
|
16
19
|
// Naming follows the MPC's canonical vocabulary (sig-net/mpc
|
|
17
20
|
// chain-signatures/primitives): the SignBidirectionalRequest record mirrors
|
|
18
|
-
// the MPC's
|
|
19
|
-
// Canton-adapter precedent)
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
// attestation mirrors RespondBidirectionalEvent / serialized_output.
|
|
21
|
+
// the MPC's canonical bidirectional request primitive (with the EVM
|
|
22
|
+
// transaction decomposed — the Canton-adapter precedent); the
|
|
23
|
+
// SignatureResponse record mirrors Signature { big_r, s, recovery_id }; the
|
|
24
|
+
// execution attestation mirrors the MPC's respond-bidirectional
|
|
25
|
+
// serialized_output.
|
|
24
26
|
//
|
|
25
27
|
// Read more:
|
|
26
28
|
// - sig-net docs (chain signatures, key derivation): https://docs.sig.network/
|
|
27
29
|
// - canonical request shape this mirrors: sig-net/mpc
|
|
28
|
-
// chain-signatures/primitives/src/bidirectional.rs
|
|
30
|
+
// chain-signatures/primitives/src/bidirectional.rs
|
|
29
31
|
// - Compact language reference (modules, types):
|
|
30
32
|
// https://docs.midnight.network/compact/reference/compact-reference
|
|
31
33
|
//
|
|
@@ -47,17 +49,22 @@ module Signet {
|
|
|
47
49
|
export new type RequestId = Bytes<32>;
|
|
48
50
|
|
|
49
51
|
// ---- The canonical request/response pair ----------------------------------
|
|
50
|
-
// 1. Client contract stores a SignBidirectionalRequest
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
//
|
|
52
|
+
// 1. Client contract stores a SignBidirectionalRequest in its own ledger and registers a
|
|
53
|
+
// SignBidirectionalNotification in the central signet contract's registry, requesting a
|
|
54
|
+
// signature from the MPC
|
|
55
|
+
// 2. MPC polls the registry, reads the request from the client's ledger, and posts a
|
|
56
|
+
// SignatureResponse (the requested signature) to the central signet contract
|
|
57
|
+
// 3. Client polls the signature response log by request id, verifies the posted
|
|
58
|
+
// SignatureResponse, broadcasts txn to destination chain
|
|
59
|
+
// 4. MPC observes txn execution on destination chain, posts a RespondBidirectional
|
|
60
|
+
// attestation to the central signet contract; the client polls it by request id
|
|
54
61
|
|
|
55
62
|
// TxParamType indiciates which transaction-param decomposition a request
|
|
56
63
|
// contains so an off-chain consumer (e.g. the MPC) knows how to re-assemble it.
|
|
57
64
|
// In-circuit this is redundant as the type is fixed at compile time (i.e. monomorphized).
|
|
58
65
|
export enum TxParamType {
|
|
59
66
|
evmType2, // EVMType2TxParams: an EIP-1559 EVM transaction (envelope + calldata)
|
|
60
|
-
reserved, // never
|
|
67
|
+
reserved, // never used — exists only to keep the enum at >= 2 variants. A
|
|
61
68
|
// 1-variant enum compiles to a zero-byte value the proof server's
|
|
62
69
|
// field-repr parser reads as ZERO field elements while the compiler
|
|
63
70
|
// allocates ONE, so persistentHash over any struct containing it
|
|
@@ -98,50 +105,38 @@ module Signet {
|
|
|
98
105
|
}
|
|
99
106
|
|
|
100
107
|
// External contract surface of the central signet contract: a client cross-
|
|
101
|
-
// contract-calls
|
|
102
|
-
|
|
103
|
-
|
|
108
|
+
// contract-calls notifyBidirectionalSignatureRequest to register the request
|
|
109
|
+
// in the central notification registry, which the MPC polls.
|
|
110
|
+
export contract SignetNotifier {
|
|
111
|
+
circuit notifyBidirectionalSignatureRequest(
|
|
112
|
+
requestId: RequestId,
|
|
113
|
+
notification: SignBidirectionalNotification
|
|
114
|
+
): [];
|
|
104
115
|
}
|
|
105
116
|
|
|
106
|
-
//
|
|
107
|
-
//
|
|
108
|
-
//
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
117
|
+
// SignBidirectionalNotification is the record a client registers in the
|
|
118
|
+
// central signet contract's notification registry to tell the MPC a
|
|
119
|
+
// SignBidirectionalRequest was stored in the client's own ledger — and WHERE
|
|
120
|
+
// to read the authenticated copy. Attribution comes from whose authenticated
|
|
121
|
+
// state the MPC reads, never from a field here.
|
|
122
|
+
export struct SignBidirectionalNotification {
|
|
123
|
+
version: Uint<8>; // payload layout tag; 1 = the V1 layout below
|
|
124
|
+
payload: Bytes<65>; // V1: callerAddress (32) ++ requestId (32) ++ requestsIndexField (1)
|
|
112
125
|
}
|
|
113
126
|
|
|
114
|
-
// V1
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
// field crashes the serialize<> event encoder (compiler self-diagnosed bug).
|
|
121
|
-
requestId: Bytes<32>;
|
|
122
|
-
|
|
123
|
-
// Ledger field position of the Map<RequestId, SignBidirectionalRequest> in
|
|
124
|
-
// the caller contract.
|
|
125
|
-
signBidirectionalRequestsIndexField: Uint<8>;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Build the V1 event: pack the concrete fields into the opaque payload with
|
|
129
|
-
// serialize<> and tag version = 1. Client contracts should call
|
|
130
|
-
// this instead of hand-constructing the envelope.
|
|
131
|
-
export pure circuit constructSignBidirectionalEventV1(
|
|
127
|
+
// Build the V1 notification: manually pack the caller's raw address bytes,
|
|
128
|
+
// the raw request id, and the request-index ledger-field position into the
|
|
129
|
+
// 65-byte payload (exact, byte-concatenated, no padding) and tag
|
|
130
|
+
// version = 1. Client contracts call this instead of hand-constructing the
|
|
131
|
+
// envelope; off-chain readers decode by the same fixed offsets.
|
|
132
|
+
export pure circuit constructSignBidirectionalNotificationV1(
|
|
132
133
|
callerAddress: ContractAddress,
|
|
133
134
|
requestId: Bytes<32>,
|
|
134
|
-
|
|
135
|
-
):
|
|
136
|
-
return
|
|
135
|
+
requestsIndexField: Uint<8>
|
|
136
|
+
): SignBidirectionalNotification {
|
|
137
|
+
return SignBidirectionalNotification {
|
|
137
138
|
version: 1,
|
|
138
|
-
payload:
|
|
139
|
-
SignBidirectionalEventV1Payload {
|
|
140
|
-
callerAddress,
|
|
141
|
-
requestId,
|
|
142
|
-
signBidirectionalRequestsIndexField
|
|
143
|
-
}
|
|
144
|
-
)
|
|
139
|
+
payload: Bytes[...callerAddress.bytes, ...requestId, requestsIndexField]
|
|
145
140
|
};
|
|
146
141
|
}
|
|
147
142
|
|
|
@@ -157,24 +152,7 @@ module Signet {
|
|
|
157
152
|
recoveryId: Uint<8>; // parity of R.y for public-key recovery
|
|
158
153
|
}
|
|
159
154
|
|
|
160
|
-
//
|
|
161
|
-
// SignatureResponse has been posted to the central signet contract's
|
|
162
|
-
// response log — the response-direction counterpart of
|
|
163
|
-
// SignBidirectionalEvent. A ping, never the source of truth: the client
|
|
164
|
-
// reads the post back from the log at (requestId, count) and verifies the
|
|
165
|
-
// signature off-chain — the log is unauthenticated, so verification, not
|
|
166
|
-
// the event, confers trust.
|
|
167
|
-
export struct SignatureRespondedEvent {
|
|
168
|
-
// Representation type (Bytes<32>), NOT the RequestId new type: a `new type`
|
|
169
|
-
// field crashes the serialize<> event encoder (compiler self-diagnosed bug).
|
|
170
|
-
requestId: Bytes<32>,
|
|
171
|
-
|
|
172
|
-
// 0-based position of the post in the request's response log — the
|
|
173
|
-
// `count` half of the SignetResponseKey it is stored under.
|
|
174
|
-
count: Uint<64>,
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// The counterpart to SignatureResponse, emitted by the MPC after
|
|
155
|
+
// The counterpart to SignatureResponse, posted by the MPC after
|
|
178
156
|
// it observes execution of the signed transaction on the destination chain.
|
|
179
157
|
// This response contains execution output and an attestation as to its authenticity.
|
|
180
158
|
// TODO: currently contains a Schnorr attestation --> migrate to ECDSA.
|
|
@@ -200,22 +178,6 @@ module Signet {
|
|
|
200
178
|
response: Field;
|
|
201
179
|
}
|
|
202
180
|
|
|
203
|
-
// RespondBidirectionalEvent notifies the requesting client that the MPC's
|
|
204
|
-
// RespondBidirectional attestation of a request's remote execution has been
|
|
205
|
-
// stored in the central signet contract's respond-bidirectional index — the
|
|
206
|
-
// attestation-direction counterpart of SignatureRespondedEvent. A ping,
|
|
207
|
-
// never the source of truth: the client reads the record back from the
|
|
208
|
-
// index at requestId. Unlike signature responses, NO off-chain verification
|
|
209
|
-
// follows — the contract verified the attestation in-circuit at post time,
|
|
210
|
-
// so the stored record is authentic by construction. Emitted at most once
|
|
211
|
-
// per request: the index holds one authenticated slot, first valid write
|
|
212
|
-
// wins, and a re-post is a no-op that emits nothing.
|
|
213
|
-
export struct RespondBidirectionalEvent {
|
|
214
|
-
// Representation type (Bytes<32>), NOT the RequestId new type: a `new type`
|
|
215
|
-
// field crashes the serialize<> event encoder (compiler self-diagnosed bug).
|
|
216
|
-
requestId: Bytes<32>;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
181
|
// The EVM transaction to be signed, decomposed into typed fields
|
|
220
182
|
// (EIP-1559 / type-2: https://eips.ethereum.org/EIPS/eip-1559).
|
|
221
183
|
// Decomposed rather than pre-serialized so the requesting contract can
|
|
@@ -306,24 +268,31 @@ module Signet {
|
|
|
306
268
|
export new type SignetNonce = Counter;
|
|
307
269
|
|
|
308
270
|
// ---- Signet Contract Ledger Layout ------------------------------------------
|
|
309
|
-
// The CENTRAL signet contract on Midnight stores both MPC response kinds
|
|
271
|
+
// The CENTRAL signet contract on Midnight stores both MPC response kinds and
|
|
272
|
+
// the request notification registry.
|
|
310
273
|
// Its layout convention (find everything knowing only the contract address):
|
|
311
274
|
// field 0: SignatureResponseCounterIndex
|
|
312
275
|
// field 1: SignatureResponseIndex
|
|
313
276
|
// field 2: RespondBidirectionalIndex
|
|
314
277
|
// field 3: mpcPubKeyHash (sealed Bytes<32>)
|
|
278
|
+
// field 4: SignBidirectionalNotificationIndex
|
|
315
279
|
//
|
|
316
|
-
//
|
|
280
|
+
// Each store gets the defense its contents allow:
|
|
317
281
|
// - Signature responses are secp256k1 ECDSA — unverifiable in-circuit —
|
|
318
282
|
// so their log is UNAUTHENTICATED and append-only: each post lands
|
|
319
|
-
// under a fresh (requestId, count) key
|
|
320
|
-
//
|
|
321
|
-
//
|
|
322
|
-
// a request's entries and verify each signature off-chain.
|
|
283
|
+
// under a fresh (requestId, count) key; a rogue poster can add noise
|
|
284
|
+
// but never overwrite or block the genuine response. Clients poll a
|
|
285
|
+
// request's entries by request id and verify each signature off-chain.
|
|
323
286
|
// - Respond-bidirectional attestations are Schnorr on Jubjub — the
|
|
324
287
|
// embedded curve — so the contract verifies them IN-CIRCUIT at post
|
|
325
288
|
// time against its sealed MPC key hash. Garbage cannot land; one
|
|
326
289
|
// authenticated slot per request suffices, first valid write wins.
|
|
290
|
+
// Clients poll the slot by request id.
|
|
291
|
+
// - Notifications are UNAUTHENTICATED pointers ("contract X stored
|
|
292
|
+
// request Y at index field Z"): anyone may register one, so the MPC
|
|
293
|
+
// never trusts a notification's content — it authenticates by reading
|
|
294
|
+
// the request back from the NAMED caller's own ledger and refusing
|
|
295
|
+
// records whose recomputed id does not match.
|
|
327
296
|
|
|
328
297
|
// Per-request post counter for signature responses (field 0). The counter
|
|
329
298
|
// reads the number of posts made for that request; entries exist for
|
|
@@ -347,6 +316,13 @@ module Signet {
|
|
|
347
316
|
// contract-verified attestation per request.
|
|
348
317
|
export new type RespondBidirectionalIndex = Map<RequestId, RespondBidirectional>;
|
|
349
318
|
|
|
319
|
+
// The on-ledger notification registry (field 4): one notification per
|
|
320
|
+
// request id, append-only (a re-notify is an idempotent overwrite; there is
|
|
321
|
+
// deliberately no removal circuit). The MPC discovers requests by
|
|
322
|
+
// enumerating this map and diffing against the request ids it has already
|
|
323
|
+
// served.
|
|
324
|
+
export new type SignBidirectionalNotificationIndex = Map<RequestId, SignBidirectionalNotification>;
|
|
325
|
+
|
|
350
326
|
// ---- Request id -----------------------------------------------------------
|
|
351
327
|
|
|
352
328
|
// Canonical id of an EVM signature request: the domain-separated persistent
|
|
@@ -379,7 +355,7 @@ module Signet {
|
|
|
379
355
|
// length, so neither can be swapped under a reused signature; the 16-byte
|
|
380
356
|
// split is needed because a 32-byte value overflows the BLS scalar field.
|
|
381
357
|
// ONE implementation for everyone: the signet contract verifies posts
|
|
382
|
-
// against it, requester contracts (
|
|
358
|
+
// against it, requester contracts (e.g. the vault's claim) re-verify against it, and
|
|
383
359
|
// off-chain signers call the compiled copy (via circuits.compact) — never
|
|
384
360
|
// a TS re-implementation.
|
|
385
361
|
export pure circuit signetAttestationMessage(
|