#Vote

By Benjamin Fuentes

https://hackmd-prod-images.s3-ap-northeast-1.amazonaws.com/uploads/upload_beb393e946281e287749c35967fccf4c.png?AWSAccessKeyId=AKIA3XSAAW6AWSKNINWO&Expires=1649078061&Signature=MrMBpKk9KWUiLLtMa3twkvEdEB4%3D
"The ballot is stronger than the bullet."
  — Abraham Lincoln
"Just because you do not take an interest in politics doesn't mean politics won't take an interest in you."
  — Pericles

Purpose

Because voting right is the basis of all decisions, we have introduced a free[1] online Dapp based on Tezos blockchain that guarantees immutable results and free access/interaction.

Also, we wanted to share and explain the how we can build a Dapp on top of Tezos.

Use cases we propose today

Tezos bakers (i.e Tezos capital power)

This template has been designed for bakers.
Only bakers with capital power at the beginning of a voting period will be able to participate using their Tezos voting power. The more XTZ you have, the more weight you get on the final result.
The goal is to provide an alternative voting mechanism that is not the only one used internally for Tezos protocol Amendment. With this tool, anyone is able to create a poll on any topic. The voting result is just informative and not executive.

Permissioned Simple poll

This is a basic simple poll with 1 question and n options. We can only vote once. Electors are part of a whitelist managed by the creator of the poll. We consider that this template has a censorship as only the poll owner can decide who can vote.

Templates in scope

As elections can be as diverse as cats on the web,  we decided to propose different voting templates that will be added at a later date.

A template is a mix of different criteria where final poll results can diverge and profit a particular crowd or strategy. Here below is an example of some combinations.

Criteria :

- name : template name
- creation : how many questions / how many options, during creation time
- vote :  number of option choices a user can vote on
- voting power : function to calculate a final result. It can be based on :
   -  Tezos Capital Power = number of XTZ you own at the beginning of a Tezos Voting period
   -  Proof of Existence = a proof that you are a specific human identity
   -  Whitelisted Identity = be part of whitelisted users
   -  special : sometimes the algorithm more complex than a single variable input
- periodicity : defines the from/to date where voting is allowed
   - Tezos based : it starts/ends with a Tezos voting period
   - free : can choose any arbitrary dates
- no censorship : it can be ALL or some specific electors  
- privacy : option to hide ballots or make them visible to all. Also, we can apply this to the results until the end date is reached.

Summary table

Name creation (#question,#options) vote (# choices) voting power (function) periodicity no censorship privacy
Tezos bakers 1 , n 1 :sac_d'argent: Tezos Amendment cycle :coche_trait_plein: :croix: (not yet available)
Free Simple Poll 1 , n 1 :bras_levé:=>1 FromDate , ToDate :coche_trait_plein: :croix: (not yet available)
Permissioned Simple Poll 1 , n 1 :bras_levé::coche_trait_plein:=>1 FromDate , ToDate :croix: (owner whitelist) :croix: (not yet available)
Borda-Fibonacci 1 , n n :bras_levé:=>voteAllocation FromDate , ToDate :coche_trait_plein: :croix: (not yet available)
Samarkand 1 , n n Samarkand(:sac_d'argent:)=>voteAllocation Tezos Amendment cycle :coche_trait_plein: :croix: (not yet available)

Play with the Dapp

The app is available on all networks :

Look at the README to know more : https://github.com/marigold-dev/tzvote

How the Dapp works ?

architecture

Unlike web2 application, you don’t need to deploy a Certificate Authority/Identity provider. You just need to have a Tezos wallet and create an account.

Also, infrastructure robustness relies on the existing public blockchain nodes. Downtime is less than classical Cloud applications

Below, few components are required to develop the application (minimum is to deploy a smartcontract and have a web client). Btw, it is using classic javascript/typescript programing

https://hackmd-prod-images.s3-ap-northeast-1.amazonaws.com/uploads/upload_7c15756035d016808274cb0ccf21c1da.png?AWSAccessKeyId=AKIA3XSAAW6AWSKNINWO&Expires=1649073088&Signature=ELQhROdf%2BuBfDZQ5vvv6%2B3UvFSA%3D
  1. The Client : a simple React app with Taquito SDK. The client allows the user to interact with his wallet. Also, we use tzkt indexer to fetch deployed smart contracts. We could have fetched data directly to the RPC node but tzkt provides caching and a rich API
  2. The Smart Contract : voting sessions templates are embedded on the client side, so the users can deploy their own contract to the node.
  3. The Oracle : access to Tezos current voting period inside the Smart contract is not feasible, therefore we deploy another contract called Oracle and an offchain scheduler which regularly polls the RPC node to get this data and push it to the Oracle storage
  4. The Indexer : The indexer is used for caching and providing a rich API. For example, fetching all similar contracts from a template of reference

conclusion

https://hackmd-prod-images.s3-ap-northeast-1.amazonaws.com/uploads/upload_ca13be687be8a880ce668618275bcbd9.png?AWSAccessKeyId=AKIA3XSAAW6AWSKNINWO&Expires=1649073199&Signature=7QN%2FipVl3seVQqUm3ofz9a5v6%2FU%3D

What you have seen is just the beginning of a larger scope of voting templates to come. What we learned so far ?

  • a simple voting app can provide high degree of transparency and reduce community friction. Also, a large variety of templates might fit every need.
  • providing web3 authentication using wallets over web2 reduce censorship and availability of service
  • developing a Tezos dapp is nothing difficult and is very cheap[1:1]

Do not forget that Tezos is a blockchain that can improve itself over time by using a formalized process of upgrade to its protocol, so called “self amendment”. As World is evolving, people are evolving, decisions have to be taken though election mechanism.

I hope you enjoy TzVote!

Other, free-to-use, tools and applications will be offered to the Tezos community by the Marigold team soon.

Stay tuned!

If you want to know more about Marigold, please follow us on social media (Twitter, Reddit, Linkedin)!

  1. Marigold do not charge any fee on this application. User pays normal gas (~few dollars cents) ↩︎ ↩︎
Scroll to top