1 of 72

CosmoVoting

Akash Kumar

IIT Bombay

Smit Rajput

IIIT Vadodara

Tezan Sahu

IIT Bombay

2 of 72

Elections in India

3 of 72

Facts and Figures, Lok Sabha Elections 2014

Population eligible to vote 900 million

Intra-India migrant population which didn’t vote: 281 million

Approx. 30%

4 of 72

Long time in

Queues

Lengthy Voting

+ Counting Process

Large population�is migrant

Problems

5 of 72

Why not a solution until now?

anonymity

Transparency

Security

6 of 72

Voting

Blockchain

Decentralized Voting System

Solution

7 of 72

Processes

Registration

Voting

Counting

8 of 72

Entities Involved

Voter

Political Parties

Constituencies

ECI

9 of 72

Registration

The voter uploads

Information on

Online portal

Verification done by

ECI

Voter UUID hash Created

a mapping of hash to kycDone made true on blockchain

10 of 72

Voting

Registered Voters

Logins with OTP & UUID

11 of 72

Voting

Registered Voters

Logins with OTP & UUID

UUID_hash is checked

from the registration done

on the blockchain

12 of 72

Voting

Registered Voters

Logins with OTP & UUID

Selects the party

for the vote

UUID_hash is checked

from the registration done

on the blockchain

13 of 72

Voting

Registered Voters

Logins with OTP & UUID

Selects the party

for the vote

UUID_hash is checked

from the registration done

on the blockchain

party_hash is created

combining party_id with

a random_number

14 of 72

Voting

Registered Voters

Logins with OTP & UUID

Selects the party

for the vote

Contract is

Updated with the vote

UUID_hash is checked

from the registration done

on the blockchain

party_hash is created

combining party_id with

a random_number

15 of 72

Voting

Registered Voters

Logins with OTP & UUID

Selects the party

for the vote

Contract is

Updated with the vote

UUID_hash is checked

from the registration done

on the blockchain

party_hash is created

combining party_id with

a random_number

Transaction is completed

on blockchain

16 of 72

Counting

Chief Election Officer

concludes the voting

3 way authentication

+ decryption

Run the vote_count

function

Vote count declared

Elections complete

17 of 72

Benefits

Faster Elections

More voters vote as it can

be done from anywhere

Anonymity for Voter

Trust

18 of 72

The Way Forward

Replace the postal voting system

Will result in increasing awareness among citizens, increasing voter turn out

Can be conducted in parallel with the normal elections. Schools’ computer labs can be utilised as polling booths

19 of 72

Future Prospects

MnC elections

Co-operative societies’ elections

Integration with services like civic and decentralized oracles

City wide elections

Using Sovrin network for decentralized identity

20 of 72

How do we ensure the anonymity and secrecy of vote on a public blockchain?

Diving deep into Cryptography

21 of 72

Voting

5 parameters generated on client side :

  • constituency
  • uuid_hash
  • party_data_hash
  • party_data_encrypted
  • vote_hash

22 of 72

Constituency

Constituency the person belongs to

23 of 72

uuid hash

voter’s adhaar number

Hash function

24 of 72

uuid hash

voter’s adhaar number

Hash function

UUID Hash

25 of 72

Vote hash

voter’s adhaar number

26 of 72

Vote hash

voter’s adhaar number

Salt added by user. This is to be remembered to verify vote

27 of 72

Vote hash

voter’s adhaar number

Hash function

Salt added by user. This is to be remembered to verify vote

28 of 72

Vote hash

voter’s adhaar number

Hash function

Vote hash.

Salt added by user. This is to be remembered to verify vote

29 of 72

party data hash

voter’s chosen Party

30 of 72

party data hash

voter’s chosen Party

Salt added by a random generator. This need not be remembered

31 of 72

party data hash

voter’s chosen Party

Hash function

Salt added by a random generator. This need not be remembered

32 of 72

party data hash

voter’s chosen Party

Hash function

Party data hash.

Salt added by a random generator. This need not be remembered

33 of 72

Public-Private Key Pair

Publlic Key

Private Key

This needs to be kept safe till the end of election

34 of 72

party data encrypted

voter’s chosen Party

same Salt which was used to generate party data hash

35 of 72

party data encrypted

voter’s chosen Party

Encryption Algorithm

Salt added by a random generator. This need not be remembered

36 of 72

party data encrypted

voter’s chosen Party

Encryption Algorithm

Salt added by a random generator. This need not be remembered

Publlic Key

37 of 72

party data encrypted

voter’s chosen Party

Encryption Algorithm

Party data encrypted.

Salt added by a random generator. This need not be remembered

Publlic Key

38 of 72

Registering Vote

Transaction data

Constituency

39 of 72

Registering Vote

UUID Hash

Transaction data

Constituency

40 of 72

Registering Vote

Vote hash.

UUID Hash

Transaction data

Constituency

41 of 72

Registering Vote

Party data hash.

Vote hash.

UUID Hash

Transaction data

Constituency

42 of 72

Registering Vote

Party data encrypted.

Party data hash.

Vote hash.

UUID Hash

Transaction data

Constituency

43 of 72

Registering Vote

Smart contract on the blockchain

Party data encrypted.

Party data hash.

Vote hash.

UUID Hash

Transaction data

Constituency

44 of 72

In smart Contract

UUID Hash

Check if the person have voted before or not

45 of 72

in smart contract

A mapping of constituency to array of vote data is generated

Constituency

vote data

46 of 72

in smart contract

A mapping of constituency to array of vote data is generated

Constituency

vote data

47 of 72

in smart contract

A mapping of constituency to array of vote data is generated

Constituency

vote data

48 of 72

Decryption

Party data encrypted is sent

Smart Contract

Oracle

49 of 72

Decryption

Party data encrypted is sent

Smart Contract

Oracle

Oracle decrypts the data using private key

50 of 72

Decryption

Party data encrypted is sent

Smart Contract

Oracle

Oracle decrypts the data using private key

Party Data

Private key

51 of 72

Decryption

Party data encrypted is sent

Smart Contract

Oracle

Party Data

Party Data is signed by the oracle and sent back

Signed Party Data

Private key

Oracle decrypts the data using private key

52 of 72

Verification

Decrypted Party Data

Hash function

53 of 72

Verification

New Party data hash.

Decrypted Party Data

Hash function

54 of 72

Verification

New Party data hash.

This check makes sure there is no data manipulation by the oracle

Decrypted Party Data

Hash function

Party data hash.

55 of 72

chosen party extraction

Decrypted Party data

Salt previously added by a random generator. Not needed

56 of 72

chosen party extraction

voter’s chosen Party

Decrypted Party data

Salt previously added by a random generator. Not needed

57 of 72

in smart contract

A mapping of constituency to party to array of vote hashes is generated

Constituency

vote hash

Party A

Party B

58 of 72

in smart contract

A mapping of constituency to party to array of vote hashes is generated

Constituency

vote hash

Party A

Party B

59 of 72

in smart contract

A mapping of constituency to party to array of vote hashes is generated

Constituency

vote hash

Party A

Party B

60 of 72

in smart contract

A mapping of constituency to party to array of vote hashes is generated

Constituency

vote hash

Party A

Party B

61 of 72

in smart contract

A mapping of constituency to party to array of vote hashes is generated

Constituency

vote hash

Party A

Party B

62 of 72

in smart contract

A mapping of constituency to party to array of vote hashes is generated

Constituency

vote hash

Party A

Party B

63 of 72

Counting

Chief Election Officer

concludes the voting

Run the vote_count

function

Calculate length of arrays to decide the winner

64 of 72

Verification of vote

voter’s adhaar number

Hash function

Vote hash.

Salt added by user initially

65 of 72

Verification of vote

Vote Hashes are made public at the end of election

Constituency

Party A

Party B

Matched

66 of 72

CosmoVoting

Thank You

Akash Kumar

IIT Bombay

Smit Rajput

IIIT Vadodara

Tezan Sahu

IIT Bombay

67 of 72

Pseudo Code

Voting process :

On the client side :

Parameters generated:

  • Constituency

  • Uuid_hash :  Hash(adhaar number)

  • Party_data_hash : Hash(partyID||random_no)

  • Party_data_encrypted : public_key_encryption((partyID||random_no), public_key)

  • Vote_hash = Hash(uuid || security_token)

68 of 72

Pseudo Code

In smart contract:

Check if:

  • Person’s kyc is done
  • Person has voted before or not
  • The vote is being registered only during the voting phase

�Once checking is done, store the data in the following manner:

�Contract :

Vote_data[Constituency][{votedata1},{votedata2},{votedata3}..]

 

vote data = {

Vote_hash

Party_data_hash

party_data_encrypted

}

� �

69 of 72

Pseudo Code

Decryption process :

The decryption oracle loops through the voting data, decrypts the data

and sends back the plain text.

Decrypter                    <== Contract

          (constituency, index)

�Decrypter                    ==> Contract

(constituency, index, plaintext(partyID||random_no))

��In the Contract:

   Check if:

      Hash(plaintext) == Party_data_hash (Hash(partyID||random_no))

70 of 72

Pseudo Code

The last step makes sure there is no manipulation of vote data by the decryption oracle.

Now, use the party ID, to generate vote hash arrays :

we have the following data:� constituency

party ID

vote hash

�Contract :

Vote_hashes [Constituency][partyID][votehash1, votehash2,...]

��

71 of 72

Pseudo Code

Vote Calculation process :

�EC Head            ==> Contract: calculateVotes ()

        

calculateVotes() :

Loop across constituencies :

Loop across party ids :

Number of votes = the array length of vote hashes

Check which party have highest votes�Store the winner as winner[constituency] = partyID with max votes

//done

�Here no entity can manipulate the calculation of votes.

�Later election commission can make public the array of

vote hashes corresponding to every party in every constituency.

��

72 of 72

Pseudo Code

After Election :

�Voter :

�Uuid + security token (chosen at the time of voting) ==> vote hash

�Go to publicly available list of vote hashes => check vote

hash belong to the array of the party he voted for