Skip to content

Latest commit

 

History

History
112 lines (72 loc) · 6.31 KB

patternTemplate.md

File metadata and controls

112 lines (72 loc) · 6.31 KB

Use this file to gather the content required for the pattern overview. Copy this draft-patten-template.md file, replace with your own content for each of the sections below, and attach your file to the GitHub tracking issue for your pattern.

For full details on requirements for each section, see "Write a code pattern overview" on w3 Developer: https://w3.ibm.com/developer/documentation/write-code-pattern-overview/

Short title

Build a secure evoting app

Long title

Expand on the short title, focusing on open source or generic tools and programs. Include IBM product names only if that product is required in the pattern and cannot be substituted.

Build a web-based blockchain evoting app using IBM Blockchain Platform and IBM Kubernetes Service

Author

URLs

Github repo

https://github.com/horeaporutiu/chainVote

Other URLs

Summary

With its distributed ledger, smart contracts, and non-repudiation capabilities, blockchain is revolutionizing the way organizations do business, and the election industry is no exception. This code pattern shows you how to implement a web-based blockchain app using the IBM Blockchain Platform to facilitate voting and ensure the prevention of double-voting.

Technologies

  • Hyperledger Fabric v1.4: A platform for distributed ledger solutions, underpinned by a modular architecture that delivers high degrees of confidentiality, resiliency, flexibility, and scalability.

Node.js:An open source, cross-platform JavaScript run-time environment that executes server-side JavaScript code.

Description

Have you ever wondered how exactly the votes in a presidential election counted? What if instead of having volunteers that are spending hours a day counting votes manually, we have an app that was backed by blockchain, recording each vote made by a voter, ensuring double-voting is not possible? That's what this code pattern explains how to do. We aim to build a web-app in which the voter can register with their drivers license, get a unique voterId which is used to login to the app, and cast the vote. The vote is tallied on the blockchain, and the web-app shows the current standings of the polls.

At the start of the application, the user registers to vote by providing their drivers license number, registrar district, and first and last name. In this step, we can check to see if the drivers license is valid, and has not been registered previously. If all goes well, we create a private and public key for the voter with our certificate authority that is running on the cloud, and add those keys to the wallet.

After that, we use our drivers license number to submit our vote, during which the application checks if this drivers license number has voted before and tells the user they have already submitted a vote if so. If all goes well, the political party which the voter has chosen is added a vote, and the world state is updated. The application then updates our current standings of the election to show which political party the user has voted for.

Since each transaction that is submitted to the ordering service must have a signature from a valid public-private key pair, we can trace back each transaction to a registered voter of the application, in the case of an audit.

In conclusion, although this is a simple application, the developer can see how they can implement a Hyperledger Fabric web-app to decrease the chance of election-meddling, and enhance a voting application by using blockchain technology.

Flow



Flow Description

  1. The blockchain operator sets up the IBM Blockchain Platform 2.0 service.
  2. The IBM Blockchain Platform 2.0 creates a Hyperledger Fabric network on an IBM Kubernetes Service, and the operator installs and instantiates the smart contract on the network.
  3. The Node.js application server uses the Fabric SDK to interact with the deployed network on IBM Blockchain Platform 2.0 and creates APIs for a web client.
  4. The Vue.js client uses the Node.js application API to interact with the network.
  5. The user interacts with the Vue.js web interface to cast their ballot and and query the world state to see current poll standings.

Instructions

Find the detailed steps for this pattern in the readme file. The steps will show you how to:

  1. Clone the Repo
  2. Create IBM Cloud services
  3. Build a network
  4. Deploy voterContract Smart Contract on the network
  5. Connect application to the network
  6. Run the application

Components and services

IBM Cloud Kubernetes Service

Blockchain Platform 2.0

Runtimes

  • Node.js

Related IBM Developer content

Related links

  • Hyperledger Fabric Docs: Enterprise grade permissioned distributed ledger platform that offers modularity and versatility for a broad set of industry use cases.