deviant/scripts/lib
walerikus 757d381776 feat(t6-mvp): wire BTC 2-of-2 lifecycle into the wallet — real open + coop close
The self-custodial agent now drives BOTH chains of a T6 channel, closing the gap
Phase 4b left open (board-only). Open funds a real BTC 2-of-2 on signet coordinated
with board state 0 (1:1 capacity); Close settles the 2-of-2 to the board's latest
split via a cooperative-close PSBT co-signed over the keyless relay — the co-signer
verifies the payout against the board before signing (verifyClose: outputs == board
split AND input spends our 2-of-2; no blind-signing). BTC pubkeys ride the hello
handshake; each agent still holds only its own keys, relay holds none.

Validated on real coins (two agent processes):
  BTC fund   c0832299 (10000 sat 2-of-2)  [signet]
  board #0   04ccc060 (6000/4000)         [chipnet]
  A→B 2000   fd3367bd (4000/6000)
  B→A 1000   d968a524 (5000/5000)
  coop close a380d0e4 → Alice 4750 / Bob 4750  [signet, 2 outputs spend the 2-of-2]

Adds t6-btc.inspectClose + agent Close flow + UI Close button/BTC panel. Finding:
bitcoinjs v7 returns witnessScript as Uint8Array — Buffer.from() before .toString('hex').
Spec §3.5/§4/§5/§6/§7 + snapshot 0189.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 00:52:39 +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): wire BTC 2-of-2 lifecycle into the wallet — real open + coop close 2026-07-03 00:52:39 +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
t6-wallet.mjs feat(t6-mvp): two-party self-custodial wallet protocol (Phase 4a) 2026-07-02 18:14:52 +02:00