Zk-SNARKs-Based Anonymous Payment Channel in Blockchain
Abstract
:1. Introduction
- We present the details of a zk-SNARKs-based anonymous payment channel, which retains all the advantages of the original payment channel schemes while being more robust and secure. Specifically, we achieve privacy protection by integrating blockchain systems with zero-knowledge proofs and commitment schemes and ensure fair transactions using verifiable timed commitments.
- Experimental validation of the zk-SNARKs-based anonymous payment channel was conducted, including testing the three stages of the payment channel transaction process and related tests of zk-SNARKs within the entire system.
2. Related Work
3. Preliminaries
3.1. Blockchain
- The application layer mainly encapsulates blockchain application scenarios, such as finance, supply chain, transportation, medical care, insurance, etc. Blockchain technology can solve some difficult points that cannot be solved using existing information technology. In addition, blockchain’s empowerment of traditional industries can further enhance their competitiveness.
- The contract layer mainly encapsulates self-executing code scripts and smart contracts, so that the ledger has programmable features. The emergence of smart contracts has accelerated the application of blockchain technology in various industries and fields. At present, most blockchain applications are DAPPs based on smart contracts.
- The incentive layer integrates an issuance and distribution mechanism and encourages the nodes in the blockchain network to actively participate in the consensus and reward the nodes that verify the safety through the incentive mechanism.
- The consensus layer includes various consensus algorithms, such as PoW, PBFT, etc., which are used for packaging transactions into blocks and blockchains.
- The network layer includes the networking mode of nodes, network transmission protocol, data security transmission mechanism, etc.; the network layer is used to realize communication between nodes.
- The data layer includes data block storage, blockchain storage structure encryption technology, etc., to realize data storage and ensure data security.
3.2. zk-SNARKs
- : Input a security parameter , the algorithm outputs a public parameter list . is published to the public and can be accessed by any user, and the algorithm is only executed once at the very beginning.
- : Input a mathematical operation circuit , the algorithm uses public parameters and generates a key pair for zero-knowledge proof, where is the proof key for generating zero-knowledge proof, and is the verification key for verifying a zero-knowledge proof key. The key pair are also exposed as a public parameter.
- : input circuit zero-knowledge proof key, the normal input x of circuit , and the private input (auxiliary input) w of the circuit , the algorithm generates a that satisfies the relationship ’s non-interactive proof , constructed using the circuit . are public.
- : input circuit zero-knowledge proof key, circuit normal input x, and the non-interactive proof generated according to the circuit , the algorithm verifies the validity of the non-interactive proof , and outputs the result b. If , the non-interactive proof is verified valid. Otherwise, the non-interactive proof is invalid.
4. The Concepts and Definitions
4.1. System Model
- Certificate Authority: This is a trusted third party responsible for generating and managing identity certificates for users or trusted parties.
- Users: The main participants in the payment system are users, who can either be payers or receivers. Each user has an account comprising an address and a private key. The user’s address serves as their identity and must be registered with the certificate authority before they can participate in the system. On the other hand, a private key is used to transfer coins from one address to another. Additionally, each user can have a long-term address and any number of anonymous addresses to ensure anonymity.
- Miners: Miners are responsible for verifying the correctness of transactions and maintaining the public ledger. If the transaction is valid and compliant with policies, they will add it to the blockchain ledger. Otherwise, the miner will discard the transaction, causing the transaction to fail.
- Trusted parties: Trusted parties are responsible for initializing the system and generating public parameters for users and miners.
4.2. Design Goal
- Unlinkability: The connection between the parties involved in transactions through the payment channel is unlinkable. This attribute ensures the public cannot link the fund sender (consumer) with the corresponding receiver (provider) within the payment channel.
- Privacy Preserving: The amount of funds transacted between parties within the payment channel should only be known to those involved; this remains hidden from the public. This means the public must be unaware of how much was spent or received by the participants.
4.3. Threat Model
- Certificate Authority: We assume that the certificate authority is honest and trustworthy and does not disclose any information.
- Users: Since many transacting users are in the system, they are arbitrarily malicious. They will act in their own best interests and deviate from the intended protocol at will.
- Miners: We assume that miners implement a secure consensus algorithm to maintain their blockchain and that our scheme trusts the blockchain as a trusted intermediary to properly process transactions and smart contracts. However, the blockchain is public to all entities and does not retain private data.
- Trusted party: We assume the trusted party is honest but curious. That is, the trusted party will honestly follow the deployed protocols, but it is also interested in inferring users’ details, such as identity and data information.
5. Proposed Model
5.1. Phase I: Setup Phase
Algorithm 1 Initialization Algorithm |
Input: Safety parameter Output: The list of public parameters
|
5.2. Phase II: Minting Phase
- Address : this is the address of the transaction sender and the address of the transaction receiver.
- Value : this is the value of minting transactions that need to be transformed from plaintext currency into zero-knowledge currency.
- Commitment Value : the commitment scheme generates a fresh zero-knowledge currency commitment value. This commitment value encapsulates the hidden components, including the address , value , the newly generated random number , and a unique string generated by the function associated with this specific commitment.
- The zero-knowledge proof is a proof generated by zk-SNARKs.GenProof that the following conditions apply to the circuit of :
- (1)
- COMM ()
- (2)
- PRF ()
- Signature User signs the above (, ,) with private key .
Algorithm 2 Mint Algorithm |
Input: The list of public parameters , the coin value to be converted and address Output: A zero-knowledge currency and a mint transaction
|
5.3. Phase III: Payment Channel Establishment Phase
- Merkle tree root : This is the proof that the commitment exists in the ledger;
- Commitment serial number : A unique string associated with the commitment .
- Commitment value : This value is generated by the commitment scheme COMM, and the content implied in the commitment includes the Payer’s address , the Payee’s address , the transferred value , commitment serial number , and the serial number associated with this commitment value generated by the PRF function and discrete logarithmic value Y.
- Zero-knowledge proof : This zero-knowledge proof is a proof generated by zk-SNARKs.GenProof that the following conditions apply to the circuit of :
- (1)
- = COMM()
- (2)
- = PRF()
- (3)
- = COMM()
- (4)
- = PRF()
- (5)
- The path from to the saved on the ledger is correct
Algorithm 3 Payment Channel Establishment Algorithm |
Input: The list of public parameters pp, Merkle root , path , Zero-knowledge currency and address Output: Zero-knowledge currency and payment channel establishment transactions
|
5.4. Phase IV: Payment Channel Update Phase
- Merkle tree root : the proof that the commitment exists in the ledger;
- Serial numbers : strings associated with commitment commitment ;
- Commitment values and : these are also generated by the commitment scheme COMM. The contents implicit in the commitment are the address , the address , the explicit value , serial number associated with this commitment value generated by the PRF function, and the serial number ; the contents implicit in the commitment are the address , the address , the explicit value , serial number associated with this commitment value generated by the PRF function, and the serial number ;
- Address : the address of the payer;
- Zero-knowledge proof : this zero-knowledge proof is a proof generated by zk-SNARKs.GenProof, which is suitable for the circuit of .
- (1)
- = COMM(
- (2)
- = PRF(
- (3)
- = COMM(
- (4)
- = PRF(
- (5)
- = COMM(
- (6)
- = PRF(
- (7)
- (8)
- The path from to the saved on the ledger is correct
- Signature : signature of the above (, , , , ) using the private key .
- Discrete logarithmic value Y and secret value y: (where g is the common parameter).
Algorithm 4 Payment Channel Update Algorithm |
Input: The public parameter list , , Merkle tree root , path , Private key owned by , plaintext values and Output: Zero-knowledge currency and , payment channel update transaction
|
5.5. Phase V: Payment Channel Closure Phase
- Merkle tree root : This is the proof that the commitment exists in the ledger;
- Commitment serial number : A unique string associated with the commitment ;
- Commitment value : This value is generated by the commitment scheme COMM, and the content implied in the commitment includes the address , the transferred value , new random numbers , and the serial number associated with this commitment value generated by the PRF function;
- Address : the address of user ;
- Zero-knowledge proof : this zero-knowledge proof is a proof generated by zk-SNARKs.GenProof that the following conditions apply to the circuit of :
- (1)
- COMM(
- (2)
- PRF(
- (3)
- COMM(
- (4)
- PRF(
- (5)
- The path from to the saved on the ledger is correct
- Signature :Signature of the above , , , using the payment channel private key .
Algorithm 5 Transfer Algorithm |
Input: The public parameter list , , Merkle tree root and path , public key of , new public key of and new private key of Output: New zero-knowledge currency ,transfer transaction
|
6. Analysis
7. Experiment and the Results
7.1. Experiment Configuration
- We conducted a performance evaluation of the zk-SNARKs circuits for the , , , and aspects of the zk-SNARKs-based anonymous payment channel;
- We compared the zk-SNARKs-based anonymous payment channel with similar protocols, such as Blockmaze, Zerocash, and DMC [38];
- We evaluated the performance of the three phases of the payment channel, payment channel establishment, payment, and payment channel closure, and compared them with DMC.
7.2. Experiment Results
7.2.1. zk-SNARKs Performance Evaluation
7.2.2. Comparison with Blockmzae, Zerocash, and DMC
7.2.3. Payment Channel Performance Evaluation
8. Conclusions
Author Contributions
Funding
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Nakamoto, S. Bitcoin: A peer-to-peer electronic cash system. Decentralized Bus. Rev. 2008, PP, 1. [Google Scholar]
- Zheng, Z.; Xie, S.; Dai, H.N.; Chen, X.; Wang, H. Blockchain challenges and opportunities: A survey. Int. J. Web Grid Serv. 2018, 14, 352–375. [Google Scholar] [CrossRef]
- Zhang, Y.; Gai, K.; Xiao, J.; Zhu, L.; Choo, K.K.R. Blockchain-empowered efficient data sharing in Internet of Things settings. IEEE J. Sel. Areas Commun. 2022, 40, 3422–3436. [Google Scholar] [CrossRef]
- Monrat, A.A.; Schelén, O.; Andersson, K. A survey of blockchain from the perspectives of applications, challenges, and opportunities. IEEE Access 2019, 7, 117134–117151. [Google Scholar] [CrossRef]
- Gao, W.; Hatcher, W.G.; Yu, W. A survey of blockchain: Techniques, applications, and challenges. In Proceedings of the 2018 27th international conference on computer communication and networks (ICCCN), Hangzhou, China, 30 July–2 August 2018; pp. 1–11. [Google Scholar]
- Gai, K.; She, Y.; Zhu, L.; Choo, K.K.R.; Wan, Z. A blockchain-based access control scheme for zero trust cross-organizational data sharing. ACM Trans. Internet Technol. 2023, 23, 1–25. [Google Scholar] [CrossRef]
- Gai, K.; Wang, S.; Zhao, H.; She, Y.; Zhang, Z.; Zhu, L. Blockchain-Based Multisignature Lock for UAC in Metaverse. IEEE Trans. Comput. Soc. Syst. 2022, 10, 2201–2213. [Google Scholar] [CrossRef]
- Liang, H.; Guo, Y.; Gai, K. A Blockchain-Based Hierarchical Storage Method for Supply Chain Data. In Proceedings of the 2023 IEEE 8th International Conference on Smart Cloud (SmartCloud), Tokyo, Japan, 16–18 September 2023; pp. 105–110. [Google Scholar]
- Tikhomirov, S. Ethereum: State of knowledge and research perspectives. In Foundations and Practice of Security, Proceedings of the 10th International Symposium, FPS 2017, Nancy, France, 23–25 October, 2017, Revised Selected Papers 10; Springer: Nancy, France, 2018; pp. 206–221. [Google Scholar]
- Wood, G. Ethereum: A secure decentralised generalised transaction ledger. Ethereum Proj. Yellow Pap. 2014, 151, 1–32. [Google Scholar]
- Yang, D.; Long, C.; Xu, H.; Peng, S. A review on scalability of blockchain. In Proceedings of the 2020 the 2nd International Conference on Blockchain Technology, Hilo, HI, USA, 12–14 March 2020; pp. 1–6. [Google Scholar]
- Kim, S.; Kwon, Y.; Cho, S. A survey of scalability solutions on blockchain. In Proceedings of the 2018 International Conference on Information and Communication Technology Convergence (ICTC), Jeju, Republic of Korea, 17–19 October 2018; pp. 1204–1207. [Google Scholar]
- Gai, K.; Hu, Z.; Zhu, L.; Wang, R.; Zhang, Z. Blockchain meets dag: A blockdag consensus mechanism. In Algorithms and Architectures for Parallel Processing, Proceedings of the 20th International Conference, ICA3PP 2020, New York, NY, USA, 2–4 October 2020; Proceedings, Part III 20; Springer: Copenhagen, Denmark, 2020; pp. 110–125. [Google Scholar]
- Papadis, N.; Tassiulas, L. Blockchain-based payment channel networks: Challenges and recent advances. IEEE Access 2020, 8, 227596–227609. [Google Scholar] [CrossRef]
- Malavolta, G.; Moreno-Sanchez, P.; Kate, A.; Maffei, M.; Ravi, S. Concurrency and privacy with payment-channel networks. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, Dallas, TX, USA, 30 October–3 November 2017; pp. 455–471. [Google Scholar]
- Gai, K.; Wu, Y.; Zhu, L.; Zhang, Z.; Qiu, M. Differential privacy-based blockchain for industrial internet-of-things. IEEE Trans. Ind. Inform. 2019, 16, 4156–4165. [Google Scholar] [CrossRef]
- Gai, K.; Tang, H.; Li, G.; Xie, T.; Wang, S.; Zhu, L.; Choo, K.K.R. Blockchain-based privacy-preserving positioning data sharing for IoT-enabled maritime transportation systems. IEEE Trans. Intell. Transp. Syst. 2022, 24, 2344–2358. [Google Scholar] [CrossRef]
- Sasson, E.B.; Chiesa, A.; Garman, C.; Green, M.; Miers, I.; Tromer, E.; Virza, M. Zerocash: Decentralized anonymous payments from bitcoin. In Proceedings of the 2014 IEEE Symposium on Security and Privacy, Berkeley, CA, USA, 18–21 May 2014; pp. 459–474. [Google Scholar]
- Guan, Z.; Wan, Z.; Yang, Y.; Zhou, Y.; Huang, B. BlockMaze: An efficient privacy-preserving account-model blockchain based on zk-SNARKs. IEEE Trans. Dependable Secur. Comput. 2020, 19, 1446–1463. [Google Scholar] [CrossRef]
- Wijaya, D.A.; Liu, J.K.; Steinfeld, R.; Liu, D.; Yu, J. On the unforkability of monero. In Proceedings of the 2019 ACM Asia Conference on Computer and Communications Security, Auckland, New Zealand, 9–12 July 2019; pp. 621–632. [Google Scholar]
- Thyagarajan, S.A.K.; Bhat, A.; Malavolta, G.; Döttling, N.; Kate, A.; Schröder, D. Verifiable timed signatures made practical. In Proceedings of the 2020 ACM SIGSAC Conference on Computer and Communications Security, Virtual Event, 9–13 November 2020; pp. 1733–1750. [Google Scholar]
- Zhou, X.; He, D.; Ning, J.; Luo, M.; Huang, X. Efficient Construction of Verifiable Timed Signatures and Its Application in Scalable Payments. IEEE Trans. Inf. Forensics Secur. 2023, 18, 5345–5358. [Google Scholar] [CrossRef]
- Hearn, M.; Spilman, J. Bitcoin Contracts. 2015. Available online: https://en.bitcoin.it/wiki/Contracts (accessed on 8 October 2015).
- Ying, N.; Wu, T.W. Xlumi: Payment channel protocol and off-chain payment in blockchain contract systems. arXiv 2021, arXiv:2101.10621. [Google Scholar]
- Xu, S.; Yuan, J.; Li, Y.; Liu, X.; Zhang, Y. Super payment channel for decentralized cryptocurrencies. In Proceedings of the 2019 IEEE Conference on Dependable and Secure Computing (DSC), Hangzhou, China, 18–20 November 2019; pp. 1–8. [Google Scholar]
- Green, M.; Miers, I. Bolt: Anonymous payment channels for decentralized currencies. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, Dallas, TX, USA, 30 October–3 November 2017; pp. 473–489. [Google Scholar]
- Zhang, Y.; Long, Y.; Liu, Z.; Liu, Z.; Gu, D. Z-channel: Scalable and efficient scheme in zerocash. Comput. Secur. 2019, 86, 112–131. [Google Scholar] [CrossRef]
- Moreno-Sanchez, P.; Blue, A.; Le, D.V.; Noether, S.; Goodell, B.; Kate, A. DLSAG: Non-interactive refund transactions for interoperable payment channels in monero. In Financial Cryptography and Data Security, Proceedings of the 24th International Conference, FC 2020, Kota Kinabalu, Malaysia, 10–14 February 2020; Revised Selected Papers 24; Springer: Kota Kinabalu, Malaysia, 2020; pp. 325–345. [Google Scholar]
- Thyagarajan, S.A.; Malavolta, G.; Schmidt, F.; Schröder, D. Paymo: Payment Channels for Monero. Cryptol. ePrint Arch. 2020. Available online: https://eprint.iacr.org/2020/1441 (accessed on 28 December 2023).
- Pinto, A.M. An introduction to the use of zk-SNARKs in blockchains. In Mathematical Research for Blockchain Economy, Proceedings of the 1st International Conference MARBLE 2019, Santorini, Greece, 6–9 May 2019; Springer: Santorini, Greece, 2020; pp. 233–249. [Google Scholar]
- Groth, J.; Kohlweiss, M.; Maller, M.; Meiklejohn, S.; Miers, I. Updatable and universal common reference strings with applications to zk-SNARKs. In Proceedings of the Annual International Cryptology Conference, Santa Barbara, CA, USA, 19–23 August 2018; pp. 698–728. [Google Scholar]
- Fuchsbauer, G. Subversion-zero-knowledge SNARKs. In Public-Key Cryptography–PKC 2018, Proceedings of the 21st IACR International Conference on Practice and Theory of Public-Key Cryptography, Rio de Janeiro, Brazil, 25–29 March 2018; Proceedings, Part I 21; Springer: Atlanta, GA, USA, 2018; pp. 315–347. [Google Scholar]
- Ben-Saason, E.; Chiesa, A.; Genkin, D.; Kfir, S.; Tromer, E.; Virza, M. Libsnark: C++ Library for zkSNARK Proofs, 2014. Available online: https://github.com/clearmatics/libsnark (accessed on 28 December 2023).
- Groth, J. On the size of pairing-based non-interactive arguments. In Advances in Cryptology–EUROCRYPT 2016: Proceedings of the 35th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Vienna, Austria, 8–12 May 2016; Proceedings, Part II 35; Springer: Lyon, France, 2016; pp. 305–326. [Google Scholar]
- Groth, J.; Maller, M. Snarky signatures: Minimal signatures of knowledge from simulation-extractable SNARKs. In Proceedings of the Annual International Cryptology Conference, Santa Barbara, CA, USA, 20–24 August 2017; pp. 581–612. [Google Scholar]
- Parno, B.; Howell, J.; Gentry, C.; Raykova, M. Pinocchio: Nearly practical verifiable computation. Commun. ACM 2016, 59, 103–112. [Google Scholar] [CrossRef]
- Boneh, D.; Lynn, B.; Shacham, H. Short signatures from the Weil pairing. In Proceedings of the International Conference on the Theory and Application of Cryptology and Information Security, Guangzhou, China, 6–10 December 2001; pp. 514–532. [Google Scholar]
- Liu, S.; Wang, J. DMC: Decentralized Mixer with Channel for Transaction Privacy Protection on Ethereum. In Proceedings of the CS & IT Conference Proceedings, Sydney, Australia, 24–25 December 2021; Volume 11. [Google Scholar]
Channel Opening (On-Chain) | Channel Opening (Off-Chain) | Channel Update | |
---|---|---|---|
zk-APC | 224B | 5062B | 634B |
DMC | 288B | - | 256B |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Guo, Y.; Liang, H.; Zhu, L.; Gai, K. Zk-SNARKs-Based Anonymous Payment Channel in Blockchain. Blockchains 2024, 2, 20-39. https://doi.org/10.3390/blockchains2010002
Guo Y, Liang H, Zhu L, Gai K. Zk-SNARKs-Based Anonymous Payment Channel in Blockchain. Blockchains. 2024; 2(1):20-39. https://doi.org/10.3390/blockchains2010002
Chicago/Turabian StyleGuo, Yunwei, Haochen Liang, Liehuang Zhu, and Keke Gai. 2024. "Zk-SNARKs-Based Anonymous Payment Channel in Blockchain" Blockchains 2, no. 1: 20-39. https://doi.org/10.3390/blockchains2010002
APA StyleGuo, Y., Liang, H., Zhu, L., & Gai, K. (2024). Zk-SNARKs-Based Anonymous Payment Channel in Blockchain. Blockchains, 2(1), 20-39. https://doi.org/10.3390/blockchains2010002