ability-analysis
Trigger Pattern Always (Aptos Move) - foundational security check - Inject Into Breadth…
L1 trigger - audits light client and cross-chain proof verification: Merkle proof soundness, ICS-23 subkey handling (Dragonberry class), state root checks, message integrity.
$ npx -y skills add PlamenTSV/plamen --skill light-client-proof-verification --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/light-client-proof-verificationContext preview
The summary Claude sees to decide when to auto-load this skill.
L1 trigger - audits light client and cross-chain proof verification: Merkle proof soundness, ICS-23 subkey handling (Dragonberry class), state root checks, message integrity.
name: "light-client-proof-verification" description: "L1 trigger - audits light client and cross-chain proof verification: Merkle proof soundness, ICS-23 subkey handling (Dragonberry class), state root checks, message integrity."
> **L1 trigger**: `L1_PATTERN=true` AND (`light_client/` OR `ics23/` OR `merkle/` OR `proof/` OR `verify_proof` OR `verify_root` OR `validate_path` OR `merkle_tree` OR `state_root` OR `trie_proof` OR `ibc/` OR `beacon-api-client/` detected in recon subsystem map) > **Inject Into**: `depth-consensus-invariant` or `depth-external` > **Language**: Go and Rust > **Finding prefix**: `[LC-N]` > **Status**: v0.1 draft, Round 4 exemplars pending
Recon identifies light-client or cross-chain proof verification code. This skill is the most consequential for cross-chain bridges and IBC-adjacent code because a proof-verification bug can allow forged state to be accepted as canonical — the Dragonberry class.
Identify the exact proof format used:
| Format | Identifier | Notable pitfalls | |---|---|---| | **Merkle-Patricia Trie (MPT)** | Ethereum state proofs, `eth_getProof` | RLP decode edge cases; extension/branch collision | | **IAVL+** | Cosmos SDK `x/store` | Left-right ordering; ICS-23 subkey encoding | | **Sparse Merkle Tree (SMT)** | Aptos, Sui, Celestia | Empty-leaf handling; default hash values | | **Verkle** | Future Ethereum | KZG commitment; opening soundness | | **SSZ proofs** | Ethereum Beacon chain | Generalized index encoding | | **ICS-23** | IBC light clients | Generic proof spec; multiple backends |
Write the format into the finding header.
Tag: `[MPT:{defect}]`
Tag: `[ICS23:{defect}]`
**Known exemplar**: Cosmos SDK Dragonberry (Oct 2022) — [Verichains writeup](https://blog.verichains.io/p/vsa-2022-103-cosmos-sdk-forging-membership). Subkey suffix forgery allowed forged membership proofs. Patched in Cosmos SDK 0.45.9 / 0.46.3.
For custom Merkle helpers, do not stop at "hashes are recomputed." Build a field-by-field proof-soundness table:
| Check | Required invariant | Evidence | |---|---|---| | Leaf binding | The supplied leaf/value hash is compared to the target leaf, not only folded into a path | | | Target offset | `target_offset` / index selects the left-right walk and is range-checked | | | Proof length | number of siblings equals expected tree depth, or the verifier rejects | | | Operator correctness | all acceptance conditions use the intended boolean connective (`&&` vs `||`) | | | Root binding | final computed root equals the trusted root for the same block/header/context | | | Empty/singleton tree | zero-node and one-node cases are explicitly defined | |
Mandatory procedure:
1. Locate every `validate_path`, `verify_path`, `validate_chunk`, `verify_chunk`, `calculate_root`, and `hash_leaf` function. 2. For each verifier, write the exact predicate that returns `true`. 3. Try these adversarial proofs: wrong leaf with valid sibling path, correct leaf with too-short proof, proof for adjacent `target_offset`, empty proof, and a proof where only one side of a compound condition holds. 4. If the verifier accepts any case where the leaf, path length, offset, or root is not bound, emit a finding even if another caller performs a partial check. The primitive itself is load-bearing.
Tag: `[MERKLE-PATH:{leaf|length|offset|operator|root}]`
The proof is only as good as the root it verifies against.
1. Where does the verified root come from? Block header? Light-client state? Trusted setup? 2. Is the root **freshness** bounded? A stale root can be used to verify a stale state; a recent root cannot prove historical state 3. For cross-chain proofs: the root is provided by a validator signature (Tendermint) or a fraud-proof challenge (optimistic rollup). What's the trust model? 4. **Replay**: can the same proof be replayed against a different root to deceive a different chain?
Tag: `[ROOT-BIND:{source}:{freshness-bo
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…