Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

98
Views
Is zk-snarks implementable in this use case-scenario?

I want to do something similar to a pet popularity contest dapp. From what I understand, it would involve non-interactive zero-knowledge proof.

There is an application with a list of pets competing in a popularity contest. Each pet has a popularity counter attached.

// Pseudo-code
petList = [Cobra, Elephant, Lion, Vulture]
petList[0].popularityMeasure = 0; 
petList[1].popularityMeasure = 0; 
petList[2].popularityMeasure = 0; 
petList[3].popularityMeasure = 0; 

Every person expresses a choice by calling a smart contract function like:

function sayMyChoice(witness) // witness is some sort of proof containing the name of the animal I'm opting for

Then the smart contract checks

    function sayMyChoice(witness) {
   for(int i=0; i<petList.length. i++) {
       if(witness == petList[i])
          petList[i].popularityMeasure+=1;

   } 

}

The counters should be public but you'd have no idea who opted for which pet.

My question is comprised of several parts:

  1. Is this possible with smart contracts and zk-snarks?
  2. If no, how could I do it?
  3. If yes, is there any tutorial implementing something similar using Solidity & JavaScript?

I guess the proof should be computed client-side, but the verification has to take place in a smart contract.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!