Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

106
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda