<span id="fpn9h"><noframes id="fpn9h"><span id="fpn9h"></span>
<span id="fpn9h"><noframes id="fpn9h">
<th id="fpn9h"></th>
<strike id="fpn9h"><noframes id="fpn9h"><strike id="fpn9h"></strike>
<th id="fpn9h"><noframes id="fpn9h">
<span id="fpn9h"><video id="fpn9h"></video></span>
<ruby id="fpn9h"></ruby>
<strike id="fpn9h"><noframes id="fpn9h"><span id="fpn9h"></span>
  • 《工程索引》(EI)刊源期刊
  • 中文核心期刊
  • 中國科技論文統計源期刊
  • 中國科學引文數據庫來源期刊

留言板

尊敬的讀者、作者、審稿人, 關于本刊的投稿、審稿、編輯和出版的任何問題, 您可以本頁添加留言。我們將盡快給您答復。謝謝您的支持!

姓名
郵箱
手機號碼
標題
留言內容
驗證碼

基于零知識證明的智能合約投票系統設計與實現

殷紅建 朱巖 王靜 郭光來 陳娥

殷紅建, 朱巖, 王靜, 郭光來, 陳娥. 基于零知識證明的智能合約投票系統設計與實現[J]. 工程科學學報, 2023, 45(4): 632-642. doi: 10.13374/j.issn2095-9389.2022.07.07.001
引用本文: 殷紅建, 朱巖, 王靜, 郭光來, 陳娥. 基于零知識證明的智能合約投票系統設計與實現[J]. 工程科學學報, 2023, 45(4): 632-642. doi: 10.13374/j.issn2095-9389.2022.07.07.001
YIN Hong-jian, ZHU Yan, WANG Jing, GUO Guang-lai, CHEN E. Design and implementation of a smart-contract voting system based on zero-knowledge proof[J]. Chinese Journal of Engineering, 2023, 45(4): 632-642. doi: 10.13374/j.issn2095-9389.2022.07.07.001
Citation: YIN Hong-jian, ZHU Yan, WANG Jing, GUO Guang-lai, CHEN E. Design and implementation of a smart-contract voting system based on zero-knowledge proof[J]. Chinese Journal of Engineering, 2023, 45(4): 632-642. doi: 10.13374/j.issn2095-9389.2022.07.07.001

基于零知識證明的智能合約投票系統設計與實現

doi: 10.13374/j.issn2095-9389.2022.07.07.001
基金項目: 國家科技部重點研發計劃資助項目(2018YFB1402702);國家自然科學基金資助項目(61972032)
詳細信息
    通訊作者:

    E-mail: chene@ustb.edu.cn

  • 中圖分類號: TP309.2

Design and implementation of a smart-contract voting system based on zero-knowledge proof

More Information
  • 摘要: 作為一種具有法律約束力的程序,智能合約為電子投票系統提供了可信執行平臺.然而,由于合約部署在公開透明的區塊鏈上,這將為投票內容的有效性與隱私性帶來巨大威脅.為了解決上述問題,基于交互式零知識證明技術設計了智能合約投票系統.首先,提出了一個新的交互式零知識集合成員關系證明協議,使得投票者在不泄露投票內容的前提下,完成對投票內容有效性的驗證,從而避免無效選票對投票系統的影響.其次,本文通過智能合約規范語言SPESC對投票合約進行描述并對投票各個階段的觸發條件進行限定,通過將合約以JAR包形式上傳至區塊鏈,實現智能合約投票系統的部署和自動化執行.最后,對智能合約投票系統的性能進行分析,實驗結果表明該系統投票和計票階段均可高效實施,為密碼協議構造技術與智能合約投票系統的有效結合提供參考.

     

  • 圖  1  智能合約投票系統框架

    Figure  1.  Framework of the smart-contract voting system

    圖  2  智能合約投票系統模型

    Figure  2.  Model of the smart-contract voting system

    圖  3  零知識集合成員關系證明協議

    Figure  3.  Zero-knowledge set membership proof protocol

    圖  4  SPESC語言編寫的投票智能合約

    Figure  4.  Voting contracts written in SPESC language

    圖  5  智能合約部署流程

    Figure  5.  Deployment process of smart contract

    圖  6  智能合約投票系統初始化階段

    Figure  6.  Initialization of the smart-contract voting system

    圖  7  智能合約發布結果

    Figure  7.  Results of smart contract release

    圖  8  智能合約初始化結果

    Figure  8.  Results of smart contract initialization

    圖  9  智能合約投票系統注冊階段

    Figure  9.  Registration of the smart-contract voting system

    圖  10  智能合約投票系統投票階段

    Figure  10.  Voting of the smart-contract voting system

    圖  11  第一輪挑戰碼對應的交易

    Figure  11.  Transaction of the first challenge

    圖  12  第二輪響應碼對應的交易

    Figure  12.  Transaction of the second response

    圖  13  智能合約投票系統計票階段

    Figure  13.  Vote-counting of the smart-contract voting system

    圖  14  不同數量投票者耗時對比

    Figure  14.  Time cost of different numbers of voters

    圖  15  不同數量候選者耗時對比

    Figure  15.  Time cost of different numbers of candidates

    表  1  符號說明表

    Table  1.   Notation declaration

    SymbolDescription
    ${\boldsymbol{G}}$Elliptic curve multiplicative cyclic group
    ${\bf{Z} }$Integer group
    gGenerator of the group ${\boldsymbol{G}}$
    nNumber of candidates
    sNumber of voters
    ${v_i}$The i-th voter
    ${\rm{s}}{{\rm{k}}_i}$Secret key of voter $ {v_i} $
    ${\rm{p}}{{\rm{k}}_i}$Public key of voter $ {v_i} $
    ${\rm{nu}}{{\rm{m}}_i}$Voting number of voter $ {v_i} $
    $ {w_j} $The j-th candidate
    ${\rm{wi}}{{\rm{d}}_j}$Identity of candidate $ {w_j} $
    下載: 導出CSV

    表  2  initParam算法

    Table  2.   initParam algorithm

    input: rbit, qbit
    output: void
    pg ← new TypeACurveGenerator(rbit,qbit)
    typeAParams ← pg.generate()
    pairing←PairingFactory.getPairing(typeAParams)
    G ← pairing.getG1();
    Z ← pairing.getZr();
    gG.newRandomElement().getImmutable();
    return;
    下載: 導出CSV

    表  3  candidateForm算法

    Table  3.   candidateForm algorithm

    input: params
    output: candidateList
    params={}
    for i ← 0 to params.length by 1 do
    n ← params.length;
    w.setCandidateAddress(params[i]);
    z← newNum();
    w.setNumid((int)pow(2,(i+1)·z);
    w.setNumid(i+1);
    w.setTotal(0);
    candidateList.add(w);
    resultMap.put(params[i?1],0);
    end for
    return candidateList;
    下載: 導出CSV

    表  4  voterRegist算法

    Table  4.   voterRegist algorithm

    input: params
    output: voterList
    params={}
    for i ← 0 to params.length by 1 do
    v ← new Voter();
    v.setVoterAddress(params[i]);
    v.setVoteStatus(false);
    voterList.add(v);
    end for
    return voterList;
    下載: 導出CSV

    表  5  generateCommit算法

    Table  5.   generateCommit algorithm

    input: address,num
    output: Commit
    Commit ← {};
    if address in voterList then
    sk1←Z.newRandomElement().getImmutable().duplicate();
    sk2←Z.newRandomElement().getImmutable().duplicate();
    pk1 ← g.duplicate().powZn(sk1);
    pk2 ← g.duplicate().powZn(sk2);
    x ← pk1.duplicate();
    yy ← pk2.duplicate();
    wid ← (int) pow(2, num * newNum());
    e ←g.duplicate().pow(BigInteger.valueOf(wid));
    y ← yy.mul(e);
    Commit.add(x);
    Commit.add(y);
    end if
    return Commit;
    下載: 導出CSV

    表  6  generateChallenge2算法

    Table  6.   generateChallenge2 algorithm

    input: address
    output: miuN
    for i ← 0 to n-1 by 1 do
    sum ← sum.add(A.get(i));
    end for
    sum ← sum.add(x));
    phi ← hash(sum);
    for i ← 0 to n-1 by 1 do
    miuN ← miuN.sub(U.get(i));
    end for
    return miuN;
    下載: 導出CSV

    表  7  voteResult算法

    Table  7.   voteResult algorithm

    input: candidateList
    output: result
    for j ← 0 to n-1 by 1 do
    candidateddress ← candidateList.get(j).candidateaddress;
    for i ← 0 to s-1 by 1 do
    eTotal ← eTotal +
    BGN(getPK.initiator, candidateaddress);
    end for
    result.put(candidateaddess, eTotal);
    end for
    return result;
    下載: 導出CSV

    表  8  不同方案之間安全特性對比

    Table  8.   Comparison of security features

    Voting schemesValidity of the ballotPrivacy of ballotsUniquenessSupervision freeSelf-counting
    [10]YesYesYesNoNo
    [11]NoYesNoYesNo
    [12]NoYesYesYesNo
    [27]NoYesYesNoNo
    OursYesYesYesYesYes
    下載: 導出CSV
    <span id="fpn9h"><noframes id="fpn9h"><span id="fpn9h"></span>
    <span id="fpn9h"><noframes id="fpn9h">
    <th id="fpn9h"></th>
    <strike id="fpn9h"><noframes id="fpn9h"><strike id="fpn9h"></strike>
    <th id="fpn9h"><noframes id="fpn9h">
    <span id="fpn9h"><video id="fpn9h"></video></span>
    <ruby id="fpn9h"></ruby>
    <strike id="fpn9h"><noframes id="fpn9h"><span id="fpn9h"></span>
    www.77susu.com
  • [1] Wang D, Zhu Y, Chen E, et al. Smart legal contract and its research progress. Chin J Eng, 2022, 44(1): 68

    王迪, 朱巖, 陳娥, 等. 智能法律合約及其研究進展. 工程科學學報, 2022, 44(1):68
    [2] Wang S, Ouyang L, Yuan Y, et al. Blockchain-enabled smart contracts: Architecture, applications, and future trends. IEEE Trans Syst Man Cybern Syst, 2019, 49(11): 2266 doi: 10.1109/TSMC.2019.2895123
    [3] Zhu Y, Wang Q S, Qin B H, et al. Survey of blockchain technology and its advances. Chin J Eng, 2019, 41(11): 1361

    朱巖, 王巧石, 秦博涵, 等. 區塊鏈技術及其研究進展. 工程科學學報, 2019, 41(11):1361
    [4] Zhu Y, Qin B H, Chen E, et al. An advanced smart contract conversion and its design and implementation for auction contract. Chin J Comput, 2021, 44(3): 652 doi: 10.11897/SP.J.1016.2021.00652

    朱巖, 秦博涵, 陳娥, 等. 一種高級智能合約轉化方法及競買合約設計與實現. 計算機學報, 2021, 44(3):652 doi: 10.11897/SP.J.1016.2021.00652
    [5] Hewa T, Ylianttila M, Liyanage M. Survey on blockchain based smart contracts: Applications, opportunities and challenges. J Netw Comput Appl, 2021, 177: 102857 doi: 10.1016/j.jnca.2020.102857
    [6] Buterin V. A next-generation smart contract and decentralized application platform [R/OL]. Ethereum (2014-12-01) [2022-07-07].https://ethereum.org/669c9e2e2027310b6b3cdce6e1c52962/Ethereum_Whitepaper_-_Buterin_2014.pdf
    [7] Lerner S D. RSK Bitcoin powered smart contracts [R/OL]. Sciencepaper Online (2015-11-19) [2022-07-07]. http://cryptochainuni.com/wp-content/uploads/Rootstock-WhitePaper-v9-Overview.pdf
    [8] Androulaki E, Barger A, Bortnikov V, et al. Hyperledger fabric: A distributed operating system for permissioned blockchains // Proceedings of the Thirteenth EuroSys Conference. Portugal, 2018: 1
    [9] Chaum D L. Untraceable electronic mail, return addresses, and digital pseudonyms. Commun ACM, 1981, 24(2): 84 doi: 10.1145/358549.358563
    [10] Zhang P, Yu J P, Liu H W. A homomorphic signcryption scheme and its application in electronic voting. J Shenzhen Univ Sci Eng, 2011, 28(6): 489

    張鵬, 喻建平, 劉宏偉. 同態簽密方案及其在電子投票中的應用. 深圳大學學報(理工版), 2011, 28(6):489
    [11] Sun M, Wang Y B. Traceable anonymous electronic voting scheme based on blockchain. Cyberspace Secur, 2019, 10(9): 85 doi: 10.3969/j.issn.1674-9456.2019.09.011

    孫萌, 王昀飚. 基于區塊鏈的可追蹤匿名電子投票方案. 網絡空間安全, 2019, 10(9):85 doi: 10.3969/j.issn.1674-9456.2019.09.011
    [12] Zheng J, Lai H C. Blockchain e-voting scheme based on one-time ring signature. Appl Res Comput, 2020, 37(11): 3378

    鄭劍, 賴恒財. 基于一次性環簽名的區塊鏈電子投票方案. 計算機應用研究, 2020, 37(11):3378
    [13] Satizábal C, Páez R, Forné J. Secure Internet Voting Protocol (SIVP): A secure option for electoral processes. J King Saud Univ Comput Inf Sci, 2022, 34(6): 3647
    [14] Wang K H, Mondal S K, Chan K, et al. A review of contemporary e-voting: Requirements, technology, systems and usability. Data Sci Pattern Recognit, 2017, 1(1): 31
    [15] Alvarez R M, Hall T E, Trechsel A H. Internet voting in comparative perspective: The case of Estonia. PS Political Sci Politics, 2009, 42(3): 497 doi: 10.1017/S1049096509090787
    [16] Zhao Z C, Chan T H H. How to vote privately using bitcoin // International Conference on Information and Communications Security. Beijing, 2015: 82
    [17] Tarasov P, Tewari H. Internet voting using zcash [R/OL]. Sciencepaper Online (2017-06-20) [2022-07-07].https://eprint.iacr.org/2017/585
    [18] McCorry P, Shahandashti S F, Hao F. A smart contract for boardroom voting with maximum voter privacy // International Conference on Financial Cryptography and Data Security. Sliema, 2017: 357
    [19] Yu B, Liu J K, Sakzad A, et al. Platform-independent secure blockchain-based voting system // International Conference on Information Security. Guildford, 2018: 369
    [20] Camenisch J, Chaabouni R, Shelat A. Efficient protocols for set membership and range proofs // International Conference on the Theory and Application of Cryptology and Information Security. Melbourne, 2008: 234
    [21] Morais E, Koens T, Van W C, et al. A survey on zero knowledge range proofs and applications. SN Appl Sci, 2019, 1(8): 946 doi: 10.1007/s42452-019-0989-z
    [22] Boneh D, Boyen X. Short signatures without random oracles // International Conference on the Theory and Applications of Cryptographic Techniques. Interlaken, 2004: 56
    [23] Yin H J, Chen E, Zhu Y, et al. An efficient zero-knowledge dual membership proof supporting pos-and-neg membership decision. Mathematics, 2022, 10(17): 3217 doi: 10.3390/math10173217
    [24] De Caro A, Iovino V. jPBC: Java pairing based cryptography // 2011 IEEE Symposium on Computers and Communications. Corfu, 2011: 850
    [25] He X, Qin B H, Zhu Y, et al. SPESC: A specification language for smart contracts // 2018 IEEE 42nd Annual Computer Software and Applications Conference. Tokyo, 2018, 1: 132
    [26] Boneh D, Goh E J, Nissim K. Evaluating 2-DNF formulas on ciphertexts // Proceedings of the 2005 Second International Conference on Theory of Cryptography. Spain, 2005: 325
    [27] Kumar M, Chand S, Katti C P. A secure end-to-end verifiable internet-voting system using identity-based blind signature. IEEE Syst J, 2020, 14(2): 2032 doi: 10.1109/JSYST.2019.2940474
  • 加載中
圖(15) / 表(8)
計量
  • 文章訪問數:  762
  • HTML全文瀏覽量:  283
  • PDF下載量:  76
  • 被引次數: 0
出版歷程
  • 收稿日期:  2022-07-07
  • 網絡出版日期:  2022-10-24
  • 刊出日期:  2023-04-01

目錄

    /

    返回文章
    返回