We present an implementation of a Web3 platform that leverages the Groth16 Zero-Knowledge Proof schema to verify the validity of questionnaire results within Smart Contracts. Our approach ensures that the answer key of the questionnaire remains undisclosed throughout the verification process, while ensuring that the evaluation is done fairly. To accomplish this, users respond to a series of questions, and their answers are encoded and securely transmitted to a hidden backend. The backend then performs an evaluation of the user's answers, generating the overall result of the questionnaire. Additionally, it generates a Zero-Knowledge Proof, attesting that the answers were appropriately evaluated against a valid set of constraints. Next, the user submits their result along with the proof to a Smart Contract, which verifies their validity and issues a non-fungible token (NFT) as an attestation of the user's test result. In this research, we implemented the Zero-Knowledge functionality using Circom 2 and deployed the Smart Contract using Solidity, thereby showcasing a practical and secure solution for questionnaire validity verification in the context of Smart Contracts.
翻译:我们提出了一种Web3平台的实现方案,该方案利用Groth16零知识证明模式来验证智能合约中问卷调查结果的有效性。我们的方法确保问卷答案在验证过程中始终保密,同时保证评估的公正性。为实现这一目标,用户需回答一系列问题,其答案经过编码后安全传输至隐藏后端。后端对用户答案进行评估,生成问卷调查的总体结果,并附带生成零知识证明,以证实答案已依据有效约束集进行恰当评估。随后,用户将结果与证明提交至智能合约,合约验证其有效性并发放非同质化代币(NFT)作为用户测试结果的凭证。在本研究中,我们使用Circom 2实现了零知识功能,并采用Solidity部署智能合约,从而在智能合约场景下展示了实用且安全的问卷有效性验证解决方案。