Adds AES-256-GCM + PBKDF2-SHA256 (200,000 iterations) encryption for the
consolidated chipnet keystore. Loader auto-detects the encrypted format
(`chipnet-keystore/2-encrypted`) and prompts for the master password on
first use — or reads CHIPNET_KEYSTORE_PASSWORD env for scripted/CI runs.
Password cached in-process only.
- scripts/chipnet-keystore-encrypt.mjs — one-shot encrypt in place;
backs up plaintext to Keys/chipnet-keystore.plain.bak (also gitignored)
- scripts/chipnet-keystore-decrypt.mjs — --check, --in-place, --stdout,
--out=<path> modes for verification and one-time exports (bulk import
into a wallet UI, migration, key rotation)
- scripts/lib/chipnet-keystore.mjs — adds loadAllAsync(),
getEntryAsync(), ensureKeystoreUnlocked(); sync API still works on
plain keystores and throws a clear "call *Async instead" on encrypted
ones until unlocked once at boot
Test coverage: round-trip encrypt+verify+load-async validated end-to-end;
plain-keystore path still loads all 12 wallets unchanged.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Prove the Potidaea platform-fee revenue model live on chipnet with two
end-to-end swap-relay tests, then sweep the cumulative chipnet-swap tally
from "17,000+" to the exact figure 52,998 across every referencing doc.
Snapshot 0239 (four revisions) captures the full arc — GMX Potidaea
(9,296 swaps · 5.47 M platform bits) → OpenMint Potidaea (26,599 swaps ·
15.02 M platform bits · 30.03 M founder bits · 44 swaps/sec peak · 2:1
founder/platform ratio matching ADR-0053 spec exactly). Client-added
platform-fee output at tx.outputs[3] — no covenant change required.
Ships the multi-source connectivity layer used throughout:
scripts/lib/chipnet-multisource.mjs (race local Fulcrum + BCHN RPC +
public electrums, chipnet-only endpoint list, wrong-network tip-guard,
belt-and-braces broadcast) and scripts/lib/chipnet-keystore.mjs (single
Keys/chipnet-keystore.json for all wallets, legacy per-file fallback).
Keys/ added to .gitignore.
Also: GMX/Game.X zero-bet-fee policy — chipnet-gmx-game-loop-test.mjs
now returns 0n from escrowFee() by default (feeAmount=0 on the escrow
covenant; already covered by the "if feeAmount > 0" gate at
GamePoolEscrowFlat.cash:54, no covenant change needed). Old formula
kept behind ARBITER_FEE_LEGACY=1 env flag.
Canonical tally table lives in
Parameters/ASM_Native/ASM-single-asset-throughput.md §4a; update it
first when the next throughput runs land, then grep-replace the exact
number across dependent files.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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>
T6Wallet (scripts/lib/t6-wallet.mjs) — one party's self-custodial wallet holding only its
own key. Two wallets pay each other over a transport: payer signs the next state, peer signs
it remotely, board is updated (payUni). No shared keys, no tx co-signing; the transport carries
only a proposal + a 64-byte state signature. Validated on chipnet (t6-wallet-p2p-demo.mjs):
open + 3 payments both directions, monotonic 1->3, final Alice 40000 / Bob 60000.
The MVP functional core is now complete (engine + self-custodial board + BTC 2-of-2 PSBT +
this protocol). Remaining: Phase 4b front-end UI (relay + client-side keys). Snapshot 0187.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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>
- scripts/lib/btc-htlc.mjs — P2WSH HTLC mirroring AtomicSwapHTLC.cash (same SHA256
hashlock, same claim/refund split, signet via esplora). Not yet run.
- scripts/btc-signet-setup.mjs — generate/show the gitignored signet funding key.
- .gitignore — ignore .btc-*.json (signet testnet keys).
Deps (bitcoinjs-lib, ecpair, tiny-secp256k1) intentionally left in package.json's
working tree, not committed — package.json carries an unrelated uncommitted line from
another session (chipnet:dashboard); same reason a71841f kept it out.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Brings the whole project into git (previously only the on-ramp feature and
a few parallel files were tracked). Includes: wallet core (src/), CashScript
contracts/, the Capacitor shell (shells/), scripts/, tests, and the docs
corpus (wiki/, snapshots/, Parameters/, Archive/, KnowledgeBase text).
Excluded via .gitignore: node_modules/, dist/, .env (secrets), testnet WIF
key files (.chipnet-*.json, devWallets.ts), KnowledgeBase/RAW media (~9.6 GB),
transcripts/ (session logs), and machine-local config (.claude/*.local,
*.lock). Secret-scanned before commit — no credentials in the tree.
Note: src/swapMath.ts, src/swapBuilder.ts, contracts/OpenMintToken.cash are
legacy (OP_RETURN era) but still imported; committed as-is, flagged for a
separate removal once de-referenced.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>