# FakeTicket Demo Research Foundations

這份 demo 的模擬資料不是 random 亂數抽樣，而是把公開 anti-bot / behavioral biometrics patterns 轉成固定情境模板，再用 deterministic 公式展開成 session。

## Layer 1. 入口風控

1. [Cloudflare JA3/JA4 fingerprint docs](https://developers.cloudflare.com/bots/concepts/ja3-ja4-fingerprint/)
   用來定義 `ja4_reuse_count`、同一 JA4 在多個 IP / session 反覆出現的情境，對應代理池、共用無頭瀏覽器與自動化工具鏈。

2. [Cloudflare JA4 Signals](https://blog.cloudflare.com/ja4-signals/)
   用來定義跨請求的流量強度、分位數尖峰與群聚特徵，映射成 `req_burst_5s`、`rtt_cv` 與 on-sale timeline。

3. [Cloudflare Bot Detection Alerts](https://developers.cloudflare.com/bots/reference/alerts/)
   用來設計 cluster watchlist 與營運告警，讓 dashboard 直接顯示依 JA4 / ASN / 尖峰分組的異常集群。

4. [Chrome User-Agent Client Hints](https://developer.chrome.com/articles/user-agent-client-hints)
   用來設計 `header_consistency` 與 `ua_hint_mismatch`，模擬 UA 宣告與 Sec-CH-UA / platform hints 互相打架的情境。

5. [FP-Consistent? Fingerprint Inconsistencies in Browsers](https://arxiv.org/abs/2406.07647)
   用來模擬「同一帳號或裝置宣告在時間與空間上漂移」的風險，映射成 `ips_per_account_10m` 與 device claim drift 類型訊號。

6. [Queue-it ticket bots overview](https://queue-it.com/blog/ticket-bots/)
   用來建立同 IP、多帳號、老舊瀏覽器與搶票場景的關聯，特別是 queue sharing 與 bot cluster 的故事線。

7. [Queue-it data center IP blocking](https://queue-it.com/blog/data-center-ip-blocking/)
   用來把資料中心 IP、極短延遲與高頻請求轉成 `datacenter_ip`、`queue_wait_sec` 與 `accounts_per_ip_10m`。

8. [OWASP Credential Stuffing Prevention Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Credential_Stuffing_Prevention_Cheat_Sheet.html)
   用來建立 credential stuffing cluster，核心欄位是 `failed_login_ratio`、同 IP 多帳號與 step-up 流程。

## Layer 2. 行為生物識別與感測器

1. [BeCAPTCHA-Mouse](https://biometrics.eps.uam.es/fierrez/files/2022_PR_BeCAPTCHA-Mouse_Acien.pdf)
   用來建立真人滑鼠軌跡與 bot 軌跡的差異：真人有微調、曲線與波動，bot 更接近固定函數或直線。

2. [BeCAPTCHA: Behavioral Bot Detection using Touchscreen](https://arxiv.org/abs/2005.13655)
   用來建立手機場景的 `touch_pressure_var`、`tap_interval_cv`、`sensor_sync` 與 `motion_energy`。

## Layer 3. 隱私保護型資格驗證

1. [Semaphore docs](https://docs.semaphore.pse.dev/)
   用 commitment / nullifier 的概念來模擬實名制下的一人一票驗證。這個 demo 沒有實作完整 ZK 電路，但完整保留了：
   - 名單只保存 commitment，不保存原始身分字串
   - 每個活動生成不同 nullifier
   - 同一 nullifier 重複時，直接視為重複購票

## Demo 如何使用這些研究

1. 先由 `generate_demo_data.py` 產生 216 個 deterministic sessions。
2. 每個 scenario 都有固定的網路層、行為層與資格層模板。
3. 風險分數不是模型黑盒，而是規則加權，可直接對照每條 signal。
4. `web/` 前端只讀 `data/demo-data.json`，所有圖、表與 persona 模擬都使用同一份資料。
