0

I am creating a voting dapp in which the voter comes to the poll for voting and after the id verification of the voter an account is made for them which is printed as QR code and handed to them for voting purposes, is it possible to creating the account through the contract deployed for voting (and is it feasible) or can the account be created on the go? or do I have to create the numbers of accounts before the voting process to hand it to the voter? which one is more feasible? And if the accounts are pre-created, should I verify the account in contract or the webpage(Web3js) code?

0

You can use web3's accounts.create function:

web3.eth.accounts.create();
> {
    address: "0xb8CE9ab6943e0eCED004cDe8e3bBed6568B2Fa01",
    privateKey: "0x348ce564d427a3311b6536bbcff9390d69395b06ed6c486954e971d960fe8709",
    signTransaction: function(tx){...},
    sign: function(data){...},
    encrypt: function(password){...}
}
  • How do i verify if this is valid account in the network through the contract? – Rajiv Shah Feb 17 '18 at 15:02
  • What do you mean by valid account? – martriay Feb 17 '18 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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