Deviant BCH wallet — CashTokens + covenants (Katalogos v1 · chipnet)
Four improvements in one pass:
1) Swap preview matches on-chain result (fixes user-reported drift)
The mockup's recalc applied a flat 0.5 % fee to the FROM amount, then
converted. The covenant works differently:
- CLAIM (BCH → MBA): gross BCH enters covenant; user receives
floor(gross / rate) MBA units. Fee is an EXTRA BCH output
deducted from wallet change, NOT from the mint amount.
- REDEEM (MBA → BCH): user burns units; receives units × rate
− miner_fee bits. No founder / platform fee.
User reported "preview showed 999.5 ASM, receipt 1005 ASM" — off by
the mockup's fake 0.5 %. Now the preview reads 100,000 ASM for
0.1 BCH → ASM and 0.04997 BCH for 50,000 ASM → BCH, both matching
handleRealSwapConfirm's integer math.
main.ts exposes potidaeaEstimateNet(from, to, amt) using KNOWN_MBAS;
recalc + recalcFromOut call it first, fall back to the mockup's flat
approximation for unknown pairs (USDm etc.).
Fee-value display now uses 6 decimals when denominated in BCH (was
fixed at 2 — rounded 0.0015 BCH to "0.00").
2) My-assets rows get action buttons
Every row now shows Swap → · Publish → · ↗:
- Swap → sets from=BCH / to=<ticker> and jumps to swap view.
- Publish → keeps the existing wiring to openPublishOverlay.
- ↗ links to chipnet.imaginary.cash/tx/<genesisTxid>.
loadLocalKnownMbas now includes the genesis txid so the ↗ works
without a second lookup.
3) Anthemus preview ribbon
The DEX view is a mockup (hardcoded book / AMM pool / quotes) but was
sitting silently next to real Potidaea flows. Adds a persistent amber
banner at the top of #v-anthemus: "Anthemus is a preview. Order book,
AMM pool and quotes on this page are illustrative — no real orders
are broadcast." + "Try Potidaea instead ↗" link. Stops eroding trust
in the shipped surface.
4) Wizard draft autosave
sessionStorage snapshot of every wizard field (asSym / asName /
asRate / asFee / asDec / asGlyph + wiz.step / family / cls) on every
input change and every step transition. Restored on next Artemision
visit — a stray refresh mid-flow no longer wipes progress. Successful
broadcast (mockup + real via runArtemisionGenesis) clears the draft
so the next fresh visit starts clean.
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.