Thomas A. MayfieldTeam Lead Decentralized Trust and Identity Solutions (DTIS)
The ability to cast a ballot and have your vote counted is essential to any fair election. Ideally, this process should be accurate and transparent, verifiable yet secure, and accessible to all. In 2022, the first Cardano Ballot iteration occurred in collaboration with SundaeSwap—a partnership established to support voting for the Cardano Summit Awards and Day 2 speaker. Again this year, Awards voting for the Cardano Summit 2023 took place using the Cardano Ballot.
Ongoing public debates surrounding various elections around the world have highlighted the need for improvements and continuous increased confidence surrounding ballot issuance, processing, and vote tallying procedures. Given the Cardano Foundation’s fundamental understanding of these common challenges, we set about providing a solution by way of the 2023 Cardano Ballot while simultaneously endeavoring to enhance the Ballot’s previous iteration.
Improving Cardano Ballot
Over the last 12 months, the Cardano Ballot has evolved significantly into a modular, open source repository featuring independent backend services that can be coupled with bespoke user interfaces—thus enabling a truly custom blockchain-based voting solution. As a result, the Ballot continues to provide free, user-based voting, but it is now also possible to leverage it for stake-based voting events.
The Cardano Ballot’s staked-based voting requires participants to have staked ada before a predefined snapshot of the Cardano blockchain. This snapshot determines the weighted amount of each participant’s vote within a specific Cardano Ballot event. Also, due to the new backend service voting-admin-app, Cardano Ballot events are now registered publicly on-chain. This new on-chain registration process ensures transparency and serves as an immutable record for all Cardano Ballot voting events. In addition to these enhancements, among many others, we at the Foundation would like to happily announce that the Cardano Ballot is now open source.
Cardano Ballot Journey and Outlook
In 2022, the Ballot laid the foundation not just for a free and user-based voting application, but an anonymous one that is transparent, verifiable, and secure. However, following the Cardano Summit 2022, we identified a number of enhancements worth considering. For instance, the open source cardano-connect-with-wallet component developed by the Foundation and featured in the Ballot last year constitutes one such improvement. Throughout 2023, this component has evolved from a React-specific one into a framework-independent library.
The driving idea for the component has always been to simplify the integration of Cardano wallets with Cardano decentralized applications (DApps). Limited mobile wallet support already existed for last year’s Cardano Ballot, but the team wished to extend it further. This spurred us to ideate over possible alternatives for communications between DApps and existing wallets. As a result, the Decentralized WebRTC DApp-Wallet Communication, or CIP-45, now provides a standard for decentralized peer-to-peer (P2P) communications between wallets and DApps on Cardano. CIP-45 utilizes the well-established WebRTC protocol coupled with WebTorrent trackers to enable a truly decentralized peer discovery method that is both privacy-preserving and reliable. The 2023 Ballot demonstrated the CIP-45 application, whereby users could utilize Eternl’s CIP-45 implementation to connect P2P with the Cardano Ballot.
The Ballot exhibited further innovation this year, supporting the Cardano Summit 2023 Awards voting with the first-ever Hydra Tally. The team expressed a desire to explore Hydra following last year’s Summit. Moreover, we wanted to further enhance transparency, scalability, and auditability. To achieve these enhancements, we leveraged Aiken smart contracts and Hydra to enable on-chain validation of the voting results tally. The public can now inspect the smart contract data and easily confirm whether the results were tallied correctly for each Cardano Summit 2023 Award category.
Evolving Applications of Cardano Ballot
Earlier this year, the Cardano Foundation received a request from IOG to support CIP-1694 pre-ratification events by way of the Cardano Ballot. IOG had previously made an evaluation of voting solutions on Cardano, including a review of Voteaire and SundaeSwap Governance, and decided to opt for the Foundation’s voting solution. This request to support CIP-1694 pre-ratification events established a new requirement for stake-based voting, prompting the Foundation’s team to develop the necessary functionality.
The weight assigned to each ballot stands as the key difference between user and stake-based voting. Stake-based voting requires the calculation of a weighted amount for each ballot based on the amount of ada staked by an address at a given time. This time is captured using a snapshot of the Cardano blockchain and must occur before the Cardano Ballot event commences. The specifics of each Cardano Ballot event appear detailed on-chain. In fact, this aspect is part of the new registration process mentioned previously.
Cardano Ballot Technical Insights
The Ballot’s open sourced, modularized repository with the backend-services includes six applications: Admin, Voting, Commitment, Ledger Follower, Verification, and Hydra Tally. The team designed these modular applications to be lightweight and decentralized. For example, the voting-verification-app provides an independent application meant for the community, voters, and third parties to verify on-chain Cardano Ballot vote proofs. Many backend services, including the verification app, are configured using the Cardano Ballot event registration metadata on-chain.
In keeping with its previous version, the Cardano Ballot currently supports two user verification methods: SMS and Discord Bot. For the Cardano Summit, SMS verification leveraged multi-factor authentication (MFA) best practices, and the Ballot specifically only stored a hash value for the phone number. The Discord Bot, developed last year for the Cardano Summit 2022, supported participants who did not want to provide a phone number to vote. The Cardano Foundation discord-wallet-verification-bot has since evolved into an open source library designed for Cardano developers. This year, the user experience has also improved considerably: Users only have to perform the single action of clicking a button within Discord to verify their account with the Cardano Ballot.
When configured to a Cardano Ballot event, the Ledger Follower App will fetch all event-related data from the Cardano blockchain, including stake amounts for stake-based Cardano Ballot events. In addition to the modularized backend services, the Ballot implements Authenticated Web3 HTTP Requests, or CIP-93. This new approach provides an authentication method for user requests to DApp servers leveraging the Cardano blockchain and CIP-08 Message Signing.
Next for Cardano Ballot
The newly open sourced Cardano Ballot repository provides developers with reference implementations for two complete Cardano Ballot events: Cardano Summit 2023 (user-based) and CIP-1694 (stake-based). Each event utilizes the Cardano Ballot backend services with their respective frontends contained within the UI directory. With the Ballot now open sourced, we hope the developer ecosystem will benefit from our journey over the last two years. But, most importantly, we hope the Cardano Ballot will continue to evolve in collaboration with the community.
The Foundation would encourage those interested to review BloxBean Cardano Projects, as our team benefited greatly from BloxBean’s Yaci Store and DevKit when developing the Ballot. We are thankful for their work, and we would indeed feel remiss if we did not mention them.
In 2024, the Cardano Ballot will no longer require Cardano stake addresses to identify users. Instead, and if they so wish, users will have the possibility of utilizing mobile digital identity wallets to interact with the Ballot. This functionality will provide an innovative solution and reference implementation for identity management on the Cardano network. We also intend to continue our discovery with Hydra and further explore scalability, with an emphasis on verification and decentralized data storage solutions for cryptographic proofs. We have consciously not planned the complete 2024 Cardano Ballot roadmap as we want to remain flexible given any potential collaborations or requests from the community.
Regardless of the use case, enhanced Cardano Ballot functionality benefits Web 2 developers looking to understand voting DApps, as well as experienced Cardano developers aiming to orchestrate their own Cardano Ballot user or stake-based event. Similarly, the Cardano Foundation intends the Ballot repository to empower Cardano ecosystem participants, delivering a robust methodology to cast a ballot and have any person’s vote counted.
Original Source : Cardano Ballot 2023: The Voice of the Cardano Community