Real subnet rules
Not mechanisms written to fail. Three scoring rules taken from real subnet code, two of them named.Why test the ones already deployed
The reference mechanisms elsewhere on this site were written to demonstrate specific design mistakes. That is useful for explaining a scenario, and useless as evidence: nobody deployed them.
The adapters in examples/real/ are different. Each file reproduces a scoring rule taken from published subnet code, byte for byte where the interface allows it. The question they answer is not "how would a bad mechanism fail" but "how does this one fail". Three so far: the official subnet template, rank-decay scoring, and SN22's paid-volume mechanism.
The official template: 3 of 7
RaoFoundation/bittensor-subnet-template is the repository the Bittensor documentation points new subnet owners at. Its reward function is four lines:
pythondef reward(query: int, response: int) -> float:return 1.0 if response == query * 2 else 0
Correct answers score 1.0, everything else scores 0.0. Run against seven adversaries:
| scenario | measured | allowed | what it means |
|---|---|---|---|
| weight_copying | 1.000 | 0.25 | a copier scores exactly what the miner it copied scores |
| sybil_farm | 0.590 | 0.40 | eight hotkeys from one operator capture more than half an honest share |
| stale_replay | 1.000 | 0.20 | a replayed answer keeps full reward indefinitely |
None of this is a mistake in the template — it is a minimal starting point and says so. But a subnet owner who ships it unchanged inherits all three, and two of them cost money directly: copying is free income, and a stale answer is free income forever.
Ranked harmonic: 4 of 7
Many subnets do not score on an absolute scale — they rank miners and pay by position, with rank r paying 1/(r+1). Ranking is scale-free, so it cannot be defeated by inflating scores. It fails differently.
| scenario | measured | allowed | what it means |
|---|---|---|---|
| collusion_ring | 3.281 | 1.50 | four hotkeys submitting one answer occupy four ranks |
| weight_copying | 0.750 | 0.25 | a copier lands just below its target, in the next rank |
| stale_replay | 1.667 | 0.20 | a stale answer ranks above honest miners on later rounds |
| noise_flood | 0.252 | 0.05 | a fast wrong answer outranks a slow right one |
The collusion result is the one worth staring at. Ranking does not merely fail to prevent a ring — it amplifies one, because each duplicate consumes a rank. Three point two eight times the fair share, from four hotkeys that did the work once.
SN22 (Desearch): 6 of 7, one unanswered
The first adapter built from a named subnet's repository rather than from a pattern. SN22 pays for *volume of verified work*: validators mark each row pass or fail, and only verified rows are payable. Weight is a miner's share of that volume within a pool, multiplied by a percentile term, with 30% of emission routed to an emission-control hotkey.
Reproduced in examples/real/sn22_paid_volume.py and run against the same seven adversaries:
| scenario | result | why |
|---|---|---|
| stale_replay | PASS | a replayed row is already verified, so it earns nothing new |
| noise_flood | PASS | unverified output is not payable, however fast it arrives |
| collusion_ring | PASS | the ring shares one payout, not one payout each |
| sybil_farm | FAIL 0.422 | distinct cheap work is paid per hotkey — a coldkey with eight hotkeys earns 3.4x |
| weight_copying | INVALID | not answered — see below |
Paying for verified volume rather than for a score is the structural reason this mechanism mostly holds: everything the adversaries exploit is a way of *claiming* value, and here value only exists after someone else has confirmed work. The sybil verdict moved from 0.000 to 0.422 in 0.7.9 and the 0.000 was not resistance — the farm's payloads used to be identical, and the ledger deduped them. Eight distinct cheap submissions are paid as eight hotkeys, and nothing in the rule groups them.
How `assay check` was measured
assay check guesses which function in a repository is the rule, so the guess has to be checked against code nobody wrote for it. Two shallow clones, and the first version got both wrong:
| repository | first pick | the actual rule |
|---|---|---|
| desearch-ai/subnet-22 | `format_score() -> str` | `weights_from_shares()`, at rank 4 |
| taoshidev/proprietary-trading-network | `normalize_scores()` | `combine_scores()` |
Both picks were plausible on name, directory and argument type: a function called score in scoring.py that takes a float. The return annotation is what gives the formatter away, and the payout vocabulary (reward, weight, incentive) is what distinguishes the mechanism from a rescaling step inside it. Both fixes are in the ranking, and both repositories are reproduced as test fixtures so it cannot silently regress.
The third kind: unauditable
Not every subnet can be modelled at all, and that is itself a finding. SN9 (IOTA) has a validator that does not score anything. Its weight_loop() fetches a global weight vector from an orchestrator over HTTP, and on any exception or timeout it calls copy_weights_from_chain().
So the mechanism lives off-chain, in a service the miner cannot see, and the published validator's local behaviour is "reuse whatever the chain last said". There is no scoring rule to reproduce and therefore nothing this tool can say about it.
Three shapes, three verdicts
All three adapters are in the repository and run with one command each:
bashmake realassay run examples/real/subnet_template.py # 3 of 7assay run examples/real/ranked_reward.py # 4 of 7assay run examples/real/sn22_paid_volume.py # 6 of 7, 1 unanswered
Three is not a survey either, and the spread is the point. Binary reward and rank decay — the two most common shapes in Bittensor — each fail a majority or near-majority of the scenarios, structurally rather than by a threshold. SN22 fails none of them, because it pays for volume someone else verified instead of for a score the miner asserts. That is the design lesson this tool exists to make concrete: what the mechanism *pays for* decides which adversaries are even reachable.