Voting system in Cairo

In this guide we will write Cairo code for a small voting system, which can be used, for example, to run a secure (non-private) voting with a lot of voters.

In this section we will write Cairo code for a small voting system. This voting system can be used, for example, to run a secure (non-private) voting with a lot of voters on a blockchain. We will assume that each voter has a pair of private and public keys (for the ECDSA signature scheme) and that the list of votersโ€™ public keys is fixed. Each voter may vote โ€œYesโ€ (1) or โ€œNoโ€ (0). The system will not guarantee anonymity.

This section assumes some basic knowledge of cryptographic primitives such as hash functions, digital signatures and Merkle trees. In addition, if you havenโ€™t already read the previous parts of the โ€œHello, Cairoโ€ tutorial, you are encouraged to do so before reading this part.