Karmicc

Architecture Specification · Karmicc v1

Methodology & Architecture

Reputation in high-value hobbyist trading cannot rely on opaque star ratings, pay-to-win boosts, or unprovable black-box scores. Karmicc runs on a pure, zero-I/O deterministic Beta Lower Confidence Bound (LCB) engine with verifiable inputs, context isolation, and offline cryptographic credentials.

Section 1

Score Identity & Context Hierarchy

Every standing projection in Karmicc is uniquely addressed by a four-tuple compound key:

(subject_id, context_key, scope_id, algo_version)

This explicit projection identity guarantees zero-downtime shadow migrations between algorithm generations (e.g. backfilling and validating v1 → v2 side-by-side in production) and allows instant 1-second metadata rollbacks without touching historical records.

Day-1 Context Hierarchy Tree

Reputation is contextual: trading cards online via postal shipping requires reliable packaging, tracking, and postal drop-off, whereas trading in person on a convention floor requires on-the-spot counterfeit detection and card-grading agreement. Day-1 contexts are partitioned into an explicit tree:

global.trade
└── cards.trade
    ├── cards.trade.shipped       # Bilateral postal mail / parcel delivery
    └── cards.trade.in_person      # In-person convention & card-show deals

Automatic Sparse Context Fallback

When a query arrives for a sparse subcontext with insufficient effective evidence (n_eff < 3.00), the projection engine automatically falls back to its immediate parent context while emitting the machine-readable header fallback_used: true.

Shipping Discrepancy Caution Tag

Show-floor transactions must never masquerade as postal shipping competence. Any trader with zero completed shipped trades evaluated outside of pure in-person contexts permanently carries the mandatory caution tag:

zero_verified_shipped_tradesEmitted as “0 verified shipped trades” on passes and API

Section 2

Pure Deterministic Beta-LCB Engine (algo_version: v1)

Karmicc standing is computed by a pure, zero-I/O TypeScript function with zero external dependencies, zero wall-clock reads, and zero database drivers (INV-037):

export function computeReputation(
  evidence: readonly EvidenceEvent[],
  config: EngineConfig,
  asOf: Date,
): ReputationComputation;

Inputs are canonically sorted by (completed_at, trade_id) and evaluated identically across any runtime or platform. The engine produces a structured result containing exact basis-point integers (0 .. 10000), deterministic semantic tier, corroborated value band, detailed machine explanation, and an order-independent SHA-256 inputs_hash:

α = α₀ + Σ w_i           (α₀ = 2.0 prior success weight)
β = β₀ + Σ v_j           (β₀ = 4.0 prior failure weight)
n_eff = Σ w_i + Σ v_j    (effective evidence count)

score_bps      = Math.round((α / (α + β)) × 10000)
lcb_bps        = Math.round(Q_0.10(Beta(α, β)) × 10000)
confidence_bps = Math.round((n_eff / (n_eff + 6.0)) × 10000)

Defensive Anti-Sybil Mechanisms

1. Wash-Trade Pair Collapse (30-Day Window)

Trading rings cannot farm Karm by repeatedly transacting with colluding counterparties. For any counterparty pair, trades within a 30-day rolling window [anchor, anchor + 30d) collapse: only the initial trade carries positive weight (w_pair = 1.0). Subsequent trades within that window receive w_pair = 0.0 and provide zero Karm score lift or unique counterparty credit.

2. Temporal Half-Life Decay

Standing reflects current reliability, not ancient glory. Positive trades decay with a 365-day half-life (2^(-dt / 365)). Severe defaults decay slower with a 730-day half-life (2^(-dt / 730)) coupled with a non-decaying 730-day hard cap. Recency is bucketed as <30d, <90d, <180d, or stale (after 180 days of inactivity).

3. Low-Credibility Counterparty Weighting

Feedback from unestablished raters (Unrated, Vouched Newcomer, Standing Paused) is heavily downweighted to 0.15× (w_rater = 0.15), while credible peers (Active, Established, High-Trust) carry 1.0×.

4. Corroborated Value Bands & Caps

Trades are categorized into four discrete value bands: under_50, 50_250, 250_1000, and 1000_plus. To prevent sockpuppet manipulation, deals over $500 involving unestablished counterparties are capped at the 50_250 band. The top band ($1k+) strictly requires at least two distinct credible counterparties before displaying on a pass.

Semantic Tiers Specification

Karmicc never outputs continuous credit scores. Standing is categorized into discrete, verifiable semantic tiers governed by Lower Confidence Bounds (LCB at 10th percentile):

Tier NameMin Unique PeersMin LCBMin TenureGoverning Gate Criteria
Unrated0—0dDefault entry state; unverified history
Vouched Newcomer0—0d≥1 active Blessing from established member; w_vouch = 0
Active33,000 bps (30%)0dProven trade record with ≥3 distinct credible peers
Established85,000 bps (50%)0dSubstantial trade history; unlocks Blessing slot issuance
High-Trust207,000 bps (70%)90dVeteran community collector with 90+ days continuous tenure
Standing Paused———Triggered by: severe default hard cap (730d), active interim dispute hold, or inconclusive rate breach

Section 3

Dual QR Seals, Handshakes & Scoped Blessings

Shipped Trade State Machine

Online trades follow a rigorous two-step mutual handshake prior to payment or parcel dispatch:

proposed ──[recipient accepts]──► accepted ──[blind attestations]──► completed
                                      │
                                      └──► [dispute opened] ──► disputed

Upon package receipt, both counterparty traders submit blind mutual attestations (as_agreed, minor_issue, or major_issue). Attestations remain cryptographically sealed and are revealed only after both parties have submitted or when the attestation window expires. This prevents retaliatory or coercive reviews.

Dual QR Seals on the Show Floor

Card conventions require frictionless handshakes without invasive device tracking:

  • 120-Second Ephemeral QR (Seal): Generated via POST /api/v1/handshakes, rendering a single-use token URL (/h/[token]) scanned by the counterparty camera to Seal the trade in person.
  • Zero GPS Tracking: No location coordinates, Bluetooth beacons, or cell triangulation are ever collected or stored (INV-042).
  • Direct Transition: Lands immediately in completed state (or accepted for deferred show IOUs), opening a 14-day dispute window.
  • Non-Escrow Ceilings: Any deal with declared amount ≥ $500 surfaces an explicit non-custodial warning reminding traders that Karmicc provides reputation logging, not payment escrow or parcel insurance.

Scoped Blessings & Founding Stewards

Karmicc has no spendable token economy, no points, and no paid vouch boosts (INV-005, INV-022). Instead, established members and Founding Stewards receive a strictly finite quota of risk-weighted Blessing slots:

When a Founding Steward or Established member Blesses a collector, that collector receives a 90-day Karm lift for starter trades. However, if the blessed member commits an upheld severe default in arbitration, the voucher’s Blessing slot is burned and locked for 180 days. Vouchers share real downside risk without creating artificial financialized incentives.

Section 4

Private Reviews, SLAs & Client-Side Hashing

Disputes in Karmicc are strictly bilateral and private (INV-030). There is zero public accusation wall, zero searchable “scammer list,” and zero free-text grievance publishing:

Client-Side Reference Hashing

Postal tracking numbers and payment confirmation identifiers are hashed client-side via SHA-256 in the browser before transmission. Karmicc detects cross-case reuse and postal fraud without retaining unmasked tracking numbers or banking references.

Direct-to-R2 Evidence Upload

Evidence files (packaging photos, receipts; max 5 MB, JPEG/PNG/WebP/PDF) upload directly to private Cloudflare R2 buckets via short-lived 60-second SigV4 presigned PUT URLs. Files are readable only by involved parties and moderators.

Published Operating SLAs

StageGuaranteed SLAOperational Action
Initial Triage24 HoursPrima facie review for completeness; dismissal of frivolous claims
Respondent Notice Window7 DaysMandatory formal notice and evidentiary rebuttal period before adverse action
Arbitration Resolution14 DaysFinal panel review and deterministic outcome adjudication
Appeal Window7 DaysRight to submit secondary review to an independent moderator panel
Statutory Real Erasure72 HoursCryptographic shredding of isolated PII across all active tables

Bad-Faith Strike Accounting

Benign triage dismissals (e.g. carrier delay resolved before review) incur zero strikes. However, bad-faith or fabricated filings add +1 bad-faith strike. Accumulating 2 strikes permanently suspends the member’s dispute filing privileges.

Section 5

Portable Ed25519 Offline Karm Pass & Operational Integrity

Cryptographic Karm Pass JWS (Ed25519)

Karmicc passes are portable credentials. Every active collector pass is issued as an Ed25519 JSON Web Signature (JWS) signed by our HSM-backed keys:

  • 24-Hour Expiration: Passes expire automatically after 24 hours, ensuring fresh standing status without long-lived stale credentials.
  • 100% Offline Client Verification: Any show organizer or counterparty can verify a pass completely offline in airplane mode using WebCrypto API against our public JSON Web Key Set (/.well-known/jwks.json).
  • Dual-Key Rotation: Keys rotate seamlessly using distinct kid identifiers with a 7-day overlapping retirement grace period.

Continuous Operational Verification

Nightly 100-Subject Drift Canary

Automated nightly cron runs recompute historical standing for a stratified sample of 100 members, comparing stored database projections against live engine execution to detect any bitwise score drift.

RTO < 30m Offsite Restore Drills

Encrypted offsite PostgreSQL 16 database dumps undergo verified restore drills validating a recovery time objective of under 30 minutes across four least-privilege Neon database roles (app_user, recompute_worker, erasure_worker, and readonly_audit).