deviant/scripts/asm-sequencer/lib
Local Dev b8b110dc97 feat(asm): tier-2 sequencer service drafted + chipnet-proved 5/5
Adds the coordinator-funded HTTP relay from
Parameters/ASM_Native/ASM-single-asset-throughput.md §2a — the
low-latency path that complements the tier-4 wallet retry (0272/0275/
0277) by turning N simultaneous claim requests into an ordered chain
from ONE reservoir. Trust surface: the covenant enforces the swap
math either way; the relay can only order and rebroadcast.

scripts/asm-sequencer/
  server.mjs   — Node HTTP daemon: GET /health, POST /claim, POST /admin/reload-tip
  client.mjs   — reference client (portable to wallet + dApp)
  lib/state.mjs — SequencerState + async mutex over the chain

scripts/chipnet-asm-sequencer-daemon-test.mjs
  spawns daemon, fires 5 parallel /claim requests, verifies txid chain

Chipnet result: 5 wire arrivals within 3 ms produce 5/5 accepted in
daemon-assigned order; each tx's `before.reservoir` matches the
previous tx's txid. Reservoir advanced 5 times from one starting
outpoint, zero collisions. Baseline naïve parallel is 1/5.

Snapshot 0278 documents the trust model, gotchas
(chipnet wallet BCH depletion, cashaddr → tokenaddr conversion), and
the roadmap: wallet-side client wire, then SIGHASH_ANYONECANPAY
user-funded variant, then multi-category.

Wiki handoff (wiki/asm/zero-contention-protocol.md) updated with the
tier-2 status.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-09-28 01:47:40 +02:00
..
state.mjs feat(asm): tier-2 sequencer service drafted + chipnet-proved 5/5 2026-09-28 01:47:40 +02:00