# Groth16 ZK Verifier

## 标准

* Curve: BN254 (\~110-bit security)
* Proving system: Groth16
* Trusted setup: Powers of Tau ceremony 参与
* Generator: snarkjs `groth16 zkey export solidityverifier`

## 用在哪里

* **PoBComplianceGroth16Verifier** — PoB compliance proof on-chain verify
* **Groth16PoBVerifier** — 通用 PoB ZK verifier
* **DID 6 个 circuit verifier** (age / income / region / KYC / enterprise / credit\_score)

## 性能

* Verifier 部署 gas: \~2M
* 单 proof verify: \~250K gas
* Trusted setup ceremony: 文档化必备

## 主网前必备

* BN254 → BLS12-381 评估 (\~128-bit security)
* 公开 ceremony 参与名单 + transcript 存 IPFS
* 替换为 Halo2 (universal setup, no per-circuit ceremony) 长期更优

## 自动生成代码注意

PoBComplianceGroth16Verifier 由 snarkjs 自动生成；slither 报 `incorrect-return` 是 EIP-197 fail-fast pattern, 非 bug。审计 firm 跳过逐行 review，只验 trusted setup ceremony。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yellowpaper.axblade.io/algorithms/groth16-zk-verifier.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
