- 1 — The phases of an epoch
- 2 — The exact bytes that are hashed
- 3 — Every constant, with its value and its why
- 4 — The slash waterfall
- 5 — The ledger and its one invariant
- 6 — What is off chain
- 7 — Stockereum, and the fee sink that is unarmed
- 8 — The tests
- 9 — What is not done
1 — The phases of an epoch
An epoch is one task. It has six states and a submission inside it has eight.
Every transition below is driven by a call anyone can make; there is no owner, no keeper and no
privileged address anywhere in Datasync.sol.
Open
openEpoch(taskCommit, challengeCommit, submitEnd, scoreEnd). Both commitments are
hashes and nothing else. In particular the challenge set — the held-out input/output
pairs every submission will be scored against — exists on chain only as
challengeCommit. Nobody can fit to data they cannot see.
submitEnd must be at least MIN_SUBMIT_WINDOW away and
scoreEnd at least MIN_SCORE_WINDOW after that, so an epoch cannot be
opened and closed inside one block. Anyone may fund(epochId) the pot with ether,
at any time before it settles, and their contribution is recorded against their address.
Submit
submit(epochId, commitment) with exactly STAKE. The commitment binds
the epoch, the submitter, the hash of the weights URI, and a salt. Because the
submitter is inside the preimage, a commitment copied off the mempool cannot be claimed by
whoever copied it.
Reveal
reveal(subId, weightsUri, salt). The contract recomputes the commitment and
rejects anything that does not match. Revealing the model early is harmless — the
thing that must stay sealed is the challenge set, not the model.
A submission that is never revealed cannot be scored, and at settlement its stake is forfeit to the pot. It occupied a slot and withheld the artefact; the pot is made whole for it.
Open scoring
openScoring(epochId, challengeUri, challengeSalt) publishes the preimage and
checks it against the commitment. Anyone holding the preimage may call it. It
must land between submitEnd and scoreEnd; if it never lands, the
epoch is abandoned — every stake and every contribution is refunded and nobody
is slashed. Withholding the data costs the withholder the task and costs everyone else only
time.
Score, and contradict
attest(subId, score, evidenceHash) with exactly ATTEST_BOND. The
score is a fraction of one in 18-decimal fixed point, at most MAX_SCORE. The
evidence hash binds it to the challenge set and to the input/output pairs the scorer used.
- The first attestation sets the standing score. The submission becomes Scored.
- An attestation posting the same score joins that side.
- An attestation posting a different score is a contradiction. The
submission becomes Frozen immediately and cannot be ranked or paid while frozen.
More attesters may still pile in on either side until
scoreEnd.
One address, one attestation per submission, and at most
MAX_ATTESTERS_PER_SUBMISSION in total, which is what bounds every loop in
resolve.
Resolve
resolve(subId), once scoreEnd + DISPUTE_WINDOW has passed. Sides are
weighed by bonded wei, not by headcount — a crowd of empty wallets cannot
outvote conviction. Three outcomes:
| outcome | the submission | the bonds |
|---|---|---|
| the original score wins | thaws, ranked at that score | majority whole + a share of the slash; minority loses SLASH_BPS |
| a contradictor wins | stays Frozen forever, never ranked | same, with the sides swapped |
| a tie by bonded wei | stays Frozen | every bond returned in full, nobody slashed |
The tie case is deliberate. Two scores carrying identical bonded weight is a question the chain cannot answer honestly, so it does not pretend to — it refuses to rank and refuses to punish.
A dispute can also be resolved after the epoch has settled. The bonds still go home and
the liar is still slashed, but the rank is gone: thawing into a settled epoch would leave a
Scored submission nothing will ever pay. invariant_scoredCountMatchesReality is
the test that caught that, and it is why the branch exists.
Settle
settle(epochId), once scoreEnd + DISPUTE_WINDOW has passed. Every
submission reaches exactly one terminal state:
| state at settle | becomes | what the submitter gets |
|---|---|---|
| Scored | Paid | stake + floor(net × score / Σscore) |
| Revealed, nobody scored it | Refunded | stake back — not a zero, not a rank |
| Frozen | stays Frozen | stake back; the scorer who lied is the one who paid |
| Committed, never revealed | Forfeit | nothing; the stake goes to the pot |
The sink takes SINK_FEE_BPS of the pot only when at least one submission
settles with a verified score. If nothing was verified, the fee is zero, the pot is untouched,
and its funders take it back through claimRefund.
claimRefund computes each funder's share against what is still in the pot
and what is still unclaimed, so the last claimant takes the remainder exactly and the
pot drains to the wei. That is not stylistic: dividing one total on two different partitions is
how a contract ends up one wei short, with every test passing except the final withdrawal.
2 — The exact bytes that are hashed
Four hashes, all abi.encode and never abi.encodePacked. Every field
is a fixed 32-byte word and every string is hashed before it is encoded, so no two
distinct inputs can be made to collide by sliding a field boundary. Cells
[2], [4] and
[6] reproduce all four in your browser.
COMMIT_DOMAIN = keccak256("DATASYNC_SUBMISSION_V1")
CHALLENGE_DOMAIN = keccak256("DATASYNC_CHALLENGE_V1")
EVIDENCE_DOMAIN = keccak256("DATASYNC_EVIDENCE_V1")
commitment = keccak256(abi.encode(
COMMIT_DOMAIN, // bytes32
epochId, // uint256
submitter, // address
keccak256(bytes(weightsUri)),
salt // bytes32
)) // 160 bytes of preimage
challengeHash = keccak256(abi.encode(
CHALLENGE_DOMAIN,
epochId,
keccak256(bytes(challengeUri)),
salt
)) // 128 bytes
ioLeaf[i] = keccak256(abi.encode(keccak256(input_i), keccak256(output_i)))
ioPairsHash = keccak256(abi.encode(bytes32[] leaves)) // offset, length, then the leaves
evidenceHash = keccak256(abi.encode(EVIDENCE_DOMAIN, challengeCommit, ioPairsHash))
The domain words differ so that a submission commitment can never be replayed as a challenge
seal, and so that neither can be replayed as an evidence hash. test/Hashing.t.sol
asserts the preimage lengths and the injectivity of each field, including a fuzz test that the
Solidity and the hand-written encoding agree for arbitrary inputs.
3 — Every constant, with its value and its why
| name | value | why that number |
|---|---|---|
| BPS | 10 000 | One basis-point denominator for the whole contract, so no split is ever expressed in two different units. |
| MAX_SCORE | 1e18 | A score is a fraction of one in 18-decimal fixed point. Rewards are pot × score / Σscore, so the unit only has to be consistent; 1e18 gives 18 digits of resolution and keeps the product far inside 2²⁵⁶ for any realistic pot. |
| STAKE | 0.01 ether | The price of occupying a submission slot. Low enough that a researcher can enter; high enough that squatting a hundred slots costs one ether. |
| ATTEST_BOND | 0.02 ether | Exactly 2 × STAKE. Contradicting a rival must cost strictly more than submitting against them, or the cheapest attack on the market is a lie. |
| SLASH_BPS | 7 000 | 70 % of a losing bond. Deliberately not 10 000: a scorer who ran the model honestly and landed on a different number should be punished, not erased — a total slash turns scoring into a coin flip nobody takes. |
| SLASH_TO_MAJORITY_BPS | 6 000 | The majority did the work of catching the lie, so most of what is taken is theirs. |
| SLASH_TO_POT_BPS | 3 000 | The funders paid for a task a liar tried to corrupt. |
| SLASH_TO_SINK_BPS | 1 000 | The protocol's only revenue from a dispute. The three sum to BPS, checked in the constructor. |
| SINK_FEE_BPS | 250 | 2.5 % of a settled pot, taken only when a pot really settles with at least one verified score. An abandoned or unscored epoch pays nothing. |
| DISPUTE_WINDOW | 3 days | After scoring closes, how long the quiet majority has to bond against a late contradiction. Three days so a weekend cannot be used as an attack window. |
| MIN_SUBMIT_WINDOW | 1 days | An epoch cannot be opened and closed to submissions inside one block. |
| MIN_SCORE_WINDOW | 1 days | Scorers need time to actually run the thing. |
| MAX_ATTESTERS_PER_SUBMISSION | 64 | Bounds every loop in resolve, which is O(n²) over attesters — at 64 that is 4 096 memory comparisons, after one pass copying storage to memory, so a frozen submission can always be resolved inside a block. |
| MAX_URI_BYTES | 512 | A weights URI is a pointer, not a payload. |
And in FeeSink.sol: MAX_SLIPPAGE_BPS = 300, so a buyback may give up
at most 3 % against the quoter's own number — which means a pool whose fee tier eats more than
that simply cannot be traded into by this contract. EXPECTED_SUPPLY = 1e27, the
supply every Stockereum launch mints, checked as a second independent signal alongside
factory().
4 — The slash waterfall
Walk it with your own numbers in cell [10]. The arithmetic there is the contract's, division for division.
// per LOSING bond, floored once, on ONE partition
for each minority bond b:
cut = floor(b × SLASH_BPS / BPS) // 70 %
slashed += cut
credit(attester, b - cut) // the other 30 % goes home
// then the waterfall, on exactly that `slashed`
toMajority = floor(slashed × SLASH_TO_MAJORITY_BPS / BPS) // 6000
toPot = floor(slashed × SLASH_TO_POT_BPS / BPS) // 3000
toSink = slashed - toMajority - toPot // takes both roundings
for each majority bond b:
share = floor(toMajority × b / majorityBonds)
handed += share
credit(attester, share)
toSink += toMajority - handed // the pro-rata residue, named and sent somewhere real
pot += toPot
credit(feeSink, toSink)
floor(Σb × 7000 / 10000) and Σ floor(b × 7000 / 10000) are
different numbers. A contract that uses the first for the accounting and the second
for the payouts is short by a wei, and every test passes except the last withdrawal. So the
slashed total here is never computed independently: it is accumulated from exactly the cuts
that were actually taken. The same rule applies to the majority's pro-rata and to
settle's reward split — one partition, one floor, and whatever falls out is named
dust and credited to the sink in the same transaction.
5 — The ledger and its one invariant
Every wei inside Datasync is in exactly one of two aggregates:
totalCredits, which is withdrawable by someone, and totalLocked,
which is a stake, a bond or a pot. Every state transition moves wei between them and never
creates or destroys any.
address(this).balance == totalCredits + totalLocked
That is asserted after every single action in the unit tests and as a fuzz invariant over
128 000 random calls, alongside balance ≥ totalCredits (never insolvent) and
balance == everything in − everything out (ether never appears or vanishes).
Nothing in the contract ever pushes ether. withdraw() is the only way out, and a
recipient that reverts on receive can therefore freeze nobody but itself — there is a test
which settles a pot with a reverting contract as one of the winners and watches everyone else
get paid.
6 — What is off chain
Everything that matters about a model, which is the honest shape of this:
- The model itself. The chain holds a 32-byte commitment and, after reveal, a URI of at most 512 bytes. It has never seen a weight.
- The challenge set. A hash, then a URI. The contract cannot read what is behind that URI and cannot check that it is the data the hash promised beyond the hash itself.
- Running the model. Done by whoever wants to attest, on their own hardware, with their own harness. The EVM cannot do this and never will.
- Deciding what a score means. The task definition is itself only a commitment. Two honest scorers using different harnesses will get different numbers, and the mechanism will treat that as a contradiction. That is a real cost of this design and it is why the slash is 70 % and not 100 %.
What the chain does: it fixes the order of events so nobody can fit to the test, it makes every
assertion cost money, and it pays out on arithmetic nobody can argue with. That is all, and it
is written in the first comment of Datasync.sol in those words.
7 — Stockereum, and the fee sink that is unarmed
Stockereum is a real
Ethereum launchpad that opens Uniswap v4 pools. Read live on
the anchors page; everything below was read with eth_call on
3 December 2026 at block ≥ 26 552 110.
Verified
| fact | value |
|---|---|
| STOCKER.factory() | 0x4C402AA92f166be2d3D9bA1b2879bD2b5616a26d |
| STOCKER.totalSupply() | 1e27 |
| STOCKER.name() / symbol() | "Stockereum.fun" / "STOCKER" |
| factory runtime size | 15 766 bytes |
| factory.launchCount() | 124 |
| factory.creationFee() | 1e15 |
| factory.openingFdvUsd() | 4000e18 |
| factory.SUPPLY_WHOLE() | 1e9 |
| factory.TICK_SPACING() | 200 |
| factory.poolManager() | 0x0000…4444c5dc75cB358380D2e3dE08A90 — the real v4 PoolManager |
| factory.eip712Domain() | "StockpadLaunchFactory", version "1", chainId 1 |
| allLaunches(123) | ETHERCAT, 0xD32D…8FFa — which names the same factory |
The launch ABI, derived rather than guessed
There was no selector to look up and no event to follow: the factory had emitted nothing in 200 000 blocks. The reason is that all 124 launches sit between blocks 25 899 571 and 25 908 246 — 3 to 5 September 2026 — and a 200 000-block window ending today begins two months after the pad went quiet. There was nothing to find. So:
- A PUSH4 sweep of the 15 766-byte runtime gave 78 candidate words, resolved through
api.openchain.xyz. Among them:createLaunch(...)=0x74f65323andcreateLaunchAndBuy(...,uint256)=0x67309027. - A real launch transaction was located by requesting a token's own logs
(
rpc.flashbots.netserves 2 000 blocks a call; most public endpoints refuse archive ranges entirely):0x2426667ab3ee029f759ca3e7cd7cac9a1dc465e067eaa811f990b9d14d351e74, block 25 908 246, status 1, gasUsed 1 632 117, 24 logs, 0.003 ETH of value, selector0x67309027. - Decoding its 804 bytes with the candidate struct produces the exact JSON string
that
ETHERCAT.metadataUri()still returns, byte for byte. That is the proof.
struct LaunchParams {
string name; // "ETHERCAT"
string symbol; // "ETHERCAT"
string metadataUri; // {"description":…,"web":…,"x":…,"tg":…,"image":…}
address quote; // 0xf6b1117e…103f → TSLAon, "Tesla (Ondo Tokenized)"
uint256 usdPrice; // 354080000000000000000 → $354.08 a share
uint256 deadline; // 1788577128
bytes priceSig; // 65 bytes, EIP-712
}
createLaunchAndBuy(LaunchParams, uint256 devBuy) // devBuy was 0
So Stockereum pairs against tokenized equities. That is why the opening valuation is in dollars, and why the quote's price must be attested rather than read from a pool. The signature scheme was closed by brute-forcing the typehash preimage:
PRICE_TYPEHASH = keccak256("QuotePrice(address quote,uint256 usdPrice,uint256 deadline)")
= 0x604e38e7b41a84289b02fd4a501d954c6ed2a9dd30640b2c990ffb15d9f98721
domainSeparator = 0xd484562e043b2b2e1ae7c3850b5291c0c14b7e963f51211f5fc842b041c5a088
digest (that tx) = 0xe23312071ba0a8f0a8a5ab521fe1908f9123b2a185accd4292684c6b43ca2ca4
ecrecover(digest) = 0x9296698ab7dCDe04D0E4B05d0d87cB21b6bC5CA2 ← the pad's price signer
A wrong encoding anywhere in that chain recovers a random address. Recovering one clean checksummed address is what makes the ABI certain. Cell [12] re-checks the typehash against the live chain in your browser.
QuotePrice
signed by that signer, with a deadline roughly 1 000 seconds out. Nobody outside the pad can
produce it. Replaying the real calldata on a mainnet fork reverts
PriceExpired(); signing a fresh one with any other key reverts
BadPriceSignature() (0xb5cbb5a2) — and that error was
not in the PUSH4 sweep at all. It was found by trying it on a fork, which means the
sweep is incomplete, and fifteen of the 78 words are still unresolved and are not used.
The pool key, the fee tier, the liquidity lock and the creator fee were not read off chain, so none of those numbers appear anywhere on this site.
Consequence:
src/IStockereum.sol carries the verified getters in one interface and
the launch entry points in a second one marked UNVERIFIED FOR OUR USE —
correct ABI, unusable without the pad's signature. Datasync never calls it.
The fee sink
Fees accrue in ether and nothing happens, on purpose.
arm(address token)is one-shot. It requires that the token's ownfactory()returns Stockereum's factory and that itstotalSupply()is exactly 1e27. Both reads are made against the candidate itself, so there is nothing for a caller to assert and no list to maintain. Canonical WETH fails it (nofactory()at all). A tokenized stock fails it. The factory fails it. All three are tested against the real chain.buyback(ethIn, minOut)revertsNotArmedtoday, andNoPriceSourcethe moment after arming, becausequoterisaddress(0). It refuses to trade on a price it cannot read. When it can read one, it refuses anyminOutbelowquote × (BPS − 300) / BPS, and revertsSwapShortif the swap underdelivers — so a parallel pool with a punitive fee and no depth cannot swallow it.- Shipped state:
armed == false,token == address(0),quoter == address(0), and nothing deployed on any chain.
8 — The tests
| file | n | what it pins |
|---|---|---|
| Hashing.t.sol | 14 | the four preimages, their lengths, the injectivity of every field, and a fuzz test that Solidity and a hand-written encoding agree |
| Lifecycle.t.sol | 21 | windows, exact stake, reveal checking, and that scoring cannot start before the challenge preimage is published |
| Scoring.t.sol | 25 | standing score, agreement, contradiction, freeze, resolve by bonded wei, the tie, the attester limit, bond release |
| Settle.t.sol | 16 | pro rata with three uneven scores, refund-not-zero, forfeit, abandonment, two funders draining a pot to the wei, a reverting receiver freezing nobody |
| Preview.t.sol | 10 | that the two previews this website runs match what settle and resolve actually pay, plus two conservation fuzz tests |
| Sink.t.sol | 22 | every way arm() refuses, and every way buyback() refuses |
| Invariant.t.sol | 8 | the ledger partition, solvency, conservation of ether, and that scoredCount never drifts from the submissions it counts — 128 000 calls each |
| ForkStockereum.t.sol | 31 | every anchor against real mainnet, the typehash, the domain separator, the signer recovery, the calldata replay, and the sink's gate on real tokens |
The invariant suite earned its keep: invariant_scoredCountMatchesReality failed on
the first run and found that settle moved a submission from Scored to
Paid without decrementing the counter, which also meant a dispute resolved after
settlement could thaw a submission into an epoch that would never pay it. Both are fixed; the
branch and the comment that explain them exist because a fuzz run found them.
Nothing is deployed. The only chain interaction anywhere in this repository is
vm.createSelectFork("https://ethereum-rpc.publicnode.com"), which reads.
9 — What is not done
- Nothing is deployed, on any chain. No token exists. No pot has ever been funded, and no epoch has ever been opened.
- There is no DATASYNC token on Stockereum and there cannot be one until the pad signs a price for us. There is no mechanism to ask.
resolveweighs sides by bonded wei. That is a plutocracy of bonds, not a truth oracle. It is the same shape that makes a price trustworthy when no oracle exists, with the same failure mode: enough money on the wrong side wins.- A contradiction freezes a submission for
DISPUTE_WINDOWeven if the contradictor is lying. That is a denial of service priced atATTEST_BOND × SLASH_BPS= 0.014 ETH per freeze. Datasync prices griefing; it does not prevent it. openScoringcan be withheld by whoever holds the challenge preimage. Then the epoch is abandoned and everything is refunded — censorship costs the censor the task.- Two honest scorers with different harnesses will disagree and be treated as a contradiction. The mechanism cannot distinguish a lie from a different evaluation setup.
- An unclaimed
claimRefundleaves its share locked in the contract forever. There is no sweeper, because a sweeper is a privilege and this contract has none. - No model runs here. The site cannot evaluate a model, the contract cannot evaluate a model, and no future version of either will.