Skip to main content
QUICK REVIEW

[Paper Review] Implement Liquid Democracy on Ethereum: A Fast Algorithm for Realtime Self-tally Voting System

Xuepeng Fan, Peng Li|arXiv (Cornell University)|Nov 20, 2019
Internet Traffic Analysis and Secure E-votingComputer Science1 references10 citations
TL;DR

This paper proposes a novel O(log n) on-chain algorithm for implementing liquid democracy on Ethereum, enabling real-time self-tallying voting despite gas limitations. By shifting initialization off-chain and using interval trees to track delegate chains, the method ensures sublinear computation per vote, allowing scalable deployment even for networks with over a million voters.

ABSTRACT

We study the liquid democracy problem, where each voter can either directly vote to a candidate or delegate his voting power to a proxy. We consider the implementation of liquid democracy on the blockchain through Ethereum smart contract and to be compatible with the realtime self-tallying property, where the contract itself can record ballots and update voting status upon receiving each voting massage. A challenge comes due to the gas fee limitation of Ethereum mainnet, that the number of instruction for processing a voting massage can not exceed a certain amount, which restrict the application scenario with respect to algorithms whose time complexity is linear to the number of voters. We propose a fast algorithm to overcome the challenge, such that i) shifts the on-chain initialization to off-chain and ii) the on-chain complexity for processing each voting massage is O(\log n), where n is the number of voters.

Motivation & Objective

  • Address the scalability challenge of on-chain liquid democracy on Ethereum due to gas fee constraints.
  • Enable real-time self-tallying in decentralized voting systems where results are updated on-chain with each transaction.
  • Overcome the limitation of linear-time traversal algorithms that become infeasible as voter count grows.
  • Design a protocol that maintains correctness and security even when voters deviate by creating delegate cycles.
  • Ensure compatibility with Ethereum’s gas limits to support large-scale applications with millions of voters.

Proposed method

  • Shift on-chain initialization to off-chain, storing only essential delegate relationships and voting states in sparse storage.
  • Use interval trees to represent delegate chains, enabling O(log n) updates per voting message by efficiently tracking voting power propagation.
  • Implement a cycle-detection mechanism that rejects delegate edges forming cycles, ensuring consistency and preventing infinite loops.
  • Leverage Solidity’s sparse storage semantics, where unassigned keys default to zero, to minimize gas usage and support dynamic delegate graphs.
  • Design the voting update logic to depend only on the nearest voted ancestor, reducing on-chain state dependencies and enabling incremental computation.
  • Use a recursive interval tree update strategy that processes at most two intervals per level, ensuring logarithmic time complexity.

Experimental results

Research questions

  • RQ1Can liquid democracy be efficiently implemented on Ethereum with real-time self-tallying under strict gas constraints?
  • RQ2What is the minimal on-chain computational complexity required to update voting power after each ballot submission?
  • RQ3How can delegate chains be represented and updated efficiently to avoid linear traversal of the entire graph?
  • RQ4Can the system remain robust and correct even when voters attempt to manipulate the delegate graph by creating cycles?
  • RQ5Is it possible to scale the system to support over a million voters without exceeding Ethereum’s gas limit per transaction?

Key findings

  • The proposed algorithm achieves O(log n) time complexity per voting message, significantly outperforming naive O(n) traversal methods for large networks.
  • In extreme cases with a linear delegate chain, the traversal algorithm exceeds Ethereum’s gas limit at around 1,000 voters, while the proposed method remains under the limit even at 1 million voters.
  • The gas cost of the proposed algorithm increases very slowly with chain length, remaining under 3,000 gas even for chains of 8 million voters.
  • The algorithm remains gas-efficient and functional even when voters attempt to create cycles, as such edges are automatically rejected without affecting other voters.
  • The implementation on Ganache demonstrates that the proposed method scales effectively, with gas consumption growing logarithmically rather than linearly.
  • The use of sparse storage in Solidity ensures minimal on-chain footprint, as only assigned keys consume storage, aligning perfectly with the algorithm’s needs.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.