Deviant BCH wallet — CashTokens + covenants (Katalogos v1 · chipnet)
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>
|
||
|---|---|---|
| .claude | ||
| brand | ||
| contracts | ||
| design | ||
| docs | ||
| KnowledgeBase | ||
| Parameters | ||
| public | ||
| scripts | ||
| services | ||
| shells | ||
| site/deviant | ||
| snapshots | ||
| spike | ||
| src | ||
| telegram-orderbook | ||
| test | ||
| wiki | ||
| .calibration-sweep.json | ||
| .catalytic-sweep.json | ||
| .env.example | ||
| .gitignore | ||
| .kac-extract.txt | ||
| .sim-athenae.json | ||
| adaptive-data.json | ||
| bch-history.json | ||
| bch-market.json | ||
| BCH_Token_Economy_Concept_Paper.md | ||
| bch_wallet_architecture.svg | ||
| CLAUDE.md | ||
| deviant_technical_spec_v2.7.md | ||
| package-lock.json | ||
| package.json | ||
| project-context.md | ||
| README.md | ||
| tsconfig.json | ||
| usdm-historical.json | ||
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)
- Protocol swap mechanism — most novel claim, needs validation first.
- CashScript enforcement on mainnet — not just theoretical verification.
- tokenId correlation across A/B tiers — edge cases expected.
See wiki/testing-strategy.md for the staged regtest → chipnet → mainnet plan.