Skip to content

Instantly share code, notes, and snippets.

@didnt1able
Last active September 19, 2020 12:50
Show Gist options
  • Save didnt1able/b90940130a221c5abad0f75fb46a6ac8 to your computer and use it in GitHub Desktop.
Save didnt1able/b90940130a221c5abad0f75fb46a6ac8 to your computer and use it in GitHub Desktop.
This is a proof of concept for voting on blockchain using ravencoin assets

This is a proof of concept for voting on blockchain using Ravencoin assets

Generate a main asset for the election

CAN_VOTE_2024

Generate a series of unique assets ( as many as you need to fill the voter registry wallets with one unique asset per)

CAN_VOTE_2024/VOTE01#TOKEN_532
CAN_VOTE_2024/VOTE01#TOKEN_324
CAN_VOTE_2024/VOTE01#TOKEN_682

The amount of assets issued can be verified against the chain by tracking the unique assets

Issue all voters in registry a RVN address and their corresponding unique vote asset

RKWLM4vkuyTxCJeZVLzk1f8qceQVV7bAS1  --voter523
RHWLM4vkuyTxCrVGeLzk1f8qceQVV7bGS2  --voter324
RQWLM4vkuyTweJ8ZVLzk1f8qceQVV7bAS3  --voter682

Generate a series of candidate wallets for votes to be sent to.

candidate1 <walletadr1>
candidate2 <walletadr2>
candidate3 <walletadr3>
candidate4 <walletadr4>

Broadcast the Candidate wallet addresses in an RVN message

FILL

It can be verified that everyone has received their "ballots" this way.

Have people send back the unique token to the candidate address corresponding to their vote

Check back the amount of unique assets in each of the candidate wallets to count votes.

Each vote should have 3 transactions tied to it. You can view the all the transaction details on the block explorer with the TXID.


Create new unique asset on origin address


TXID: 38b57e93bb9ef0561d518ff301af6e3cb3c3adf4a5e154b1ac8a5862f6970f94


transfer to voter wallet


TXID: 104f4c93f2b5b57b0a316d9faf43519e3f010fd23bb4c11bcc0c7fb4bdf36934


transfer to candidate wallet


TXID: a108f336bd3d6ddc0d0d4c5f18a53169e0232b06a7fb74089d03ad23313f74a5


Making sure that there was only 3 transactions is what will verify the vote as authentic.


A system like this would be highly audit-able, confidential (because wallets do not correspond to voters outside of the registry database)

Both have high levels of confidentiality and audit-ability. All votes can be verified against the chain. Votes cannot be forged. Voters cannot be tampered with as long as the operators are not crooked(even so, they would have to have grand access to the voter registry and the address database linking voters to addresses on the back-end. These factors could all be verified against the chain for corruption)

This is just a POC but it could also work without unique assets. Instead of making unique assets you could just have the main assets double as the vote assets. Generating as many votes as you need to fill the wallets.

Counting "who has the most of asset X" vs Counting "who has the most unique assets"

Voter Tokens/Unique IDs for the issuer and every voter/candidate would need to be in some database. These could also be added with IPFS hashes in JSON format.

VOTER_ID VOTER_WALLET VOTER_TOKEN
VOTER_324 RHWLM4vkuyTxCrVGeLzk1f8qceQVV7bGS2 CAN_VOTE_2024/VOTE01#TOKEN_324
VOTER_523 RKWLM4vkuyTxCJeZVLzk1f8qceQVV7bAS1 CAN_VOTE_2024/VOTE01#TOKEN_532
VOTER_682 RQWLM4vkuyTweJ8ZVLzk1f8qceQVV7bAS3 CAN_VOTE_2024/VOTE01#TOKEN_682

IPFS hash of this GIST
bafybeihvwtdqce5kkibm3ztfvbyr5wgbpwifmzhs2663fc2h447z2j4gaa
Donation address RMWLM4vkuyTxCJ8ZVLzk1f8qceQVV7bAS1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment