Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

100
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda