ability-analysis
Trigger Pattern Always (Aptos Move) - foundational security check - Inject Into Breadth…
L1 trigger - audits BLS signature aggregation: subgroup check, rogue-key attack defense, aggregation order, signing-domain separation.
$ npx -y skills add PlamenTSV/plamen --skill bls-aggregation-audit --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/bls-aggregation-auditContext preview
The summary Claude sees to decide when to auto-load this skill.
L1 trigger - audits BLS signature aggregation: subgroup check, rogue-key attack defense, aggregation order, signing-domain separation.
name: "bls-aggregation-audit" description: "L1 trigger - audits BLS signature aggregation: subgroup check, rogue-key attack defense, aggregation order, signing-domain separation."
> **L1 trigger**: `L1_PATTERN=true` AND (`bls/` OR `blst` OR `milagro` OR `pairing` OR `aggregate_signature` OR `proof_of_possession` detected in recon subsystem map) > **Inject Into**: `depth-consensus-invariant` or `depth-external` > **Language**: Go, Rust, occasionally C > **Finding prefix**: `[BLS-N]` > **Status**: v0.1 draft, Round 4 exemplars pending
Recon identifies BLS12-381 signature use, typically in: Ethereum beacon chain, Filecoin, Celo, Chia, Aptos, or any aggregated-signature consensus. BLS is subtle: textbook descriptions assume defenses (subgroup check, rogue-key defense) that implementations often forget.
Identify the BLS library:
| Library | Language | Canonical use | |---|---|---| | `blst` | C with Go/Rust bindings | Lighthouse, Prysm, Teku | | `milagro-crypto` | C | Older clients | | `arkworks` | Rust | Aptos, some academic | | `celo-bls-zexe` | Rust | Celo | | `py_ecc` | Python | Reference implementations | | hand-rolled pairing | Various | Red flag — usually wrong |
A hand-rolled pairing implementation is a near-certain bug source. Flag it for intensive review.
BLS signatures live in a subgroup of an elliptic curve group. An attacker can provide a curve point that is valid on the curve but outside the subgroup, leading to signature verification forgeries.
**Check**:
Tag: `[BLS-SUBGROUP:{loc}:{checked}]`
**Known exemplar class**: the `blst` library had a historical subgroup-check advisory; check upgrade logs.
Rogue-key attack: attacker registers a public key that is the difference of a target's key and the attacker's, then signs a message that verifies as signed by both.
**Defenses**:
**Check**:
Tag: `[BLS-ROGUE-KEY:{defense}:{status}]`
BLS signatures must include a **domain tag** in the hash-to-point step. This prevents a signature from one protocol being replayed in another.
**Check**:
Tag: `[BLS-DOMAIN:{message-type}:{tag}]`
Signature aggregation must be commutative. If the verification result depends on insertion order, that's a bug (and a non-determinism source).
If the same signature is aggregated twice, the result doubles. Is this intended? In beacon chain, double-counting an attestation is a slashing condition.
**Check**: Does the aggregation code deduplicate? Does it track which validators have already contributed?
Tag: `[BLS-AGG:{issue}]`
The hash-to-curve step (RFC 9380) has multiple valid implementations with subtle differences. Inconsistency across clients is a consensus bug.
**Check**:
Most BLS libraries are C (blst). Calling C from Go or Rust via FFI is a common bug source:
**Check**:
Tag: `[BLS-FFI:{issue}]`
| State | Test | Expected | Observed | |---|---|---|---| | Zero signature | identity-like bytes | spec-defined rejection | | | Zero public key | identity-like bytes | rejected | | | Subgroup-invalid sig | on-curve but wrong subgroup | rejected | | | Empty aggregation | aggregate of zero sigs | identity or error | | | Duplicate in aggregate | same sig twice | spec-defined | | | Max validator aggregation | aggregate of all validators | no integer overflow in count | | | Domain tag swap | attestation sig used as proposal sig | rejected | |
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
Trigger Pattern Always (Aptos Move) - foundational security check - Inject Into Breadth…
Trigger Pattern Always (Aptos Move) - Move VM aborts on shift = bit width - Inject Into…
Trigger Protocol has privileged roles (admin, operator, governance, resource account owner) -…
Trigger EXTERNAL_LIB flag detected (protocol uses third-party Move dependencies) - Used by…
Trigger Pattern MONETARY_PARAMETER flag (required) - Inject Into Breadth agents (merged via…