/peer-scoring-correctness
L1 trigger - audits peer reputation and scoring logic for symmetry, farming resistance, and penalty coverage.
$ npx -y skills add PlamenTSV/plamen --skill peer-scoring-correctness --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/peer-scoring-correctness
Context preview
The summary Claude sees to decide when to auto-load this skill.
L1 trigger - audits peer reputation and scoring logic for symmetry, farming resistance, and penalty coverage.
SKILL.md
peer-scoring-correctness.SKILL.mdname: "peer-scoring-correctness"
description: "L1 trigger - audits peer reputation and scoring logic for symmetry, farming resistance, and penalty coverage."
Injectable Skill: Peer Scoring Correctness
> **L1 trigger**: `P2P` flag AND (`score_peer`, `peer_score`, `reputation`, `misbehavior`, `ban_peer`, `peer_scoring` detected) > **Inject Into**: `depth-network-surface` > **Language**: Go and Rust > **Finding prefix**: `[PSC-N]`
1. Reward / Penalty Symmetry
Enumerate all score increments and all score decrements. For every reward path, identify the matching penalty path and ask whether a malicious peer can gain trust faster than it can lose it.
Tag: `[PEER-SCORE:SYMMETRY]`
**Required full-leg matrix**: Do not stop after the first scoring bug. Build a complete table of every score mutation and every peer-performance observation:
| Leg | Event / endpoint | Reward? | Penalty? | Error classes penalized | Can attacker farm? | |---|---|---|---|---|---| | block validation | valid / invalid block | | | | | | block pool / orphan handling | unknown parent, invalid data, timeout | | | | | | health check | HTTP 200, non-200, timeout, parse error | | | | | | data/chunk request | delivery success, delivery fail, no response | | | | | | gossip | valid message, invalid message, duplicate, re-gossip | | | | | | bootstrap / peer list | useful peer, bogus peer, stale address | | | | |
Every blank `Penalty?` for a harmful event is a candidate finding. Every blank `Can attacker farm?` for a reward event is incomplete analysis.
2. Penalty Coverage
Build a failure-mode table and verify every harmful action has a score impact:
| Failure mode | Penalized? | Immediate? | Resettable? | |---|---|---|---| | Invalid block / tx | | | | | Timeout / stall | | | | | Malformed gossip | | | | | Health-check failure | | | | | Excessive requests | | | | | Non-response / timeout | | | | | Non-200 HTTP response | | | | | Delivery failure after accepted request | | | | | Invalid block held in cache / orphan pool | | | | | Stale peer address update | | | |
Tag: `[PEER-SCORE:COVERAGE]`
3. Farming / Free-Riding
Check whether peers can cheaply farm score via ping loops, `get_data` style requests, acknowledgements without contribution, or reconnect-based resets. Quantify attacker cost versus defender work.
For each positive score path, identify the cost the peer actually pays. A peer must not gain score for:
- returning any HTTP 200 when the requested data was not delivered;
- responding to health checks without serving blocks/chunks;
- causing the victim to fetch data from the attacker while the attacker withholds
useful data;
- reconnecting to clear a negative history and immediately earning fresh rewards.
Tag: `[PEER-SCORE:FARMING]`
3b. Direction and Sign Sanity
For every `increase_score`, `decrease_score`, `reward`, `penalize`, or raw `score +=/-=` site, verify the sign matches the semantic event. Common miss: error branches log failure but do not call the penalty path, or non-200 responses are treated as success because transport completed.
Tag: `[PEER-SCORE:DIRECTION:{file}:{line}]`
4. Reset and Persistence Semantics
- Does disconnect/reconnect reset score?
- Is score keyed by peer ID, IP, ENR, or connection object?
- Can bans be bypassed by cheap identity rotation?
- Are penalties persisted across restart?
Tag: `[PEER-SCORE:RESET]`
5. Selection Stability
Trace where score affects sync-source selection, top-peer preference, or bandwidth allocation. A manipulable score that changes any of those choices is an enabler finding even if the scoring bug alone is not terminal.
Tag: `[PEER-SCORE:SELECTION]`
6. Output Requirement
Always include the full-leg matrix in the output, even when every row is SAFE. If a row is not applicable, write `N/A` and cite the file/line proving the protocol does not implement that leg. Missing rows are treated as incomplete peer-scoring coverage.
Read more
name: "peer-scoring-correctness" description: "L1 trigger - audits peer reputation and scoring logic for symmetry, farming resistance, and penalty coverage."
Injectable Skill: Peer Scoring Correctness
> **L1 trigger**: `P2P` flag AND (`score_peer`, `peer_score`, `reputation`, `misbehavior`, `ban_peer`, `peer_scoring` detected) > **Inject Into**: `depth-network-surface` > **Language**: Go and Rust > **Finding prefix**: `[PSC-N]`
1. Reward / Penalty Symmetry
Enumerate all score increments and all score decrements. For every reward path, identify the matching penalty path and ask whether a malicious peer can gain trust faster than it can lose it.
Tag: `[PEER-SCORE:SYMMETRY]`
**Required full-leg matrix**: Do not stop after the first scoring bug. Build a complete table of every score mutation and every peer-performance observation:
| Leg | Event / endpoint | Reward? | Penalty? | Error classes penalized | Can attacker farm? | |---|---|---|---|---|---| | block validation | valid / invalid block | | | | | | block pool / orphan handling | unknown parent, invalid data, timeout | | | | | | health check | HTTP 200, non-200, timeout, parse error | | | | | | data/chunk request | delivery success, delivery fail, no response | | | | | | gossip | valid message, invalid message, duplicate, re-gossip | | | | | | bootstrap / peer list | useful peer, bogus peer, stale address | | | | |
Every blank `Penalty?` for a harmful event is a candidate finding. Every blank `Can attacker farm?` for a reward event is incomplete analysis.
2. Penalty Coverage
Build a failure-mode table and verify every harmful action has a score impact:
| Failure mode | Penalized? | Immediate? | Resettable? | |---|---|---|---| | Invalid block / tx | | | | | Timeout / stall | | | | | Malformed gossip | | | | | Health-check failure | | | | | Excessive requests | | | | | Non-response / timeout | | | | | Non-200 HTTP response | | | | | Delivery failure after accepted request | | | | | Invalid block held in cache / orphan pool | | | | | Stale peer address update | | | |
Tag: `[PEER-SCORE:COVERAGE]`
3. Farming / Free-Riding
Check whether peers can cheaply farm score via ping loops, `get_data` style requests, acknowledgements without contribution, or reconnect-based resets. Quantify attacker cost versus defender work.
For each positive score path, identify the cost the peer actually pays. A peer must not gain score for:
- returning any HTTP 200 when the requested data was not delivered;
- responding to health checks without serving blocks/chunks;
- causing the victim to fetch data from the attacker while the attacker withholds
useful data;
- reconnecting to clear a negative history and immediately earning fresh rewards.
Tag: `[PEER-SCORE:FARMING]`
3b. Direction and Sign Sanity
For every `increase_score`, `decrease_score`, `reward`, `penalize`, or raw `score +=/-=` site, verify the sign matches the semantic event. Common miss: error branches log failure but do not call the penalty path, or non-200 responses are treated as success because transport completed.
Tag: `[PEER-SCORE:DIRECTION:{file}:{line}]`
4. Reset and Persistence Semantics
- Does disconnect/reconnect reset score?
- Is score keyed by peer ID, IP, ENR, or connection object?
- Can bans be bypassed by cheap identity rotation?
- Are penalties persisted across restart?
Tag: `[PEER-SCORE:RESET]`
5. Selection Stability
Trace where score affects sync-source selection, top-peer preference, or bandwidth allocation. A manipulable score that changes any of those choices is an enabler finding even if the scoring bug alone is not terminal.
Tag: `[PEER-SCORE:SELECTION]`
6. Output Requirement
Always include the full-leg matrix in the output, even when every row is SAFE. If a row is not applicable, write `N/A` and cite the file/line proving the protocol does not implement that leg. Missing rows are treated as incomplete peer-scoring coverage.
Autonomous Web3 security auditor for Claude Code and OpenAI Codex CLI. Orchestrates 18-100 AI agents across 40+ phases to produce audit reports with verified PoC exploits — for smart contracts and L1 node-client infrastructure.
Repo: PlamenTSV/plamen
Other skills on plamen.
- /ability-analysis
Trigger Pattern Always (Aptos Move) - foundational security check - Inject Into Breadth agents, depth agents
Open skill - /bit-shift-safety
Trigger Pattern Always (Aptos Move) - Move VM aborts on shift = bit width - Inject Into Breadth agents, depth-edge-case
Open skill - /centralization-risk
Trigger Protocol has privileged roles (admin, operator, governance, resource account owner) - Covers Single points of failure, privilege escalation, external governance dependen...
Open skill - /cross-chain-timing
Trigger Pattern wormhole|layerzero|ccip|bridge|cross_chain|vaa|guardian|emitter|relay|remote_chain|payload|nonce.sequence - Inject Into Breadth agents, depth-external
Open skill - /dependency-audit
Trigger EXTERNAL_LIB flag detected (protocol uses third-party Move dependencies) - Used by Breadth agents, depth-external
Open skill - /economic-design-audit
Trigger Pattern MONETARY_PARAMETER flag (required) - Inject Into Breadth agents (merged via M4 hierarchy)
Open skill

