deviant/Parameters/SESSION-REFERENCE_doublespend-and-blocksize-wars_2026-06-07.md
walerikus 518a3ce174 chore: initial project baseline — full Deviant codebase under version control
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>
2026-06-13 20:38:07 +02:00

8.5 KiB
Raw Blame History

Session reference — double-spend test + Block Size Wars documentation

Date: 2026-06-07 · For: future sessions, as a durable record of what this session established, built, and decided. Read this before re-opening any of the topics below — most were settled here.


0. One-paragraph summary

A feature question (can Bitcoin Cash host betting/games via Tote + oracle?) opened into (a) an empirical chipnet double-spend test that settled the "0-conf is unsafe" question, and (b) a long Bitcoin-history / block-size-war thesis that was written into the project's documentary corpus. Net output: a validated threat model + test harness, a substantially expanded Block Size Wars document, and the recognition of four core documents that carry the project's intellectual foundation.


1. The feature thread → the double-spend test (SETTLED)

Question chain: Tote/pari-mutuel works on chipnet → can it bet on real games via oracle/API? → oracle = an API wrapped in a signature (not an API itself) → can BCH run games (turn-based yes via state-machine covenants; real-time no) → is 0-conf safe enough for staked games?

What was built and run (live chipnet, 2026-06-07):

  • scripts/chipnet-doublespend-test.mjs + scripts/chipnet-doublespend-recheck.mjs
  • Test 1 (single-node first-seen): conflicting tx REJECTED — txn-mempool-conflict (code 18).
  • Test 2 (two-node race): both nodes accepted their own version; one block later exactly ONE confirmed, the conflict was DROPPED.

The settled 3-layer model (do not re-litigate — see wiki/onchain-game-settlement-threat-model.md, snapshot 0135, memory bch-doublespend-settled.md):

  1. 0-conf, no hashpower → defeated (proven above; no RBF, first-seen, DSProof).
  2. confirmed, no hashpower → defeated.
  3. confirmed, majority hashpower (Finney/51%) → economically gated, NOT impossible (Satoshi §6/§11; happened on ETC/BTG/BCH-May-2019; never on BTC). Design rule: scale settlement confirmations to pot size. The attacker (a bettor) has no hashpower anyway.

2. The block-size-war thesis (built into the corpus)

A multi-turn refinement, with the user driving the thesis and corrections being verified against primary sources before embedding. Key positions established:

  • The attack vector is philosophical, not technical. Satoshi's §11 ("secure as long as honest nodes control more CPU power…") assumes honesty is intrinsic. But §6 says nodes are honest because it pays — honesty is endogenous to the incentive field, and an incentive can be bought. The attacker reshapes the incentive field one layer above the protocol; honest miners flow to it.
  • Miners are a medium, not an agent. They serve whoever pays more; decisions are made by whoever supplies the incentives, currently above the protocol level.
  • Satoshi understood scarcity (4 documented anchors: P2P-Foundation debasement quote; genesis headline; scarce-metal analogy; whitepaper §6 gold-mining). The financialization instruments (futures/leverage/Tether) are old — they suppressed gold/silver before Bitcoin; only their application to Bitcoin was new.
  • Counterfeit scarcity / hold-vs-use. Synthetic (paper/derivative/layer-2) claims counterfeit a scarce asset. A used asset resists paper suppression (utility forces demand for real coins); a hold-only asset is paper-friendly and suppressible. "Digital gold — don't spend it" is the enabling condition for price suppression. → vectors 2 (ideological) and 3 (price speculation) are one apparatus; on-chain use is the solvent.
  • Three splits, one survivor. BTC (abandoned on-chain payments), BSV (failed identity claim), eCash/IFP (rejected centralization = immune response). BCH kept the roadmap through all three — battle-tested, not immune.
  • The protocol WAS attacked — subtly, as manufactured consent: capture the definition of what the coin is for, and the changes (RBF/SegWit/Taproot) are accepted as improvements. The "soft fork" framing obscured a coerced, split- risking operation (the "soft" is the majority-hashpower coordination, not the code). SegWit affects whitepaper §2/§7/§8; restoration was never pursued.
  • Brand ≠ definition. Bitcoin is defined by the technical document, not the ticker; the name-binding is a social convention, not a consensus fact.
  • Cobra (@CobraBitcoin), bitcoin.org co-operator, BTC-aligned, confirms the thesis in his own words: whitepaper "outdated and incorrect" (Oct 2017); bought BCH, rated it above LN for payments (Mar 2018); made the brand-vs-hashpower error the doc refutes (Nov 2018). Tweets need Wayback archival before publication.

3. What changed in the documents this session

KnowledgeBase/03_historical_and_political_economic/blocksize-war_…html (NOT Vol 13 — its own file, an extract):

  • Added the §11 epigraph + a lettered front arc §A–I (premise → warning → miners → scarcity → splits → vectors → two views → subtle attack → use-is-defense).
  • §VI additions: purchased-softness/verifying-vs-mining mechanism; reconstruction/irreversibility paragraph.
  • §H Cobra callout (3 tweets) + "it would have come later" self-refuting defense + brand-is-social-convention sharpening.
  • §F / §I cross-references to the On-Chain-Only Philosophy doc.
  • §D scarce-metal quote tightened to verified wording.

Created:

  • KnowledgeBase/RAW/blocksize-war_attack-vector_DRAFT.md — synthesis source.
  • KnowledgeBase/RAW/blocksize-war_source-verification-checklist.md — source-status tracker.
  • wiki/onchain-game-settlement-threat-model.md, snapshot 0135, memory bch-doublespend-settled.md, scripts/chipnet-doublespend-{test,recheck}.mjs.

Vol 13 was NOT modified (confirmed constraint).


4. The four core documents

The project's intellectual foundation is four documents, forming one spine:

# Document Role
1 Vol 13 — Bitcoin Discovery (vol13_bitcoin-history_…html) The technical/historical record: whitepaper spec, pre-conflict consensus, block-size-war chronology (§III–XII), BSV (§XII), derivatives (§IX). The authoritative opus.
2 Vol 14 — The Information Environment (vol14_information-environment_…html) The discourse/media/funding/platform-capture layer; tactics; the digital-gold inversion.
3 The On-Chain-Only Design Philosophy (Parameters/webfiles/the_on-chain-only_design_philosophy_FOR-reference.html) The structural philosophy: protocol = legitimacy layer; layer-2 = structurally counterfeit (gold-standard parallel); active verification (bank analogy); custodial ≠ asset; no bridge is trustless. Project-agnostic; designed to be cited, not re-litigated.
4 The Block Size Wars (blocksize-war_…html) The applied case: how the war happened, what each side defended, the attack vector, the three splits, and on-chain use as the defense. Currently an extract of Vol 13, now substantially expanded (front arc §A–I).

Spine: technical record (13) → information environment (14) → structural philosophy (on-chain-only) → block-size-war application (BSW). The user may later combine/improve these into an ebook.


5. Open / next steps

  • Verification sweep (pre-publication): Wayback-archive the 3 Cobra tweets; source-or-soften the "would have come later" characterization; optionally add verified primary URLs to the References list. (Satoshi anchors + technical claims already verified — see the checklist.)
  • Corpus numbering — DECIDED (2026-06-07): all four are designated "core" with no renumbering. Block Size Wars stays a Vol 13 extract; the On-Chain-Only Philosophy stays a standalone project-agnostic reference. Recorded in memory deviant-four-core-documents and the corpus directory.
  • Possible complementary documents and eventual ebook combining the four.

6. Working method that worked (for future sessions)

The user values verification over agreement: every claim destined for the corpus was checked against primary sources before embedding; corrections were made in both directions (the user corrected the assistant on SegWit/terminology and on "the tools didn't exist"; the assistant corrected the user on the "split" mechanism, §3-vs-§8, and the "bribe miners" framing). The corpus discipline — state documented facts + mechanism, leave motive to the reader, label the strong claims, keep honest counterweights — is the source of its credibility. Hold it.