Deviant BCH wallet — CashTokens + covenants (Katalogos v1 · chipnet)
Find a file
Local Dev b8ac497323 feat(broadcast): multi-source fan-out replacing single-endpoint cashscript send
Introduces design/potidaea/src/broadcast.ts and wires every tx-emitting
site in the Potidaea client through it. Replaces cashscript's
TransactionBuilder.send() — which hits ONE hardcoded electrum endpoint
(wss://chipnet.bch.ninja:50004) — with a parallel fan-out that pushes
the same signed tx to as many independent nodes as the pool allows.

broadcast.ts
  - fanoutBroadcast(rawTxHex) fires in parallel:
      (a) every pre-opened ElectrumClient the caller passed in
      (b) up to N (default 3) fresh ephemeral WSS connections drawn
          from endpointsFor(currentNetwork()), shuffled; closed after
      (c) every HTTPS JSON-RPC proxy in broadcastRpcFor(currentNetwork())
          — our own-node write path, uncoupled from third-party Fulcrums
  - Resolves on first success, aggregates rejections for diagnostics
  - txidOf(rawTxHex) computes txid client-side (double-SHA256 + display
    byte-order) so we trust our own hash, not whatever a server echoes
  - rpcBroadcast handles BCHN "already known" (-27) as success — a tx
    already in mempool is "safely propagated" from the caller's view

Mixed-content handling: ephemerals skip ws:// URLs when the page itself
is served over https:, since Chrome's loopback exception doesn't apply
to in-page requests from a secure origin.

Integration (all 6 tb.send() sites):
  orbital.ts
    - claimViaLocalSigner       (BCH → MBA, Static family)
    - claimViaLocalSignerShare  (BCH → MBA, Share family)
    - redeemViaLocalSigner      (MBA → BCH, any family)
  genesis.ts
    - genesisArtemisionMBA      (Static family genesis)
    - genesisDeviantShareMBA    (Share family genesis)
  publish.ts
    - publishViaLocalSigner     (KatalogosRegistryV1.register tx)

Shape at each site: tb.build() to get raw hex, then
  const { txid } = await fanoutBroadcast(rawTxHex)
Caller gets the exact same ClaimTxResult / GenesisResult / PublishResult
shape as before — swapping cashscript's send for our fan-out is purely
additive at the API layer.

Server-side companion: scratchpad/silentmode-broadcast-proxy/ (chipnet
RPC proxy bundle) + scratchpad/mainnet-broadcast-proxy/ (mainnet twin,
pending BCHN install per MAINNET-BCH-PLAYBOOK.md). The chipnet
broadcastRpcFor() URL (chipnet.silentmode.st/rpc/broadcast) starts
responding once that bundle lands on silentmode; until then the public
Fulcrums carry the broadcast.

Depends on: feat(network) — broadcast.ts imports endpointsFor +
currentNetwork from the network module.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-10-08 22:45:12 +02:00
.claude chore(hooks): auto-regenerate snapshots/INDEX.md on snapshot writes 2026-07-07 01:58:15 +02:00
brand brand(landing): clean URLs — wordmark → ./ + deviant_website.html now redirects 2026-08-30 00:30:29 +02:00
contracts feat(potidaea): real Katalogos Publish broadcast · TST431 registered on chipnet 2026-09-06 18:35:41 +02:00
design feat(broadcast): multi-source fan-out replacing single-endpoint cashscript send 2026-10-08 22:45:12 +02:00
docs docs(reorg): rename DEX_Anthemus -> Anthemus_DEX; consolidate both DEX cells + the taxonomy there 2026-07-19 22:29:08 +02:00
KnowledgeBase refactor(taxonomy): regular-form class names + DEA renamed to Direct Emission Asset 2026-09-02 00:02:53 +02:00
Parameters feat(asm): tier-4 zero-contention retry — wallet + Potidaea + chipnet proof 2026-09-27 20:57:41 +02:00
public feat(onramp): SideShift Tier-3 in-wallet shift (ADR-0036 amendment) 2026-06-09 20:57:31 +02:00
scripts feat(asm-sequencer): settings-UI toggle in both surfaces (wallet committed; Potidaea drafted) 2026-10-02 20:40:59 +02:00
services feat(cross-chain): DGB-side HTLC primitives for the atomic-swap rail 2026-09-16 01:25:02 +02:00
shells feat(network): chipnet|mainnet state module + chain-aware wiring 2026-10-08 22:42:49 +02:00
site/deviant docs(mba): publish Mathematically Backed Asset explainer at deviant.x/docs/mba/ 2026-10-08 22:27:17 +02:00
snapshots feat(asm-sequencer): settings-UI toggle in both surfaces (wallet committed; Potidaea drafted) 2026-10-02 20:40:59 +02:00
spike chore: checkpoint working tree — shell Tier-B retirement + accumulated WIP 2026-06-17 01:01:37 +02:00
src feat(wallet): adjustable-fee end-to-end — Artemision + AssetDetail + updateFee 2026-09-02 08:15:40 +02:00
telegram-orderbook chore: sweep in-flight work across all domains 2026-07-29 01:14:33 +02:00
test feat(cross-chain): DGB-side HTLC primitives for the atomic-swap rail 2026-09-16 01:25:02 +02:00
wiki feat(asm-sequencer): systemd + user-funded /tip+/submit + wallet client 2026-10-02 00:21:51 +02:00
.calibration-sweep.json chore: checkpoint working tree — shell Tier-B retirement + accumulated WIP 2026-06-17 01:01:37 +02:00
.catalytic-sweep.json chore: checkpoint working tree — shell Tier-B retirement + accumulated WIP 2026-06-17 01:01:37 +02:00
.env.example feat(onramp): SideShift Tier-3 in-wallet shift (ADR-0036 amendment) 2026-06-09 20:57:31 +02:00
.gitignore feat(explorer): master-password unlock + all 15 keystore addresses 2026-09-19 01:18:41 +02:00
.kac-extract.txt chore: initial project baseline — full Deviant codebase under version control 2026-06-13 20:38:07 +02:00
.sim-athenae.json chore: initial project baseline — full Deviant codebase under version control 2026-06-13 20:38:07 +02:00
adaptive-data.json chore: checkpoint working tree — shell Tier-B retirement + accumulated WIP 2026-06-17 01:01:37 +02:00
bch-history.json chore: checkpoint working tree — shell Tier-B retirement + accumulated WIP 2026-06-17 01:01:37 +02:00
bch-market.json chore: checkpoint working tree — shell Tier-B retirement + accumulated WIP 2026-06-17 01:01:37 +02:00
BCH_Token_Economy_Concept_Paper.md chore: initial project baseline — full Deviant codebase under version control 2026-06-13 20:38:07 +02:00
bch_wallet_architecture.svg chore: initial project baseline — full Deviant codebase under version control 2026-06-13 20:38:07 +02:00
CLAUDE.md feat(asm): Potidaea swap-relay + tally refresh to 52,998 2026-08-14 01:39:41 +02:00
deviant_technical_spec_v2.7.md chore: checkpoint in-flight work across shell, contracts, and docs 2026-07-07 02:02:05 +02:00
package-lock.json chore: sweep in-flight work across all domains 2026-07-29 01:14:33 +02:00
package.json chore: sweep in-flight work across all domains 2026-07-29 01:14:33 +02:00
project-context.md feat(asm): Potidaea swap-relay + tally refresh to 52,998 2026-08-14 01:39:41 +02:00
README.md chore: initial project baseline — full Deviant codebase under version control 2026-06-13 20:38:07 +02:00
tsconfig.json chore: initial project baseline — full Deviant codebase under version control 2026-06-13 20:38:07 +02:00
usdm-historical.json chore: checkpoint working tree — shell Tier-B retirement + accumulated WIP 2026-06-17 01:01:37 +02:00

Deviant

BCH two-tier token economy platform. Pre-implementation. See BCH_Token_Economy_Concept_Paper.md for the full design.

Status

Bootstrap snapshot — protocol swap mechanism is the validation target.

Project map

Path Purpose
BCH_Token_Economy_Concept_Paper.md Architecture spec, all [PROPOSED] claims
CLAUDE.md Working agreement for Claude sessions
src/ TypeScript wallet + token logic
contracts/ CashScript source for Architecture A contracts
test/ Unit tests (regtest) + integration plan (chipnet, mainnet)
scripts/ Code-scan, snapshot, compile helpers
wiki/ Living docs: architecture, decisions, testing strategy, code map
snapshots/ Numbered progress snapshots

Quickstart

npm install
npm run compile:contracts   # produces artifacts from contracts/*.cash
npm run test:regtest        # runs regtest suite
npm run scan                # regenerates wiki/code-map.md
npm run snapshot            # appends a new snapshot

Build priorities (active)

  1. Protocol swap mechanism — most novel claim, needs validation first.
  2. CashScript enforcement on mainnet — not just theoretical verification.
  3. tokenId correlation across A/B tiers — edge cases expected.

See wiki/testing-strategy.md for the staged regtest → chipnet → mainnet plan.