Skip to content

Code for E-VOTE-ID'25 paper "End-to-End Verifiable Internet Voting with Partially Private Bulletin Boards"

Notifications You must be signed in to change notification settings

Valeh2012/starkevoteid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cairo0 E-Voting Scheme

This repository is forked from gerlion/STARKs_for_Homomorphic_Tallying.

Installing dependencies

Install Cairo0 following the install page and activate the virtual environment. Clone the STONE prover project, build the docker image, and fetch the prover and verifier executables:

container_id=$(docker create prover)
docker cp -L ${container_id}:/bin/cpu_air_prover .
docker cp -L ${container_id}:/bin/cpu_air_verifier .

Running the project and using the STONE prover

Generate the input data for update circuit:

python generate_update_data.py 3 artifacts/update_input_3_example.json

Within a Cairo0 python virtual environment, compile the Cairo0 program:

cairo-compile src/update.cairo --output artifacts/update_compiled.json --proof_mode

Run the Cairo0 program to generate the prover input files:

cairo-run --program=artifacts/update_compiled.json \
 --layout=all_solidity \
 --program_input=artifacts/update_input.json \
 --air_public_input=artifacts/update_public_input.json \
 --air_private_input=artifacts/update_private_input.json \
 --trace_file=artifacts/update_trace.json \
 --memory_file=artifacts/update_memory.json \
 --print_output --proof_mode

Run the STONE prover executable on the program data to generate a STARK proof:

./cpu_air_prover   --out_file=artifacts/update_proof.json \
  --private_input_file=artifacts/update_private_input.json \
  --public_input_file=artifacts/update_public_input.json \
  --prover_config_file=artifacts/cpu_air_prover_config.json \
  --parameter_file=artifacts/cpu_air_params.json

Finally, run the STONE verifier executable on the STARK proof and confirm verification:

./cpu_air_verifier --in_file=artifacts/update_proof.json && echo "Successfully verified proof."

Similarly, use generate_accumulate_data.py to generate input data for accumulate.cairo, then replace update with accumulate in previous steps.

Use generate_full_data.py to simulate basic election where every voter submits one ballot. The script outputs set of inputs for the update circuit for each submission, and the accumulate circuit. Run bash prove_all_update.sh to automate previous steps for all update inputs.

About

Code for E-VOTE-ID'25 paper "End-to-End Verifiable Internet Voting with Partially Private Bulletin Boards"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published