i gotta develop an online voting system for the student elections using blockchain technology for my university project. following are the basic requirements for my system: 1. students should be able to cast vote 2. real time results of the elections.

I am using truffle, testrpc and vanilla javascript for now to connect my smart contract with the front end , i have decided that whenever a voter cast vote to their preferred candidate, that transaction of voting process or their votes is stored in the blockchain . i am trying to implement php to make my front end dynamic and mysql for backend just to add candidatees or for the login process of the students. but i am confused about whether to add voters and candidates in the blockchain or the new proposals for the elections. can someone help me out here please? Thank You

  • Have a look at the blueprint for blockchain voting. Disclosure, I'm co-author. Unfortunately, the piece was never finished, but it lists some interesting proof-of-concepts and states common issues with blockchain voting along with known concepts to circumvent them. Feel free to contribute. – Afr Apr 26 '17 at 8:23

The voting contract should be configurable. Like you can deploy for many time for different times of voting.

In user creation part, You should add the user's public address to the Blockchain in Users map structure, then only you can validate whether the user already voted or not in the blockchain. Otherwise, you will not use blockchain real data. You have to display blockchain data whenever an application connected.

Saving the data in MySQL and only executing code in blockchain will not utilize the ability of blockchain 100%.

Using Web3 logs, you have all the states of the application and update in your database.

Even though you allow users to create a login through the application, their public keys should get created and add to the blockchain.

Whenever you deploy a voting contract the candidates or proposals should pass through the contract creation means proposals should be created through the contract constructor.

So that you can run multiple voting by deploying to different contract address


This might be a good starting point:


  • Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Afr Apr 26 '17 at 8:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.