The Blockchain Voting System is a prototype application designed to ensure transparency and security in the voting process using blockchain technology. By leveraging Bitcoin Testnet and IPFS for distributed data storage, this system provides anonymity for voters, real-time result updates, and an immutable record of votes stored on the blockchain.
- Anonymous Voting: Voters can cast their votes without revealing their identity, secured through cryptography.
- Real-Time Results: Results are displayed in real-time, ensuring transparency.
- Blockchain Record: Votes and metadata are securely stored in the Bitcoin Testnet blockchain and IPFS.
- Tamper-Proof: Immutable records guarantee the integrity of the election process.
- Backend: Python (Flask framework)
- Blockchain: Bitcoin Testnet
- Distributed Storage: IPFS
- Cryptography: SHA-256 hashing
- Python 3.8 or later
- Bitcoin Core with Testnet enabled
- IPFS client
-
Clone the Repository
git clone https://github.com/XenoidXD/blockchain-voting-system.git cd blockchain-voting-system
-
Install Dependencies Use pip to install the required Python packages:
pip install -r requirements.txt
-
Configure Bitcoin RPC Update the
BITCOIN_RPC_USER
,BITCOIN_RPC_PASSWORD
,BITCOIN_RPC_HOST
, andBITCOIN_RPC_PORT
values in the script to match your Bitcoin Core setup. -
Run the Application Start the Flask server:
python app.py
-
Access the Application Open your browser and navigate to
http://127.0.0.1:5000
.
- Endpoint:
/register_candidate
- Method: POST
- Payload:
{ "name": "Candidate Name" }
- Response:
{ "message": "Candidate registered successfully.", "id": "candidate_id" }
- Endpoint:
/vote
- Method: POST
- Payload:
{ "voter_id": "unique_voter_identifier", "candidate_id": "candidate_id" }
- Response:
{ "message": "Vote recorded successfully.", "txid": "transaction_id", "ipfs_hash": "ipfs_hash" }
- Endpoint:
/results
- Method: GET
- Response:
{ "tally": { "Candidate Name": 5 }, "total_votes": 10, "blockchain_records": [ { "ipfs_hash": "hash_value", "txid": "transaction_id" } ] }
This project is licensed under the MIT License. See the License file for details.
Contributions are welcome! Feel free to fork the repository and submit a pull request with your enhancements.
For any inquiries, reach out via email at [email protected].