skills/aztec-scanner/SKILL.md
Use when the user wants to audit Aztec Network smart contracts written in Noir, scan for privacy-specific vulnerabilities including state leakage, note handling, or nullifier collisions, review private DeFi protocols for information disclosure, or analyze encrypted computation and zero-knowledge proof circuits.
npx skillsauth add 0x-shashi/web3-audit-skills skills/aztec-scannerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Security scanner for Aztec Network smart contracts written in Noir. Aztec is a privacy-focused L2 on Ethereum with a unique dual public/private state model.
| Attribute | Value | |-----------|-------| | Chain | Aztec Network (Ethereum L2) | | Language | Noir (Rust-inspired, ZK-circuit language) | | Proof System | Ultra-PLONK (client-side proving) | | State Model | Dual: Private (UTXO/notes) + Public (storage slots) | | Privacy | Private functions hide inputs, outputs, and who called them | | Execution | Private: client-side → Public: sequencer-side | | Token Standard | Private tokens via note encryption |
┌─────────────────────────────────────────────────────────┐
│ Aztec Contract │
├──────────────────────────┬──────────────────────────────┤
│ Private Functions │ Public Functions │
│ (Client-side execution) │ (Sequencer-side execution) │
│ - Hidden inputs/outputs │ - Visible state changes │
│ - Note creation/nullifying │ - Storage slot reads/writes │
│ - ZK proof generation │ - Similar to Solidity │
├──────────────────────────┴──────────────────────────────┤
│ Private State: Notes (UTXO-like, encrypted) │
│ Public State: Storage slots (like Solidity) │
│ Shared: Nullifier tree, note hash tree, L1-L2 messages │
└─────────────────────────────────────────────────────────┘
Aztec uses a UTXO-like model for private state:
Private functions execute FIRST (client-side), then public functions execute SECOND (sequencer-side). This ordering has security implications:
| Category | Detection | Severity | |----------|-----------|----------| | Privacy | Private data exposed via public state or function args | Critical | | Privacy | Note content leaked through observable behavior (timing, gas) | High | | Privacy | Encryption key mismanagement (wrong recipient) | Critical | | Nullifier | Nullifier collision (two notes produce same nullifier) | Critical | | Nullifier | Nullifier not emitted when note consumed (double-spend) | Critical | | Nullifier | Nullifier predictable (allows front-running) | High | | State Sync | Public/private state inconsistency | High | | State Sync | Private function reads stale public state | Medium | | Circuit | Under-constrained circuit (invalid proofs accepted) | Critical | | Circuit | Over-constrained circuit (valid transactions rejected) | Medium | | Oracle | Untrusted oracle data used in circuit constraints | High | | Access | Private function callable without proper auth | High | | Notes | Note not encrypted for correct recipient | Critical | | Notes | Note discovery failure (recipient can't find their notes) | High |
| Threat | Attack Vector | Mitigation | |--------|--------------|-------------| | Transaction graph analysis | Linking sender/receiver via timing | Add delay, use shield/unshield | | Amount leakage | Fixed denomination reveals nothing | Use uniform note sizes | | Metadata leakage | Public function calls reveal intent | Minimize public function usage | | Sequencer censorship | Sequencer refuses to include tx | Forced inclusion via L1 | | Nullifier linking | Linking nullifiers to note creation | Nullifier derived from note secret + position |
Aztec is a privacy-focused L2 with:
Common Aztec/Noir errors encountered during audits. Noir circuits fail at proof generation time, making errors harder to debug than runtime reverts.
| Error Type | Error Pattern | Meaning |
|-----------|--------------|----------|
| Assertion failure | assert(condition) failed | Constraint not satisfied — proof cannot be generated |
| Array bounds | index out of bounds | Array access exceeds declared length |
| Integer overflow | Overflow on arithmetic | Operation exceeds field/integer bounds |
| Type mismatch | Expected type X, found Y | Incorrect type in circuit computation |
| Unresolved variable | Variable not found | Reference to undefined variable in circuit |
| Division by zero | Division by zero | Denominator is zero in integer division |
| Error Pattern | Source | Meaning |
|--------------|--------|----------|
| 'NOTE_NOT_FOUND' | Note management | Note does not exist or was nullified |
| 'NULLIFIER_ALREADY_EXISTS' | Nullifier tree | Double-spend attempt — note already consumed |
| 'INVALID_CALLER' | Access control | Unauthorized function caller |
| 'INVALID_CONTEXT' | Context check | Wrong execution context (private vs public) |
| 'INVALID_NOTE_TYPE' | Note deserialization | Note type does not match expected schema |
| 'PUBLIC_CALL_FAILED' | Public function | Public portion of transaction reverted |
| 'PRIVATE_CALL_FAILED' | Private function | Private proof verification failed |
| 'ENCRYPTION_FAILED' | Note encryption | Failed to encrypt note for recipient |
| 'INVALID_SELECTOR' | Function dispatch | Function selector not found on contract |
| Issue | Error Pattern | Audit Significance | |-------|--------------|--------------------| | Note viewing key leak | No error — silent | If viewing keys are shared incorrectly, privacy is broken without any on-chain error | | Nullifier predictability | No error — logical | Predictable nullifiers allow note existence tracking — check nullifier derivation | | Public/private boundary leak | Transaction appears normal | Data flowing from private to public context may leak information — audit cross-context calls | | Incomplete nullification | No error | Note consumed but nullifier not published — allows double-spend | | Proof witness leakage | No on-chain error | Witness data in proof reveals private inputs — verify proof contains only public signals |
| Issue | Likely Cause | Solution | |-------|-------------|----------| | Privacy leakage not detected | Scanner audits logic without modeling information flow | Trace all data paths between private and public contexts; flag any private state exposed via public functions | | Nullifier collision risks missed | Scanner doesn't model nullifier tree | Verify nullifier derivation includes unique components (note hash, secret, index) | | Note encryption issues not caught | Scanner doesn't analyze encryption correctness | Verify notes are encrypted to correct recipient keys; check key rotation handling | | Cross-context reentrancy missed | Scanner treats private/public as isolated | Trace private → public → private call chains for state manipulation opportunities | | Proof circuit constraint gaps | Scanner checks Noir syntax, not constraint completeness | Verify every private input is constrained; unconstrained inputs allow proof forgery | | Client-side proof manipulation ignored | Scanner only checks on-chain contracts | Audit client-side proof generation logic for witness injection or tampering vectors |
development
Systematically hunt for every variant of a discovered vulnerability across the entire codebase. Use when a bug is found and all instances of the same root cause pattern must be identified, or when performing variant analysis during competitive audits on Code4rena or Sherlock.
testing
Use when the user wants to audit TON smart contracts for security vulnerabilities, scan FunC or Tact contracts for message chain replay, bounce handling, or gas issues, review TON DeFi protocols for actor-model concurrency flaws, or analyze asynchronous message passing security.
tools
Analyze ERC20/ERC721/ERC1155 token implementations for non-standard behavior, fee-on-transfer mechanics, rebasing logic, blacklists, pausability, and integration risks. Use when reviewing protocols that interact with external tokens or implementing token-related features.
testing
Use when the user wants to audit Sui Move smart contracts, scan Sui-specific patterns including object ownership, shared objects, or dynamic fields, review Sui DeFi protocols for object model security issues, or analyze Sui-specific transaction and consensus patterns.