Because voting right is the basis of all decisions, we have introduced a free 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.
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.
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.
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.
- 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.
The app is available on all networks :
Look at the README to know more : https://github.com/marigold-dev/tzvote
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
- 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
- The Smart Contract : voting sessions templates are embedded on the client side, so the users can deploy their own contract to the node.
- 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
- The Indexer : The indexer is used for caching and providing a rich API. For example, fetching all similar contracts from a template of reference
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.