deviant/scripts/lib
walerikus 0db77e154d feat(t6-mvp): self-custodial channel engine — board (checkDataSig) + BTC 2-of-2 (PSBT)
The T6 MVP core: both halves of a channel co-signed self-custodially, each party holding
only its own key. Validated on chipnet + BTC signet.

- Phase 1 — engine library (scripts/lib/t6-engine.mjs): T6Board with open/pay/settleHtlc/
  readState behind a clean API + injected per-party signers. Demo t6-engine-demo.mjs
  (open + 2 pays + read on chipnet).
- Phase 2 — self-custodial BCH board (contracts/BchChannelBoardUni.cash +
  t6-selfcustody-uni-demo.mjs): a state update is authorized by BOTH parties' checkDataSig
  over the state MESSAGE (channelId||state||balances), signed independently with each own
  key — no transaction co-signing. Sidesteps cashscript's inability to co-sign a tx across
  two key-holders (the both-signed board would need the WalletConnect signing path). channelId
  is a bytes32 constructor arg both sides control (no VM tokenCategory byte-order ambiguity;
  makes the address unique per channel = anti-replay). Validated update 932ad30d.
- Phase 3 — self-custodial BTC 2-of-2 (scripts/lib/t6-btc.mjs +
  t6-btc-selfcustody-close.mjs): real signet 2-of-2 funded + cooperatively closed to the
  board's agreed split, co-signed via bitcoinjs PSBT (Alice signs → base64 → Bob signs →
  finalize). Neither party holds the other's key. PSBT multi-party signing is native/clean,
  unlike the BCH board. Fund 98fa1d2d, close 413e52f8 (Alice 5700 / Bob 3800).

The transport carries only a PSBT (base64) or a 64-byte state signature — small, dumb, non-LN.
Remaining: Phase 4 (self-custodial wallet UI). Snapshots 0185, 0186.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 02:28:47 +02:00
..
anyhedge-oracle.mjs chore: initial project baseline — full Deviant codebase under version control 2026-06-13 20:38:07 +02:00
btc-htlc.mjs feat(t6): validate BTC↔BCH end-to-end + bonded M-of-N + wallet UX (ADR-0046) 2026-06-28 00:27:04 +02:00
t6-btc.mjs feat(t6-mvp): self-custodial channel engine — board (checkDataSig) + BTC 2-of-2 (PSBT) 2026-07-02 02:28:47 +02:00
t6-engine.mjs feat(t6-mvp): self-custodial channel engine — board (checkDataSig) + BTC 2-of-2 (PSBT) 2026-07-02 02:28:47 +02:00