@rolly-dev/witness-core 1.1.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -129,13 +129,13 @@ export interface ProcessTxRequest {
129
129
  userId: number
130
130
  amount: string
131
131
  winAmount?: string
132
- userAddress?: Buffer
133
132
  /**
134
- * `Poseidon2(recipient_address)[0..2]` as 16 little-endian bytes (2 limbs)
135
- * — the payout counterparty (hot wallet) the client Schnorr-signs. Absent
136
- * for operator / non-authenticated tx.
133
+ * 20-byte EVM address (deposit / withdrawal / key register). For a
134
+ * withdrawal this is the payout destination the client Schnorr-signed; the
135
+ * engine derives the slot's `recipient_addr_hash` from it, so the
136
+ * signature verifies only against the address that is actually paid.
137
137
  */
138
- recipientAddrHash?: Buffer
138
+ userAddress?: Buffer
139
139
  newPkHash?: Buffer
140
140
  /**
141
141
  * Client authorization signature bytes, forwarded verbatim (opaque here).
@@ -166,7 +166,21 @@ export interface ProcessTxResult {
166
166
  newBalance: string
167
167
  available: string
168
168
  newCredit: string
169
+ /**
170
+ * Full post-tx leaf nonce (`account_lane · 2^40 + game_lane`) — the value
171
+ * committed in the leaf / pubdata. Clients never sign this directly.
172
+ */
169
173
  newNonce: string
174
+ /**
175
+ * Post-tx GAME lane — the counter the next `in_house_bet` / `crash_settle`
176
+ * signature must carry.
177
+ */
178
+ newGameNonce: string
179
+ /**
180
+ * Post-tx ACCOUNT lane — the counter the next withdrawal / transfer /
181
+ * key-registration signature must carry.
182
+ */
183
+ newAccountNonce: string
170
184
  winAmount: string
171
185
  random?: string
172
186
  nextSeedHash?: string
@@ -298,7 +312,23 @@ export declare class MerkleEngine {
298
312
  getTl(): bigint
299
313
  getBalance(userId: number): bigint
300
314
  getCredit(userId: number): bigint
315
+ /**
316
+ * Full packed leaf nonce (`account_lane · 2^40 + game_lane`) — the pubdata
317
+ * value. For what a client must SIGN use [`Self::get_game_nonce`] /
318
+ * [`Self::get_account_nonce`].
319
+ */
301
320
  getNonce(userId: number): bigint
321
+ /**
322
+ * Game-lane counter the next `in_house_bet` / `crash_settle` signature
323
+ * must carry (`leaf_nonce mod 2^40`).
324
+ */
325
+ getGameNonce(userId: number): bigint
326
+ /**
327
+ * Account-lane counter the next withdrawal / transfer / key-registration
328
+ * signature must carry (`leaf_nonce >> 40`). Bets never move it, so a
329
+ * withdrawal signed against it stays valid while the user keeps playing.
330
+ */
331
+ getAccountNonce(userId: number): bigint
302
332
  /** Spendable balance minus all frozen buckets (withdrawal + game locks). */
303
333
  getAvailable(userId: number): bigint
304
334
  getSeedHash(userId: number): Buffer
@@ -355,10 +385,12 @@ export declare class MerkleEngine {
355
385
  hasInitSeedReservation(userId: number): boolean
356
386
  /**
357
387
  * Open a crash-round auth lock for `user_id`: while set, `process_tx`
358
- * rejects any nonce-bumping tx (`in_house_bet` / `withdrawal` / `transfer`
359
- * / `key_register`) with `CrashRoundOpen`, so the account's pre-signed
360
- * `crash_settle` auto-cashout keeps its bound nonce. Called by the crash
361
- * game when a bet is placed. NON-consensus; idempotent.
388
+ * rejects a game-lane tx (`in_house_bet`) or a key rotation
389
+ * (`key_register`) with `CrashRoundOpen`, so the account's pre-signed
390
+ * `crash_settle` auto-cashout keeps its bound game-lane nonce and signing
391
+ * key. Account-lane withdrawal / transfer are NOT blocked — they move a
392
+ * counter the cashout never signed. Called by the crash game when a bet is
393
+ * placed. NON-consensus; idempotent.
362
394
  */
363
395
  lockCrashRound(userId: number): void
364
396
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rolly-dev/witness-core",
3
- "version": "1.1.0",
3
+ "version": "1.3.1",
4
4
  "description": "Authoritative native witness-state engine for Rolly ZK-Rollup (Node-API addon)",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
Binary file
Binary file