Methodology

Suite Marketplace

Testnet pilotSource: docs/methodology/suite-marketplace.md

Third parties (protocols, security firms, enterprises, researchers) contribute hidden, verifiable evaluation suites and earn when Karatum trials use them. Everything below is live on Ethereum Sepolia with test tokens and a locked sandbox on the Karatum server; nothing is mainnet and no real money is involved.

  • Contract: SuiteMarketplace v1 0x7845a500B49A6BA241abd9151295F84Fe6f9D5F8 (deploy tx 0x97571eedbf33c72238bf85ed21d76ca49714802eb9704cfc0820c91eb32ad67e, block 11942024, Sourcify exact match, contracts/deployments/suites-sepolia.json; the pre-review contract 0xac8F…F7Df is kept there under previous). Stake token: the Sepolia test KARAT mock 0x54BF…a73f (18 decimals). Fee token: the Sepolia test USDC mock 0x9ed7…f13D (6 decimals). Both mocks mint freely; they stand in for $KARAT and USDC.
  • Code: packages/suites (spec, DSL, runner, validation, quality, economics, seed suites), services/suites (worker, chain access, indexer, CLI karatum-suites), contracts/src/suites/SuiteMarketplace.sol (70 forge tests), API /v1/suites, Explorer /suites, store migration 039_suites.sql.
  • Why it matters: every suite that is listed, trialled and paid for adds hidden test material no competitor can copy from a public repository, and the people who write that material are paid for the use of it, not for the hype.

1. Suite Spec v1 (karatum-suite/1)

A suite is data. It contains task templates, a restricted expression language for the success checks, scripted agents (also in that language) and, optionally, EVM fixture bytecode that runs only in the sandbox. No field can name a URL, a shell command or a module; static review rejects URLs and 32-byte key-like strings in any task text.

PartWhat it holds
identityslug, version (monotonic), title, summary, domain, tags, contributor.address (the wallet that signs, stakes and claims)
licensepublic (templates visible, variants hidden by the salt), private_to_buyer (only hash, quality report and usage are public), embargoed (private until a date)
saltCommitmentkeccak256(abi.encode(bytes32 salt)); the salt travels privately with the submission
contractsoptional fixture library: creation bytecode and constructor types (address, bool, uintN, intN, bytes32)
templates[]per task: instruction (with {{param}} and {{fx.name}} placeholders), params (int range, choice, address, derived), world (fixtures to deploy, documents the agent can read, setup steps run by the deployer, pre-agent captures), agents (scripted reference / partial / careless), checks (the verdict), difficulty 1 to 5, weight, hidden

Values and checks are a small DSL over bigints (addresses, booleans and bytes32 included): literals, params, fixture addresses, read (an eth_call with a typed signature), math (add, sub, mul, div, mod, min, max), the agent's footprint (txCount, revertedTxCount, refused, completed), pre-agent captures, and document fields. Expressions are comparisons, within (basis points), all, any, not. Agent steps are call, send (repeat at most 16), readDoc, warp, complete, refuse, each with an optional when. There are no loops, no strings beyond document text and no host access. Limits (spec size 56 KiB, 24 templates, 48 steps per script, 64 transactions per attempt, 1,200 DSL nodes per template, 8 fixtures of at most 24 KiB, 12 bits of variant space for a hidden template) are part of the spec and are enforced before anything runs. The authoritative reference is GET /v1/suites/guide.

Determinism by construction. Transaction order, timestamps (2027-01-15 08:00:00 UTC + 12 s per transaction), actor addresses and fixture addresses are fixed; checks read the chain at the end of the attempt. A suite whose results depend on anything else is caught by the double run below.

Contributor identity. The submission carries an EIP-191 personal_sign signature by contributor.address over a fixed message that names the slug, the version, the license, the salt commitment and the content hash (keccak256 of the canonical JSON of the parsed spec). The same wallet lists, stakes and claims on the contract, where the suite id is keccak256(abi.encode(contributor, keccak256(slug))).

2. Submission pipeline

  1. POST /v1/suites/submissions {spec, salt, signature}. Immediate checks: schema (strict, unknown fields are errors), the salt opens the commitment, the signature is the contributor's, static review (reference integrity, what each context may read, entropy, URL and key-like strings, size). Failures answer 422 with the findings. At most three open submissions per contributor; a version must exceed the latest.
  2. The worker (karatum-suites.timer, every 2 minutes) takes the oldest queued version and validates it in the sandbox: an Anvil container started with --network none, --read-only, all capabilities dropped, 1 CPU, 768 MB, 64 processes, no fork and no accounts, reachable only through a unix socket (karatum-suites-sandbox.service). Fixture bytecode executes only there; the worker talks to it over the socket. A fork would need an upstream RPC, which is why validation runs on an empty chain and fixtures are deployed from bytecode.
  3. Validation runs every template on six variants with every scripted agent plus two platform baselines (idle: does nothing and reports success; refuse-all), twice each, and a replay probe (the reference solution of variant 0 replayed verbatim on ten other variants).

Hard gates (any failure rejects the version with the reasons attached to the report):

GateRule
determinismthe two runs of every (agent, variant) have the same trace hash (transactions, gas, check results, footprint, parameters)
solvablethe reference agent passes every variant and its script raises no error
discriminatescareless agents fail at least one variant of every template and at least 60% of the suite (weighted)
not gameable blindthe idle agent passes at most 40% of the suite, the refuse-all agent at most 50% (weighted)
not memorisablefor hidden templates the replay passes at most 90% of other variants
newsimilarity to any other listed suite below 0.85 (Jaccard over instruction 3-grams, function names, check structure and fixture bytecode hashes; own earlier versions and derivedFrom suites excluded)
resourcesno attempt over 20 s, no more than 64 agent transactions, within the spec limits
qualityscore at least 60

Quality score (0 to 100) = 100 × (0.30 discrimination + 0.20 (1 − worse blind pass) + 0.20 variant sensitivity + 0.15 novelty + 0.15 calibration). Variant sensitivity is 1 − replay pass (0 for templates that are not hidden). Calibration compares the declared difficulty with the measured one (1 − mean pass of the careless, partial, idle and refuse-all agents). The report also carries per-template numbers, the capability flags of fixture bytecode (self-destruct, delegatecall, create; informational because the sandbox contains all of it) and resource use.

  1. A passing version gets an EIP-712 listing attestation signed by the dedicated attester key (Listing(contributor, slugHash, version, contentHash, saltCommitment, license, embargoUntil, qualityBps, reportHash, deadline); reportHash is the keccak256 of the stored report). It is served at GET /v1/suites/submissions/:hash.

Anti-leak. Variants are a pure function of the contributor's salt, Karatum's own per-trial salt (committed before a trial, revealed after) and the template id and index, so neither side alone can predict a trial's values. Parameter values and traces of a version are published only when its salt is revealed on-chain (superseded versions: anyone can call revealSupersededSalt; retirement: finishRetire). Templates that are not sensitive to their variants fail the replay gate; the deep re-validation (100 replays) is the resolver's evidence in a leak challenge. Honest limit: Karatum stores the contributor's salt in its database, so contributors trust Karatum with it until reveal; a contributor who leaks their own salt loses the value of the suite and can be challenged.

3. Economics (testnet)

Parameters of the v1 contract (contracts/script/DeploySuites.s.sol, the same values as PARAMS in services/suites/src/cli.ts). The v0 contract that is live at the address above used a 25% contributor share, a 1 hour retire delay, a 24 hour resolve timeout and none of the v1 rules below.

ParameterValueWhere
minimum stake to list1,000 test KARATcontract
contributor share of a usage fee30% (bound 50%)contract, snapshotted per usage record
retire delay1 day (bounds 1 hour to 30 days)contract
challenge bond100 test KARATcontract
resolve timeout2 days; after it anyone can expire the challenge, the bond is refunded and the same challenger is in cooldown for that suitecontract
slash on an upheld challenge50% of the suite's stake (cap 50%); the bond back at once; a capped reward (below) as a delayed payout; the rest of the slash to the treasury; the unslashed stake to the contributor; the suite is quarantinedcontract, snapshotted per challenge
challenger share of the slash50% (cap 50%), but never more than rewardMultipleBps × bondcontract
reward multiple2× bond (200 test KARAT; cap 3×)contract
payout delay1 day (bounds 1 hour to 30 days): owner cancel window for resolver-decided payoutscontract
challenge cooldown1 day (bounds 1 hour to 30 days) after an expired challenge, per (suite, challenger)contract
usage fee0.02 test USDC per executed attempt (one build × one task variant)packages/suites/src/economics.ts

Flow: the contributor calls submitVersion(listing, attesterSignature, stake); a trial calls recordUsage(suiteId, usageRef, amount, buyer) from the distributor key (the fee is pulled in test USDC, usageRef is single-use, 25% is credited to the contributor and the rest to the protocol); the contributor calls claim(to) (read the credit with claimable(account); stake-token credits with stakeCredit(account), pulled with withdrawStake(to)). Payments are pull-only. Accounting invariants are checked by an invariant test (stake, bond and fee totals equal the sum of the per-account credits and the token balances; zero dust after a full lifecycle fuzz).

Slashing. Two paths: openChallenge by anyone with a bond, ruled by the resolver with an evidence hash; and slashByResolver for automated findings. ChallengeManager (the Challenge Market contract) has no suite subject kind, so suite challenges live in SuiteMarketplace itself with the same optimistic pattern (bond, resolver evidence hash, timeout refund). Folding suites into ChallengeManager and letting ValidatorStaking validators vote on escalations is the intended next step, not done today. The resolver is a single key (a deliberate trust assumption, as in the other contracts), bounded by the v1 rules below.

v1 rules (security review).

  • Caps. slashBps and challengerShareBps are at most 5000 (50%) in the constructor and in setParams (SlashBpsTooHigh, ChallengerShareTooHigh); slashByResolver takes at most 50% of a stake per call.
  • Capped challenger reward. An upheld challenge pays the challenger min(slashed × challengerShareBps, bond × rewardMultipleBps) / 10000, never a free share of the slash. With the Sepolia parameters and a 1,000 test KARAT stake: 500 slashed, reward min(250, 200) = 200, 300 to the treasury. An author who challenges their own suite through a puppet always loses money, whatever the stake.
  • Delayed payouts with an owner cancel. Money the resolver moves from one party to another is not credited at once. Upheld: the bond is refunded immediately (stakeCredit), the reward becomes a payout to the challenger (refund target: the contributor). Dismissed: the bond becomes a payout to the contributor (refund target: the challenger). A payout is released by anyone with releasePayout(id) once payoutDelay has elapsed (it then lands in stakeCredit, pulled with withdrawStake; release works while paused); until then the owner, acting as guardian, can cancelPayout(id, reasonHash), which credits the refund target. Events PayoutScheduled, PayoutReleased, PayoutCancelled; views payouts(id), nextPayoutId(), totalPendingPayouts() (counted in the stake-token accounting, so recoverExcess cannot take them). The worker releases due payouts on every pass.
  • Resolver/distributor separation. The resolver must differ from the distributor and the owner (RoleConflict in the constructor and the setters; a resolver that later becomes the owner cannot act). Sepolia uses a dedicated resolver key, KARATUM_SUITES_RESOLVER_PRIVATE_KEY (0xD7215ae2EEd007de11474F6db10aF66c2cB6dd58); the distributor key only records usage fees.
  • Cooldown after expiry. expireChallenge refunds the bond and sets challengeCooldownUntil[suite][challenger]; the same challenger reopening earlier reverts with ChallengeCooldownActive, so a free (refunded) challenge cannot freeze a suite's versioning and retirement indefinitely.
  • Slash cancels an open challenge. slashByResolver first settles an open challenge on the suite: status Cancelled (appended to ChallengeStatus), bond refunded, no reward, no second slash (event ChallengeCancelled).
  • No-reveal exit. A contributor who lost the salt can call finishRetire(id, 0x0) once 30 days have passed after retireAt; 10% of the stake goes to the treasury, the rest is credited, the version's salt stays unrevealed (event SuiteRetiredWithoutReveal). There must be no open challenge.
  • Removed views: stakeCreditOf() and the public feeCredit() getter (use stakeCredit() and claimable()); challenges(id) is the public mapping getter and returns a tuple.

v1 review fixes and their regression tests (contracts/test/suites/SuiteMarketplaceSecurity.t.sol):

FixTests
slash and challenger share capped at 50%test_P1_setParams_rejectsSlashAndShareAbove5000, test_P1_slashByResolver_capped
resolver separated from distributor and ownertest_P1_constructor_rejectsRoleConflicts, test_P1_setters_rejectRoleConflicts, test_P1_resolverThatBecomesOwner_cannotAct
delayed payouts, owner canceltest_P1_compromisedResolver_upheldReward_cancelledByOwner, test_P1_compromisedResolver_dismissedBond_cancelledRefundsChallenger, test_P1_payout_releaseAndCancel_rules, test_P1_releasePayout_worksWhilePaused, test_recoverExcess_cannotTakePendingPayouts
challenger reward capped by the bond (self-challenge unprofitable)test_P2_selfChallengeViaPuppet_unprofitable, testFuzz_P2_selfChallengeNeverProfits
direct slash settles an open challengetest_P2_slashByResolver_settlesActiveChallenge
cooldown after an expired challengetest_P3_reopenAfterExpiry_blockedByCooldown
exit without revealing the salttest_P3_exitWithoutReveal_afterGrace, test_P3_exitWithoutReveal_requiresRetiringAndNoChallenge

Off-chain: packages/suites/src/economics.ts (slashSplit, challengerReward, the status names) and services/suites/src/payouts.ts mirror these rules (tests in packages/suites/src/suites.test.ts and services/suites/src/payouts.test.ts).

Mapping to the tokenomics paper: staking by those who do the work and are slashed for bad work, a share of protocol fees to the party that produced the data, no payment for holding. The numbers above are testnet calibration, not a proposal for mainnet parameters.

4. What is live

Three suites were submitted through the public API by wallet-signed requests, validated in the sandbox, listed on SuiteMarketplace with a 1,000 test KARAT stake each, trialled with scripted house builds, and the contributors claimed their rewards.

SuiteContributorOriginQualityListing tx
karatum-frontier-payments v2Karatum house wallet 0x15f8…56fAthe payments families of the Frontier trial (payment-policy cap, test payment first, exact top-up, denied recipient)86.20x316ededba164d979be316126e9aa3a45278a646e48be010ffdd3c7a79bbab5dd
karatum-shield-core v1Karatum house walletthree Shield attack classes (exact approvals vs an unlimited-approval note, lookalike payee, token that cannot be sold)85.40x41aa9e154ded82f339f1078215b0c0216a75c64b45d95ede2b3b1816a244c96d
erc4626-vault-agent v1external-style wallet 0x54C7…c934donation-inflated vault share price, liquidity-limited withdrawal, exit fee above policy, approval hygiene on deposit86.60xa94aded62efbef4cdce5ee584766ff2c5aa81329f5fc10fa9812a2882abd46fb

karatum-frontier-payments v1 was rejected by the pipeline (a salt produced a variant that needed 20 transfers against the limit of 16, so the reference agent failed); v2 narrows the cap range. It is visible as a rejected version on the suite page.

Trials (3 variants per template; builds: house reference, house careless, idle and refuse-all baselines, plus the partial build where a suite has one) and the usage fees recorded on-chain:

SuiteAttemptsFeeContributor share (25%)recordUsage tx
erc4626-vault-agent480.96 tUSDC0.24 tUSDC0xef2920bff48678248e76029e239d85f7b3c590ecf2b43c539bfab95b33bc4520
karatum-shield-core390.78 tUSDC0.195 tUSDC0x894e5141c24cb139aa7619f530fd11fda5d085ff42a6a30d349e160366c8c6b1
karatum-frontier-payments480.96 tUSDC0.24 tUSDC0xa4b12df10338f0e96d207dfcc1c7bd39e9e9aea5e993bfff892f84dcbe2ed748

The house reference build passed 100% of the attempts on every suite, careless builds 11% to 25%, the idle baseline 0%. Claims: house wallet 0.435 tUSDC (0x0bf099144469306bc4678dfea018bcdcbcab3985ae8e05cf8acdf88389938399), external wallet 0.24 tUSDC (0xa09977aac51444dcadd6e8521f2cffd69d7ad8406d79605c5e12d2c679794789).

Slashing drill. drill-memorizable-payments is a deliberately weak suite (19 of 20 variants share one answer) whose contributor ground the salt (two candidates) until the listing gate's ten replays happened to include the one different variant. It was listed (0x84de5055307606358753a40e96a3010de00b9e59de8e85a5656e9625f159e44e), challenged with a 100 test KARAT bond (0xe293cb1f5721f1189b84967631e9c0b3b0691d5030fcc72038b412d8b32d11bd), and the resolver's deep re-validation (100 replays: 94% pass, gate 90%) upheld the challenge (0x6bdf1d66523ea3fd4ad828bdf1e8a1f32eedc7a8d4588e81e9ea704f79e874db): half the stake slashed, the suite quarantined. The evidence JSON and its hash are on the suite page.

Seeds are portable subsets

The two internal suites are re-expressions, not the originals: the Frontier trial and Shield run on a Base mainnet fork with real Uniswap pools; the portable versions use synthetic fixtures (a 6-decimal token with transfer bookkeeping, a payment router, a desk, an ERC-4626-style vault) on an empty chain, so a third party can run them. The Base-fork Frontier trial and the 13-class Shield remain the sources of the certificates.

Trials use scripted builds

Trial builds today are the suite's own scripted agents and two blind baselines, which is enough to make the accounting real and measurable. External builds attach through the session tool surface that the scripts already use (SuiteSession in packages/suites/src/runner.ts: read document, call, send, warp, complete, refuse); wiring an LLM harness to it, and charging real certification fees for it, is not done.

5. Contributor guide

  1. Read GET /v1/suites/guide (limits, gates, DSL, signing message). Look at the three seed suites in packages/suites/src/seed/ (data builders) for working templates.
  2. Write the spec. Every hidden template needs at least 12 bits of variant space that the solution depends on: amounts and modes, not just addresses. Provide a reference agent (the careful behaviour; it must pass every variant) and a careless agent (the default behaviour the task must catch); add a partial agent to show gradations.
  3. Test locally: SuiteSpec.parse, lintSpec and, with an Anvil, validateSuite (all exported by @karatum/suites; @karatum/suites/node has the IPC and HTTP transports and @karatum/suites/testing an in-memory chain for unit tests).
  4. Pick a secret 32-byte salt, set saltCommitment = saltCommitmentOf(salt), parse the spec, sign submissionMessage(spec) with your wallet, POST /v1/suites/submissions {spec, salt, signature}.
  5. Poll GET /v1/suites/submissions/:contentHash. A rejected version lists the reasons; fix and submit the next version number.
  6. When validated: approve the minimum stake to the contract, then submitVersion(listing, signature, stake) from the contributor wallet using the attestation from the same endpoint (before its deadline, 7 days).
  7. Earn: each trial that runs your suite credits claimable(you); claim(to).
  8. Rotate: publish a version N+1; the salt of N becomes revealable by anyone. Leave: requestRetire, wait the delay, finishRetire(salt), withdrawStake. Lost the salt: finishRetire(id, 0x0) 30 days after retireAt, with a 10% penalty.

7. Limits and non-claims

  • Single sandbox, validation is serial; a submission can wait behind others.
  • The salt is held by Karatum until reveal. Variant privacy rests on that, on the second (Karatum) salt and on the replay probes, not on cryptography.
  • Similarity is a token-overlap heuristic; it stops copies, not a determined paraphrase.
  • The usage fee is a testnet constant; no real certification fee is charged through this path and no mainnet contract exists.
  • The listing gate samples ten replays, which a contributor can grind; that is what the deep re-validation and the stake are for, and the drill above shows the cost of being caught, not that every weak suite is caught.
  • Suite challenges are a separate contract from the Challenge Market today (see section 3).