Toward a Secure and Private Cross-Chain Protocol Based on Encrypted Communication
Abstract
:1. Introduction
1.1. Background and Motivation
1.2. Contributions
- Enhanced Security and Privacy: By employing the Paillier homomorphic encryption algorithm, we ensure that the locked transaction information is securely encrypted before being uploaded to the blockchain. This encryption protects the data from unauthorized access and tampering during transmission.
- Identity Privacy Protection: The integration of an identity authentication module prevents adversaries from masquerading as legitimate clients, thereby safeguarding the participants’ identities throughout the transaction process.
- Decentralization and Practical Deployment: ExchangeSC maintains the decentralized nature of blockchain technology and is designed for easy deployment in real-world scenarios. The system includes a reward and punishment mechanism to mitigate malicious behaviors by nodes, ensuring the integrity and reliability of cross-chain transactions.
- Performance Efficiency: Implementing ExchangeSC within the Ethereum Virtual Machine (EVM) has shown reasonable performance, with the time cost of cross-chain transactions being only marginally higher than that of the original protocol. Moreover, ExchangeSC outperforms established projects such as BitXHub in terms of security and time efficiency.
2. Related Knowledge
2.1. Blockchain Technology
2.2. Smart Contract
2.3. MA-HTLC
2.4. Paillier Homomorphic Encryption
2.4.1. Encryption and Decryption Process of the Paillier Algorithm
- (1)
- Key GenerationTwo large prime numbers p and q are randomly selected such that , where denotes the greatest common divisor of a and b. and are calculated, where denotes the least common multiple of a and b. is selected, and is satisfied. It is ensured that divides the order of by checking the existence of the following modular multiplicative inverse: , where . The public key is , and the private key is .
- (2)
- EncryptionLet m be the plaintext; a random number is selected. m is encrypted to obtain ciphertext c.
- (3)
- DecryptionLet c be the ciphertext, where . c is decrypted to obtain plaintext .
2.4.2. The Additive Homomorphism Property of Paillier’s Algorithm
3. ExchangeSC Design
3.1. Client Part
3.2. Paillier Encryption API Part
- (1)
- The signature information uploaded by the client is received and saved.
- (2)
- A Div interface is provided. The client first inputs into the API, then invokes Div to convert the hexadecimal hash value into a decimal number, and randomly decomposes it into the following two numbers in the form of addition for the subsequent encryption.
- (3)
- Clients are provided with the KeyGen interface to generate public and private key pairs () for Paillier encryption.
- (4)
- An encryption interface Enc and decryption interface Dec are provided. Clients can encrypt to by invoking Enc, and they can decrypt to plaintext information by invoking Dec. Finally, the decimal plaintext information is converted into a hexadecimal hash value to obtain .
3.3. Blockchain Part
- Registered deposit.
- Node address.
- The slowest service completion time.
- The number of completed services (initially 0, +1 after correct service completion, and −1 after incorrect service completion).
Algorithm 1 Registration |
Input parameters: node address, deposit, slowest service time Output: RegistrationInfor
|
Algorithm 2 Request |
Input: ciphertext, num participants, deposit requirement, service time requirement, slowest service time requirement Output:
|
- To deal with the improper behavior of miscalculation, we designed a service mode. When a service request is received, the smart contract selects the with service number n. Assuming that the returns two different results to through calculation, both results will be sent to the client’s local API. The client first decrypts the results of a larger number of calculations and decrypts another result if this fails. When the client completes this exchange service, it will broadcast the ciphertext information to the blockchain network. The node that does not participate in this service but has paid the deposit will calculate and send the report information to the smart contract. The report information includes the registered deposit and misconduct of the nodes. Similarly, the registration deposit of the reporting node is also more than the requirement, thus reducing the behavior of malicious reporting. Then, the smart contract check results show that if the does have the improper behavior of miscalculation, part of its registration deposit will be deducted from the reporting node.
- To deal with the improper behavior of providing a negative service, the nodes in the blockchain network can detect the service record and whether the returned the results within the shortest service time. If not, negative service behavior is found. The report information is sent to the smart contract, including the registered deposit and misconduct. Then, the smart contract checks the service record. If it is indeed as shown in the report information, the reporting node will obtain part of the deposit of the . Otherwise, it will deduct part of its deposit.
- Privacy: The blockchain protects the privacy of the client’s identity, and ordinary participating nodes cannot obtain relevant client information.
- Security: and in the blockchain cannot deduce any information related to plaintext information through ciphertext.
- Fairness: The blockchain’s reward and punishment mechanisms ensure the calculation results’ correctness. Malicious nodes will be detected after service, and their deposit will be deducted. At the same time, the blockchain also has a Report mechanism, and the whole process is recorded in the blockchain network, which means that malicious nodes that fail to provide services correctly for any reason will be detected by the smart contract and punished.
Algorithm 3 Report |
Input: registration deposit, improper behavior Output: reportInfor
|
3.4. Workflow of ExchangeSC
4. Correctness and Security Analysis
4.1. Correctness Analysis
4.2. Security Analysis
- The key of the encryption API is generated by the KGC, and both sides of the encryption API are deployed and synchronized by the KGC, which is a trusted party; the key is not disclosed to anyone after it is generated.
- No party in the blockchain network can control the vast majority of computing power, i.e., no 51% attack can be launched, so all transactions and actions of nodes are publicly recorded in the blockchain and are tamper-evident.
- The communication channel between the crypto API and the blockchain network is protected by SSL/TLS and cannot be tampered with or leaked to nodes in the blockchain.
- Since all actions of nodes are public in the blockchain network, their misbehaviors are recorded. The system’s reporting mechanism can detect these misbehaviors and punish nodes that have done so.
- The client’s identity information is not made public to the blockchain network but is sent by the API, which verifies the identity information. Therefore, an internal attacker cannot distinguish who it is actually providing services to, which effectively protects the privacy of the client’s identity.
5. Experiment and Performance Evaluation
5.1. Experimental Environment
5.2. Encryption API Simulation
5.3. Experiments on the Official Test Network
5.4. Verification Experiment on the Theorems
5.5. Cross-Chain Simulation
6. Conclusions and Further Work
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Ma, B.; Tao, Z.Q.; Ma, R.H.; Wang, C.P.; Li, J.; Li, X.L. A High-Performance Robust Reversible Data Hiding Algorithm Based on Polar Harmonic Fourier Moments. IEEE Trans. Circuits Syst. Video Technol. 2024, 34, 2763–2774. [Google Scholar] [CrossRef]
- Nakamoto, S. Bitcoin: A peer-to-peer electronic cash system. Decentralized Bus. Rev. 2008. [Google Scholar]
- Leng, J.; Zhou, M.; Zhao, J.L.; Huang, Y.; Bian, Y. Blockchain security: A survey of techniques and research directions. IEEE Trans. Serv. Comput. 2020, 15, 2490–2510. [Google Scholar] [CrossRef]
- Tian, Y.; Li, T.; Xiong, J.; Bhuiyan, M.Z.A.; Ma, J.; Peng, C. A blockchain-based machine learning framework for edge services in IIoT. IEEE Trans. Ind. Inform. 2021, 18, 1918–1929. [Google Scholar] [CrossRef]
- Cortes-Goicoechea, M.; Franceschini, L.; Bautista-Gomez, L. Resource analysis of Ethereum 2.0 clients. In Proceedings of the 2021 3rd Conference on Blockchain Research & Applications for Innovative Networks and Services (BRAINS), Paris, France, 27–30 September 2021; IEEE: Piscataway, NJ, USA, 2021; pp. 1–8. [Google Scholar]
- Aggarwal, S.; Kumar, N. Hyperledger. In Advances in Computers; Elsevier: Amsterdam, The Netherlands, 2021; Volume 121, pp. 323–343. [Google Scholar]
- Ou, W.; Huang, S.; Zheng, J.; Zhang, Q.; Zeng, G.; Han, W. An overview on cross-chain: Mechanism, platforms, challenges and advances. Comput. Netw. 2022, 218, 109378. [Google Scholar] [CrossRef]
- Neisse, R.; Hernández-Ramos, J.L.; Matheu-Garcia, S.N.; Baldini, G.; Skarmeta, A.; Siris, V.; Lagutin, D.; Nikander, P. An interledger blockchain platform for cross-border management of cybersecurity information. IEEE Internet Comput. 2020, 24, 19–29. [Google Scholar] [CrossRef]
- Scheid, E.J.; Kiechl, P.; Franco, M.; Rodrigues, B.; Killer, C.; Stiller, B. Security and standardization of a notary-based blockchain interoperability API. In Proceedings of the 2021 Third International Conference on Blockchain Computing and Applications (BCCA), Tartu, Estonia, 5–16 November 2021; IEEE: Piscataway, NJ, USA, 2021; pp. 42–48. [Google Scholar]
- Xiong, A.; Liu, G.; Zhu, Q.; Jing, A.; Loke, S.W. A notary group-based cross-chain mechanism. Digit. Commun. Netw. 2022, 8, 1059–1067. [Google Scholar] [CrossRef]
- Siris, V.A.; Nikander, P.; Voulgaris, S.; Fotiou, N.; Lagutin, D.; Polyzos, G.C. Interledger approaches. IEEE Access 2019, 7, 89948–89966. [Google Scholar] [CrossRef]
- Westerkamp, M.; Eberhardt, J. zkrelay: Facilitating sidechains using zksnark-based chain-relays. In Proceedings of the 2020 IEEE European Symposium on Security and Privacy Workshops (EuroS&PW), Genoa, Italy, 7–11 September 2020; IEEE: Piscataway, NJ, USA, 2020; pp. 378–386. [Google Scholar]
- Saleh, F. Blockchain without waste: Proof-of-stake. Rev. Financ. Stud. 2021, 34, 1156–1190. [Google Scholar] [CrossRef]
- Sliwinski, J.; Wattenhofer, R. Better incentives for proof-of-work. In Proceedings of the International Symposium on Stabilizing, Safety, and Security of Distributed Systems, Clermond Ferrand, France, 15–17 November 2022; Springer: Berlin/Heidelberg, Germany, 2022; pp. 314–328. [Google Scholar]
- Yin, L.; Xu, J.; Tang, Q. Sidechains with fast cross-chain transfers. IEEE Trans. Dependable Secur. Comput. 2021, 19, 3925–3940. [Google Scholar] [CrossRef]
- Herlihy, M. Atomic cross-chain swaps. In Proceedings of the 2018 ACM Symposium on Principles of Distributed Computing, Washington, DC, USA, 25–27 July 2018; pp. 245–254. [Google Scholar]
- Cai, J.; Zhou, Y.; Hu, T.; Li, B. PTLC: Protect the Identity Privacy during Cross-Chain Asset Transaction More Effectively. In Proceedings of the 2022 IEEE 22nd International Conference on Software Quality, Reliability, and Security Companion (QRS-C), Guangzhou, China, 5–9 December 2022; IEEE: Piscataway, NJ, USA, 2022; pp. 70–78. [Google Scholar]
- Monika; Bhatia, R.; Jain, A.; Singh, B. Hash time locked contract based asset exchange solution for probabilistic public blockchains. Clust. Comput. 2022, 25, 4189–4201. [Google Scholar] [CrossRef]
- Barbàra, F.; Schifanella, C. MP-HTLC: Enabling blockchain interoperability through a multiparty implementation of the hash time-lock contract. Concurr. Comput. Pract. Exp. 2023, 35, e7656. [Google Scholar] [CrossRef]
- Liu, F.; Zhang, J.; Zhou, J.; Li, M.; Kong, D.; Yang, J.; Qi, J.; Zhou, A. Novel hash-time-lock-contract based cross-chain token swap mechanism of blockchain. China J. Comput. Sci 2022, 49, 336–344. [Google Scholar]
- Jhanwar, M.P.; Venkateswarlu, A.; Safavi-Naini, R. Paillier-based publicly verifiable (non-interactive) secret sharing. Des. Codes Cryptogr. 2014, 73, 529–546. [Google Scholar] [CrossRef]
- Guerrero, J.; Chapman, A.C.; Verbič, G. Decentralized P2P energy trading under network constraints in a low-voltage network. IEEE Trans. Smart Grid 2018, 10, 5163–5173. [Google Scholar] [CrossRef]
- Zhao, Z.; Zhou, L.; Su, C. Systematic Research on Technology and Challenges of Lightning Network. In Proceedings of the 2021 IEEE Conference on Dependable and Secure Computing (DSC), Fukushima, Japan, 30 January–2 February 2021; IEEE: Piscataway, NJ, USA, 2021; pp. 1–8. [Google Scholar]
- Remix-Project. Available online: https://github.com/ethereum/remix-project (accessed on 2 July 2024).
- The Solidity Contract Oriented Programming Language. Available online: https://github.com/ethereum/solidity (accessed on 1 June 2023).
- Sepolia: Ethereum Official Testnet. Available online: https://sepolia.dev (accessed on 1 June 2023).
Operations | 512-Bit | 1024-Bit | 2048-Bit |
---|---|---|---|
0.018 | 0.018 | 0.019 | |
8.727 | 31.913 | 341.626 | |
1.597 | 9.648 | 71.619 | |
10.342 | 41.579 | 413.264 |
Field | Description |
---|---|
input 22 | |
A | set |
changing set | |
an element used to replace or add | |
Test | = | = Enc(∼) | True and False | |
---|---|---|---|---|
1 | 546…158 | 448…549 | 22 | Ture (✓) |
2 | 846…113 | 244…647 | 22 | Ture (✓) |
3 | 715…484 | 184…754 | 22 | Ture (✓) |
4 | 436…122 | 137…641 | 22 | Ture (✓) |
Test | True or False | |||
---|---|---|---|---|
1 | 386…754 | 16 | False (×) | |
2 | 911…521 | 25 | False (×) | |
3 | 315…775 | 21 | False (×) | |
3 | 476…667 | 23 | False (×) |
Test | True or False | |||
---|---|---|---|---|
1 | 9 | 228…697 | 13 | False (×) |
2 | 5 | 927…200 | 17 | False (×) |
3 | 2 | 466…454 | 20 | False (×) |
4 | 6 | 872…155 | 16 | False (×) |
Test | True or False | |||
---|---|---|---|---|
1 | 3 | 331…751 | 25 | False (×) |
2 | 4 | 275…312 | 26 | False (×) |
3 | 7 | 355…162 | 29 | False (×) |
4 | 8 | 390…661 | 30 | False (×) |
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
Wang, Y.; Chen, Z.; Ma, R.; Ma, B.; Xian, Y.; Li, Q. Toward a Secure and Private Cross-Chain Protocol Based on Encrypted Communication. Electronics 2024, 13, 3116. https://doi.org/10.3390/electronics13163116
Wang Y, Chen Z, Ma R, Ma B, Xian Y, Li Q. Toward a Secure and Private Cross-Chain Protocol Based on Encrypted Communication. Electronics. 2024; 13(16):3116. https://doi.org/10.3390/electronics13163116
Chicago/Turabian StyleWang, Yuli, Zhuo Chen, Ruihe Ma, Bin Ma, Yongjin Xian, and Qi Li. 2024. "Toward a Secure and Private Cross-Chain Protocol Based on Encrypted Communication" Electronics 13, no. 16: 3116. https://doi.org/10.3390/electronics13163116
APA StyleWang, Y., Chen, Z., Ma, R., Ma, B., Xian, Y., & Li, Q. (2024). Toward a Secure and Private Cross-Chain Protocol Based on Encrypted Communication. Electronics, 13(16), 3116. https://doi.org/10.3390/electronics13163116