{
  "markdown": "<p align=\"center\">\n  <img src=\"aikido-og.png\" alt=\"Aikido - Security analysis platform for Aiken smart contracts on Cardano\" width=\"100%\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"LICENSE\"><img src=\"https://img.shields.io/badge/license-MIT-blue.svg\" alt=\"License\" /></a>\n  <img src=\"https://img.shields.io/badge/rust-%3E%3D1.88.0-orange.svg\" alt=\"Rust\" />\n  <img src=\"https://img.shields.io/badge/tests-1186%2B-brightgreen.svg\" alt=\"Tests\" />\n  <img src=\"https://img.shields.io/badge/detectors-75-2EFFB5.svg\" alt=\"Detectors\" />\n  <img src=\"https://img.shields.io/badge/crashes-0-2EFFB5.svg\" alt=\"Crashes\" />\n  <img src=\"https://img.shields.io/badge/audit_coverage-85%25-2EFFB5.svg\" alt=\"Audit Coverage\" />\n</p>\n\n---\n\n**Security analysis platform for [Aiken](https://aiken-lang.org/) smart contracts on Cardano.**\n\nAikido goes beyond static analysis. It combines a 75-detector suite with SMT verification, transaction simulation, compliance analysis, protocol pattern detection, and grammar-aware fuzzing to find vulnerabilities in Aiken smart contracts before they reach mainnet. Multi-lane analysis cross-correlates evidence across techniques, producing findings with source context, severity ratings, CWE/CWC classifications, and actionable remediation guidance.\n\nBuilt in Rust. Fast. Zero configuration required.\n\n---\n\n## Why Aikido\n\nCardano smart contracts are immutable once deployed. A vulnerability in production means lost funds with no recourse. Manual audits are expensive, slow, and bottlenecked. Aikido catches the classes of bugs that auditors find most often - double satisfaction, missing signature checks, unbounded iteration, unsafe datum handling - automatically, in seconds.\n\n- **The only security tool for Aiken** - no alternatives exist in the ecosystem\n- **75 detectors** with CWC (Cardano Weakness Classification) and CWE mappings\n- **Multi-lane analysis** - static detectors, compliance, SMT verification, transaction simulation, protocol detection, fuzzing\n- **Validated against professional audit** - 85% coverage on TxPipe's Strike Finance audit findings ([full comparison](AUDIT_COMPARISON.md))\n- **Evidence framework** - findings corroborated across multiple analysis techniques (PatternMatch -> SmtProven -> SimulationConfirmed)\n- **9 output formats** - terminal, JSON, SARIF, Markdown, HTML, PDF, CSV, GitLab SAST, reviewdog\n- **Ecosystem proven** - 10+ real-world projects including SundaeSwap, Anastasia Labs, Strike Finance, and Seedelf (0 crashes)\n\n---\n\n## Quick Start\n\n### Install\n\n```bash\n# Homebrew (macOS/Linux)\nbrew install Bajuzjefe/tap/aikido\n\n# Cargo (Rust >= 1.88.0)\ncargo install --git https://github.com/Bajuzjefe/Aikido-Security-Analysis-Platform aikido-cli\n\n# npm (wrapper)\nnpx aikido-aiken /path/to/project\n\n# Docker\ndocker run --rm -v $(pwd):/project ghcr.io/bajuzjefe/aikido:0.3.1 /project\n\n# From source\ngit clone https://github.com/Bajuzjefe/Aikido-Security-Analysis-Platform.git\ncd aikido && cargo build --release\n```\n\n### Run\n\n```bash\naikido /path/to/your-aiken-project\n```\n\n### Example Output\n\n```\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n  AIKIDO v0.3.1  Static Analysis Report\n  Project: test/simple-treasury v0.1.0\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n  [CRITICAL] (definite) double-satisfaction - Handler treasury.spend iterates\n    outputs without own OutputReference - validators/treasury.ak:23\n\n    Spend handler accesses tx.outputs but never uses __own_ref to identify\n    its own input. An attacker can satisfy multiple script inputs with a\n    single output, draining funds.\n\n        22 | validator treasury {\n    >   23 |   spend(\n    >   24 |     datum: Option<TreasuryDatum>,\n    >   25 |     redeemer: TreasuryRedeemer,\n\n    Suggestion: Use the OutputReference parameter to correlate outputs\n    to this specific input.\n\n  ...\n\n  1 critical, 5 high, 7 medium, 0 low, 0 info\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n```\n\n---\n\n## Analysis Architecture\n\nAikido uses a multi-lane approach where independent analysis techniques cross-validate each other:\n\n```mermaid\ngraph TB\n    subgraph Input\n        A[Aiken Project] --> B[Typed AST]\n    end\n\n    subgraph Analysis Lanes\n        B --> C[Detector Suite<br/>75 detectors]\n        B --> D[Compliance<br/>Securify2-style]\n        B --> E[SMT Verification<br/>Cardano axioms]\n        B --> F[Tx Simulation<br/>exploit generation]\n        B --> G[Protocol Detection<br/>DeFi classification]\n        B --> H[Fuzz Lane<br/>grammar-aware]\n    end\n\n    subgraph Evidence Correlation\n        C --> I[Evidence Framework]\n        D --> I\n        E --> I\n        F --> I\n        G --> I\n        H --> I\n    end\n\n    I --> J[PatternMatch]\n    J --> K[PathVerified]\n    K --> L[SmtProven]\n    L --> M[SimulationConfirmed]\n    M --> N[Corroborated]\n\n    N --> O[Report<br/>9 output formats]\n\n    style C fill:#2EFFB5,color:#0a0a0a\n    style D fill:#2EFFB5,color:#0a0a0a\n    style E fill:#2EFFB5,color:#0a0a0a\n    style F fill:#2EFFB5,color:#0a0a0a\n    style G fill:#2EFFB5,color:#0a0a0a\n    style H fill:#2EFFB5,color:#0a0a0a\n    style I fill:#111111,color:#e0e0e0\n    style O fill:#111111,color:#e0e0e0\n```\n\n### Lane Details\n\n| Lane | What it does |\n|------|-------------|\n| **Detector Suite** | Cross-module interprocedural analysis, taint tracking, symbolic execution, delegation-aware suppression, transitive signal merging, datum continuity tracking |\n| **Compliance** | Securify2-style dual-pattern system: every security property has compliance (safe) and violation (unsafe) patterns. 10 security property variants |\n| **SMT Verification** | Solver-independent interface with Cardano domain axioms (value conservation, signature semantics, minting policy). Constraint solving for reachability |\n| **Tx Simulation** | ScriptContext builder generates concrete exploit scenarios. Tests 6 detector categories against simulated transactions |\n| **Protocol Detection** | Automatic DeFi protocol classification (DEX, Lending, Staking, DAO, NFT, Options, Escrow). Token flow and authority analysis |\n| **Fuzz Lane** | Grammar-aware Cardano transaction generation, Echidna-style stateful protocol fuzzing, deterministic PRNG |\n\nSupporting modules: **CWC Registry** (30 entries mapping all 75 detectors), **Scorecard** (Experimental -> Beta -> Stable promotion with quality gates), **SSA IR** (phi nodes, dominators, use-def chains).\n\n---\n\n## Real-World Validation\n\n### Strike Finance Audit Comparison\n\nAikido was benchmarked against TxPipe's professional audit of Strike Finance (perpetuals + forwards contracts):\n\n| Metric | Result |\n|--------|--------|\n| TxPipe security findings analyzed | 24 |\n| Full match (true positive) | 12 |\n| Partial match | 5 |\n| Correctly not flagged (code fixed) | 4 |\n| False negatives | 3 |\n| Aikido unique findings | 26 |\n| **Coverage (unfixed findings)** | **85%** |\n\nFull methodology and per-finding breakdown: **[AUDIT_COMPARISON.md](AUDIT_COMPARISON.md)**\n\n### Ecosystem Validation\n\nValidated against **10+ real-world Aiken smart contract projects** with **zero crashes**:\n\n| Project | Findings | Severity Distribution |\n|---------|----------|-----------------------|\n| SundaeSwap DEX | 47 | 1 critical, 13 high, 24 medium, 3 low, 6 info |\n| Anastasia Design Patterns | 24 | 3 critical, 10 high, 8 medium, 2 low, 1 info |\n| Anastasia Multisig | 6 | 2 critical, 4 medium |\n| Seedelf Wallet | 4 | 1 high, 2 medium, 1 low |\n| Strike Finance (4 repos) | 75 | 5 critical, 18 high, 40 medium, 8 low, 4 info |\n| Acca | 20 | 20 medium |\n| **Total** | **176** | **81% estimated true positive rate** |\n\n---\n\n## Detectors\n\n75 detectors mapped to CWE identifiers.\n\n<details>\n<summary><strong>Critical (5)</strong></summary>\n\n| Detector | CWE | Description |\n|----------|-----|-------------|\n| `double-satisfaction` | CWE-362 | Spend handler iterates outputs without referencing own input |\n| `missing-minting-policy-check` | CWE-862 | Mint handler doesn't validate which token names are minted |\n| `missing-utxo-authentication` | CWE-345 | Reference inputs used without authentication |\n| `unrestricted-minting` | CWE-862 | Minting policy with no authorization check at all |\n| `output-address-not-validated` | CWE-20 | Outputs sent to unchecked addresses |\n\n</details>\n\n<details>\n<summary><strong>High (19)</strong></summary>\n\n| Detector | CWE | Description |\n|----------|-----|-------------|\n| `missing-redeemer-validation` | CWE-20 | Catch-all redeemer pattern trivially returns True |\n| `missing-signature-check` | CWE-862 | Authority datum fields with no `extra_signatories` check |\n| `unsafe-datum-deconstruction` | CWE-252 | Option datum not safely deconstructed with `expect Some` |\n| `missing-datum-in-script-output` | CWE-404 | Script output without datum attachment (funds locked forever) |\n| `arbitrary-datum-in-output` | CWE-20 | Outputs produced without validating datum correctness |\n| `division-by-zero-risk` | CWE-369 | Division with attacker-controlled denominator |\n| `token-name-not-validated` | CWE-20 | Mint policy checks auth but not token names |\n| `value-not-preserved` | CWE-682 | Spend handler doesn't verify output value >= input value |\n| `unsafe-match-comparison` | CWE-697 | Value compared with match instead of structural equality |\n| `integer-underflow-risk` | CWE-191 | Subtraction on redeemer-controlled values |\n| `quantity-of-double-counting` | CWE-682 | Token quantity checked without isolating input vs output |\n| `state-transition-integrity` | CWE-20 | Redeemer actions without datum transition validation |\n| `withdraw-zero-trick` | CWE-863 | Withdraw handler exploitable with zero-value withdrawal |\n| `other-token-minting` | CWE-862 | Mint policy allows minting tokens beyond intended scope |\n| `unsafe-redeemer-arithmetic` | CWE-682 | Arithmetic on redeemer-tainted values without bounds |\n| `value-preservation-gap` | CWE-682 | Lovelace checked but native assets not preserved |\n| `uncoordinated-multi-validator` | CWE-362 | Multi-handler validator without cross-handler coordination |\n| `missing-burn-verification` | CWE-862 | Token burning without proper verification |\n| `oracle-manipulation-risk` | CWE-20 | Oracle data used without manipulation safeguards |\n\n</details>\n\n<details>\n<summary><strong>Medium (24)</strong></summary>\n\n| Detector | CWE | Description |\n|----------|-----|-------------|\n| `missing-validity-range` | CWE-613 | Time-sensitive datum without validity_range check |\n| `insufficient-staking-control` | CWE-863 | Outputs don't constrain staking credential |\n| `unbounded-datum-size` | CWE-400 | Datum fields with unbounded types (List, ByteArray) |\n| `unbounded-value-size` | CWE-400 | Outputs don't constrain native asset count |\n| `unbounded-list-iteration` | CWE-400 | Direct iteration over raw transaction list fields |\n| `oracle-freshness-not-checked` | CWE-613 | Oracle data used without recency verification |\n| `non-exhaustive-redeemer` | CWE-478 | Redeemer match doesn't cover all constructors |\n| `hardcoded-addresses` | CWE-798 | ByteArray literals matching Cardano address lengths |\n| `utxo-contention-risk` | CWE-400 | Single global UTXO contention pattern |\n| `cheap-spam-vulnerability` | CWE-770 | Validator vulnerable to cheap UTXO spam |\n| `unsafe-partial-pattern` | CWE-252 | Expect pattern on non-Option type that may fail at runtime |\n| `unconstrained-recursion` | CWE-674 | Self-recursive handler without clear termination |\n| `empty-handler-body` | CWE-561 | Handler with no meaningful logic |\n| `unsafe-list-head` | CWE-129 | `list.head()` / `list.at()` without length guard |\n| `missing-datum-field-validation` | CWE-20 | Spend handler accepts datum fields but never validates them |\n| `missing-token-burn` | CWE-862 | Minting policy with no burn handling |\n| `missing-state-update` | CWE-665 | State machine without datum update |\n| `rounding-error-risk` | CWE-682 | Integer division on financial values |\n| `missing-input-credential-check` | CWE-862 | Input iteration without credential check |\n| `duplicate-asset-name-risk` | CWE-694 | Minting without unique asset name enforcement |\n| `fee-calculation-unchecked` | CWE-682 | Fee or protocol payment without validation |\n| `datum-tampering-risk` | CWE-20 | Datum passed through without field-level validation |\n| `missing-protocol-token` | CWE-862 | State transition without protocol token verification |\n| `unbounded-protocol-operations` | CWE-400 | Both input and output lists iterated without bounds |\n\n</details>\n\n<details>\n<summary><strong>Low / Info (12)</strong></summary>\n\n| Detector | Severity | Description |\n|----------|----------|-------------|\n| `reference-script-injection` | Low | Outputs don't constrain reference_script field |\n| `unused-validator-parameter` | Low | Validator parameter never referenced |\n| `fail-only-redeemer-branch` | Low | Redeemer branch that always fails |\n| `missing-min-ada-check` | Info | Script output without minimum ADA check |\n| `dead-code-path` | Low | Unreachable code paths |\n| `redundant-check` | Low | Trivially true conditions |\n| `shadowed-variable` | Info | Handler parameter shadowed by pattern binding |\n| `magic-numbers` | Info | Unexplained numeric literals |\n| `excessive-validator-params` | Info | Too many validator parameters |\n| `unused-import` | Info | Imported module with no function calls |\n\n</details>\n\nEach detector has detailed documentation with vulnerable examples, safe examples, and remediation guidance. Use `aikido --explain <detector-name>` or see `docs/detectors/`.\n\n---\n\n## Output Formats\n\n9 formats for different workflows:\n\n```bash\naikido /path/to/project                        # Colored terminal output (default)\naikido /path/to/project --format json          # JSON (machine-readable)\naikido /path/to/project --format sarif         # SARIF v2.1.0 (GitHub Code Scanning)\naikido /path/to/project --format markdown      # Markdown report\naikido /path/to/project --format html          # Standalone HTML report\naikido /path/to/project --format pdf           # PDF audit report\naikido /path/to/project --format csv           # CSV export\naikido /path/to/project --format gitlab-sast   # GitLab SAST\naikido /path/to/project --format rdjson        # reviewdog\n```\n\n---\n\n## Configuration\n\n### `.aikido.toml`\n\n```toml\n# Use a preset as a starting point\nextends = \"strict\"      # or \"lenient\" for fewer warnings\n\n[detectors]\ndisable = [\"magic-numbers\", \"unused-import\"]\n\n[detectors.severity_override]\nunbounded-datum-size = \"low\"\n\n# Per-file overrides\n[[files]]\npattern = \"tests/**\"\ndisable = [\"hardcoded-addresses\", \"magic-numbers\"]\n```\n\n### Inline Suppression\n\n```rust\n// aikido:ignore[double-satisfaction] -- false positive: own_ref checked in helper\nspend(datum, redeemer, own_ref, tx) {\n  ...\n}\n```\n\n### Baseline Support\n\n```bash\naikido /path --accept-baseline    # Save current findings as baseline\naikido /path                      # Only new findings reported\n```\n\n---\n\n## CI/CD Integration\n\n### GitHub Actions\n\n```yaml\nname: Security\non: [push, pull_request]\njobs:\n  aikido:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - name: Install Aikido\n        run: cargo install --git https://github.com/Bajuzjefe/Aikido-Security-Analysis-Platform aikido-cli\n      - name: Run analysis\n        run: aikido . --format sarif --fail-on high > results.sarif\n      - name: Upload SARIF\n        if: always()\n        uses: github/codeql-action/upload-sarif@v3\n        with:\n          sarif_file: results.sarif\n```\n\n### Docker\n\n```bash\ndocker run --rm -v $(pwd):/project ghcr.io/bajuzjefe/aikido:0.3.1 /project --format json\n```\n\n---\n\n## CLI Reference\n\n```bash\naikido /path                        # Analyze project\naikido /path --fail-on high         # Exit non-zero for high+ findings\naikido /path --min-severity medium  # Filter to medium+ only\naikido /path --verbose              # Include UPLC metrics and budget\naikido /path --list-rules           # Show all detectors\naikido /path --explain <rule>       # Detailed explanation with examples\naikido /path --diff main            # Only report findings in changed files\naikido /path --watch                # Re-run on file changes\naikido /path -q                     # Quiet mode\naikido /path --config my.toml       # Use specific config file\naikido /path --accept-baseline      # Save current findings as baseline\naikido /path --lsp                  # LSP JSON-RPC diagnostics\naikido /path --interactive          # Terminal navigator for findings\naikido /path --fix                  # Insert suppression comments\naikido /path --generate-config      # Generate .aikido.toml from findings\naikido /path --strict-stdlib        # Reject stdlib v1.x (default: warn)\naikido --git <url>                  # Clone and analyze remote repo\naikido --benchmark-manifest benchmarks/local-fixtures.toml --format json\naikido --benchmark-manifest benchmarks/local-fixtures.toml --benchmark-enforce-gates\n```\n\n---\n\n## Architecture\n\n```\naikido/\n├── crates/\n│   ├── aikido-core/           # Library: analysis engine\n│   │   ├── src/\n│   │   │   ├── project.rs            # Aiken project loading & compilation\n│   │   │   ├── ast_walker.rs         # Typed AST traversal -> ModuleInfo\n│   │   │   ├── body_analysis.rs      # Handler body signal extraction + taint tracking\n│   │   │   ├── call_graph.rs         # Function dependency graph\n│   │   │   ├── cross_module.rs       # Cross-module interprocedural analysis\n│   │   │   ├── symbolic.rs           # Symbolic execution & constraints\n│   │   │   ├── delegation.rs         # Delegation-aware suppression\n│   │   │   ├── evidence.rs           # 5-level evidence framework\n│   │   │   ├── cwc.rs               # Cardano Weakness Classification registry\n│   │   │   ├── scorecard.rs          # Detector quality tracking & promotion\n│   │   │   ├── ssa.rs               # SSA IR with phi nodes & use-def chains\n│   │   │   ├── compliance.rs         # Securify2-style compliance analysis\n│   │   │   ├── smt.rs               # SMT verification with Cardano axioms\n│   │   │   ├── path_analysis.rs      # Path-sensitive analysis & CFG\n│   │   │   ├── invariant_spec.rs     # .aikido-invariants.toml DSL\n│   │   │   ├── protocol_patterns.rs  # DeFi protocol detection & classification\n│   │   │   ├── tx_simulation.rs      # ScriptContext builder & exploit generation\n│   │   │   ├── fuzz_lane.rs          # Grammar-aware tx fuzzing\n│   │   │   ├── config.rs             # .aikido.toml configuration\n│   │   │   ├── suppression.rs        # Inline suppression comments\n│   │   │   ├── baseline.rs           # Baseline file support\n│   │   │   ├── uplc_analysis.rs      # UPLC bytecode analysis & budgets\n│   │   │   └── detector/             # 75 detector implementations\n│   │   └── tests/                    # 1186+ tests\n│   └── aikido-cli/            # Binary: clap-based CLI\n├── fixtures/                  # Test contracts (7 fixtures)\n├── audits/                    # Audit comparison artifacts\n├── docs/detectors/            # Per-detector documentation\n├── .github/workflows/         # CI, cross-platform, release, fuzz\n├── homebrew/                  # Homebrew formula\n├── npm/                       # npm wrapper package\n├── vscode-extension/          # VS Code extension\n├── fuzz/                      # cargo-fuzz targets\n└── Dockerfile                 # Multi-stage build\n```\n\n### Building from Source\n\n```bash\ngit clone https://github.com/Bajuzjefe/Aikido-Security-Analysis-Platform.git\ncd aikido\ncargo build --release          # Binary at target/release/aikido\ncargo test                     # Run test suite (1186+ tests)\ncargo clippy --all-targets     # Lint (zero warnings)\n```\n\nRequires Rust >= 1.88.0.\n\n---\n\n## Vulnerability Coverage\n\nDetectors are derived from real vulnerabilities found in published Cardano smart contract audits:\n\n| Source | Findings Covered |\n|--------|-----------------|\n| MLabs audit reports | Double satisfaction, missing minting policy, arbitrary datum, unbounded size |\n| Vacuumlabs audit reports | Unbounded value size, token dust attacks |\n| [Plutonomicon](https://github.com/Plutonomicon/plutonomicon) | Unrestricted minting, double satisfaction patterns |\n| Anastasia Labs audit reports | Staking credential theft, datum handling |\n| TxPipe audit reports | Oracle manipulation, state transition integrity, value preservation |\n| CWE Database | 75 detectors mapped to specific CWE identifiers |\n\n---\n\n## License\n\nMIT\n\n<!-- Current detector count: 75 -->\n",
  "bytes": 20383,
  "sha": "f89245934c2c741ebe0008fb00a564b27f473ff877a218820c96bf75be83179b",
  "repo_slug": "bajuzjefe/aikido-security-analysis-platform",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_bajuzjefe_aikido_mcp_d3c08397/readme"
}