Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
25763f2
docs: LS-QMSR verification — disprove properness, confirm bounded loss
tvolk131 Apr 16, 2026
12e9605
feat: on-chain market seeder script and relay-cache discovery fix
dmnyc Apr 16, 2026
17d0a00
docs: move wallet entropy doc to architecture folder
dmnyc Apr 16, 2026
b1300af
fix: cat loader for market fetch, remove unused nav and help UI
dmnyc Apr 16, 2026
14a9987
fix: auto-sync wallet every 15s while unlocked
dmnyc Apr 16, 2026
58cd376
docs: market grouping spec for multi-outcome events
dmnyc Apr 16, 2026
9206295
feat: toast notifications for wallet transactions
dmnyc Apr 16, 2026
f2647d4
feat: wallet badge and unconfirmed transaction indicators
dmnyc Apr 16, 2026
bfb2eda
fix: relay cache replacement and empty-response guard
dmnyc Apr 16, 2026
47127dd
fix: chain tip for time remaining and human-readable chart axis
dmnyc Apr 16, 2026
89a79b1
feat: trading panel UX — insufficient funds, friendly errors, lock state
dmnyc Apr 16, 2026
f1d8c10
fix: wallet badge only triggers on incoming funds
dmnyc Apr 16, 2026
e68cda8
feat: expanded market seeder with UTXO retry and docs
dmnyc Apr 16, 2026
81344d9
style: formatting fixes for biome and cargo fmt
dmnyc Apr 16, 2026
9dba933
feat: password-protect nsec reveal, clickable market cards
dmnyc Apr 16, 2026
41b3807
fix: replace LazyLock with once_cell::Lazy for MSRV 1.77 compat
dmnyc Apr 16, 2026
101f034
fix: restore liquid receive QR code when switching tabs
dmnyc Apr 16, 2026
c385e6d
feat: send confirmation flow, max drain, and friendly errors
dmnyc Apr 16, 2026
31f3b51
refactor: shared useLockScroll hook for all modals
dmnyc Apr 16, 2026
03606b4
fix: skeleton loading state replaces splash/empty-state race condition
dmnyc Apr 16, 2026
ec67a59
docs: update AGENTS.md and add CLAUDE.md with CI checks and conventions
dmnyc Apr 16, 2026
d048641
fix: onboarding restore flow focus and password persistence bugs (#77)
dmnyc Apr 16, 2026
c00da61
perf: non-blocking startup — serve cached data instantly
dmnyc Apr 16, 2026
3f67aef
perf: persist relay market cache to disk for instant cold start
dmnyc Apr 16, 2026
6fb0cbd
feat: add checkmark icon for Resolved category tab
dmnyc Apr 16, 2026
fbb537d
feat: category icons on all pages, reorder tabs, shorten Ending Soon
dmnyc Apr 16, 2026
649af22
fix: unlock body scroll when profile modal is closed
dmnyc Apr 17, 2026
9efdc80
feat: embed macOS traffic lights via transparent title bar
dmnyc Apr 17, 2026
7797861
fix: switch title bar to Overlay + reserve space for traffic lights
dmnyc Apr 17, 2026
cb245b4
feat: full-width drag, inline search at all widths, smaller logo
dmnyc Apr 17, 2026
9f9b4ae
fix: improve keyboard interactions across dialogs
dmnyc Apr 17, 2026
54fd3bb
Settings version footer + scrollbar and traffic-light polish (#82)
dmnyc Apr 19, 2026
5a5bd09
fix: logo click resets category to Trending
dmnyc Apr 19, 2026
6fe959b
Feat/preview charts (#83)
Uty-re Apr 21, 2026
2fc7009
fix: avoiding repeated syncs during fee-convergence
sergey3bv Apr 16, 2026
ab36bf5
feat: Polymarket-style probability chart with Yes/No toggles (#84)
Uty-re Apr 21, 2026
a9abe98
fix: split preview vs commit for Nostr identity to stop onboarding fr…
dmnyc Apr 21, 2026
d475718
feat: Polymarket-inspired detail page UX refresh (#87)
Uty-re Apr 22, 2026
18618dd
refactor: introduce NostrSigner trait abstraction for NIP-46 remote s…
claude Apr 16, 2026
56c6886
feat: add NIP-46 remote signing commands (connect, disconnect, status)
claude Apr 16, 2026
b56ac08
feat: add bunker login UI for NIP-46 remote signing
claude Apr 16, 2026
d9366d1
feat: show NIP-46 signer status in settings, guard nsec UI
claude Apr 16, 2026
3b25bd0
docs: add NIP-46 remaining work spec for post-testing polish
claude Apr 16, 2026
6b6cd70
fix: resolve compilation errors from rebase onto current master
dmnyc Apr 16, 2026
271b1cc
fix: resolve test compilation errors from signer trait refactor
dmnyc Apr 16, 2026
2473ebc
feat: nostrconnect QR code for app-initiated NIP-46 flow
dmnyc Apr 16, 2026
dda212c
fix: replace nsec.app references with Amber and Primal
dmnyc Apr 16, 2026
d54239a
fix: password minimum label and validation consistent at 8 characters
dmnyc Apr 16, 2026
cb05449
fix: NIP-46 aware logout and consistent password validation
dmnyc Apr 16, 2026
0f274b2
feat: user menu UX — Nostr ID badge, reorder items, NIP-46 disconnect…
dmnyc Apr 16, 2026
bb6633d
feat: show NIP-05 with verified badge under name in profile editor
dmnyc Apr 16, 2026
59c6871
style: NIP-05 badge — purple star with checkmark, better spacing
dmnyc Apr 16, 2026
4c64a8e
style: use verified-symbol SVG for NIP-05 badge in purple
dmnyc Apr 16, 2026
35b8891
style: darken npub text below NIP-05 in profile editor
dmnyc Apr 16, 2026
02e4b6b
fix: preserve Tahoe drag strip over overlays
dmnyc Apr 17, 2026
56a561d
fix: full-viewport Settings modal on Tahoe
dmnyc Apr 18, 2026
29beb60
copy: update Nostr identity description in Settings
dmnyc Apr 18, 2026
dc53df6
feat: NIP-46 remote signing — Primal + Amber compatible, unified flows
dmnyc Apr 22, 2026
a2f0349
feat: NIP-22 market comments backend (#89)
dmnyc Apr 23, 2026
74cd3b6
feat: NIP-22 market comments UI
dmnyc Apr 23, 2026
0985d5e
feat: Bitcoin Connect + NIP-57 zaps (#91)
dmnyc Apr 23, 2026
fa422f4
feat: NWC secret storage, onboarding overhaul, NIP-46 polish (#93)
dmnyc Apr 23, 2026
af98944
feat: zap aggregation + detail polish + footer + onboarding fixes
dmnyc Apr 23, 2026
1072451
docs: Nostr social features roadmap
dmnyc Apr 24, 2026
4c0a413
fix: zap UX + identity hygiene + copy standardization
dmnyc Apr 24, 2026
c4f1924
docs: NIP-78 prefs + logout purge plan
dmnyc Apr 24, 2026
820af0e
feat(reactions): NIP-25 per-comment reactions
dmnyc Apr 24, 2026
c53ccb3
feat(comments): one-level threaded replies + Reddit-style tombstones
dmnyc Apr 24, 2026
570f259
feat: multi-outcome binary market groups (Polymarket-style) (#92)
Uty-re Apr 24, 2026
64ac699
feat: notifications bell + full emoji picker (#100)
dmnyc Apr 24, 2026
3da3908
feat: trending carousel slide animation + manual-nav pause (#101)
dmnyc Apr 24, 2026
59c0994
fix(wallet): post-delete hygiene + post-unlock sync + syncing pulse (…
dmnyc Apr 24, 2026
6810234
feat: follow/mute + NIP-05 verification (NIP-02 + NIP-51) (#103)
dmnyc Apr 24, 2026
9ff8ab0
chore(ui): switch block explorer links to liquid.network (#105)
dmnyc Apr 24, 2026
879a4f4
feat: store nostr identity key in OS keychain (#104)
dmnyc Apr 24, 2026
e170561
feat: scope notifications to deadcat-authored content + topshell poli…
dmnyc Apr 25, 2026
a58bb06
fix(nip46): publish kind:0 + create NIP-98 auth via signer trait
dmnyc Apr 27, 2026
914748d
feat(detail): sticky minimized market header for both market types
dmnyc Apr 27, 2026
ce17b92
fix(modals): tie body-scroll lock to open state
dmnyc Apr 27, 2026
437637f
chore(deps): patch dependabot-flagged dev tooling
dmnyc Apr 28, 2026
66b83f8
feat(home): tighten right-sidebar sections
dmnyc Apr 30, 2026
505e4de
fix(carousel): reverse slide direction on prev arrow
dmnyc Apr 30, 2026
e8f84f0
docs: multi-outcome market pivots to 2N-token design; add shared prin…
tvolk131 Apr 16, 2026
d33d3cf
docs: land AMM pool design decisions — binary LMSR only, Option C for…
tvolk131 Apr 17, 2026
77a0270
docs(core): Stage 1 — introduce multi-outcome core types
tvolk131 Apr 17, 2026
7e7cbd5
docs(core): Stage 2 — view types and restructured API surface
tvolk131 Apr 17, 2026
752a799
docs(core): Stage 3 — behavior, interpretation, and multi-contract pa…
tvolk131 Apr 18, 2026
b4ac002
docs(core): outcome-scoped store relationship queries + routing doc pass
tvolk131 Apr 18, 2026
c1127cd
docs(multi-outcome): generic solvency-preservation spend path
tvolk131 Apr 18, 2026
0c6448e
docs(core): align with generic solvency-preservation spend path
tvolk131 Apr 18, 2026
3f15280
docs: clarify script uniqueness guarantee and collapse stale staging …
tvolk131 Apr 18, 2026
c321140
docs: add System Invariants section and covenant self-enforcement pri…
tvolk131 Apr 18, 2026
6e8f34d
docs(recovery): add Integration Contract section
tvolk131 Apr 18, 2026
87e13a6
docs: unify denomination — primary param base_payout, cp = base_payou…
tvolk131 Apr 18, 2026
7d0ce8e
docs: defer cross-outcome arb API to v2, reserve surface for future d…
tvolk131 Apr 18, 2026
ce6a6d5
docs: land B3 codegen strategy — MiniJinja generator, N={3,4} for v1
tvolk131 Apr 18, 2026
958cf87
docs: land B1 LMSR F-value computation — bignum runtime, 1-2-5 pool d…
tvolk131 Apr 18, 2026
419ee69
docs: add deadcat-core implementation plan
tvolk131 Apr 18, 2026
8f0577f
docs: add smplx testing infrastructure section to implementation plan
tvolk131 Apr 18, 2026
24fe00f
docs: sprint 1 pre-implementation review updates
tvolk131 Apr 20, 2026
c851cce
docs(core): sprint 2 type and error refactor
tvolk131 Apr 20, 2026
8bd4f16
docs(core): sprint 3 new sections and rustdoc pass
tvolk131 Apr 20, 2026
cf5d3eb
docs: sprint 4 capture remaining review context
tvolk131 Apr 20, 2026
592cd2a
docs: expand rationale for allowing post-resolution pool trading
tvolk131 Apr 20, 2026
c961e1f
docs: sprint 5 resolve review drift across recovery, derive, and hints
tvolk131 Apr 21, 2026
9f7cc27
docs: fix sprint 5 review findings
tvolk131 Apr 21, 2026
ada58ce
docs: resolve deadcat-core cluster 1 spec contradictions
tvolk131 Apr 21, 2026
b92b982
docs: clarify LMSR bootstrap defaults and runtime model
tvolk131 Apr 22, 2026
877c490
docs: specify assisted pool trade composition
tvolk131 Apr 22, 2026
ac0638b
:wq
tvolk131 Apr 22, 2026
c0aac3b
docs: canonicalize recovery hints and LMSR math
tvolk131 Apr 22, 2026
245c903
docs: clarify implementation targets and legacy deltas
tvolk131 Apr 22, 2026
86ea01c
docs: clarify strict-canonical ingestion
tvolk131 Apr 23, 2026
39b0565
docs: add deadcat-core normative map
tvolk131 Apr 26, 2026
c676be9
docs: align deadcat-core implementation guidance
tvolk131 Apr 26, 2026
d8058bc
docs: resolve trade pset pre-blinding API
tvolk131 Apr 26, 2026
f56d689
ci: enable Rust tests in CI, migrate to nextest, fix broken tests
tvolk131 May 6, 2026
6e8b174
Merge master into docs
tvolk131 May 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ on:

jobs:
check:
runs-on: ubuntu-large
runs-on: blacksmith-8vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4

- uses: DeterminateSystems/nix-installer-action@main

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
cmd-format: "nix develop .#default --command {0}"
workspaces: ./src-tauri -> target

- name: Install dependencies
run: nix develop --command just install

Expand All @@ -29,8 +35,8 @@ jobs:
- name: Rust clippy
run: nix develop --command just cargo-clippy

# - name: Rust tests
# run: nix develop --command just cargo-test
- name: Rust tests
run: nix develop --command just cargo-test

build:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
Expand All @@ -39,13 +45,10 @@ jobs:
fail-fast: false
matrix:
include:
- platform: macos-26
- platform: blacksmith-6vcpu-macos-latest
args: --target aarch64-apple-darwin
arch: aarch64
- platform: macos-26
args: --target x86_64-apple-darwin
arch: x86_64
- platform: ubuntu-22.04
- platform: blacksmith-8vcpu-ubuntu-2404
args: ""
arch: x86_64-linux

Expand All @@ -54,7 +57,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install Linux dependencies
if: matrix.platform == 'ubuntu-22.04'
if: contains(matrix.platform, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y \
Expand All @@ -76,8 +79,6 @@ jobs:

- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ startsWith(matrix.platform, 'macos') && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}

- name: Rust cache
uses: swatinem/rust-cache@v2
Expand All @@ -101,14 +102,14 @@ jobs:
args: ${{ matrix.args }}

- name: Upload DMG artifact
if: startsWith(matrix.platform, 'macos')
if: contains(matrix.platform, 'macos')
uses: actions/upload-artifact@v4
with:
name: dmg-${{ matrix.arch }}
path: src-tauri/target/${{ matrix.arch }}-apple-darwin/release/bundle/dmg/*.dmg

- name: Upload Linux artifacts
if: matrix.platform == 'ubuntu-22.04'
if: contains(matrix.platform, 'ubuntu')
uses: actions/upload-artifact@v4
with:
name: linux-${{ matrix.arch }}
Expand All @@ -120,7 +121,7 @@ jobs:
release:
if: github.event_name == 'push'
needs: [build]
runs-on: ubuntu-latest
runs-on: blacksmith-8vcpu-ubuntu-2404
permissions:
contents: write
steps:
Expand Down
2,558 changes: 2,133 additions & 425 deletions docs/architecture/deadcat-core-design.md

Large diffs are not rendered by default.

339 changes: 339 additions & 0 deletions docs/architecture/deadcat-core-implementation-plan.md

Large diffs are not rendered by default.

151 changes: 151 additions & 0 deletions docs/architecture/deadcat-core-normative-map.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# deadcat-core Normative Map

Status: Normative guide to the `deadcat-core` design documents.

This document is a map of the `deadcat-core` design docs. The design docs are
the map of the implementation.

This document does not specify `deadcat-core` directly. It specifies which
design documents are authoritative for each part of `deadcat-core`, and how to
resolve scope, status, and priority between them. If this document conflicts
with a referenced spec, fix the underlying specs rather than treating this file
as a parallel implementation spec.

## Source Priority

When documents disagree, use this order:

1. [`deadcat-core-design.md`](deadcat-core-design.md)
is authoritative for public Rust API shape, engine behavior, store traits,
contract state enums, transition interpretation, PSET builder placement,
ingestion, chain sync, error semantics, implementation scope, and design
decisions for `deadcat-core`.

2. [`market-contract-principles.md`](../contracts/market-contract-principles.md)
is authoritative for covenant-level security principles shared by market
contracts: solvency, RT burn requirements, sibling UTXO checks, oracle power,
deterministic RT blinding, permissionlessness, and terminal-path
completeness.

3. [`contract-specification.md`](../contracts/contract-specification.md)
is authoritative for per-contract covenant behavior where it agrees with
`deadcat-core-design.md` and `market-contract-principles.md`.

4. Focused protocol specs are authoritative for their named surfaces:
- [`chain-only-recovery.md`](../protocol/chain-only-recovery.md)
- [`deterministic-rt-blinding.md`](../protocol/deterministic-rt-blinding.md)
- [`oracle-bip340-tagged-hash.md`](../protocol/oracle-bip340-tagged-hash.md)

5. Focused architecture specs are authoritative for their named mechanisms,
except where explicitly superseded by `deadcat-core-design.md`:
- [`transaction-composability-model.md`](transaction-composability-model.md)
- [`trade-routing-algorithm.md`](trade-routing-algorithm.md)
- [`enforcement-layers.md`](enforcement-layers.md)

6. Contract-specific focused specs are authoritative for their named contract
or math surface, subject to the higher-priority docs above:
- [`lmsr-pool-design.md`](../contracts/lmsr-pool/lmsr-pool-design.md)
- [`lmsr-deterministic-table-spec.md`](../contracts/lmsr-pool/lmsr-deterministic-table-spec.md)
- [`lmsr-pool-close-path.md`](../contracts/lmsr-pool/lmsr-pool-close-path.md)
- [`multi-outcome-market-contract.md`](../contracts/multi-outcome/multi-outcome-market-contract.md)
- [`market-dormant-terminal-paths.md`](../contracts/prediction-market/market-dormant-terminal-paths.md)

7. Historical, decision-record, refactor, and future-design docs explain why
choices were made or preserve rejected paths. They are not implementation
specs unless a normative doc links to a specific section and says it is
authoritative for the current implementation.

## Topic Ownership

| Topic | Authoritative source |
| --- | --- |
| Public Rust API | [`deadcat-core-design.md`](deadcat-core-design.md) |
| Core type shapes | [`deadcat-core-design.md`](deadcat-core-design.md) |
| Engine methods and view types | [`deadcat-core-design.md`](deadcat-core-design.md) |
| Store trait and atomicity | [`deadcat-core-design.md`](deadcat-core-design.md) |
| Ingestion and tracking policy | [`deadcat-core-design.md`](deadcat-core-design.md), then [`chain-only-recovery.md`](../protocol/chain-only-recovery.md) |
| Chain sync and rollback | [`deadcat-core-design.md`](deadcat-core-design.md) |
| Output classification | [`deadcat-core-design.md`](deadcat-core-design.md) |
| Market state machines | [`deadcat-core-design.md`](deadcat-core-design.md), then [`contract-specification.md`](../contracts/contract-specification.md) |
| Market covenant principles | [`market-contract-principles.md`](../contracts/market-contract-principles.md) |
| Binary market covenant behavior | [`contract-specification.md`](../contracts/contract-specification.md), subject to [`market-contract-principles.md`](../contracts/market-contract-principles.md) |
| Multi-outcome market covenant behavior | [`multi-outcome-market-contract.md`](../contracts/multi-outcome/multi-outcome-market-contract.md), subject to [`deadcat-core-design.md`](deadcat-core-design.md) and [`market-contract-principles.md`](../contracts/market-contract-principles.md) |
| LMSR pool parameters and lifecycle | [`lmsr-pool-design.md`](../contracts/lmsr-pool/lmsr-pool-design.md) |
| LMSR deterministic table generation | [`lmsr-deterministic-table-spec.md`](../contracts/lmsr-pool/lmsr-deterministic-table-spec.md) |
| LMSR pool close path | [`lmsr-pool-close-path.md`](../contracts/lmsr-pool/lmsr-pool-close-path.md) |
| Maker order behavior | [`deadcat-core-design.md`](deadcat-core-design.md), then [`contract-specification.md`](../contracts/contract-specification.md) |
| Trade routing | [`trade-routing-algorithm.md`](trade-routing-algorithm.md), with public API from [`deadcat-core-design.md`](deadcat-core-design.md) |
| Multi-covenant transaction layout | [`transaction-composability-model.md`](transaction-composability-model.md) |
| OP_RETURN recovery | [`chain-only-recovery.md`](../protocol/chain-only-recovery.md) |
| Oracle attestation message | [`oracle-bip340-tagged-hash.md`](../protocol/oracle-bip340-tagged-hash.md) |
| RT blinding | [`deterministic-rt-blinding.md`](../protocol/deterministic-rt-blinding.md) |
| Burn script and enforcement layering | [`market-contract-principles.md`](../contracts/market-contract-principles.md), then [`enforcement-layers.md`](enforcement-layers.md) |
| Implementation phases | [`deadcat-core-implementation-plan.md`](deadcat-core-implementation-plan.md) |

## V1 Scope

V1 includes:

- Binary markets.
- Multi-outcome markets for N in `{3, 4}`.
- Market issuance, cancellation, oracle resolution, expiry, and redemption.
- Multi-outcome split/merge primitives.
- LMSR pools.
- Maker orders.
- Trade routing across pools and maker orders.
- Existing-pool market-assisted routes via `build_trade_pset -> PreBlindedPset`.
- Chain-only recovery using canonical OP_RETURN hints.
- Strict-canonical tracking policy.
- Store compliance requirements sufficient for atomic multi-contract state
updates.

V1 excludes:

- Cross-outcome arb quote/build API.
- Cross-outcome arb aggregate transaction classification.
- LP-tokenized pools.
- Atomic market creation plus pool bootstrap.
- Exact-output trade routing.
- N greater than 4 unless explicitly added.
- Fixed-point Taylor LMSR runtime optimization.

## Conflict Handling

If an implementation agent finds a contradiction:

1. Do not infer a new protocol rule.
2. Prefer the highest-priority source listed above.
3. If the conflict is only in examples or historical rationale, follow the
normative source and leave a note for docs cleanup.
4. Ask for human review if the conflict affects:
- fund safety,
- RT issuance or destruction,
- deterministic blinding,
- oracle authorization,
- chain-only recovery,
- PSET layout,
- store atomicity,
- public API shape.

## Known Cleanup Items

Resolve these before treating the docs as fully implementation-ready:

- Multi-outcome public params Rust representation for runtime `outcome_count`.
- Exact LMSR admin/close signature preimages and domain strings.
- Whether `half_payout_sats` is intentionally independent from the parent
market denomination, or should be constrained by it.

## Document Status Labels

Related markdown files should start with one of:

- `Status: Normative`
- `Status: Normative for <specific topic>`
- `Status: Decision record, non-normative`
- `Status: Historical, non-normative`
- `Status: Future / v2, non-normative for v1`

Implementation agents should not implement from non-normative docs unless a
normative doc links to a specific section and says it is authoritative for the
current implementation.
12 changes: 6 additions & 6 deletions docs/architecture/enforcement-layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The builder/application layer. Conventions enforced by `deadcat-core` during PSE

**Mechanisms:**
- OP_RETURN recovery hints (chain-only recovery)
- Standard denomination conventions (1-2-5 table, 26-value mantissa)
- Standard denomination conventions (shared 16-value 1-2-5 table for market `base_payout` and pool `max_loss_sats` / `half_payout_sats`)
- Deterministic key and nonce derivation
- Output layout conventions for multi-covenant transactions
- Convention validation in derive functions and PSET builders
Expand Down Expand Up @@ -123,11 +123,11 @@ Each row maps a security property to the layer(s) that enforce it and notes any

| Property | Primary enforcement | Cross-layer dependency | What goes wrong without it |
|---|---|---|---|
| **Token supply = collateral / collateral_per_pair** | L2: covenant checks collateral on issuance | L2 must also enforce RT burns (see below) and `ensure_no_issuance` on non-issuance paths, because L1 reissuance/issuance mechanisms bypass L2 | Unbacked tokens dilute legitimate holders |
| **Token supply = collateral / cp** (where `cp = base_payout × N`) | L2: covenant checks collateral on issuance | L2 must also enforce RT burns (see below) and `ensure_no_issuance` on non-issuance paths, because L1 reissuance/issuance mechanisms bypass L2 | Unbacked tokens dilute legitimate holders |
| **RT destruction on terminal transitions** | L2: `ensure_blinded_reissuance_burn_output` verifies burn script + commitment | Required because L1 reissuance uses RT + ABF (public with deterministic blinding) — if RTs escape to wallet addresses, L1 reissuance bypasses L2 entirely | Attacker mints unbacked tokens via Elements reissuance |
| **No parasitic issuance** | L2: `ensure_no_issuance` on every covenant input for non-issuance paths | L1 allows issuance fields on any input — without L2 checks, a builder could attach issuance to a resolution/swap/fill spend | Attacker mints tokens alongside a legitimate covenant transition |
| **Oracle-only resolution** | L2: BIP-340 signature verification against `ORACLE_PUBLIC_KEY` | L1 provides the Schnorr verification primitive (secp256k1 jet) | Anyone can resolve markets, stealing from token holders |
| **Collateral conservation** | L2: covenant checks `collateral = pairs × collateral_per_pair` | None — purely L2 | Issue tokens without backing |
| **Collateral conservation** | L2: covenant checks `collateral = pairs × cp` (where `cp = base_payout × N`) | None — purely L2 | Issue tokens without backing |
| **Correct redemption rates** | L2: covenant enforces half-value (expired) or full-value (resolved) | None — purely L2 | Expired-market holders redeem at full value |
| **Deterministic RT blinding** | L2: covenant verifies commitments match deterministic ABF + CBF pass-through | L1 Pedersen balance constrains transaction structure (need confidential outputs for confidential inputs). L2 enforcement is the griefing defense — without it, L4 convention alone is insufficient | Malicious issuer locks the market for all participants |
| **Swap pricing integrity** | L2: Merkle proofs for F(old_s) and F(new_s), conservation equation | None — purely L2 | Extract more tokens than the LMSR curve allows |
Expand Down Expand Up @@ -225,9 +225,9 @@ When adding a new security property or modifying an existing one:

## Key Files

- `src-tauri/crates/deadcat-sdk/contract/prediction_market.simf` — `ensure_blinded_reissuance_burn_output`, `ensure_no_issuance`, `verify_token_commitment`
- `src-tauri/crates/deadcat-sdk/contract/lmsr_pool.simf` — pool covenant (swap, admin, close paths)
- `src-tauri/crates/deadcat-sdk/contract/maker_order.simf` — order covenant (fill path only)
- `crates/deadcat-core/contracts/prediction_market.simf` — `ensure_blinded_reissuance_burn_output`, `ensure_no_issuance`, `verify_token_commitment`
- `crates/deadcat-core/contracts/lmsr_pool.simf` — pool covenant (swap, admin, close paths)
- `crates/deadcat-core/contracts/maker_order.simf` — order covenant (fill path only)
- `docs/protocol/deterministic-rt-blinding.md` — RT blinding scheme and covenant enforcement
- `docs/contracts/contract-specification.md` — spend paths and covenant constraints
- `docs/architecture/deadcat-core-design.md` — security model section, covenant-enforced properties table
Loading
Loading