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.

Note
These results are from assay's scripted adversaries in a simulated validator. They are not findings about the subnets' code quality, and they are not vulnerabilities.

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:

python
def 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:

scenariomeasuredallowedwhat it means
weight_copying1.0000.25a copier scores exactly what the miner it copied scores
sybil_farm0.5900.40eight hotkeys from one operator capture more than half an honest share
stale_replay1.0000.20a 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.

Note
The rule compares answers, not identities, and mentions nothing about time. Both failures follow from that, and neither is fixable by adjusting a threshold.

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.

scenariomeasuredallowedwhat it means
collusion_ring3.2811.50four hotkeys submitting one answer occupy four ranks
weight_copying0.7500.25a copier lands just below its target, in the next rank
stale_replay1.6670.20a stale answer ranks above honest miners on later rounds
noise_flood0.2520.05a 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:

scenarioresultwhy
stale_replayPASSa replayed row is already verified, so it earns nothing new
noise_floodPASSunverified output is not payable, however fast it arrives
collusion_ringPASSthe ring shares one payout, not one payout each
sybil_farmFAIL 0.422distinct cheap work is paid per hotkey — a coldkey with eight hotkeys earns 3.4x
weight_copyingINVALIDnot 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.

Note
The seventh is INVALID, not PASS, and the distinction matters. SN22 rejects copies by assigning a different URL per task, so two miners cannot submit the same answer to the same task. assay's payloads are opaque bytes — the tool cannot express per-task assignment, so the copier in the scenario ends up excluded along with everyone else. A pass here would be an artefact of the harness.

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:

repositoryfirst pickthe 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.

Caution
Neither repository could be *run* — SN22 needs a desearch package, SN8 needs a whole vali_objects tree — so check refuses with a reason rather than a verdict. Correct aim and a refusal is what the tool promises; a fabricated number is what it exists to avoid.

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.

Note
That is not a criticism of the design — moving evaluation off-chain is a legitimate architecture. It is a limit on what any repository-based audit can conclude, and an honest audit should name it rather than quietly skipping the subnet.

Three shapes, three verdicts

All three adapters are in the repository and run with one command each:

bash
make real
assay run examples/real/subnet_template.py # 3 of 7
assay run examples/real/ranked_reward.py # 4 of 7
assay 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.

Caution
The same caveat as everywhere else: assay tests mechanism design against scripted adversaries. It does not run the subnet, does not read domain logic, and cannot see an exploit that requires knowing the commodity. A mechanism that passes all seven can still be broken.

Previous

The reward model

Next

Subnet scan