## 4 Methodology and System Design
### VoteChain: Smart Contracts, Implementation, and Technical Architecture  
To create a secure and transparent e-voting system, the proposed VoteChain system employs the Ethereum network, which is an open-source blockchain for decentralizedapplications [31; 33]. Voters and candidates can register and participate in the elections by integrating MetaMask [35], which is a cryptocurrency wallet, with the VoteChain. The Central Election Commission (CEC) manages the system, ensuring transparency throughout the voting process. Via VoteChain, voters cast ballots using two types of nodes, including (1) Full Nodes that are directly connected to the Ethereum blockchain, providing higher security, and (2) Service Nodes that are accessed via cloud services or wallets, allowing more flexible and accessible interaction with VoteChain. A key aspect of VoteChain is the Casper consensus mechanism that employs a Proof-of-Stake (PoS) protocol [36]. PoS enables validators to \"stake\" cryptocurrency as collateral. Validators are selected to propose or validate new blocks based on their staked assets, significantly enhancing the security of the system while simultaneously minimizing energy consumption. Any malicious behavior by validators results in losing their staked assets, thereby discouraging dishonest practices. Therefore, VoteChain ensures that transactions are validated securely, protecting the election process from manipulation or fraud. The integration with the Casper consensus mechanism enables decentralized governance by distributing the power to validate transactions, ensuring that no single entity can dominate the process. The smart contract of the proposed VoteChain, written in Solidity, automates critical processes such as the registration of voters/candidates, vote casting, and vote counting. These smart contracts ensure transparency and immutability at every step of the election cycle. The list below presents the key smart contract structures:  
* PoliticalParty: Stores information about political parties, such as the party name and the number of seats won;
* Candidate: Holds candidate details, such as their name, party affiliation, and vote count;
* Voter: Manages voter information, ensuring that each voter can only vote once by tracking the canVote flag. During the election phases, smart contracts manage transitions from registration to voting and finally to result declaration. This automated governance ensures that all election operations comply with the pre-set rules, minimizing the need for manual oversight and reducing the risk of tampering. The technical architecture of VoteChain enhances its overall security, privacy, and efficiency. Before transactions are recorded on Ethereum's main chain, voter credentials are verified against an off-chain database maintained by the CEC. This dual-layer architecture, combining on-chain and off-chain components, strengthens the privacy of voter data while maintaining a transparent voting process. MongoDB Atlas Cloud Database is used to store voter credentials and supplementary information securely. Furthermore, VoteChain integrates several cryptographic techniques to ensure the confidentiality and integrity of voter data. SHA-256 Hashing ensures immutability and verifiability by cryptographically securing each vote. The Elliptic Curve Digital Signature Algorithm (ECDSA) authenticates the identity of voters without revealing their personal details, ensuring non-repudiation and preserving privacy. Zero-Knowledge Proofs (ZKPs) enhance privacy by allowing voter actions to be verified without exposing underlying data. Homomorphic Encryption enables computations on encrypted votes without decrypting them, ensuring vote tallying can be performed securely while maintaining the confidentiality of individual votes. In addition to the security provided via the cryptographic mechanisms, VoteChain further enhances privacy via the integration with Blockshare [37]. Blockshare is a privacy-preserving data-sharing system designed for blockchain platforms.