Silverfire Category Theory & Algebraic Diagrams (All 9 Presets)

Classical tikz-cd & Freyd string diagrams compiled from pure MoonBit (libs/silverfire_cat) — 2× Retina PNG exports in Vellum (LaTeX Paper) and Midnight (Chalkboard).

ADT Universal Spotlight Open Interactive Studio → Silverfire Curve Explorer ECDSA Lab Cardano Conway Lab
Flagship — MoonBit Algebraic Data Types as Classical Universal Diagrams
Universal Constructions (Product, Coproduct, Equalizer) · ecdsa-adt-universal

1. MoonBit Algebraic Data Types as Universal Diagrams (Silverfire ECDSA)

Maps MoonBit ADTs directly to Mac Lane universal diagrams: Product (β/η, schematic Signature { r, s } / repo RawSignedSecp256k1), Coproduct (β/η, schematic Sig + Err / repo EcdsaVerifyOutcome ≅ 1 + String), and Curve Equalizer E_aff(𝔽ₚ) (AffinePointSecp256k1/P256) with explicit equalizer premise y² ∘ m = (x³ + ax + b) ∘ m ⇒ ∃! u, e ∘ u = m.

Counterfactual Overlay · bypass-curve-equalizer · ContradictoryWitness

1b. Rejected Counterfactual — Off-Curve secp256k1 (0, 1) Factoring Through E_aff(𝔽ₚ)

Candidate m = (0, 1) fails the secp256k1 curve equation (1² = 1 ≠ 7 = 0³ + 7 mod p); assuming a bogus factorization e ∘ u = m derives a path-congruence contradiction rejected statically with CatError::ContradictoryWitness.

Domain 1 — Silverfire ECDSA (secp256k1 & P-256)
Substructural Freyd SMC · ecdsa-smc-custody

2. ECDSA 8-Stage Custody Signing SMC (secp256k1)

Lifted directly from libs/protocol_vocab/ecdsa_pipeline.mbt: tracks an elliptic-curve signing request through eight ordered stages, locking private keys and RFC 6979 ephemeral nonces onto single-use linear wires while ordered effect rails isolate custody side effects.

Counterfactual Overlay · illegal-copy-k · IllegalCopy

2b. Rejected Counterfactual — Illegal Δ Copy on Linear Nonce k

Applying a Cartesian copy spider Δ to linear secret EphemeralK is statically rejected with CatError::IllegalCopy (Quint mutant M1: invSingleDigestPerNonce) without mutating the accepted semantic digest.

Commutative & Non-Commuting Squares · ecdsa-projective-rcb

3. Projective RCB Refinement (L3) & Two-Field Set-Map Crossing

Contrasts complete homogeneous Renes–Costello–Batina addition commuting via the projective-class quotient π : C* ↠ E(𝔽ₚ) = E_aff(𝔽ₚ) ∪ {O} (prime field char ≠ 2, 3, NoTwoTorsion) against an evidenced Amethyst non-commuting witness proving can_p mod n from 𝔽₇₉ to 𝔽₆₇ is a Set-map, not additive.

Commutative Square & Low-S Quotient Section · ecdsa-verify-lows

4. ECDSA Verification Square (L1) & C2 Low-S Section (L2)

Under s ≠ 0 and Q = [d]G, signing sk = z + rd commutes with [z/s]G + [r/s]Q = [k]G (ecdsa_sign_verify_correct), paired with the canonical StrictLowS section j at fixed (Q, z, r) and odd order n ≥ 3, 1 ≤ s < n (ecdsa_malleability_equiv, strict_low_s_exclusive, normalizeLowS_satisfies_strict_low_s).

Monotone Poset Assurance Functor · ecdsa-assurance-lanes

5. 5-Lane Assurance Poset & Barred Evidence Wall

Separates verified claims across five independent lanes (default-prelude pinned moon prove, Quint, Lean 4, Multi-Oracle/Wycheproof, Native CT) from MARS non-upgradable assumptions (A1 ECDLP, A2 SHA-256 CR, A2b SHA-256 RO, A3 HMAC-SHA-256 PRF, A4/A5 HW & fault); the Evidence Wall bars upward upgrading from NonUpgradable/Unsupported to Proved.

Domain 2 — Schnorr / Σ-Protocols & Fiat-Shamir
Markov / Substructural SMC · schnorr-sigma-fork

6. Schnorr Σ-Protocol + Fiat-Shamir SMC & Forking Subobject

Public commitment R and challenge c copy via Cartesian spiders ΔR and Δc with aligned non-crossing leads into H_FS(R, m) and respond(r + cx), while secret witness x and nonce r stay linear; on the distinct-challenge subobject ForkSub(c1 ≠ c2) ↪ T ×R T (excluding diagonal c1 = c2), (c1 − c2)−1 ∈ 𝔽q× extracts x = (z1 − z2)/(c1 − c2).

Domain 3 — BLS12-381 Bilinear Pairings
Bilinear Tensor in Mod(ℤ) · bls-bilinear-pairing

7. BLS12-381 Bilinear Pairing Square & PoP Key-Admission Check

Models the pairing as the induced ℤ-linear homomorphism ẽ : 𝔾1 ⊗ℤ 𝔾2 → 𝔾T in Mod(ℤ) (keeping element evaluations e(σ, g2) = e(H(m), pk) in captions) alongside a separate Proof-of-Possession key-admission predicate PoP(pk), with both faces honestly marked (?).

Domain 4 — Cardano Conway Ledger STS & CIP-1694 Governance
Freyd Effect-Rail SMC · conway-ledger-sts

8. Cardano Conway Ledger STS Monoidal Pipeline (Phase2Valid)

Matches actual runtime Phase2Valid order in libs/cardano_ledger/ledger.mbt:117-174 & utxo.mbt:1235: CERTS (DRep/Pool) → GOV (CIP-1694) → UTXOW (pre-CERTS env; calls UTXO & settles fees) → Deposit Reconcile (Phase2Valid only) across ordered linear rails (cert_rail, gov_rail, utxo_rail), while Phase2Invalid skips CERTS, GOV, and deposit reconcile to settle net collateral inside UTXOW/UTXO (utxo.mbt:443).

Functor & Deposit Conservation Square · conway-ratify-functor

9. Cardano Conway CIP-1694 RATIFY → ENACT & Deposit Conservation

Double-bordered state-transition categories map CIP-1694-RATIFY into CIP-1694-ENACT across both ratification and expiry generators with non-crossing nested accounting arcs; Lean 4 proves Ada conservation (conway_epoch_refund_conserved, L189) and deposit/refund partitioning (forest_prune_single_refund, L553) under explicit balance premises, while full categorical naturality squares stay honestly open [?].