@sig-net/midnight 0.15.0 → 0.17.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.
Files changed (51) hide show
  1. package/README.md +113 -49
  2. package/dist/constants.d.ts +55 -0
  3. package/dist/constants.d.ts.map +1 -1
  4. package/dist/constants.js +85 -5
  5. package/dist/constants.js.map +1 -1
  6. package/dist/ecdsa-attestation.d.ts +6 -5
  7. package/dist/ecdsa-attestation.d.ts.map +1 -1
  8. package/dist/ecdsa-attestation.js +5 -4
  9. package/dist/ecdsa-attestation.js.map +1 -1
  10. package/dist/index.d.ts +1 -2
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +3 -4
  13. package/dist/index.js.map +1 -1
  14. package/dist/managed/compiler/contract-manifest.json +2 -2
  15. package/dist/managed/contract/index.js +31 -31
  16. package/dist/managed/contract/index.js.map +1 -1
  17. package/dist/signature-requests-state-reader.d.ts +7 -7
  18. package/dist/signature-requests-state-reader.js +7 -7
  19. package/dist/signature-response-verification.d.ts +1 -1
  20. package/dist/signature-response-verification.d.ts.map +1 -1
  21. package/dist/signature-response-verification.js +3 -3
  22. package/dist/signature-response-verification.js.map +1 -1
  23. package/dist/signature-state-reading.js +2 -2
  24. package/dist/signature-state-reading.js.map +1 -1
  25. package/dist/signet-contract-events.d.ts +267 -0
  26. package/dist/signet-contract-events.d.ts.map +1 -0
  27. package/dist/signet-contract-events.js +272 -0
  28. package/dist/signet-contract-events.js.map +1 -0
  29. package/dist/signet-evtype2tx-requests.d.ts +4 -4
  30. package/dist/signet-evtype2tx-requests.d.ts.map +1 -1
  31. package/dist/signet-evtype2tx-requests.js +3 -3
  32. package/dist/signet-request-feed.d.ts +61 -33
  33. package/dist/signet-request-feed.d.ts.map +1 -1
  34. package/dist/signet-request-feed.js +116 -62
  35. package/dist/signet-request-feed.js.map +1 -1
  36. package/dist/signet-request-response-reader.d.ts +62 -55
  37. package/dist/signet-request-response-reader.d.ts.map +1 -1
  38. package/dist/signet-request-response-reader.js +85 -99
  39. package/dist/signet-request-response-reader.js.map +1 -1
  40. package/dist/signet-requests.js +2 -2
  41. package/dist/signet-requests.js.map +1 -1
  42. package/package.json +2 -2
  43. package/src/Signet.compact +45 -36
  44. package/dist/signet-contract-state-reader.d.ts +0 -247
  45. package/dist/signet-contract-state-reader.d.ts.map +0 -1
  46. package/dist/signet-contract-state-reader.js +0 -363
  47. package/dist/signet-contract-state-reader.js.map +0 -1
  48. package/dist/signet-request-resolver.d.ts +0 -60
  49. package/dist/signet-request-resolver.d.ts.map +0 -1
  50. package/dist/signet-request-resolver.js +0 -78
  51. package/dist/signet-request-resolver.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import type { PublicDataProvider } from "@midnight-ntwrk/midnight-js-types";
2
2
  import type { Transaction } from "ethers";
3
- import { type SignatureRespondedEvent, type RespondBidirectionalEvent } from "./signet-contract-state-reader.ts";
3
+ import { type SignetEventSource, type SignatureRespondedEvent, type RespondBidirectionalEvent } from "./signet-contract-events.ts";
4
4
  import { type Secp256k1Point } from "./ecdsa-attestation.ts";
5
5
  import type { RawContractState } from "./signature-state-reading.ts";
6
6
  import { type SignBidirectionalEvent, type RequestIdHex } from "./signet-requests.ts";
@@ -38,11 +38,16 @@ export interface SignetRequestResponseReaderConfig {
38
38
  readonly signetContractAddress: string;
39
39
  /** Source of raw contract state, e.g. midnight-js's `indexerPublicDataProvider`. */
40
40
  readonly publicDataProvider: SignetPublicStateSource;
41
+ /**
42
+ * Source of the signet contract's emitted events. Adapt a full provider
43
+ * with `signetEventSourceFromPublicDataProvider`.
44
+ */
45
+ readonly eventSource: SignetEventSource;
41
46
  }
42
- /** The verdict on one posted response, in `count` order. */
47
+ /** The verdict on one emitted response, in emission order. */
43
48
  export interface SignatureResponseVerdict {
44
- /** 0-based position of the post in the request's response log. */
45
- count: bigint;
49
+ /** 0-based position of the post among the request's signature-response events. */
50
+ index: bigint;
46
51
  /** The posted signature record, verbatim. */
47
52
  response: SignatureRespondedEvent;
48
53
  /** Recovered signer address, absent when the signature did not decode. */
@@ -53,13 +58,13 @@ export interface SignatureResponseVerdict {
53
58
  /** Result of {@link SignetRequestResponseReader['getVerifiedSignatureRespondedEvent']}. */
54
59
  export interface VerifiedSignatureResponseResult {
55
60
  /**
56
- * The first valid response (lowest count), or `undefined` when no valid
61
+ * The first valid response (lowest index), or `undefined` when no valid
57
62
  * response has been posted yet: poll again.
58
63
  */
59
64
  verified?: SignatureRespondedEvent;
60
65
  /**
61
- * One verdict per post, count order. Pure data: the reader never logs, so
62
- * callers decide how to surface rejected posts.
66
+ * One verdict per post, emission order. Pure data: the reader never logs,
67
+ * so callers decide how to surface rejected posts.
63
68
  */
64
69
  verdicts: SignatureResponseVerdict[];
65
70
  }
@@ -67,24 +72,16 @@ export interface VerifiedSignatureResponseResult {
67
72
  * Reader over one requester contract / signet contract pair.
68
73
  * Construct once per pair and reuse: fetched request records are cached (they
69
74
  * are immutable, the ledger key is their hash), so repeated verification
70
- * calls cost one responses-contract query each.
75
+ * calls cost one event query each.
71
76
  */
72
77
  export declare class SignetRequestResponseReader {
73
78
  private readonly config;
74
79
  private readonly requestCache;
75
80
  /**
76
- * @param config - The contract pair and state source to read through.
81
+ * @param config - The contract pair, state source and event source to read
82
+ * through.
77
83
  */
78
84
  constructor(config: SignetRequestResponseReaderConfig);
79
- /**
80
- * Query one contract's raw state, throwing a uniform error when absent.
81
- *
82
- * @param contractAddress - The contract to query.
83
- * @param role - Human name of the contract for the error message.
84
- * @returns The raw ledger state tree.
85
- * @throws Error when the address holds no contract state.
86
- */
87
- private queryRawState;
88
85
  /**
89
86
  * Fetch the request record for `requestId` from the requester contract's
90
87
  * request index (at the configured `requesterRequestsPath`). Cached
@@ -97,35 +94,49 @@ export declare class SignetRequestResponseReader {
97
94
  */
98
95
  getSignatureRequest(requestId: RequestIdHex): Promise<SignBidirectionalEvent>;
99
96
  /**
100
- * Fetch every response posted for `requestId`, in post (count) order.
101
- * UNVERIFIED: any of them may be garbage (see
102
- * {@link getVerifiedSignatureRespondedEvent}).
97
+ * Fetch every event of `name` the signet contract has emitted, decode each
98
+ * with `decode`, and keep the posts whose declared request id is
99
+ * `requestId`, in emission order. The declared id is routing data only:
100
+ * the verified getters run the actual authenticity checks.
101
+ *
102
+ * @param name - The signet event name to keep.
103
+ * @param decode - The payload decoder for that event kind.
104
+ * @param requestId - The request id the kept posts must declare.
105
+ * @returns The kept posts' records, oldest first.
106
+ */
107
+ private getRespondPostsNamed;
108
+ /**
109
+ * Fetch every signature response posted under `requestId`, in emission
110
+ * order. UNVERIFIED: the declared id is routing data on an unauthenticated
111
+ * event log, so any post may still be garbage (see
112
+ * {@link getVerifiedSignatureRespondedEvent}, where verification
113
+ * establishes authenticity).
103
114
  *
104
- * @param requestId - The request id whose posts to enumerate.
105
- * @returns The posted payloads, index = count, empty when none yet.
106
- * @throws Error when the responses contract has no state, or its counter
107
- * disagrees with the log (inconsistent ledger).
115
+ * @param requestId - The request id the posts must declare.
116
+ * @returns The request's posted records, oldest first, empty when none yet.
108
117
  */
109
- getSignatureResponses(requestId: RequestIdHex): Promise<SignatureRespondedEvent[]>;
118
+ getSignatureRespondedEvents(requestId: RequestIdHex): Promise<SignatureRespondedEvent[]>;
110
119
  /**
111
- * Fetch and verify the responses posted for `requestId`: each post's
112
- * signature must recover to `expectedSigner`
113
- * (compared case-insensitively) over the signing hash of the transaction
114
- * the request record describes. The first valid post wins, and every post
115
- * gets a verdict so callers can report the noise.
120
+ * Fetch the signature responses posted under `requestId` and verify each
121
+ * against the request: a post's signature must recover to
122
+ * `expectedSigner` (compared case-insensitively) over the signing hash of
123
+ * the transaction the request record describes. The first valid post wins,
124
+ * and every candidate gets a verdict so callers can report the noise. The
125
+ * declared id only routes: this verification is what separates the genuine
126
+ * response from garbage posted under the same id.
116
127
  *
117
128
  * @param requestId - The request id to fetch a verified response for.
118
129
  * @param expectedSigner - The EVM address (0x hex, any case) the genuine
119
130
  * response must be signed by: the requester's MPC-derived address.
120
131
  * @returns The first valid response (if any) plus per-post verdicts.
121
- * @throws Error when either contract has no state, the request is not on
122
- * the requester's ledger, or the responses ledger is inconsistent.
132
+ * @throws Error when the requester contract has no state or the request is
133
+ * not on its ledger.
123
134
  */
124
135
  getVerifiedSignatureRespondedEvent(requestId: RequestIdHex, expectedSigner: string): Promise<VerifiedSignatureResponseResult>;
125
136
  /**
126
137
  * Rebuild the unsigned EIP-1559 transaction for `requestId`: the exact
127
138
  * transaction the MPC signs, assembled from the request record's decomposed
128
- * fields. No responses-contract query: this needs only the request record
139
+ * fields. No event query: this needs only the request record
129
140
  * (fetched via {@link getSignatureRequest}, cached).
130
141
  *
131
142
  * @param requestId - The request id whose transaction to rebuild.
@@ -139,7 +150,7 @@ export declare class SignetRequestResponseReader {
139
150
  * Assemble the broadcast-ready signed EIP-1559 transaction for `requestId`:
140
151
  * rebuild the request's transaction and attach the first VERIFIED response
141
152
  * signed by `expectedSigner` (see {@link getVerifiedSignatureRespondedEvent}:
142
- * the response log is unauthenticated, so an `expectedSigner` is required
153
+ * the event log is unauthenticated, so an `expectedSigner` is required
143
154
  * and unverified posts are never attached).
144
155
  *
145
156
  * @param requestId - The request id to produce a signed transaction for.
@@ -148,47 +159,43 @@ export declare class SignetRequestResponseReader {
148
159
  * @returns The signed ethers transaction (`serialized` is the payload for
149
160
  * `eth_sendRawTransaction`), or `undefined` when no valid response has
150
161
  * been posted yet: poll again.
151
- * @throws Error when either contract has no state, the request is not on the
152
- * requester's ledger, or the responses ledger is inconsistent.
162
+ * @throws Error when the requester contract has no state or the request is
163
+ * not on its ledger.
153
164
  */
154
165
  getSignedEvmTransaction(requestId: RequestIdHex, expectedSigner: string): Promise<Transaction | undefined>;
155
166
  /**
156
- * Fetch every respond-bidirectional response posted for `requestId`, in
157
- * post (count) order. UNVERIFIED: the signet contract stores posts without
158
- * checking them, so any entry may be garbage. Each post carries a signature
159
- * and nothing else, so verifying it against the MPC response key you expect
160
- * is the only way to pick the genuine one: in-circuit at claim time, or off
161
- * chain with {@link verifyRespondBidirectionalSignature} over the output you
162
- * fetched. An empty array simply means none posted yet: poll again.
167
+ * Fetch every respond-bidirectional response posted under `requestId`, in
168
+ * emission order. UNVERIFIED: the declared id is routing data on an
169
+ * unauthenticated event log, so verifying a post against the MPC response
170
+ * key you expect is still the only way to pick the genuine one: in-circuit
171
+ * at claim time, or off chain with
172
+ * {@link verifyRespondBidirectionalSignature} over the output you fetched.
173
+ * An empty array simply means none posted yet: poll again.
163
174
  *
164
- * @param requestId - The request id whose responses to enumerate.
165
- * @returns The posted records, index = count, empty when none yet.
166
- * @throws Error when the signet contract has no state, or its counter
167
- * disagrees with the log (inconsistent ledger).
175
+ * @param requestId - The request id the posts must declare.
176
+ * @returns The request's posted records, oldest first, empty when none yet.
168
177
  */
169
178
  getRespondBidirectionalEvents(requestId: RequestIdHex): Promise<RespondBidirectionalEvent[]>;
170
179
  /**
171
- * Fetch the respond-bidirectional posts for `requestId` and return the
172
- * first (lowest count) one whose signature verifies over
180
+ * Fetch the respond-bidirectional posts declared under `requestId` and
181
+ * return the first (oldest) one whose signature verifies over
173
182
  * `serializedOutput` against `mpcResponseKey`: the off-chain twin of the
174
183
  * check the client contract runs in-circuit, and the only way to pick a
175
- * genuine post out of an unauthenticated log now that posts carry nothing
176
- * but a signature.
184
+ * genuine post out of an unauthenticated event log.
177
185
  *
178
186
  * The output must be the exact unpadded bytes the attestation commits to
179
187
  * (the packed respond payload, recomputed from the execution output the
180
188
  * client fetched), so a post that verifies here is the post that proves at
181
189
  * claim time.
182
190
  *
183
- * @param requestId - The request id to fetch a verified attestation for.
191
+ * @param requestId - The request id the posts must declare and the
192
+ * attestation must commit to.
184
193
  * @param serializedOutput - The serialised execution output the attestation
185
194
  * must commit to, exact unpadded bytes.
186
195
  * @param mpcResponseKey - The MPC response key the requesting contract
187
196
  * pinned at deploy (see `deriveMidnightResponseKey`).
188
197
  * @returns The first verifying post, or `undefined` when none has been
189
198
  * posted yet (poll again) or none attests this output.
190
- * @throws Error when the signet contract has no state, or its counter
191
- * disagrees with the log (inconsistent ledger).
192
199
  */
193
200
  getVerifiedRespondBidirectionalEvent(requestId: RequestIdHex, serializedOutput: Uint8Array, mpcResponseKey: Secp256k1Point): Promise<RespondBidirectionalEvent | undefined>;
194
201
  }
@@ -1 +1 @@
1
- {"version":3,"file":"signet-request-response-reader.d.ts","sourceRoot":"","sources":["../src/signet-request-response-reader.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAG1C,OAAO,EAGL,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC/B,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAKrE,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAE9B;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;OAMG;IACH,kBAAkB,CAChB,eAAe,EAAE,UAAU,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,GACvE,OAAO,CAAC;QAAE,IAAI,EAAE,gBAAgB,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;CAC/C;AAED,yEAAyE;AACzE,MAAM,WAAW,iCAAiC;IAChD,2EAA2E;IAC3E,QAAQ,CAAC,wBAAwB,EAAE,MAAM,CAAC;IAC1C;;;;;;OAMG;IACH,QAAQ,CAAC,qBAAqB,EAAE,SAAS,MAAM,EAAE,CAAC;IAClD,8CAA8C;IAC9C,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,oFAAoF;IACpF,QAAQ,CAAC,kBAAkB,EAAE,uBAAuB,CAAC;CACtD;AAED,4D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WG;IACG,6BAA6B,CACjC,SAAS,EAAE,YAAY,GACtB,OAAO,CAAC,yBAAyB,EAAE,CAAC;IAQvC;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,oCAAoC,CACxC,SAAS,EAAE,YAAY,EACvB,gBAAgB,EAAE,UAAU,EAC5B,cAAc,EAAE,cAAc,GAC7B,OAAO,CAAC,yBAAyB,GAAG,SAAS,CAAC;CAWlD"}
@@ -1,50 +1,40 @@
1
1
  // One-stop client-side reader for the signet request/response flow: fetch a
2
- // request record from the requester contract's ledger, enumerate the posts in
3
- // the signet contract's signature response log, and verify each candidate
4
- // against the request.
5
- // This is the helper the Signet.compact "Response Ledger Layout" comment
6
- // promises: the log is UNAUTHENTICATED, so a client must verify every post
7
- // and take the first valid one. This class packages that flow so every
8
- // consumer (CLI poller, integration tests, a future UI) shares one
9
- // implementation. Single-shot by design: each call queries state once, and
10
- // the caller owns any poll loop.
2
+ // request record from the requester contract's ledger, read the request's
3
+ // responses out of the contract events the signet contract emits, and verify
4
+ // each candidate against the request.
5
+ // A response is a Misc contract event that carries the request id it answers
6
+ // beside a signature. The id is UNAUTHENTICATED routing data: it scopes a
7
+ // read to one request's posts, and VERIFICATION establishes authenticity. A
8
+ // signature response answers a request exactly when it recovers to that
9
+ // request's derived signer over the request's transaction, and a
10
+ // respond-bidirectional post answers exactly when it verifies over
11
+ // (requestId, output) against the request's MPC response key. This class
12
+ // packages that flow so every consumer (CLI poller, integration tests, a
13
+ // future UI) shares one implementation. Single-shot by design: each call
14
+ // queries once, and the caller owns any poll loop.
11
15
  import { lookupSignetRequestAt } from "./signature-requests-state-reader.js";
12
- import { readSignetContractLedgerFromState, signetMapEntryKey, } from "./signet-contract-state-reader.js";
16
+ import { decodeRespondBidirectionalEventPayload, decodeSignatureRespondedEventPayload, SignetEventName, } from "./signet-contract-events.js";
13
17
  import { recoverSignatureResponseSigner } from "./signature-response-verification.js";
14
18
  import { verifyRespondBidirectionalSignature, } from "./ecdsa-attestation.js";
15
19
  import { signBidirectionalEventToSignedEvmTransaction, signBidirectionalEventToUnsignedEvmTransaction, } from "./signet-evtype2tx-requests.js";
16
- import { requestIdBytes, } from "./signet-requests.js";
20
+ import { requestIdBytes, requestIdHex, } from "./signet-requests.js";
17
21
  /**
18
22
  * Reader over one requester contract / signet contract pair.
19
23
  * Construct once per pair and reuse: fetched request records are cached (they
20
24
  * are immutable, the ledger key is their hash), so repeated verification
21
- * calls cost one responses-contract query each.
25
+ * calls cost one event query each.
22
26
  */
23
27
  export class SignetRequestResponseReader {
24
28
  config;
25
29
  // Request records never change once stored, so cache them across calls.
26
30
  requestCache = new Map();
27
31
  /**
28
- * @param config - The contract pair and state source to read through.
32
+ * @param config - The contract pair, state source and event source to read
33
+ * through.
29
34
  */
30
35
  constructor(config) {
31
36
  this.config = config;
32
37
  }
33
- /**
34
- * Query one contract's raw state, throwing a uniform error when absent.
35
- *
36
- * @param contractAddress - The contract to query.
37
- * @param role - Human name of the contract for the error message.
38
- * @returns The raw ledger state tree.
39
- * @throws Error when the address holds no contract state.
40
- */
41
- async queryRawState(contractAddress, role) {
42
- const state = await this.config.publicDataProvider.queryContractState(contractAddress);
43
- if (!state?.data) {
44
- throw new Error(`no state data found for ${role} contract '${contractAddress}' (is it deployed?)`);
45
- }
46
- return state.data;
47
- }
48
38
  /**
49
39
  * Fetch the request record for `requestId` from the requester contract's
50
40
  * request index (at the configured `requesterRequestsPath`). Cached
@@ -60,8 +50,11 @@ export class SignetRequestResponseReader {
60
50
  if (cached !== undefined) {
61
51
  return cached;
62
52
  }
63
- const raw = await this.queryRawState(this.config.requesterContractAddress, "requester");
64
- const request = lookupSignetRequestAt(raw, this.config.requesterRequestsPath, requestId);
53
+ const state = await this.config.publicDataProvider.queryContractState(this.config.requesterContractAddress);
54
+ if (!state?.data) {
55
+ throw new Error(`no state data found for requester contract '${this.config.requesterContractAddress}' (is it deployed?)`);
56
+ }
57
+ const request = lookupSignetRequestAt(state.data, this.config.requesterRequestsPath, requestId);
65
58
  if (request === undefined) {
66
59
  throw new Error(`request ${requestId} is not on the requester contract's ledger ` +
67
60
  `(request index at path ${JSON.stringify(this.config.requesterRequestsPath)}): was it submitted?`);
@@ -70,69 +63,78 @@ export class SignetRequestResponseReader {
70
63
  return request;
71
64
  }
72
65
  /**
73
- * Fetch every response posted for `requestId`, in post (count) order.
74
- * UNVERIFIED: any of them may be garbage (see
75
- * {@link getVerifiedSignatureRespondedEvent}).
66
+ * Fetch every event of `name` the signet contract has emitted, decode each
67
+ * with `decode`, and keep the posts whose declared request id is
68
+ * `requestId`, in emission order. The declared id is routing data only:
69
+ * the verified getters run the actual authenticity checks.
76
70
  *
77
- * @param requestId - The request id whose posts to enumerate.
78
- * @returns The posted payloads, index = count, empty when none yet.
79
- * @throws Error when the responses contract has no state, or its counter
80
- * disagrees with the log (inconsistent ledger).
71
+ * @param name - The signet event name to keep.
72
+ * @param decode - The payload decoder for that event kind.
73
+ * @param requestId - The request id the kept posts must declare.
74
+ * @returns The kept posts' records, oldest first.
81
75
  */
82
- async getSignatureResponses(requestId) {
83
- const raw = await this.queryRawState(this.config.signetContractAddress, "signet contract");
84
- const { respondCounterMap, respondMap } = readSignetContractLedgerFromState(raw);
85
- const totalPosts = respondCounterMap.get(requestId) ?? 0n;
86
- const responses = [];
87
- for (let count = 0n; count < totalPosts; count++) {
88
- const response = respondMap.get(signetMapEntryKey(requestId, count));
89
- if (response === undefined) {
90
- throw new Error(`response log has no entry ${count} for request ${requestId} ` +
91
- `despite its counter reading ${totalPosts}: ledger state is inconsistent`);
92
- }
93
- responses.push(response);
94
- }
95
- return responses;
76
+ async getRespondPostsNamed(name, decode, requestId) {
77
+ const events = await this.config.eventSource.querySignetEvents(this.config.signetContractAddress);
78
+ return events
79
+ .filter((event) => event.name === name)
80
+ .map((event) => decode(event.payload))
81
+ .filter((post) => requestIdHex(post.requestId) === requestId)
82
+ .map((post) => post.event);
83
+ }
84
+ /**
85
+ * Fetch every signature response posted under `requestId`, in emission
86
+ * order. UNVERIFIED: the declared id is routing data on an unauthenticated
87
+ * event log, so any post may still be garbage (see
88
+ * {@link getVerifiedSignatureRespondedEvent}, where verification
89
+ * establishes authenticity).
90
+ *
91
+ * @param requestId - The request id the posts must declare.
92
+ * @returns The request's posted records, oldest first, empty when none yet.
93
+ */
94
+ async getSignatureRespondedEvents(requestId) {
95
+ return this.getRespondPostsNamed(SignetEventName.SignatureRespondedEvent, decodeSignatureRespondedEventPayload, requestId);
96
96
  }
97
97
  /**
98
- * Fetch and verify the responses posted for `requestId`: each post's
99
- * signature must recover to `expectedSigner`
100
- * (compared case-insensitively) over the signing hash of the transaction
101
- * the request record describes. The first valid post wins, and every post
102
- * gets a verdict so callers can report the noise.
98
+ * Fetch the signature responses posted under `requestId` and verify each
99
+ * against the request: a post's signature must recover to
100
+ * `expectedSigner` (compared case-insensitively) over the signing hash of
101
+ * the transaction the request record describes. The first valid post wins,
102
+ * and every candidate gets a verdict so callers can report the noise. The
103
+ * declared id only routes: this verification is what separates the genuine
104
+ * response from garbage posted under the same id.
103
105
  *
104
106
  * @param requestId - The request id to fetch a verified response for.
105
107
  * @param expectedSigner - The EVM address (0x hex, any case) the genuine
106
108
  * response must be signed by: the requester's MPC-derived address.
107
109
  * @returns The first valid response (if any) plus per-post verdicts.
108
- * @throws Error when either contract has no state, the request is not on
109
- * the requester's ledger, or the responses ledger is inconsistent.
110
+ * @throws Error when the requester contract has no state or the request is
111
+ * not on its ledger.
110
112
  */
111
113
  async getVerifiedSignatureRespondedEvent(requestId, expectedSigner) {
112
114
  const request = await this.getSignatureRequest(requestId);
113
- const responses = await this.getSignatureResponses(requestId);
114
- const verdicts = responses.map((response, index) => {
115
- const count = BigInt(index);
115
+ const responses = await this.getSignatureRespondedEvents(requestId);
116
+ const verdicts = responses.map((response, position) => {
117
+ const index = BigInt(position);
116
118
  let signer;
117
119
  try {
118
120
  signer = recoverSignatureResponseSigner(request, response);
119
121
  }
120
122
  catch (error) {
121
123
  return {
122
- count,
124
+ index,
123
125
  response,
124
126
  rejectedReason: `not a decodable signature (${String(error)})`,
125
127
  };
126
128
  }
127
129
  if (signer.toLowerCase() !== expectedSigner.toLowerCase()) {
128
130
  return {
129
- count,
131
+ index,
130
132
  response,
131
133
  signer,
132
134
  rejectedReason: `signed by ${signer}, expected ${expectedSigner}`,
133
135
  };
134
136
  }
135
- return { count, response, signer };
137
+ return { index, response, signer };
136
138
  });
137
139
  return {
138
140
  verified: verdicts.find((v) => v.rejectedReason === undefined)?.response,
@@ -142,7 +144,7 @@ export class SignetRequestResponseReader {
142
144
  /**
143
145
  * Rebuild the unsigned EIP-1559 transaction for `requestId`: the exact
144
146
  * transaction the MPC signs, assembled from the request record's decomposed
145
- * fields. No responses-contract query: this needs only the request record
147
+ * fields. No event query: this needs only the request record
146
148
  * (fetched via {@link getSignatureRequest}, cached).
147
149
  *
148
150
  * @param requestId - The request id whose transaction to rebuild.
@@ -158,7 +160,7 @@ export class SignetRequestResponseReader {
158
160
  * Assemble the broadcast-ready signed EIP-1559 transaction for `requestId`:
159
161
  * rebuild the request's transaction and attach the first VERIFIED response
160
162
  * signed by `expectedSigner` (see {@link getVerifiedSignatureRespondedEvent}:
161
- * the response log is unauthenticated, so an `expectedSigner` is required
163
+ * the event log is unauthenticated, so an `expectedSigner` is required
162
164
  * and unverified posts are never attached).
163
165
  *
164
166
  * @param requestId - The request id to produce a signed transaction for.
@@ -167,8 +169,8 @@ export class SignetRequestResponseReader {
167
169
  * @returns The signed ethers transaction (`serialized` is the payload for
168
170
  * `eth_sendRawTransaction`), or `undefined` when no valid response has
169
171
  * been posted yet: poll again.
170
- * @throws Error when either contract has no state, the request is not on the
171
- * requester's ledger, or the responses ledger is inconsistent.
172
+ * @throws Error when the requester contract has no state or the request is
173
+ * not on its ledger.
172
174
  */
173
175
  async getSignedEvmTransaction(requestId, expectedSigner) {
174
176
  const { verified } = await this.getVerifiedSignatureRespondedEvent(requestId, expectedSigner);
@@ -181,56 +183,40 @@ export class SignetRequestResponseReader {
181
183
  return signBidirectionalEventToSignedEvmTransaction(request, verified);
182
184
  }
183
185
  /**
184
- * Fetch every respond-bidirectional response posted for `requestId`, in
185
- * post (count) order. UNVERIFIED: the signet contract stores posts without
186
- * checking them, so any entry may be garbage. Each post carries a signature
187
- * and nothing else, so verifying it against the MPC response key you expect
188
- * is the only way to pick the genuine one: in-circuit at claim time, or off
189
- * chain with {@link verifyRespondBidirectionalSignature} over the output you
190
- * fetched. An empty array simply means none posted yet: poll again.
186
+ * Fetch every respond-bidirectional response posted under `requestId`, in
187
+ * emission order. UNVERIFIED: the declared id is routing data on an
188
+ * unauthenticated event log, so verifying a post against the MPC response
189
+ * key you expect is still the only way to pick the genuine one: in-circuit
190
+ * at claim time, or off chain with
191
+ * {@link verifyRespondBidirectionalSignature} over the output you fetched.
192
+ * An empty array simply means none posted yet: poll again.
191
193
  *
192
- * @param requestId - The request id whose responses to enumerate.
193
- * @returns The posted records, index = count, empty when none yet.
194
- * @throws Error when the signet contract has no state, or its counter
195
- * disagrees with the log (inconsistent ledger).
194
+ * @param requestId - The request id the posts must declare.
195
+ * @returns The request's posted records, oldest first, empty when none yet.
196
196
  */
197
197
  async getRespondBidirectionalEvents(requestId) {
198
- const raw = await this.queryRawState(this.config.signetContractAddress, "signet contract");
199
- const { respondBidirectionalCounterMap, respondBidirectionalMap } = readSignetContractLedgerFromState(raw);
200
- const totalPosts = respondBidirectionalCounterMap.get(requestId) ?? 0n;
201
- const responses = [];
202
- for (let count = 0n; count < totalPosts; count++) {
203
- const response = respondBidirectionalMap.get(signetMapEntryKey(requestId, count));
204
- if (response === undefined) {
205
- throw new Error(`respond-bidirectional log has no entry ${count} for request ${requestId} ` +
206
- `despite its counter reading ${totalPosts}: ledger state is inconsistent`);
207
- }
208
- responses.push(response);
209
- }
210
- return responses;
198
+ return this.getRespondPostsNamed(SignetEventName.RespondBidirectionalEvent, decodeRespondBidirectionalEventPayload, requestId);
211
199
  }
212
200
  /**
213
- * Fetch the respond-bidirectional posts for `requestId` and return the
214
- * first (lowest count) one whose signature verifies over
201
+ * Fetch the respond-bidirectional posts declared under `requestId` and
202
+ * return the first (oldest) one whose signature verifies over
215
203
  * `serializedOutput` against `mpcResponseKey`: the off-chain twin of the
216
204
  * check the client contract runs in-circuit, and the only way to pick a
217
- * genuine post out of an unauthenticated log now that posts carry nothing
218
- * but a signature.
205
+ * genuine post out of an unauthenticated event log.
219
206
  *
220
207
  * The output must be the exact unpadded bytes the attestation commits to
221
208
  * (the packed respond payload, recomputed from the execution output the
222
209
  * client fetched), so a post that verifies here is the post that proves at
223
210
  * claim time.
224
211
  *
225
- * @param requestId - The request id to fetch a verified attestation for.
212
+ * @param requestId - The request id the posts must declare and the
213
+ * attestation must commit to.
226
214
  * @param serializedOutput - The serialised execution output the attestation
227
215
  * must commit to, exact unpadded bytes.
228
216
  * @param mpcResponseKey - The MPC response key the requesting contract
229
217
  * pinned at deploy (see `deriveMidnightResponseKey`).
230
218
  * @returns The first verifying post, or `undefined` when none has been
231
219
  * posted yet (poll again) or none attests this output.
232
- * @throws Error when the signet contract has no state, or its counter
233
- * disagrees with the log (inconsistent ledger).
234
220
  */
235
221
  async getVerifiedRespondBidirectionalEvent(requestId, serializedOutput, mpcResponseKey) {
236
222
  const events = await this.getRespondBidirectionalEvents(requestId);
@@ -1 +1 @@
1
- {"version":3,"file":"signet-request-response-reader.js","sourceRoot":"","sources":["../src/signet-request-response-reader.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,8EAA8E;AAC9E,0EAA0E;AAC1E,uBAAuB;AACvB,yEAAyE;AACzE,2EAA2E;AAC3E,uEAAuE;AACvE,mEAAmE;AACnE,2EAA2E;AAC3E,iCAAiC;AAKjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EACL,iCAAiC,EACjC,iBAAiB,GAGlB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EACL,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AAM,GAAG,MAAM,IAAI,CAAC,6BAA6B,CAAC,SAAS,CAAC,CAAC;QACnE,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAC3B,mCAAmC,CACjC,cAAc,CAAC,SAAS,CAAC,EACzB,gBAAgB,EAChB,KAAK,EACL,cAAc,CACf,CACF,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"signet-request-response-reader.js","sourceRoot":"","sources":["../src/signet-request-response-reader.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,0EAA0E;AAC1E,6EAA6E;AAC7E,sCAAsC;AACtC,6EAA6E;AAC7E,0EAA0E;AAC1E,4EAA4E;AAC5E,wEAAwE;AACxE,iEAAiE;AACjE,mEAAmE;AACnE,yEAAyE;AACzE,yEAAyE;AACzE,yEAAyE;AACzE,mDAAmD;AAKnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EACL,sCAAsC,EACtC,oCAAoC,EACpC,eAAe,GAKhB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EACL,mCAAmC,GAEpC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,4CAA4C,EAC5C,8CAA8C,GAC/C,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,cAAc,EACd,YAAY,GAGb,MAAM,sBAAsB,CAAC;AAsE9B;;;;;GAKG;AACH,MAAM,OAAO,2BAA2B;IACrB,MAAM,CAAoC;IAE3D,wEAAwE;IACvD,YAAY,GAAG,IAAI,GAAG,EAGpC,CAAC;IAEJ;;;OAGG;IACH,YAAY,MAAyC;QACnD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,mBAAmB,CACvB,SAAuB;QAEvB,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,SA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Ac,CAAC,SAAS,CAAC,EACzB,gBAAgB,EAChB,KAAK,EACL,cAAc,CACf,CACF,CAAC;IACJ,CAAC;CACF"}
@@ -16,8 +16,8 @@
16
16
  // the assertion, so any structural drift between the generated managed types
17
17
  // and these twins fails that package's `yarn build` / `yarn test`.
18
18
  //
19
- // Read more: https://docs.sig.network/ (signet protocol) and the module
20
- // header in Signet.compact (key derivation, event flow).
19
+ // Read more: the module header in Signet.compact (key derivation, event
20
+ // flow) and this package's README ("Sign bidirectional flow").
21
21
  import { CompactTypeBoolean, CompactTypeBytes, CompactTypeEnum, CompactTypeUnsignedInteger, } from "@midnight-ntwrk/compact-runtime";
22
22
  /**
23
23
  * Which transaction-param decomposition a request carries (Compact:
@@ -1 +1 @@
1
- {"version":3,"file":"signet-requests.js","sourceRoot":"","sources":["../src/signet-requests.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,4EAA4E;AAC5E,4EAA4E;AAC5E,0EAA0E;AAC1E,sEAAsE;AACtE,EAAE;AACF,iEAAiE;AACjE,2EAA2E;AAC3E,8EAA8E;AAC9E,gDAAgD;AAChD,EAAE;AACF,6EAA6E;AAC7E,mFAAmF;AACnF,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,mEAAmE;AACnE,EAAE;AACF,wEAAwE;AACxE,yDAAyD;AAEzD,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,0BAA0B,GAE3B,MAAM,iCAAiC,CAAC;AAsBzC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,sFAAsF;IACtF,QAAQ,EAAE,CAAC;IACX;;;;OAIG;IACH,QAAQ,EAAE,CAAC;CACH,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,4BAA4B;IAC5B,KAAK,EAAE,CAAC;IACR,0EAA0E;IAC1E,QAAQ,EAAE,CAAC;CACH,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC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MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IACpD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,qCAAqC,KAAK,GAAG,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,GAAmB,CAAC;AAC7B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,EAAgB;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;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,CAAC;AAE7B;;;;;;;;GAQG;AACH,MAAM,UAAU,6BAA6B,CAC3C,WAA0D;IAE1D,MAAM,KAAK,GAAgC,IAAI,GAAG,EAAE,CAAC;IACrD,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.15.0",
3
+ "version": "0.17.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sig-net/midnight-integration",
@@ -40,7 +40,7 @@
40
40
  "@midnight-ntwrk/compact-runtime": "0.18.0-rc.1",
41
41
  "@midnight-ntwrk/midnight-js-types": "5.0.0-beta.4",
42
42
  "@noble/curves": "^2.2.0",
43
- "@sig-net/midnight-serde": "^0.15.0",
43
+ "@sig-net/midnight-serde": "^0.17.0",
44
44
  "ethers": "^6.17.0"
45
45
  },
46
46
  "devDependencies": {