deviant/CLAUDE.md
Local Dev 6130c0cab1 feat(asm): Potidaea swap-relay + tally refresh to 52,998
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>
2026-08-14 01:39:41 +02:00

5.2 KiB
Raw Permalink Blame History

This is a BCH wallet project with additional features that exist only as ideas for now, that need to be tested and implemented.

During the implementation we may need the basic optimisationset of rules for claude efficiency.

Wiki updates to keep a track of changes. Snapshots, to track progress. Create scripts to navigate source code and reduce claude processing time and token burn. Add other code processing optimisation configurations, verify them, drop if not necessary.

Terminology (project-wide — always apply)

  • Unit name: use "bit" / "bits", never "sat" / "sats". The smallest Bitcoin Cash unit is called a bit (plural bits) throughout this project. It is the same unit as a satoshi — 1 bit = 1 sat = 0.00000001 BCH — only the name changes (not the value; this is not the legacy "1 bit = 100 sats" meaning). Apply to all user-facing copy, UI text, docs, comments, and new writing: write "10,000 bits/unit", "fee ≈ 50 bits", "bit/vByte", etc. Migrate sat→bit / sats→bits when editing copy. Code identifiers stay as-is (e.g. rateSats, backingRateSats, satoshis, bchSats) unless a rename is explicitly requested — only their displayed labels read "bits".

Required reading on session start (in this order)

  1. deviant_technical_spec_v2.7.md — current authoritative spec. Start at §1 (Project Overview).
  2. BCH_Token_Economy_Concept_Paper.md — original concept; the spec refines it.
  3. wiki/index.md — entry point to the living docs.
  4. The latest snapshots/00NN-*.md — what shipped last, what's deferred, what's superseded. Use snapshots/INDEX.md (domain view) to find snapshots for the area you're working in.
  5. wiki/decisions.md — ADRs, including any that flag spec/code divergence.

The protocol swap was validated on chipnet back at snapshot 0008 (52,998 swaps since, zero exploits — canonical count lives in Parameters/ASM_Native/ASM-single-asset-throughput.md §4a; refresh both when new throughput runs land). Phase 2 + Phase 3 are complete: the full DeviantWallet stack, CLI + web UI, verify module, and SQLite registry all ship and are validated end-to-end on live chipnet. Pick up from the latest snapshot.

Documentation conventions (keep the knowledge base navigable)

The project spans several products (Wallet UI · ASM/Potidaea/Anthemus · FIATm/BCHm · cross-chain · games/tote · governance). Rules to keep 200+ snapshots + the wiki navigable by domain — follow them so the index stays correct:

  • Snapshots stay a flat, chronological changelog in snapshots/. Do NOT reorganise them into per-app folders — chronology is their value; the domain view is an index.
    • Give every NEW snapshot YAML frontmatter: domain: — one of wallet | asm | fiatm | cross-chain | games-tote | governance | onramp | infra — plus summary: (one concise line) and optional tags: (comma keywords); and a domain-prefixed slug (e.g. 0225-wallet-…, 0226-asm-…).
    • After writing a snapshot, run node scripts/build-snapshot-index.mjs to regenerate snapshots/INDEX.md. That file is DERIVED — never hand-edit it; fix the frontmatter and rerun. INDEX.md has a top Quick-find table (№ · domain · tags · summary) + per-domain sections. All snapshots are tagged; an untagged one falls back to slug-keyword bucketing (then fix by adding a tag).
  • Reference docs are organised by DOMAIN — wiki/<domain>/ folders: wallet/ asm/ fiatm/ cross-chain/ governance/ games-tote/ onramp/ platform/ infra/, each with an index.md (current state + "how to add here" + links to its snapshots, Parameters/ specs, and code). wiki/index.md is a router (domain table); wiki/decisions.md (ADRs), wiki/glossary.md, wiki/architecture.md, wiki/asset-landscape.md stay global at the root. Put a new reference doc in the right domain folder and add it to that folder's index.md. (Potidaea/Anthemus deep specs live under Parameters/, linked from wiki/asm/index.md.)
  • Parameters/ is the source-spec / context layer (already domain-organised: ASM_CrossChain, ASM_Native (holds Potidaea_OrbitalSwap · MBA_Shares · FIATm), Anthemus_DEX (holds the DEX cells + ASM_DEX_Taxonomy.md, the ASM-vs-DEX 2×2), dApp, …). Link to it from wiki domain indexes — don't duplicate.
  • Two chat sessions may share this working tree. Before editing wallet files, check shells/app/WALLET-COORDINATION.md: contracts-first (read the owner's spec/snapshot before coding), one owner per file.

Model selection

At the start of each task, declare the recommended model on the first line of your response:

  • > Model: Sonnet — script adaptation, chipnet runs, snapshot/wiki writes, file wiring, pattern-following code, debugging known error classes.
  • > Model: Opus — novel CashScript covenant design, ADR drafting, security/threat analysis, new economic model design, complex multi-constraint reasoning.

Do not pin a specific version number (e.g. write Opus, not Opus 4.6). If recommending Opus, add one line of justification: > Reason: [what makes this task require deeper reasoning]. The user will run /model to switch before confirming the task. Skip the declaration only for trivial one-liners (single-file reads, status checks, yes/no questions).