合约验证 groth16 proof:https://github.com/felicityin/zkm-contracts/blob/main/contracts/src/v1.0.0/Groth16Verifier.sol#L533

对证明 (A, B, C) 与公开输入线性组合 $L_{pub}$,Groth16 的标准验证等式(乘法形式)为:

$$ e(A, B) * e(C, -δ) * e(α, -β) * e(L_{pub}, -γ) == 1 $$

A (G1), B (G2), C (G1) 来自 proof

$L_{pub}$ 为 public inputs 的线性组合点

$$ L_{pub} = IC_0 + input[0]*IC_1 + input[1]*IC_2 $$

其中

  • IC_* 对应 VK 中的常量点(合约中是 CONSTANT_* 和 PUB_* 常量)

    IC 列表长度 = 1 + 公共输入数量,对于 Ziren 有 2 个 public inputs,所以 IC 有 3 个点

  • input 为公共输入,对于 Ziren

    • input[0] 是 zkm_vkey_hash
    • input[1] 是 hash(zkm_public_inputs)

α (G1), β (G2), γ (G2), δ (G2), IC_* (G1) 来自 VK,VK 由证明系统运行 Groth16 setup(或 MPC setup)得到