I am novice solidity developer and I am trying to develop a voting application on ethereum

Requirements of application are -

1) There should be candidate and voter registration form

2) Voter should be able to login using some authentication mechanism like username , password

3) Each voter should be able to vote only once

4) Result of voting should be visible to everyone

Things that I have tried -

I have developed a smart contract for voting in candidate and voter are of struct type in which respective attributes of candidate and voter are stored.

Data of candidates and voters is stored in array of structures. Functions are written in smart contract to vote , to get count of no. of voters and candidates, to insert a voter and candidate etc.

Issues I am facing -

1) How shall I authenticate voter and candidate ?

2) Shall I create new account using personal.newAccount() command for every candidate and voter ?

3) Can one account have multiple addresses ? so that I can create multiple addresses for different voter and candidate ?

4) According to answer of this question message.sender() shall be used for authenticating user. I am not able to understand that how every user will have different addresses ? Is it address of account that we can create using personal.newAccount() command ?

5) As ethereum is permission less block chain ,how to implement/simulate authentication and authorisation with the help of which one can control who can participate in a private block chain network?

1 Answer 1


I have recently created a small project - not voting related - that might answer some of your questions. Check the 'html' folder in the zip file.


  • In your use case every project is separate account right? Correct me if I am wrong. But I am not able to get how authentication for Lake approver and forest approver is done ? Second thing which I have observed and which is potential problem is as you are using addresses of account and their respective private keys for authentication those are very hard to remember as compare to username+password . Do we have any other solution ? Commented Apr 19, 2018 at 6:17
  • The DApp's username+password is something offline from eth network (ie.,specific to dapp) and not related to ethereum network. It is something like, say you've an account with zebpay, you will have username + password (+ mobile + authenticator) to login into zebpay. Once you login, as part of your profile data, zebpay will securely maintain a list of ethereum account numbers (0x123.. + password + private key info etc.,), which you can go ahead and use or add few more accounts if you want to. Commented Apr 19, 2018 at 14:17
  • To answer specific questions - in my use case, the Land struct will not have separate accounts. It is identified by id of type bytes32. Authentication for Lake/ Forest is not set ie., anybody with valid address + gas can approve them (will fix this). I'm using address + password (which is separate from private key - use web3.personal.newAccount("password") to set pwd) - which user can remember. Commented Apr 19, 2018 at 14:22
  • As part of approver list, I've created a function in contract like here and then am checking like this ` function isValidLakeApprover(address _lakeApprover) returns (bool){ return lakeApprover[_lakeApprover]; }` Commented Apr 19, 2018 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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