ZKP 验证器
零知识证明验证器,支持 Groth16/Plonk/KYC 证明/范围证明,保护投资者隐私。
💡 应用场景:投资者可以证明自己符合 KYC 要求,而无需暴露身份信息;可以证明投资金额在范围内,而无需暴露具体金额。
预编译合约列表
| 地址 | 功能 | Gas 成本 |
|---|---|---|
0x0300 | Groth16 验证 | 150,000 |
0x0301 | Plonk 验证 | 200,000 |
0x0302 | KYC 证明验证 | 100,000 |
0x0303 | 范围证明验证 | 80,000 |
Solidity 调用示例
interface IKYCProofVerify {
function verifyKYCProof(
bytes32 proofCommitment,
bytes32 jurisdictionHash,
bytes32 investorType,
bytes32 proof
) external view returns (bool);
}
function transferWithZKPKYC(address to, uint256 amount, bytes memory proof) external {
bool valid = IKYCProofVerify(0x0302).verifyKYCProof(
proofCommitment, jurisdictionHash, investorType, proof
);
require(valid, "KYC proof invalid");
_transfer(msg.sender, to, amount);
}
文件位置
pkg/evm/zkp_verifier.go - 约 200 行