[go: up one dir, main page]

CN116388957A - A blockchain-based off-chain expansion technology - Google Patents

A blockchain-based off-chain expansion technology Download PDF

Info

Publication number
CN116388957A
CN116388957A CN202310320042.2A CN202310320042A CN116388957A CN 116388957 A CN116388957 A CN 116388957A CN 202310320042 A CN202310320042 A CN 202310320042A CN 116388957 A CN116388957 A CN 116388957A
Authority
CN
China
Prior art keywords
chain
expansion
channel
blockchain
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310320042.2A
Other languages
Chinese (zh)
Inventor
邱望洁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beihang University
Original Assignee
Beihang University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beihang University filed Critical Beihang University
Priority to CN202310320042.2A priority Critical patent/CN116388957A/en
Publication of CN116388957A publication Critical patent/CN116388957A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/20Network architectures or network communication protocols for network security for managing network security; network security policies in general
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

本发明公开了一种基于区块链的链下扩容技术,包括区块链链下扩容方案、基于等离子智能合约的数据完整性审计协议、批审计方案和安全定义,所述区块链链下扩容方案包括0层扩容、链上扩容和链下扩容,所述0层扩容通过改变区块链的底层数据传输协议来提高区块链的可扩展性;所述链上扩容包括数据层改进方案、共识层改进方案和网络层改进方案;所述链下扩容是在应用层进行更改以提高可扩展性。本发明采用上述一种基于区块链的链下扩容技术,增强隐私保护,降低网络时延,提高处理效率,通过将链上的交易过程转移到线下进行,降低存储和计算成本。

Figure 202310320042

The invention discloses a blockchain-based off-chain expansion technology, including a blockchain off-chain expansion scheme, a data integrity audit protocol based on a plasma smart contract, a batch audit scheme, and a security definition. The expansion plan includes 0-layer expansion, on-chain expansion and off-chain expansion. The 0-layer expansion improves the scalability of the blockchain by changing the underlying data transmission protocol of the blockchain; the on-chain expansion includes the data layer improvement plan , consensus layer improvement plan and network layer improvement plan; the off-chain expansion is to make changes in the application layer to improve scalability. The present invention adopts the above-mentioned block chain-based off-chain expansion technology to enhance privacy protection, reduce network delay, improve processing efficiency, and reduce storage and computing costs by transferring the transaction process on the chain to offline.

Figure 202310320042

Description

一种基于区块链的链下扩容技术A blockchain-based off-chain expansion technology

技术领域technical field

本发明涉及区块链技术领域,尤其是涉及一种基于区块链的链下扩容技术。The invention relates to the technical field of block chains, in particular to a block chain-based off-chain expansion technology.

背景技术Background technique

区块链是一种基于分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用体系。它本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。狭义来讲,区块链是一种按照时间顺序将数据区块以顺序相连的方式组合成的一种链式数据结构,并以密码学方式保证的不可篡改和不可伪造的分布式账本。广义来讲,区块链技术是利用块链式数据结构来验证与存储数据、利用分布式节点共识算法来生成和更新数据、利用密码学的方式保证数据传输和访问的安全、利用由自动化脚本代码组成的智能合约来编程和操作数据的一种全新的分布式基础架构与计算方式。Blockchain is a new application system based on distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and other computer technologies. It is essentially a decentralized database, which is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting ) and generate the next block. In a narrow sense, the blockchain is a chained data structure that combines data blocks in a sequential manner in chronological order, and is cryptographically guaranteed to be tamper-proof and unforgeable distributed ledgers. Broadly speaking, blockchain technology uses block chain data structures to verify and store data, uses distributed node consensus algorithms to generate and update data, uses cryptography to ensure the security of data transmission and access, and uses automated scripts to A new distributed infrastructure and computing method for programming and manipulating data through smart contracts composed of code.

目前为止,区块链的影响范畴已经不仅仅是针对于金融系统的革新,其对互联网的重构以及对整个产业结构的重塑已经成为当前最为热门的话题之一。So far, the scope of influence of the blockchain is not only aimed at the innovation of the financial system, but its reconstruction of the Internet and the reshaping of the entire industrial structure has become one of the most popular topics at present.

现行长安链网络中的共识节点需参与共识流程中通信消息和账本的同步,因此共识存在着一定的时延。同时,面对大规模交易带来的数据存储负担、加密解密计算量负担,交易处理效率也存在着瓶颈。对于数据存储资源有限的问题,众多企业和个人都选择将数据存储在云服务器上。虽然云计算是一种基于大型共享虚拟化计算资源池的分布式计算模型,它可以帮助用户使用强大的计算和存储资源,大大减轻用户在硬件和软件上的数据存储负担。但是,其安全性、可靠性和隐私一直是一个严重的问题。The consensus nodes in the current Changan chain network need to participate in the synchronization of communication messages and ledgers in the consensus process, so there is a certain delay in the consensus. At the same time, in the face of the data storage burden and encryption and decryption calculation burden brought by large-scale transactions, there is also a bottleneck in transaction processing efficiency. For the problem of limited data storage resources, many enterprises and individuals choose to store data on cloud servers. Although cloud computing is a distributed computing model based on a large pool of shared virtualized computing resources, it can help users use powerful computing and storage resources, and greatly reduce the user's data storage burden on hardware and software. However, its security, reliability and privacy have been a serious concern.

在用户将数据存储在云服务器上之后,服务器提供商可能会由于各种因素损坏或删除用户数据,验证外包数据的完整性成为云存储中的关键问题。远程数据完整性审计技术非常方便和安全,可以帮助用户检查外包存储的数据的完整性。因此云数据安全的本质是云存储提供商(CSP)如何与用户建立信任。云设备故障、非法攻击和CSP可能被贿赂以查看用户数据,所有这些都可能导致非法侵犯用户数据。After users store data on cloud servers, server providers may damage or delete user data due to various factors, and verifying the integrity of outsourced data becomes a key issue in cloud storage. Remote data integrity auditing technology is very convenient and secure, and can help users check the integrity of outsourced stored data. Therefore, the essence of cloud data security is how cloud storage providers (CSPs) establish trust with users. Cloud device failures, illegal attacks, and the possibility of CSPs being bribed to view user data, all of which can lead to illegal violations of user data.

区块链具有去中心化、抗篡改、一致性和可追溯性。因此,存储在区块链上的信息是公开和透明的。尽管使用区块链作为可信的第三方审计可以解决很多问题,但区块的快速增长将导致区块链网络维护和用户创建新区块的高成本。Blockchain is decentralized, tamper-resistant, consistent and traceable. Therefore, the information stored on the blockchain is open and transparent. Although using the blockchain as a trusted third-party audit can solve many problems, the rapid growth of blocks will lead to high costs for blockchain network maintenance and users to create new blocks.

发明内容Contents of the invention

本发明的目的是提供一种基于区块链的链下扩容技术,增强隐私保护,降低网络时延,提高处理效率,通过将链上的交易过程转移到线下进行,降低存储和计算成本。The purpose of the present invention is to provide a block chain-based off-chain capacity expansion technology, enhance privacy protection, reduce network delay, improve processing efficiency, and reduce storage and computing costs by transferring the transaction process on the chain to offline.

为实现上述目的,本发明提供了一种基于区块链的链下扩容技术,包括区块链链下扩容方案、基于等离子智能合约的数据完整性审计协议、批审计方案和安全定义,所述区块链链下扩容方案包括0层扩容、链上扩容和链下扩容,所述0层扩容通过改变区块链的底层数据传输协议来提高区块链的可扩展性;所述链上扩容包括数据层改进方案、共识层改进方案和网络层改进方案;所述链下扩容是在应用层进行更改以提高可扩展性。In order to achieve the above purpose, the present invention provides a blockchain-based off-chain expansion technology, including a blockchain off-chain expansion scheme, a data integrity audit protocol based on a plasma smart contract, a batch audit scheme, and a security definition. The blockchain off-chain expansion scheme includes 0-layer expansion, on-chain expansion and off-chain expansion. The 0-layer expansion improves the scalability of the blockchain by changing the underlying data transmission protocol of the blockchain; the on-chain expansion Including data layer improvement plan, consensus layer improvement plan and network layer improvement plan; the off-chain expansion is to make changes in the application layer to improve scalability.

优选的,所述基于等离子智能合约的数据完整性审计协议是通过引入等离子子链并在链上和链下部署智能合约,以低计算和通信开销执行。Preferably, the data integrity audit protocol based on Plasma smart contracts is implemented with low computing and communication overhead by introducing Plasma sub-chains and deploying smart contracts on-chain and off-chain.

优选的,所述批审计方案可以同时批处理多个审计任务并引入非交互式审计的概念。Preferably, the batch audit solution can batch process multiple audit tasks at the same time and introduce the concept of non-interactive audit.

优选的,所述安全定义使任何伪造的证明都不能以不可忽略的概率通过验证,保障了数据的安全性。Preferably, the security definition makes it impossible for any forged certificate to pass the verification with a non-negligible probability, thereby ensuring the security of data.

优选的,所述链下扩容由链下交易、链下共识和链上通道合约组成。Preferably, the off-chain expansion consists of off-chain transactions, off-chain consensus and on-chain channel contracts.

优选的,所述链下扩容方法包括以下步骤:Preferably, the off-chain expansion method includes the following steps:

(1)在链上创建通道,然后在通道内进行数据交互,最后关闭通道并提交最新状态到链上清算,其中在通道内的数据交互和链下状态更新都无需进行区块链共识;(1) Create a channel on the chain, then perform data interaction in the channel, and finally close the channel and submit the latest status to the chain for liquidation, in which data interaction in the channel and off-chain status updates do not require blockchain consensus;

(2)基于哈希时间锁机制,在创建通道时形成各方的资产证明,用以监察交易各方数据,基于领导者重要性评分机制选举可信节点,对通道各方的交易行为进行监督,以保证通道内信息交互行为安全可控,构建高效可靠的多人链下即时交互网络,把高频交易从链上转移到链下通道进行处理,卸载链上事务处理压力;(2) Based on the hash time lock mechanism, asset certificates of all parties are formed when the channel is created to monitor the data of all parties to the transaction, and trusted nodes are elected based on the leader importance scoring mechanism to supervise the transaction behavior of all parties to the channel , to ensure the safety and controllability of information interaction behavior in the channel, build an efficient and reliable multi-person off-chain real-time interaction network, transfer high-frequency transactions from the chain to the off-chain channel for processing, and offload the transaction processing pressure on the chain;

(3)把链下的海量的交易组织成默克尔树,通过新型默克尔树数据结构,把海量的链下数据和复杂的链下业务流程以默克尔树根哈希的形式映射到链上,提高链上数据摘要和链下数据的一致性和业务执行的完整性的验证效率;(3) Organize massive off-chain transactions into Merkle trees, and map massive off-chain data and complex off-chain business processes in the form of Merkle tree root hashes through the new Merkle tree data structure To the chain, improve the consistency of the data summary on the chain and the data off the chain and the verification efficiency of the integrity of business execution;

(4)用链上合约来管理节点的信用值,通过设置初始通道节点的权限,让通道管理员对申请进入通道的节点进行审核,结合链上合约审计功能来决定节点是否可以进入;(4) Use the contract on the chain to manage the credit value of the node. By setting the authority of the initial channel node, the channel administrator can review the nodes that apply to enter the channel, and combine the contract audit function on the chain to determine whether the node can enter;

(5)节点退出机制依靠链下合约审计机制,通过链下合约对节点的事物进行审计,计算是否存在未完成的事物,并且保留一段时间给链下的节点或者监督节点提出异议,如果都没有,则对链下的事务进行清算,把结果进行上链,节点退出通道。(5) The node exit mechanism relies on the off-chain contract audit mechanism to audit the node's affairs through the off-chain contract, calculate whether there are unfinished things, and reserve a period of time for the off-chain nodes or supervisory nodes to raise objections. , the transaction under the chain is liquidated, the result is uploaded to the chain, and the node exits the channel.

本发明所述的一种基于区块链的链下扩容技术的优点和积极效果是:The advantages and positive effects of a blockchain-based off-chain expansion technology described in the present invention are:

1.增强隐私保护,采用链下通道隔离技术,解决了长安链链上交易存在的隐私泄露问题。1. Enhance privacy protection, adopt off-chain channel isolation technology, and solve the privacy leakage problem existing in transactions on the Changan chain.

2.降低网络时延,通过高安全、高可用、高性能的链上链下协作体系和参与节点的动态增删机制,使部分节点能够利用链下网络快速、高效、安全地处理交易,整体降低长安链网络的时延和大规模节点组网能力。2. Reduce network delay, through the highly secure, highly available, high-performance on-chain and off-chain collaboration system and the dynamic addition and deletion mechanism of participating nodes, so that some nodes can use the off-chain network to process transactions quickly, efficiently and safely, reducing the overall The latency and large-scale node networking capabilities of the Changan chain network.

3.提高处理效率,构建高效可靠的多人链下即时交互网络,把高频交易从链上转移到链下通道进行处理,卸载链上事务处理压力,提升系统事务处理效率。3. Improve processing efficiency, build an efficient and reliable real-time multi-person off-chain interactive network, transfer high-frequency transactions from on-chain to off-chain channels for processing, offload transaction processing pressure on the chain, and improve system transaction processing efficiency.

下面通过附图和实施例,对本发明的技术方案做进一步的详细描述。The technical solutions of the present invention will be described in further detail below with reference to the accompanying drawings and embodiments.

附图说明Description of drawings

图1为本发明一种基于区块链的链下扩容技术中的链上链下交互图;Fig. 1 is an on-chain and off-chain interaction diagram in a blockchain-based off-chain expansion technology of the present invention;

图2为本发明一种基于区块链的链下扩容技术中的交易流程图;Fig. 2 is a transaction flow chart in a blockchain-based off-chain expansion technology of the present invention;

图3为本发明一种基于区块链的链下扩容技术中的链下交易过程图;FIG. 3 is a diagram of the off-chain transaction process in a blockchain-based off-chain expansion technology of the present invention;

图4为本发明一种基于区块链的链下扩容技术中的链下共识过程图;Fig. 4 is a block chain-based off-chain consensus process diagram in the off-chain expansion technology of the present invention;

图5为本发明一种基于区块链的链下扩容技术中的合约判断流程图。Fig. 5 is a flow chart of contract judgment in a blockchain-based off-chain expansion technology of the present invention.

具体实施方式Detailed ways

以下通过附图和实施例对本发明的技术方案作进一步说明。The technical solutions of the present invention will be further described below through the accompanying drawings and embodiments.

除非另外定义,本发明使用的技术术语或者科学术语应当为本发明所属领域内具有一般技能的人士所理解的通常意义。Unless otherwise defined, the technical terms or scientific terms used in the present invention shall have the usual meanings understood by those skilled in the art to which the present invention belongs.

实施例Example

一种基于区块链的链下扩容技术,包括区块链链下扩容方案、基于等离子智能合约的数据完整性审计协议、批审计方案和安全定义,区块链链下扩容方案包括0层扩容、链上扩容和链下扩容,0层扩容通过改变区块链的底层数据传输协议来提高区块链的可扩展性。A blockchain-based off-chain expansion technology, including a blockchain off-chain expansion scheme, a data integrity audit protocol based on a plasma smart contract, a batch audit scheme, and security definitions. The blockchain off-chain expansion scheme includes 0-layer expansion , On-chain expansion and off-chain expansion, 0-layer expansion improves the scalability of the blockchain by changing the underlying data transmission protocol of the blockchain.

链上扩容包括数据层改进方案、共识层改进方案和网络层改进方案,增加块大小(直接或间接)或减少块验证传播时间和共识形成时间。链下扩容不会改变基本协议,而是在应用层进行更改以提高可扩展性。链下扩容主要包括四种方法:状态通道、侧链、交叉链和链下计算,将一些链上交易转移到链下执行,以减轻链上的处理压力,提高整体效率。在提高区块链性能的同时,链下扩容技术考虑了去中心化和安全性,并具有各种优异的性能。On-chain expansion includes data layer improvement plan, consensus layer improvement plan and network layer improvement plan, increasing block size (directly or indirectly) or reducing block verification propagation time and consensus formation time. Off-chain scaling does not change the base protocol, but changes are made at the application layer to improve scalability. Off-chain expansion mainly includes four methods: state channels, side chains, cross-chains, and off-chain calculations. Some on-chain transactions are transferred to off-chain execution to reduce the processing pressure on the chain and improve overall efficiency. While improving the performance of the blockchain, the off-chain expansion technology considers decentralization and security, and has various excellent performances.

基于等离子智能合约的数据完整性审计协议是通过引入等离子子链并在链上和链下部署智能合约,以低计算和通信开销执行。The data integrity audit protocol based on the Plasma smart contract is implemented with low computing and communication overhead by introducing the Plasma sub-chain and deploying smart contracts on-chain and off-chain.

批审计方案可以同时批处理多个审计任务并引入非交互式审计的概念。为了尽可能避免在审计过程中由于与CSP的沟通而影响用户体验,引入了非交互式审计的概念。为了保证审计的正确性,采用了奖励池机制,验证节点可以获得合理的奖励。The batch audit scheme can batch process multiple audit tasks at the same time and introduce the concept of non-interactive audit. In order to avoid affecting user experience due to communication with CSP during the audit process, the concept of non-interactive audit is introduced. In order to ensure the correctness of the audit, a reward pool mechanism is adopted, and the verification nodes can obtain reasonable rewards.

安全定义使任何伪造的证明都不能以不可忽略的概率通过验证,保障了数据的安全性。The security definition prevents any forged proof from passing the verification with a non-negligible probability, ensuring data security.

链下扩容的方法,包括以下步骤:The method of off-chain expansion includes the following steps:

(1)在链上创建通道,然后在通道内进行数据交互,最后关闭通道并提交最新状态到链上清算,其中在通道内的数据交互和链下状态更新都无需进行区块链共识;(1) Create a channel on the chain, then perform data interaction in the channel, and finally close the channel and submit the latest status to the chain for liquidation, in which data interaction in the channel and off-chain status updates do not require blockchain consensus;

(2)基于哈希时间锁机制,在创建通道时形成各方的资产证明,用以监察交易各方数据,基于领导者重要性评分机制选举可信节点,对通道各方的交易行为进行监督,以保证通道内信息交互行为安全可控,构建高效可靠的多人链下即时交互网络,把高频交易从链上转移到链下通道进行处理,卸载链上事务处理压力;(2) Based on the hash time lock mechanism, asset certificates of all parties are formed when the channel is created to monitor the data of all parties to the transaction, and trusted nodes are elected based on the leader importance scoring mechanism to supervise the transaction behavior of all parties to the channel , to ensure the safety and controllability of information interaction behavior in the channel, build an efficient and reliable multi-person off-chain real-time interaction network, transfer high-frequency transactions from the chain to the off-chain channel for processing, and offload the transaction processing pressure on the chain;

(3)把链下的海量的交易组织成默克尔树,通过新型默克尔树数据结构,把海量的链下数据和复杂的链下业务流程以默克尔树根哈希的形式映射到链上,提高链上数据摘要和链下数据的一致性和业务执行的完整性的验证效率;(3) Organize massive off-chain transactions into Merkle trees, and map massive off-chain data and complex off-chain business processes in the form of Merkle tree root hashes through the new Merkle tree data structure To the chain, improve the consistency of the data summary on the chain and the data off the chain and the verification efficiency of the integrity of business execution;

(4)用链上合约来管理节点的信用值,通过设置初始通道节点的权限,让通道管理员对申请进入通道的节点进行审核,结合链上合约审计功能来决定节点是否可以进入;(4) Use the contract on the chain to manage the credit value of the node. By setting the authority of the initial channel node, the channel administrator can review the nodes that apply to enter the channel, and combine the contract audit function on the chain to determine whether the node can enter;

(5)节点退出机制依靠链下合约审计机制,通过链下合约对节点的事物进行审计,计算是否存在未完成的事物,并且保留一段时间给链下的节点或者监督节点提出异议,如果都没有,则对链下的事务进行清算,把结果进行上链,节点退出通道。(5) The node exit mechanism relies on the off-chain contract audit mechanism to audit the node's affairs through the off-chain contract, calculate whether there are unfinished things, and reserve a period of time for the off-chain nodes or supervisory nodes to raise objections. , the transaction under the chain is liquidated, the result is uploaded to the chain, and the node exits the channel.

链下扩容由链下交易、链下共识和链上通道合约组成。领导者节点组织链下的交易和共识过程,当领导者的更新提议得到全部用户的投票后,把链下检查点提交到链上通道智能合约,链下通道的主要流程如图1所示。Off-chain expansion consists of off-chain transactions, off-chain consensus, and on-chain channel contracts. The leader node organizes the off-chain transaction and consensus process. When the leader’s update proposal is voted by all users, the off-chain checkpoint is submitted to the on-chain channel smart contract. The main process of the off-chain channel is shown in Figure 1.

1、交易发起用户1向用户3发起转账请求;1. Transaction initiating user 1 initiates a transfer request to user 3;

2、交易收款用户2对这笔交易的签名表示同意交易,并返回给用户1;2. The transaction receiving user 2 agrees to the transaction with the signature of the transaction, and returns it to user 1;

3、交易发起者用户1向领导者提交附有双方签名的交易;3. User 1, the transaction initiator, submits a transaction signed by both parties to the leader;

4、领导者对该笔交易的合法性检查无误后回复交易回执。4. The leader returns the transaction receipt after checking the legality of the transaction.

经过一个轮次(多笔交易)的链下交易后进入链下共识阶段:After one round (multiple transactions) of off-chain transactions, enter the off-chain consensus stage:

1、领导者发布检查点更新提案;1. The leader issues a checkpoint update proposal;

2、其他用户收到提案后,回复对该提案的签名表示对该提案的投票;2. After receiving the proposal, other users reply to the signature of the proposal to express their vote on the proposal;

3、领导者获得全部用户的投票后把提交检查点到链上通道合约,或超时未收集,则领导者节点调用合约查看是否有挑战者。3. After the leader obtains the votes of all users, he submits the checkpoint to the channel contract on the chain, or if it fails to collect after a timeout, the leader node calls the contract to check whether there is a challenger.

4、当链下出现共识争议,挑战者节点提交当前轮次涉及自己的所有交易构造的默克尔树,领导者节点提交当前轮次涉及挑战者节点的所有交易构造的默克尔树,交由链上合约解决争议(如图2所示)。4. When there is a consensus dispute under the chain, the challenger node submits the Merkle tree constructed by all transactions involving itself in the current round, and the leader node submits the Merkle tree constructed by all transactions involving the challenger node in the current round. Disputes are resolved by on-chain contracts (as shown in Figure 2).

链下交易过程:Off-chain transaction process:

链下交易模块实现了安链链下通道内交易的功能,链下交易与链上交易解耦,链下交易结构定义区别于链上交易结构,只将链下阶段性的用户状态通过链上交易存区块链。链下交易具体流程如图3所示。The off-chain transaction module realizes the transaction function in the off-chain channel of Anchain. The off-chain transaction is decoupled from the on-chain transaction. The definition of off-chain transaction structure is different from the on-chain transaction structure. Transactions are stored on the blockchain. The specific process of off-chain transactions is shown in Figure 3.

1.用户向交易接收方请求构建交易。链下交易发送方随机生成一个唯一的uuid对交易进行构造,设置交易的发送方、接收方、支付金额和其他状态参数,并对交易进行签名,最后向接收方发送此交易,请求其对交易进行签名。1. The user requests the transaction recipient to construct a transaction. The off-chain transaction sender randomly generates a unique uuid to construct the transaction, sets the sender, receiver, payment amount and other status parameters of the transaction, signs the transaction, and finally sends the transaction to the receiver, requesting it to verify the transaction to sign.

2.接收方响应构建交易请求。接收方接到发送方构建交易的请求后,验证发送方交易签名,若验证通过,则使用其私钥对交易签名,并将具有交易双方签名的交易发送给领导者。2. The receiver responds to the construction transaction request. After receiving the sender's request to construct a transaction, the receiver verifies the sender's transaction signature. If the verification is passed, it uses its private key to sign the transaction and sends the transaction signed by both parties to the leader.

3.领导者向交易双方响应确认交易。当前领导者收到带有双方签名的交易,验证交易双方签名,若验证通过,领导者将使用其私钥对交易进行签名,签名后向交易双方响应确认信息。3. The leader responds to both parties to confirm the transaction. The current leader receives the transaction with the signatures of both parties, and verifies the signatures of both parties. If the verification is passed, the leader will use its private key to sign the transaction, and then respond to the confirmation information to both parties after signing.

链下共识过程Off-chain consensus process

1.当前epoch的leader节点在交易周期结束时驱动通道进入共识阶段,首先leader节点计算当前epoch的最终状态,包括当前epoch、下个周期leaderId、所有通道参与者的余额、节点退出集合。leader将最终状态在通道中进行广播,并等待接收通道参与者对最终状态的签名。1. The leader node of the current epoch drives the channel to enter the consensus stage at the end of the transaction cycle. First, the leader node calculates the final state of the current epoch, including the current epoch, the leaderId of the next cycle, the balance of all channel participants, and the node exit set. The leader broadcasts the final state in the channel and waits to receive the signature of the final state from the channel participants.

2.通道参与者从leader节点接收到当前epoch的最终状态,需验证的余额是否正确,若验证通过,通道参与者对最终状态进行签名,并将此签名发送给leader节点,等待leader节点的状态确认消息。2. The channel participant receives the final state of the current epoch from the leader node, and the balance to be verified is correct. If the verification is passed, the channel participant signs the final state and sends the signature to the leader node, waiting for the status of the leader node Confirm the message.

3.leader节点接收到所有通道参与者的签名并验证,若验证签名通过后,将一个包含最终状态和所有通道参与者对状态签名的确认消息广播给所有参与者,以完成当前的epoch,至此,多人通道的参与者即可进入下一个epoch。3. The leader node receives and verifies the signatures of all channel participants. If the signature is verified, it broadcasts a confirmation message containing the final state and all channel participants’ signatures to the state to all participants to complete the current epoch. , the participants of the multi-person channel can enter the next epoch.

链上通道智能合约On-chain channel smart contract

链上通道合约作为连接链与链下通道的桥梁,它的功能主要是是记录链下通道的交易情况和行为,同时为关键的链上操作提供执行的完整性和正确性保证。部署在链上的通道智能合约能够保证用户挑战时的正确性(如图5所示)。The on-chain channel contract serves as a bridge connecting the chain and the off-chain channel. Its function is mainly to record the transactions and behaviors of the off-chain channel, and at the same time provide the integrity and correctness guarantee for the execution of key on-chain operations. The channel smart contract deployed on the chain can guarantee the correctness of the user's challenge (as shown in Figure 5).

1.先判断双方提交的默克尔树根是否相同,如果相同,则认为领导者正确。这里分情况讨论,第一种情况,挑战者没有作弊,提交了涉及的所有交易,那么领导者节点提交的该挑战者的交易和挑战者相同,则认为所有交易都正确,挑战者发起无意义挑战,领导者正确,第二种情况,挑战者作弊,隐瞒部分交易,领导者节点提交的该挑战者的交易和挑战者不相同,由于挑战者作弊,则领导者节点正确。1. First judge whether the Merkel tree roots submitted by both parties are the same, if they are the same, the leader is considered correct. Here we discuss different situations. In the first case, the challenger did not cheat and submitted all the transactions involved. Then the challenger’s transaction submitted by the leader node is the same as the challenger’s. All transactions are considered correct, and the challenger’s initiation is meaningless. In the challenge, the leader is correct. In the second case, the challenger cheats and conceals some transactions. The challenger’s transaction submitted by the leader node is different from the challenger’s. Since the challenger cheated, the leader node is correct.

2.若默克尔树根不同,则判断交易数量相同部分是否相同,若不同,则开始验证交易不同部分及后面所有交易签名,若相同则判断交易数量是否相同,若相同则认为领导者正确,否则也开始验证交易不同部分及后面所有交易签名。2. If the Merkle tree roots are different, then judge whether the part with the same transaction quantity is the same, if not, start to verify the different parts of the transaction and all subsequent transaction signatures, if they are the same, judge whether the transaction quantity is the same, if they are the same, the leader is considered correct , otherwise it also starts to verify different parts of the transaction and all subsequent transaction signatures.

3.若挑战者提交交易签名有问题,则领导者正确,否则判断领导者提交交易,若领导者提交交易签名有问题,则挑战者正确,都正确,则判断交易数量。3. If there is a problem with the transaction signature submitted by the challenger, then the leader is correct; otherwise, it is judged that the leader submitted the transaction;

4.若挑战者提交的交易数量多,则挑战者正确,否则领导者正确。4. If the number of transactions submitted by the challenger is large, the challenger is correct, otherwise the leader is correct.

5.领导者正确,则领导者提交该阶段状态到链上通道合约,若挑战者正确,则回滚该阶段状态,选择新的领导者重新开始本阶段交易。5. If the leader is correct, the leader submits the state of this stage to the channel contract on the chain. If the challenger is correct, the state of this stage is rolled back, and a new leader is selected to restart the transaction of this stage.

因此,本发明采用上述一种基于区块链的链下扩容技术,增强隐私保护,降低网络时延,提高处理效率,通过将链上的交易过程转移到线下进行,降低存储和计算成本。Therefore, the present invention adopts the above-mentioned block chain-based off-chain expansion technology to enhance privacy protection, reduce network delay, improve processing efficiency, and reduce storage and computing costs by transferring the transaction process on the chain to offline.

最后应说明的是:以上实施例仅用以说明本发明的技术方案而非对其进行限制,尽管参照较佳实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对本发明的技术方案进行修改或者等同替换,而这些修改或者等同替换亦不能使修改后的技术方案脱离本发明技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that: it still Modifications or equivalent replacements can be made to the technical solutions of the present invention, and these modifications or equivalent replacements cannot make the modified technical solutions deviate from the spirit and scope of the technical solutions of the present invention.

Claims (6)

1.一种基于区块链的链下扩容技术,其特征在于:包括区块链链下扩容方案、基于等离子智能合约的数据完整性审计协议、批审计方案和安全定义,所述区块链链下扩容方案包括0层扩容、链上扩容和链下扩容,所述0层扩容通过改变区块链的底层数据传输协议来提高区块链的可扩展性;所述链上扩容包括数据层改进方案、共识层改进方案和网络层改进方案;所述链下扩容是在应用层进行更改以提高可扩展性。1. A blockchain-based capacity expansion technology, characterized in that it includes a blockchain capacity expansion scheme, a data integrity audit protocol based on a plasma smart contract, a batch audit scheme, and a security definition. The off-chain expansion scheme includes 0-layer expansion, on-chain expansion and off-chain expansion. The 0-layer expansion improves the scalability of the blockchain by changing the underlying data transmission protocol of the blockchain; the on-chain expansion includes the data layer Improvement plan, consensus layer improvement plan and network layer improvement plan; the off-chain expansion is to make changes at the application layer to improve scalability. 2.根据权利要求1所述的一种基于区块链的链下扩容技术,其特征在于:所述基于等离子智能合约的数据完整性审计协议是通过引入等离子子链并在链上和链下部署智能合约,以低计算和通信开销执行。2. A block chain-based off-chain expansion technology according to claim 1, characterized in that: the data integrity audit protocol based on the plasma smart contract is implemented by introducing a plasma sub-chain and on-chain and off-chain Deploy smart contracts for execution with low computational and communication overhead. 3.根据权利要求1所述的一种基于区块链的链下扩容技术,其特征在于:所述批审计方案可以同时批处理多个审计任务并引入非交互式审计的概念。3. A blockchain-based off-chain expansion technology according to claim 1, characterized in that: the batch audit scheme can batch process multiple audit tasks at the same time and introduce the concept of non-interactive audit. 4.根据权利要求1所述的一种基于区块链的链下扩容技术,其特征在于:所述安全定义使任何伪造的证明都不能以不可忽略的概率通过验证,保障了数据的安全性。4. A block chain-based off-chain expansion technology according to claim 1, characterized in that: the security definition prevents any forged proof from passing verification with a non-negligible probability, ensuring data security . 5.根据权利要求1所述的一种基于区块链的链下扩容技术,其特征在于:所述链下扩容由链下交易、链下共识和链上通道合约组成。5. A blockchain-based off-chain expansion technology according to claim 1, characterized in that: the off-chain expansion consists of off-chain transactions, off-chain consensus and on-chain channel contracts. 6.根据权利要求1所述的一种基于区块链的链下扩容技术,其特征在于,所述链下扩容包括以下步骤:6. A blockchain-based off-chain expansion technology according to claim 1, wherein the off-chain expansion comprises the following steps: (1)在链上创建通道,然后在通道内进行数据交互,最后关闭通道并提交最新状态到链上清算,其中在通道内的数据交互和链下状态更新都无需进行区块链共识;(1) Create a channel on the chain, then perform data interaction in the channel, and finally close the channel and submit the latest status to the chain for liquidation, in which data interaction in the channel and off-chain status updates do not require blockchain consensus; (2)基于哈希时间锁机制,在创建通道时形成各方的资产证明,用以监察交易各方数据,基于领导者重要性评分机制选举可信节点,对通道各方的交易行为进行监督,以保证通道内信息交互行为安全可控,构建高效可靠的多人链下即时交互网络,把高频交易从链上转移到链下通道进行处理,卸载链上事务处理压力;(2) Based on the hash time lock mechanism, asset certificates of all parties are formed when the channel is created to monitor the data of all parties to the transaction, and trusted nodes are elected based on the leader importance scoring mechanism to supervise the transaction behavior of all parties to the channel , to ensure the safety and controllability of information interaction behavior in the channel, build an efficient and reliable multi-person off-chain real-time interaction network, transfer high-frequency transactions from the chain to the off-chain channel for processing, and offload the transaction processing pressure on the chain; (3)把链下的海量的交易组织成默克尔树,通过新型默克尔树数据结构,把海量的链下数据和复杂的链下业务流程以默克尔树根哈希的形式映射到链上,提高链上数据摘要和链下数据的一致性和业务执行完整性的验证效率;(3) Organize massive off-chain transactions into Merkle trees, and map massive off-chain data and complex off-chain business processes in the form of Merkle tree root hashes through the new Merkle tree data structure To the chain, improve the consistency of the data summary on the chain and the data off the chain and the verification efficiency of the integrity of business execution; (4)用链上合约来管理节点的信用值,通过设置初始通道节点的权限,让通道管理员对申请进入通道的节点进行审核,结合链上合约审计功能来决定节点是否可以进入;(4) Use the contract on the chain to manage the credit value of the node. By setting the authority of the initial channel node, the channel administrator can review the nodes that apply to enter the channel, and combine the contract audit function on the chain to determine whether the node can enter; (5)节点退出机制依靠链下合约审计机制,通过链下合约对节点的事物进行审计,计算是否存在未完成的事物,并且保留一段时间给链下的节点或者监督节点提出异议,如果都没有,则对链下的事务进行清算,把结果进行上链,节点退出通道。(5) The node exit mechanism relies on the off-chain contract audit mechanism to audit the node's affairs through the off-chain contract, calculate whether there are unfinished things, and reserve a period of time for the off-chain nodes or supervisory nodes to raise objections. , the transaction under the chain is liquidated, the result is uploaded to the chain, and the node exits the channel.
CN202310320042.2A 2023-03-29 2023-03-29 A blockchain-based off-chain expansion technology Pending CN116388957A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310320042.2A CN116388957A (en) 2023-03-29 2023-03-29 A blockchain-based off-chain expansion technology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310320042.2A CN116388957A (en) 2023-03-29 2023-03-29 A blockchain-based off-chain expansion technology

Publications (1)

Publication Number Publication Date
CN116388957A true CN116388957A (en) 2023-07-04

Family

ID=86972510

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310320042.2A Pending CN116388957A (en) 2023-03-29 2023-03-29 A blockchain-based off-chain expansion technology

Country Status (1)

Country Link
CN (1) CN116388957A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118779154A (en) * 2024-07-04 2024-10-15 河北电力工程监理有限公司 A blockchain-based underground substation engineering settlement monitoring data management method
CN119854029A (en) * 2025-03-18 2025-04-18 浙江理工大学 TEE-based state channel dynamic trust guarantee method and device
WO2025111750A1 (en) * 2023-11-27 2025-06-05 中国科学院深圳先进技术研究院 Verifiable ledger database storage extension method and system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2025111750A1 (en) * 2023-11-27 2025-06-05 中国科学院深圳先进技术研究院 Verifiable ledger database storage extension method and system
CN118779154A (en) * 2024-07-04 2024-10-15 河北电力工程监理有限公司 A blockchain-based underground substation engineering settlement monitoring data management method
CN119854029A (en) * 2025-03-18 2025-04-18 浙江理工大学 TEE-based state channel dynamic trust guarantee method and device

Similar Documents

Publication Publication Date Title
CN109964446B (en) Consensus method based on voting
US11971877B2 (en) Method, apparatus, device, and storage medium for proposal message processing for blockchain
Zheng et al. An overview of blockchain technology: Architecture, consensus, and future trends
JP7607601B2 (en) Evidence management method, evidence management system and node
Decker et al. Bitcoin meets strong consistency
TW202046223A (en) System and method for providing privacy and security protection in blockchain-based private transactions
JP2025000912A (en) Execution of smart contract using distributed coordination
CN116388957A (en) A blockchain-based off-chain expansion technology
CN115152177B (en) System and method for providing specialized proof of confidential knowledge
CN109493056A (en) A kind of block chain common recognition mechanism based on supply chain Ecological Information scene
KR20210135495A (en) A method for generating random numbers in blockchain smart contracts
CN108833081A (en) A block chain-based device network authentication method
CN111798233B (en) Token Link
US20210297251A1 (en) System and method for providing privacy and security protection in blockchain-based private transactions
US20240249289A1 (en) System and Method for Securing a Non-Fungible Digital Asset
Du et al. A blockchain-based random number generation algorithm and the application in blockchain games
CN115244526A (en) Method and system for decentralized transaction communication protocols
US20240378600A1 (en) Methods and systems for formation and termination of payment channel between distinct ledgers
CN114143021B (en) News information credit score system based on block chain
Scaffino et al. Alba: The dawn of scalable bridges for blockchains
CN113783700B (en) Authority and interest proving method and system capable of monitoring safety under fragmented block chain
Gai et al. A secure sidechain for decentralized trading in internet of things
Jangid et al. An overview of blockchain technology: Architecture, consensus, and future trends
CN118400086A (en) A two-layer consensus method for enterprise-level composite blockchain
Cui et al. Outsourced privately verifiable proofs of retrievability via blockchain

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination