Example 1

July 5, 2026 · View on GitHub

A minimal end-to-end audit. Submit a strategy.py + backtest_results.csv and get a verdict + receipt hash. No contract file, no payment (demo mode).

Inputs

strategy.py:

import pandas as pd

def signal(close: pd.Series) -> pd.Series:
    # NB: this strategy is intentionally overfit (lookahead via rolling().mean())
    return close.rolling(20).mean().shift(-5)  # shift(-5) = lookahead bug

backtest_results.csv (first 3 rows):

date,       equity,   daily_return
2026-01-01, 10000.00, 0.0
2026-01-02, 10012.50, 0.00125
2026-01-03, 10045.10, 0.00325

Submit (demo mode, no payment)

curl -X POST https://falsify.example.com/audit \
  -H "X-Payment: demo" \
  -F strategy_script=@strategy.py \
  -F backtest_results=@backtest_results.csv

Response

{
  "verdict": "BLOCK",
  "reason": "L2 red-light rule FORWARD_INDEX_ILIC: shift(-N) on line 6 — lookahead bias",
  "receipts": [
    {
      "anchor":      { "file": "strategy.py", "line": 6, "symbol": "signal" },
      "artifact":    { "rule_id": "FORWARD_INDEX_ILIC", "severity": "P0" },
      "refutation":  "Replace shift(-5) with shift(1) or rolling(20).apply(...).shift(1)"
    }
  ],
  "receipt_hash": "sha256:9a3f2c1b8d7e4f5a6b2c9d8e1f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2",
  "onchain_tx_hash": "0xabc123def4567890123456789012345678901234567890123456789012345678",
  "onchain_explorer": "https://www.oklink.com/xlayer/tx/0xabc123def4567890123456789012345678901234567890123456789012345678"
}

Verify the receipt

python judge_verify.py \
  --tx 0xabc123def4567890123456789012345678901234567890123456789012345678 \
  --expected-hash "sha256:9a3f2c1b8d7e4f5a6b2c9d8e1f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2"

Expected output:

[VERIFIED] onchain receipt_hash matches local sha256
[VERIFIED] tx confirmed on X Layer (block 12345678, 2 confirmations)
[VERIFIED] verdict=BLOCK, receipts count=1

What happened

  1. L1 Context assembled the audit context (no contract file → defaults).
  2. L2 Red-Light matched rule FORWARD_INDEX_ILIC (gate4 v0.9.8) on shift(-5).
  3. L2 returned BLOCK immediately — no L3 LLM cost, no payment consumed.
  4. L4 Ledger appended the finding.
  5. L5 Output anchored receipt_hash on X Layer via onchainos wallet contract-call.

Total audit time: ~3 seconds (L2 deterministic block, no LLM).