Election voting DAPP using Smart contracts (Block Chain)- Part I

Nishant Vemulakonda
2 min readJun 2, 2021

--

election

Problem Statement:

Conducting elections in a traditional way is generally a huge expense, and has many inherent flaws, which if not addressed leads to a high trust deficit and unworthy candidates being chosen.

· A Centralized process

· Double (Multiple) Voting.

· Voting for Invalid candidates.

· Voter impersonation is possible.

· Voter identity is not private.

· Tampering with election process is possible

· Trust deficit as only central authority has access to verify every vote.

Hence, we need to devise a more convenient way for people to vote using technology which enables complete trust and is easily verifiable.

Solution:

Blockchain enables a trust less, verifiable decentralized system on a replicated hyper ledger.

Build a DAPP (Decentralized Application) to enable election voting using smart contracts.

All credits to dappuniversity for explaining DAPPS concepts in an easy way.

A question that could & should naturally come up now is:

Why is a DAPP (or) decentralized application required, can we not take a traditional client server application setup for this?

No, this wouldn’t work well for our problem statement. Following points reflects why such a setup would be counterproductive.

· No central authority should be able to modify the rules (contracts) of the election once finalized.

· To create and store value (of assets), the code & data store (DB) should not be under the control of central authority or some developers.

· Block chain enables voter anonymity, using public address to vote instead of real names.

· Block chain ledger allows for finality & immutability.

· Hacking/ Injecting fraudulent transactions (votes) is almost impossible as every node has a latest copy of the election voting ledger with itself.

Features of the Smart Contract based DAPP:

· Election voting DAPP allows accounts to vote for candidates listed in an election.

· No one (even developers/ central agency) is able to modify the rules (contracts) of the election once finalized as this is completely controlled by the smart contracts.

· Block chain enables individual voter anonymity, using public address to vote instead of real names.

· Block chain ledger allows for finality & immutability to prevent double voting.

Implementation:

· Solidity Programming for building the DAPP smart contract(s).

· Ganache for enabling local Ethereum block chain setup.

· Truffle framework for deploying the smart contract to the blockchain.

· Tests to validate & check for double voting & invalid voting (Mocha framework).

· JavaScript for building event driven web app.

· Metamask extension to record block chain accounts & vote transactions.

Thanks for reading, this concludes Part I of this medium article.

In Part II, we would discuss in detail about the working of the DAPP and also challenges & results based on a local blockchain setup.

Please share and support and lets build a decentralized future.

--

--

Nishant Vemulakonda
Nishant Vemulakonda

Written by Nishant Vemulakonda

Prolific Blockchain Smart Contract Developer, Experienced Data Scientist , forever Learner

No responses yet