[论文解读] Implement Liquid Democracy on Ethereum: A Fast Algorithm for Realtime Self-tally Voting System
本文提出了一种新颖的 O(log n) 链上算法,用于在以太坊上实现流动民主,即使在气体费用限制下也能实现实时自计票。通过将初始化过程移至链下,并使用区间树追踪委托链,该方法确保每次投票的计算量为次线性,从而即使在超过一百万投票者的网络中也能实现可扩展的部署。
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.
研究动机与目标
- 解决由于气体费用限制导致的以太坊上链流动民主可扩展性挑战。
- 在去中心化投票系统中实现实时自计票,使结果在每次交易后都更新至链上。
- 克服线性时间遍历算法的局限性,这些算法在投票者数量增加时变得不可行。
- 设计一种即使投票者通过创建委托环路而偏离时仍能保持正确性和安全性的协议。
- 确保与以太坊的气体限制兼容,以支持拥有数百万投票者的大型应用。
提出的方法
- 将链上初始化移至链下,仅在稀疏存储中存储必要的委托关系和投票状态。
- 使用区间树表示委托链,通过高效追踪投票权传播,实现在每次投票消息下 O(log n) 的更新。
- 实现一种循环检测机制,拒绝形成循环的委托边,以确保一致性并防止无限循环。
- 利用 Solidity 的稀疏存储语义,未分配的键默认为零,从而最小化气体消耗并支持动态委托图。
- 设计仅依赖最近已投票祖先的投票更新逻辑,减少链上状态依赖,实现增量计算。
- 采用递归的区间树更新策略,每层最多处理两个区间,确保对数时间复杂度。
实验结果
研究问题
- RQ1在严格气体限制下,是否能高效地在以太坊上实现流动民主并实现实时自计票?
- RQ2每次选票提交后,更新投票权所需的最小链上计算复杂度是多少?
- RQ3如何高效地表示和更新委托链,以避免对整个图进行线性遍历?
- RQ4当投票者试图通过创建循环来操纵委托图时,系统是否仍能保持稳健和正确?
- RQ5是否可能将系统扩展至支持超过一百万投票者,而不会超出以太坊单笔交易的气体限制?
主要发现
- 所提出的算法在每次投票消息下实现 O(log n) 的时间复杂度,显著优于大规模网络中朴素的 O(n) 遍历方法。
- 在极端情况下,当委托链呈线性时,遍历算法在约 1,000 名投票者时即超出以太坊的气体限制,而所提方法即使在 100 万投票者时仍保持在限制范围内。
- 所提算法的气体成本随链长增长极慢,即使在 800 万投票者链上,气体消耗仍低于 3,000。
- 即使投票者试图创建循环,该算法仍保持气体效率且功能正常,因为此类边会被自动拒绝,且不影响其他投票者。
- 在 Ganache 上的实现表明,所提方法可有效扩展,气体消耗呈对数增长而非线性增长。
- Solidity 中使用稀疏存储可确保最小的链上存储足迹,因为仅分配的键才消耗存储,与该算法的需求完全契合。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。