← Back to home

OpenSurvey

OpenSurvey is a decentralized and sybil-resistant survey dApp leveraging blockchain and zkProofs. It allows users to publish and answer surveys, aggregate data and reward survey contribution allows users to publish and answer surveys and aggregate data from them

Screenshots

OpenSurvey screenshot 1
OpenSurvey screenshot 2
OpenSurvey screenshot 3
OpenSurvey screenshot 4
OpenSurvey screenshot 5
OpenSurvey screenshot 6

Problem Statement

OpenSurvey is an innovative decentralized survey application that prioritizes sybil-resistance while maintaining data quality. It achieves this by harnessing Zero-Knowledge Proofs (ZkProofs) using Sismo.The application revolves around three core features:Survey CreationSurvey ParticipationSurvey Data AnalysisTo illustrate its utility, consider the scenario of conducting a political opinion survey. When using the blockchain for our survey, we encounter two significant challenges:The risk of participants from any location, potentially skewing the results The possibility of individuals employing multiple wallets to manipulate the survey To address these concerns, we implement a two-pronged verification approach.Users are required to provide a 'ZkProof of Humanity' to thwart sybil attacks, and a 'proof of country' to ensure that external influences from other nations do not affect the survey.Furthermore, we may also request a 'proof of age' to guarantee that only eligible participants have an impact on the survey results. In this context, we leverage Sismo to facilitate the generation of these ZkProofs.OpenSurvey also tackles another set of issues related to data storage and aggregation. Traditional blockchain storage is expensive, and querying survey responses from the blockchain can be time-consuming and inefficient.To overcome these challenges, OpenSurvey takes advantage of two key technologies:IPFS (InterPlanetary File System) for cost-effective and efficient data storage. TheGraph, a powerful tool for streamlined data retrieval and analysis. In summary, OpenSurvey stands as a powerful and efficient solution that not only ensures data quality and sybil-resistance through ZkProofs but also addresses data storage and access issues by utilizing IPFS and TheGraph.

Solution

Survey Creation:App has a front-end in react, there is a dedicated page for the survey creationUser can Define questions for the survey, there are 3 types for the answer of the survey :Mutiple answer (ex : asking for yes/no)Range of number (ex : asking for age)ZkAnswerThe ZkAnswer is a bit special as it allow the survey creator to ask for a ZkProof and the value from Sismo response will be the value of this answer, this is done with the userSelectable zkProof value from Sismo. This guarentee a better authenticity of the dataThen The survey Creator can ask for zkProofs as condition for submiting the survey.There is a search bar, that fetch sismo.api to find a datagroup description corresponding to what the user has searched, if he want to search for proof of degree for example, he can search for itThen the creator can set an amount of tokens as reward, since the app is sybil resistant, there is no issue of this kind of system and it allow some incentive for answering the survey.Lastly, the user need to submit the survey, first of all, All the survey data is uploaded on IPFS, like questions and sismo group involvedThe file CID returned by IPFS will be our id for the survey, it will allow us to fetch all the relative data after thatThen we upload on the blockchain only what we need, the FileCID the number of questions, and sismo group involved to generate the zkProof afterward We emit a event in a smart contract once the survey deployed to be fetched by TheGraph and accessible in the APPSurvey Browser and Participation:On the app, we use the graph to query the latest survey deployed, then we query the survey data with the ipfs web3.link urlGiven this, we already have the data to display to the user,Then the user can simply answer all the questionsThen he need to generate a zkProof with sismo connectThen he need to make a transaction to answer the survey on the blokchain, he needs to put the fileCID, his answers numbers and the sismo ResponseOnce processes in the blockchain, the answer of zkProof answer type will be automatically attributed, and a event with all the answer will be emittedSurvey Data Analysis :Lastly, For each survey (so each CID) we use theGraph to query all the answer associated and then make charts with ItUser can see the charts by toggling a button in the top of the survey

Hackathon

ETHOnline 2023

2023

Contributors