CN114401099A - Block chain PoW selfish mining attack defense method based on network topology - Google Patents
Block chain PoW selfish mining attack defense method based on network topology Download PDFInfo
- Publication number
- CN114401099A CN114401099A CN202110943159.7A CN202110943159A CN114401099A CN 114401099 A CN114401099 A CN 114401099A CN 202110943159 A CN202110943159 A CN 202110943159A CN 114401099 A CN114401099 A CN 114401099A
- Authority
- CN
- China
- Prior art keywords
- node
- network
- branch
- betweenness
- mining
- 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.)
- Granted
Links
- 238000005065 mining Methods 0.000 title claims abstract description 66
- 230000007123 defense Effects 0.000 title claims abstract description 5
- 238000000034 method Methods 0.000 title claims description 12
- 238000004364 calculation method Methods 0.000 claims description 19
- 230000005540 biological transmission Effects 0.000 claims description 7
- 238000005516 engineering process Methods 0.000 abstract description 5
- 230000008901 benefit Effects 0.000 description 5
- 230000000694 effects Effects 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000001568 sexual effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/14—Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
- H04L63/1441—Countermeasures against malicious traffic
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2209/00—Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
- H04L2209/56—Financial cryptography, e.g. electronic payment or e-cash
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
本发明属于区块链技术领域,具体为一种基于网络拓扑的区块链PoW自私挖矿攻击防御技术。其特征是,包括:1)计算与更新全网节点中心介数2)在区块链共识机制中,采用基于中心介数的分支选择算法实现对自私挖矿的抵抗。本发明在网络拓扑结构无法改变的情况下,通过与网络中心介数的负相关处理,提升了自私挖矿节点需要获利所要付出的算力代价,由于每个节点按概率立刻重选分支,对区块链的性能没有影响。
The invention belongs to the technical field of blockchain, in particular to a blockchain PoW selfish mining attack defense technology based on network topology. It is characterized by: 1) calculating and updating the central betweenness of nodes in the entire network; 2) in the blockchain consensus mechanism, a branch selection algorithm based on the central betweenness is used to achieve resistance to selfish mining. Under the condition that the network topology structure cannot be changed, the present invention increases the computing power cost that selfish mining nodes need to pay for profit through the negative correlation processing with the betweenness of the network center. There is no impact on the performance of the blockchain.
Description
技术领域technical field
本发明属于区块链技术领域,具体为一种基于网络拓扑的区块链PoW自私挖矿攻击防御技术。The invention belongs to the technical field of blockchain, in particular to a blockchain PoW selfish mining attack defense technology based on network topology.
背景技术Background technique
3.1部分属性解释3.1 Partial attribute explanation
区块:区块为区块链组成的基本单位。区块链系统每隔一段时间会产生一个区块,该区块通过HASH值与上一个区块连接,形成链性数据结构。每个区块中会打包从上一个区块结束后,网络中发生的若干笔交易(在比特币中,主要为比特币的转账交易)。Block: Block is the basic unit of blockchain. The blockchain system will generate a block at regular intervals, which is connected with the previous block through the HASH value to form a chain data structure. Each block will include several transactions in the network since the end of the previous block (in Bitcoin, mainly Bitcoin transfer transactions).
区块链分支:在一个已存在区块中,在网络中可能出现两个或两个以上合法的新区块,他们的HASH值都能与已存在的区块对应上,但是可能由于发布区块的节点在网络中的位置不同、或者对交易的选择偏好不同、区块中打包的内容以及区块挖矿的解不同等原因,导致几个新区块内容不同。这种情况下,网络就出现了分支。按现有的比特币协议,节点会给予它第一个收到的合法区块继续挖下一个区块链。此时就形成了多条支链。Blockchain branch: In an existing block, two or more legal new blocks may appear in the network, and their HASH values can correspond to the existing blocks, but may be due to the release of the block. The content of several new blocks is different due to the different positions of the nodes in the network, different preferences for transaction selection, different content packaged in blocks, and different solutions of block mining. In this case, the network branches. According to the existing Bitcoin protocol, the node will give it the first legal block it receives to continue mining the next blockchain. At this point, multiple branches are formed.
支链的长度也可以是任意正整数(包括1,也就是仅有一个区块)。The length of the branch chain can also be any positive integer (including 1, that is, there is only one block).
最长链原则:当网络中有一个支链的长度最长,该支链向全网广播的时候,会被所有节点认可,其他节点即使原来正在基于其他支链挖矿,此时也会放弃其他支链。于此同时,被放弃的支链上所有的区块也无法获得奖励。The longest chain principle: When there is a branch chain with the longest length in the network, when the branch chain is broadcast to the whole network, it will be recognized by all nodes. Even if other nodes are mining based on other branch chains, they will give up at this time. other branches. At the same time, all blocks on the abandoned fork chain will not be rewarded.
3.2区块链工作量证明(PoW)3.2 Blockchain Proof of Work (PoW)
工作量证明Proof of Work(PoW)是目前在区块链特别是公链中,影响力最大的共识机制。PoW通过计算一个数值(nonce),使得拼揍上交易数据后内容的Hash值满足一个特殊的规定。在区块链中,节点尝试并成功找到满足的Hash值之后,会立即向全网进行广播,并获得打包区块的权利以及相应的激励,网络的节点收到广播打包区块,会立刻对其进行验证。目前,比特币就采用了PoW的机制,以太坊也基于PoW机制起步。尽管PoW在生产过程中会产生大量的电力浪费,但在目前的区块链公链领域中,PoW特别是比特币系统在安全性、可靠性上仍然具有一定标杆意义。Proof of Work (PoW) is currently the most influential consensus mechanism in blockchains, especially public chains. PoW calculates a value (nonce) so that the hash value of the content after the transaction data is put together satisfies a special requirement. In the blockchain, after the node tries and successfully finds a satisfactory Hash value, it will broadcast to the whole network immediately, and obtain the right to package the block and the corresponding incentives. The node of the network receives the broadcast packaged block and will immediately respond to the broadcast. its verified. At present, Bitcoin adopts the PoW mechanism, and Ethereum also started based on the PoW mechanism. Although PoW will generate a lot of power waste in the production process, in the current blockchain public chain field, PoW, especially the Bitcoin system, still has certain benchmarking significance in terms of security and reliability.
3.3PoW算力3.3 PoW computing power
根据目前以比特币为例的PoW算法,每个区块的产生对应了一个节点通过计算,成功找到了满足规定的解(或者说值nonce)。理论上来说,网络中的每个节点都有概率获得区块链产生的奖励。而当我们拉长区块链运行的时间,可以通过评估每个节点获得区块奖励的概率来衡量我们参与PoW挖矿的收益。According to the current PoW algorithm taking Bitcoin as an example, the generation of each block corresponds to a node that successfully finds a solution (or value nonce) that meets the requirements through calculation. In theory, each node in the network has a probability to receive the rewards generated by the blockchain. When we lengthen the running time of the blockchain, we can measure the benefits of our participation in PoW mining by evaluating the probability of each node getting block rewards.
近年来随着国际上比特币、以太坊等数字货币与法定货币之间的交易渠道增多,数字货币本身具有的稀缺性以及数字货币领域方面的营销宣传等多重影响,数字货币的法定货币购买价格提升到一个不得忽视的程度。甚至有部分公司与国家公开将数字货币视作资产配置和价值流通的工具。In recent years, with the increase in the number of trading channels between digital currencies such as Bitcoin and Ethereum and legal tender, the scarcity of digital currency itself and the multiple influences of marketing promotion in the field of digital currency, the legal currency purchase price of digital currency Raised to a level that cannot be ignored. Some companies and countries even openly regard digital currency as a tool for asset allocation and value circulation.
因此,在当前市场环境下,获取PoW算力投入到区块链共识机制中获得激励是在商业上具有盈利潜能的做法。PoW算力在区块链公链数字货币领域中,具有相当重要的战略意义:一方面是其标志了拥有算力的节点在区块链中获得激励收益的期望、另一方面所有参与者也在警惕PoW算力过于集中而导致区块链账本的分布式属性失效。Therefore, in the current market environment, it is a commercially profitable practice to obtain PoW computing power and invest it in the blockchain consensus mechanism to obtain incentives. PoW computing power has a very important strategic significance in the field of blockchain public chain digital currency: on the one hand, it marks the expectation of nodes with computing power to obtain incentive benefits in the blockchain, on the other hand, all participants also We are wary of PoW computing power being too concentrated, which will lead to the failure of the distributed properties of the blockchain ledger.
3.4自私挖矿攻击技术3.4 Selfish mining attack technology
在全网节点都诚实工作的情况下,每个节点所获得的奖励比例与节点提供的算力比例是公平对应的。而区块链的攻击技术能够让某些节点获得超额收益,其他诚实工作的节点收益会抵御其拥有的算力比例。In the case that the entire network nodes are working honestly, the proportion of rewards obtained by each node corresponds to the proportion of computing power provided by the nodes fairly. The attack technology of the blockchain can allow some nodes to obtain excess income, and the income of other nodes who work honestly will resist the proportion of their computing power.
自私挖矿成立的前提与区块链采用最长链原则的共识机制有关联,并且在人们发现自私挖矿技术前[1],51%算力攻击被公认是PoW区块链面临的唯一安全性挑战。因此,在介绍自私挖矿以前,简要介绍最长链原则以及“51%”算力攻击。The premise of the establishment of selfish mining is related to the consensus mechanism that the blockchain adopts the longest chain principle, and before people discovered the selfish mining technology [1], the 51% computing power attack was recognized as the only security faced by the PoW blockchain. sexual challenges. Therefore, before introducing selfish mining, briefly introduce the longest chain principle and the "51%" attack.
3.4.1最长链原则3.4.1 The longest chain principle
由于在显示网络中,节点和节点之间的信息传输存在一定延迟。因此会有一定概率出现当一个节点A在某一个区块中挖矿成功并广播后,网络中比较远的节点B还未听到这个广播节点的时候,也成功挖出了一个区块。这个时候,整个网络中节点A距离较近的节点由于优先听到了节点A的广播内容,会认可节点A的区块链并基于此继续挖新的区块链。而优先听到节点B区块链的也一样,此时网络中短时间就会出现一个分叉,我们将其分为子链A和子链B。此时,如果基于子链A先成功挖出了一个区块链,并且在子链B未能挖出新区块前,广播到网络中所有的节点,则全网节点会放弃B链,重新在最长A链开始下一个区块的计算(如图1所示)。Because in the display network, there is a certain delay in the transmission of information between nodes. Therefore, there is a certain probability that when a node A successfully mines and broadcasts a block in a certain block, when the distant node B in the network has not heard the broadcast node, it also successfully mines a block. At this time, the nodes that are closer to node A in the entire network will recognize the blockchain of node A and continue to mine new blockchains based on the priority of hearing the broadcast content of node A. The same is true for those who hear the blockchain of node B first. At this time, a fork will appear in the network in a short time, and we will divide it into sub-chain A and sub-chain B. At this time, if a block chain is successfully dug out based on sub-chain A, and broadcast to all nodes in the network before sub-chain B fails to dig out a new block, the whole network nodes will give up the B chain and re-enter the chain. The longest A chain starts the calculation of the next block (as shown in Figure 1).
总的来说,在PoW最长链原则下的区块链账本中,没有一个绝对正确的账本概念,仅有网络中的所有节点最终会承认哪个账本的结果。而在这个系统下,以比特币为例的分布式账本,能够以一个非常高的概率保证账本的安全性。In general, in the blockchain ledger under the PoW longest chain principle, there is no absolutely correct concept of ledger, only all nodes in the network will eventually recognize the result of which ledger. Under this system, a distributed ledger such as Bitcoin can guarantee the security of the ledger with a very high probability.
3.4.2“51%”算力攻击3.4.2 "51%" Hashrate Attack
如图2所示as shown in picture 2
当网络中区块链的算力过于集中时,当这个掌握集中算力的节点想要作恶,那么对它而言,发起账本的篡改是可行的。When the computing power of the blockchain in the network is too concentrated, when the node that masters the centralized computing power wants to do evil, it is feasible for it to initiate the tampering of the ledger.
根据最长链原则,如果网络中有一个节点拥有全网50%以上的算力,那么意味着如果我们拉长观察时间,网络中的大多数区块链都将由这个节点挖出。利用这个特点,具有50%以上算力的节点可以完成“双花”攻击。According to the longest chain principle, if there is a node in the network that has more than 50% of the computing power of the entire network, it means that if we lengthen the observation time, most of the blockchains in the network will be mined by this node. Taking advantage of this feature, nodes with more than 50% computing power can complete a "double spend" attack.
假设在主链中,第i个区块链记录了节点A花掉了一笔费用并换取了相应的服务或商品,但是从此刻开始,节点A将动用其全部的算力从第i-1个区块开始,不理会主链(其他节点所认同的链)重新进行PoW算力计算,并生成新的区块,区块中不包含A花掉的费用。由于A节点的算力大于全网其他节点的算力,只要时间足够长,则节点A一定能通过PoW算力得到一个比其他节点所挖的“主链”更长的链,当这一刻到来,节点A将更长的链公布到网络上,则根据最长链原则,所有链将会舍弃原来的“主链”,节点A制造的分支就成为了新的主链。之前记录A话费的那个区块,也随着原“主链”被舍弃,一同作废了。此时账本中就不会记录A在原始的第i区块链中的那笔话费。节点A完成了双花攻击。Assuming that in the main chain, the i-th blockchain records that node A spent a fee and exchanged for the corresponding service or commodity, but from this moment onwards, node A will use all its computing power to start from the i-1 Starting from a block, ignore the main chain (the chain recognized by other nodes) and recalculate the PoW computing power, and generate a new block. The block does not include the cost spent by A. Since the computing power of node A is greater than that of other nodes in the entire network, as long as the time is long enough, node A will be able to obtain a chain that is longer than the "main chain" mined by other nodes through PoW computing power. When this moment comes , node A publishes the longer chain to the network, then according to the longest chain principle, all chains will abandon the original "main chain", and the branch made by node A becomes the new main chain. The block that previously recorded the call fee of A was also discarded along with the original "main chain" and was invalidated together. At this time, the call fee of A in the original i-th blockchain will not be recorded in the ledger. Node A completes a double-spend attack.
3.4.3自私挖矿获利原理3.4.3 Profitability principle of selfish mining
自私挖矿是一种利用PoW算力最长链原则,主要基于隐藏自身已挖出的合法区块,并通过一系列延迟广播该区块的方式,最优化自己的收益,且超过了自身算力占全网的比例(另一方面也侵害了诚实节点所能够获得收益)。Selfish mining is a principle of using the longest chain of PoW computing power. It is mainly based on hiding the legal blocks that it has dug, and broadcasting the block through a series of delays to optimize its own income and exceed its own computing power. The power accounts for the proportion of the entire network (on the other hand, it also violates the benefits that honest nodes can obtain).
而自私挖矿方法的出现,使得拥有较大算力(即使不超过全网算力的50%)的节点能够获得大于算力比例的收益比例。The emergence of selfish mining methods enables nodes with larger computing power (even if it does not exceed 50% of the total network computing power) to obtain a revenue ratio greater than the computing power ratio.
一种典型的自私挖矿原理如下:A typical selfish mining principle is as follows:
假设自私节点A(或者是一个由多个共同执行节点构成的“矿池”节点),其算力占全网算力的比例为α。如果节点A成功挖出一个区块后,将该序区块信息保密,并在这个区块基础上继续挖下一个区块链。那么一定存在一定的概率,使得节点A所挖的区块链数量领先网络中剩余节点在挖的数量。如图3所示,假设节点A在一定概率下,能够连续领先挖到3个区块链。此时节点A隐藏3个区块不公布,其他节点则会沿着另一个分支继续工作。由于A能够接收到其他节点公布的区块信息,当其他节点所挖的区块链数量只落后一个时,此时节点A向全网公布之前隐藏的三个区块,此时按最长链原则,其他诚实节点所处理的两个区块链将会被作废。Assuming that selfish node A (or a "mining pool" node composed of multiple joint execution nodes), the proportion of its computing power to the computing power of the entire network is α. If node A successfully mines a block, it will keep the sequence block information secret, and continue to mine the next block chain based on this block. Then there must be a certain probability that the number of blockchains mined by node A is ahead of the number of remaining nodes in the network. As shown in Figure 3, it is assumed that node A can mine 3 blockchains in a row with a certain probability. At this point, node A hides 3 blocks from publishing, and other nodes continue to work along another branch. Since A can receive the block information announced by other nodes, when the number of blockchains mined by other nodes is only one behind, then node A announces the three previously hidden blocks to the whole network, at this time according to the longest chain In principle, two blockchains processed by other honest nodes will be invalidated.
在这个过程中,节点A的不诚实行为浪费了诚实节点算力,使得节点A收益的期望大于公平的比例,完成了一次自私挖矿攻击。In this process, the dishonest behavior of node A wastes the computing power of honest nodes, so that the expectation of node A's income is greater than the fair ratio, and a selfish mining attack is completed.
详细的自私挖矿介绍可以参考文献[1],该文献指出,只要节点A所拥有的算力α满足:For a detailed introduction to selfish mining, please refer to [1], which points out that as long as the computing power α possessed by node A satisfies:
时,自私挖矿能够获得额外的收益。其中,γ受网络拓扑影响,如果网络中节点A能够更快速广播传达到的节点比例越高,则γ值越大。, selfish mining can obtain additional income. Among them, γ is affected by the network topology. If the proportion of nodes in the network that node A can broadcast more quickly, the greater the value of γ.
3.5网络的中心介数3.5 The central betweenness of the network
中心介数是表征网络中某个节点在网络中重要性的衡量指标。具体含义,中心介数是基于最短路径的图中心性的一种度量。对于连通图中的每一对节点,在两节点之间至少存在一条最短路径,使得路径通过的边数(对于未加权图)或者边权重的和(对于加权图)最小。节点的中心介数是经过该节点的最短路径的数量或者最短路径数量占所有路径数量的比例。Central betweenness is a measure that characterizes the importance of a node in the network. Specifically, central betweenness is a measure of graph centrality based on the shortest path. For each pair of nodes in a connected graph, there is at least one shortest path between the two nodes that minimizes the number of edges (for unweighted graphs) or the sum of edge weights (for weighted graphs) that the path passes through. The central betweenness of a node is the number of shortest paths passing through the node or the ratio of the number of shortest paths to the number of all paths.
3.5.1网络的中心介数与自私挖矿的关系3.5.1 The relationship between the central betweenness of the network and selfish mining
自私挖矿节点的网络中心介数越大,自私挖矿的收益越大The greater the betweenness of the network center of the selfish mining node, the greater the profit of selfish mining
网路中心介数与自私挖矿的关系主要在下面描述的一种自私挖矿场景中起作用(与3.4.3中描述原理时的例子有区别)The relationship between the betweenness of the network center and selfish mining mainly works in a selfish mining scenario described below (different from the example when the principle is described in 3.4.3)
如图4所示,自私挖矿节点处于中心介数较高的位置,所有虚线框内的节点向框外找最短路径,都要通过自私挖矿节点。也就意味着自私挖矿节点有能力先于框外节点对框内节点进行信息广播。As shown in Figure 4, the selfish mining node is located in a position with a high central betweenness, and all nodes in the dotted box find the shortest path outside the box through the selfish mining node. This means that selfish mining nodes have the ability to broadcast information to nodes inside the frame before nodes outside the frame.
①假设自私挖矿节点仅领先主链一个区块,并且隐藏未公布。①Assume that the selfish mining node is only one block ahead of the main chain, and it is hidden and unpublished.
②其他诚实节点(假设节点A)可能在自私节点挖出新区块前,先挖出一个新的合法区块,形成支链j,导致自私挖矿节点不领先主链,无法直接适用最长链原则让支链j作废。②Other honest nodes (assuming node A) may dig a new legal block before the selfish node digs out a new block, forming a branch chain j, resulting in the selfish mining node not leading the main chain and unable to directly apply the longest chain The principle makes the branch j invalid.
③此时,自私挖矿节点在接受到节点A广播的支链j后,马上向外广播支链i的存在。此时,由于自私挖矿节点的网络拓扑位置关系,虚线框内的节点会接受到合法的支链i,并且在上面继续挖矿。此时,自私挖矿节点就达到了裹挟更多算力为自己支链服务的目标,如此长期执行该策略,会让自私挖矿节点的收益期望大于诚实节点。(在这个策略下,一方面可以提升继续隐藏并领先主链两个区块链的概率,另一方面,即使暂时被诚实节点赶上,由于能够裹挟一部分诚实节点在支链i上继续挖矿,自己隐藏唯一一个区块获得认可的概率也会大于自己本身的算力比例)③ At this time, after receiving the branch chain j broadcasted by node A, the selfish mining node immediately broadcasts the existence of branch chain i to the outside world. At this time, due to the network topology position relationship of the selfish mining nodes, the nodes in the dotted box will receive the legal branch i and continue mining on it. At this point, the selfish mining node has achieved the goal of coordinating more computing power to serve its fork chain, and implementing this strategy for a long time will make the selfish mining node's revenue expectation greater than that of the honest node. (Under this strategy, on the one hand, it can increase the probability of continuing to hide and lead the two blockchains in the main chain. On the other hand, even if it is temporarily caught up by the honest nodes, it can coerce some honest nodes to continue mining on the branch i , the probability of hiding the only block to be recognized by yourself will also be greater than the proportion of your own computing power)
综上,自私挖矿节点收益和它能够影响到的节点占比成正向关系。因此,本发明的发明任务是基于网络中心介数抵抗自私挖矿的合理有效。To sum up, the profit of selfish mining nodes has a positive relationship with the proportion of nodes it can affect. Therefore, the inventive task of the present invention is to resist selfish mining reasonably and effectively based on the betweenness of the network center.
参考文献references
[1]Eyal,Ittay,and Emin Gün Sirer."Majority is not enough:Bitcoinmining is vulnerable."International conference on financial cryptography anddata security.Springer,Berlin,Heidelberg,2014.[1] Eyal, Ittay, and Emin Gün Sirer. "Majority is not enough: Bitcoinmining is vulnerable." International conference on financial cryptography and data security. Springer, Berlin, Heidelberg, 2014.
Brandes,Ulrik."A faster algorithm for betweenness centrality."Journalof mathematical sociology 25.2(2001):163-177.Brandes, Ulrik. "A faster algorithm for betweenness centrality." Journal of mathematical sociology 25.2(2001):163-177.
发明内容SUMMARY OF THE INVENTION
本发明的发明目的是公开一种针对基于网络中心介数自私挖矿的抵抗方法。本发明基于网络拓扑的中心介数,实现降低区块链PoW自私挖矿攻击的收益,提升区块链自私挖矿攻击的成本。The purpose of the present invention is to disclose a method for resisting selfish mining based on the betweenness of the network center. Based on the central betweenness of the network topology, the present invention reduces the benefit of the blockchain PoW selfish mining attack and increases the cost of the blockchain selfish mining attack.
技术方案Technical solutions
一种基于网络拓扑的区块链PoW自私挖矿攻击防御方法,其特征是,包括:A blockchain PoW selfish mining attack defense method based on network topology is characterized by including:
1)计算与更新全网节点中心介数1) Calculate and update the central betweenness of nodes in the entire network
在原有的区块链网络外,加入用于计算所有节点中心介数的计算模块,并将计算结果传递给区块链网络中的所有节点,作为抵抗自私攻击模块的输入参数;In addition to the original blockchain network, a calculation module for calculating the central betweenness of all nodes is added, and the calculation result is passed to all nodes in the blockchain network as the input parameters of the module for resisting selfish attacks;
每间隔一段时间重新更新计算模块进行网络中心介数的计算;在间隔期间,采用上一次更新的值;计算模块输出的计算结果为网络中每个节点的中心介数,用CB(vi)表示,其中vi∈V,V为区块链网络中所有节点的集合;The calculation module is re-updated at intervals to calculate the central betweenness of the network; during the interval, the value of the last update is used; the calculation result output by the calculation module is the central betweenness of each node in the network, represented by CB(vi) , where vi∈V, V is the set of all nodes in the blockchain network;
2)在区块链共识机制中,采用基于中心介数的分支选择算法实现对自私挖矿的抵抗2) In the blockchain consensus mechanism, the branch selection algorithm based on center betweenness is used to achieve resistance to selfish mining
抵抗自私攻击模块引入中心介数,当节点收到两个长度相同的合法支链时,随机重新选择其中一个继续挖矿;算法过程包括步骤如下:The anti-selfish attack module introduces the central betweenness. When the node receives two legal fork chains of the same length, it randomly selects one of them to continue mining. The algorithm process includes the following steps:
2.1)网络中由两个节点在接近的时间向全网广播了各自合法的分支,且分支长度相同;2.1) Two nodes in the network broadcast their legal branches to the whole network at close times, and the branch lengths are the same;
2.2)由于存在两个分支的发送时间差以及网络拓扑的导致的传输时间差,节点1接收到两个分支有一个先后顺序,假设节点2的支链信息先与节点3被广播到节点1,此时,节点1按照原PoW最长链原则基于先收到的节点2分支进行挖矿;2.2) Due to the transmission time difference between the two branches and the transmission time difference caused by the network topology,
2.3)在节点1还没有基于节点2的支链挖出新区块钱,又收到了来自节点3的一条支链,且支链长度与在步骤2.2)中收到节点2的支链长度相同,此时当节点1停止当前的挖矿行为,并按以下概率重新随机选择一次支链:2.3)
即节点进行一次随机运算,有Pv2的概率会选择节点2分支,Pv3的概率会选择节点3分支;That is, the node performs a random operation, the probability of P v2 will select the node 2 branch, and the probability of P v3 will select the node 3 branch;
如果节点同时面临两个以上的分支选择,则通用的选择概率表达书如下:If a node faces more than two branch choices at the same time, the general choice probability expression is as follows:
Pvi:选择节点i支链的概率P vi : the probability of choosing a branch of node i
CB(vi):节点i的网络中心介数C B (vi ): the network center betweenness of node i
2.4)基于2.3)中的选择结果选择对应的分支进一步挖矿;2.4) Based on the selection result in 2.3), select the corresponding branch for further mining;
2.5)如果在步骤2.3)到2.4)过程中,有合法的新区块出现,则仍然按最长链原则,切换到合法的最长链上挖矿,从而保证区块链整体网络性能不变。2.5) If there is a new legal block in the process of step 2.3) to 2.4), it will still switch to the legal longest chain for mining according to the longest chain principle, so as to ensure that the overall network performance of the blockchain remains unchanged.
有益效果beneficial effect
1)在网络拓扑结构无法改变的情况下,通过与网络中心介数的负相关处理,提升了自私挖矿节点需要获利所要付出的算力代价。1) Under the condition that the network topology cannot be changed, through the negative correlation processing with the betweenness of the network center, the computing power cost that selfish mining nodes need to pay for profit is increased.
2)由于每个节点按概率立刻重选分支,对区块链的性能没有影响。2) Since each node immediately reselects the branch according to the probability, it has no effect on the performance of the blockchain.
附图说明Description of drawings
图1最长链原则Figure 1 The longest chain principle
图2“51%”算力攻击Figure 2 "51%" Hashrate Attack
图3自私挖矿Figure 3 Selfish mining
图4自私挖矿与网络中心介数Figure 4 Selfish mining and network center betweenness
图5所示的区块链网络中心介数计算模块的输出The output of the central betweenness calculation module of the blockchain network shown in Figure 5
图6区块链网络中心介数计算的定期更新Figure 6 Regular update of betweenness calculation in the center of blockchain network
图7基于中心介数的支链选择算法Fig.7 Branch selection algorithm based on center betweenness
图8基于中心介数的支链选择中断算法Figure 8. Branch selection interruption algorithm based on center betweenness
具体实施方式Detailed ways
1)计算与更新全网节点中心介数。1) Calculate and update the central betweenness of nodes in the entire network.
如图5所示,本发明在原有的区块链网络外,加入用于计算所有节点中心介数的计算模块,并将计算结果传递给区块链网络中的所有节点,作为抵抗自私攻击模块的输入参数。As shown in Figure 5, the present invention adds a calculation module for calculating the central betweenness of all nodes outside the original blockchain network, and transmits the calculation results to all nodes in the blockchain network as a module for resisting selfish attacks input parameters.
由于网络的拓扑变化速度相对较慢,因此可以每间隔一段时间重新更新计算模块进行网络中心介数的计算(如图6所示)。在间隔期间,采用上一次更新的值即可。计算模块输出的计算结果为网络中每个节点的中心介数,用CB(vi)表示,其中vi∈V,V为区块链网络中所有节点的集合。Since the topology of the network changes relatively slowly, the calculation module can be re-updated at intervals to calculate the betweenness of the network center (as shown in Figure 6). During the interval, the last updated value is used. The calculation result output by the calculation module is the central betweenness of each node in the network, which is represented by C B (vi ), where vi ∈ V , and V is the set of all nodes in the blockchain network.
2)在区块链共识机制中,基于中心介数的分支选择算法实现对自私挖矿的抵抗。2) In the blockchain consensus mechanism, the branch selection algorithm based on center betweenness realizes resistance to selfish mining.
抵抗自私攻击模块引入中心介数,当节点收到两个长度相同的合法支链时,随机重新选择其中一个继续挖矿;分支所属的中心介数越大,被随机重选倒的概率越小。The anti-selfish attack module introduces the center betweenness. When a node receives two legal forks of the same length, it randomly reselects one of them to continue mining; the larger the center betweenness of the branch, the smaller the probability of being randomly reselected. .
如图7所示抵抗自私攻击模块的算法,包括步骤如下:As shown in Figure 7, the algorithm of resisting selfish attack module includes the following steps:
2.1)网络中由两个节点在比较接近的时间向全网广播了各自合法的分支,且分支长度相同(大多数情况下分支长度为1,即一个区块链)。2.1) Two nodes in the network broadcast their legal branches to the entire network at relatively close times, and the branch lengths are the same (in most cases, the branch length is 1, that is, a blockchain).
2.2)由于两个分支的发送时间差以及网络拓扑的导致的传输时间差,节点1接收到两个分支有一个先后顺序。我们假设节点2的支链信息先与节点3被广播到节点1,此时,节点1按照原PoW最长链原则基于先收到的节点2分支进行挖矿。(这里假设节点2或节点3任意支链优先都可以,对算法没有影响)2.2) Due to the transmission time difference between the two branches and the transmission time difference caused by the network topology, the
2.3)在节点1还没有基于节点2的支链挖出新区块钱,又收到了来自节点3的一条支链,且支链长度与在步骤2.2)中收到节点2的支链长度相同,此时当节点1停止当前的挖矿行为,并按以下概率重新随机选择一次支链:2.3)
即节点进行一次随机运算,有Pv2的概率会选择节点2分支,Pv3的概率会选择节点3分支。That is, the node performs a random operation. The probability of P v2 will select the node 2 branch, and the probability of P v3 will select the node 3 branch.
如果节点同时面临两个以上的分支选择,则通用的选择概率表达书如下:If a node faces more than two branch choices at the same time, the general choice probability expression is as follows:
Pvi:选择节点i支链的概率P vi : the probability of choosing a branch of node i
CB(vi):节点i的网络中心介数C B (vi ): the network center betweenness of node i
2.4)基于2.3)中的选择结果选择对应的分支进一步挖矿。2.4) Based on the selection result in 2.3), select the corresponding branch for further mining.
2.5)如图8所示为分支选择算法中的一种特殊情况,使得分支选择中断,节点重新回到最长的合法支链上进行挖矿。具体是:如果在步骤2.3)到2.4)过程中,有合法的新区块出现,则仍然按最长链原则,切换到合法的最长链上挖矿。从而保证区块链整体网络性能不变。2.5) As shown in Figure 8, it is a special case in the branch selection algorithm, which makes the branch selection interrupted, and the node returns to the longest legal branch chain for mining. Specifically: if a new legal block appears in the process of steps 2.3) to 2.4), it will still switch to the legal longest chain for mining according to the longest chain principle. This ensures that the overall network performance of the blockchain remains unchanged.
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110943159.7A CN114401099B (en) | 2021-08-17 | 2021-08-17 | A block chain PoW selfish consensus resistance method based on network topology |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110943159.7A CN114401099B (en) | 2021-08-17 | 2021-08-17 | A block chain PoW selfish consensus resistance method based on network topology |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114401099A true CN114401099A (en) | 2022-04-26 |
CN114401099B CN114401099B (en) | 2023-05-09 |
Family
ID=81225686
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110943159.7A Active CN114401099B (en) | 2021-08-17 | 2021-08-17 | A block chain PoW selfish consensus resistance method based on network topology |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114401099B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115412454A (en) * | 2022-04-28 | 2022-11-29 | 深圳大学 | Detection method, device and equipment for selfish mining behavior and storage medium |
CN115913559A (en) * | 2022-07-05 | 2023-04-04 | 北京理工大学 | Method for synchronizing local smart consensus ledger based on network delay and computing power delay |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019232789A1 (en) * | 2018-06-08 | 2019-12-12 | 北京大学深圳研究生院 | Voting-based consensus method |
CN110889699A (en) * | 2019-11-25 | 2020-03-17 | 长沙理工大学 | Shielding mechanism for selfish mining in block chain system |
WO2020168477A1 (en) * | 2019-02-20 | 2020-08-27 | 北京大学深圳研究生院 | Method for constructing topology satisfying partition tolerance under alliance chain consensus and system |
CN111681123A (en) * | 2020-06-10 | 2020-09-18 | 电子科技大学中山学院 | Detection method for selfish mining behavior on block chain of workload certification mechanism |
CN111737358A (en) * | 2020-07-20 | 2020-10-02 | 百度在线网络技术(北京)有限公司 | Method, device and equipment for determining main chain of block chain and storage medium |
CN112232844A (en) * | 2019-07-14 | 2021-01-15 | 湖南科技学院 | Block chaining coin mine pool multi-miner cooperative evolution method based on time sequence difference algorithm |
US20210119778A1 (en) * | 2018-06-22 | 2021-04-22 | Wealedger Network Technologies Co., Ltd. | Method for preventing short-term bifurcation and double-spend attack on block chain network |
CN112783983A (en) * | 2021-02-07 | 2021-05-11 | 中国人民解放军国防科技大学 | Self-adaptive consensus method based on major-minor block diagram chain structure block chain account book design |
-
2021
- 2021-08-17 CN CN202110943159.7A patent/CN114401099B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019232789A1 (en) * | 2018-06-08 | 2019-12-12 | 北京大学深圳研究生院 | Voting-based consensus method |
US20210119778A1 (en) * | 2018-06-22 | 2021-04-22 | Wealedger Network Technologies Co., Ltd. | Method for preventing short-term bifurcation and double-spend attack on block chain network |
WO2020168477A1 (en) * | 2019-02-20 | 2020-08-27 | 北京大学深圳研究生院 | Method for constructing topology satisfying partition tolerance under alliance chain consensus and system |
CN112232844A (en) * | 2019-07-14 | 2021-01-15 | 湖南科技学院 | Block chaining coin mine pool multi-miner cooperative evolution method based on time sequence difference algorithm |
CN110889699A (en) * | 2019-11-25 | 2020-03-17 | 长沙理工大学 | Shielding mechanism for selfish mining in block chain system |
CN111681123A (en) * | 2020-06-10 | 2020-09-18 | 电子科技大学中山学院 | Detection method for selfish mining behavior on block chain of workload certification mechanism |
CN111737358A (en) * | 2020-07-20 | 2020-10-02 | 百度在线网络技术(北京)有限公司 | Method, device and equipment for determining main chain of block chain and storage medium |
CN112783983A (en) * | 2021-02-07 | 2021-05-11 | 中国人民解放军国防科技大学 | Self-adaptive consensus method based on major-minor block diagram chain structure block chain account book design |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115412454A (en) * | 2022-04-28 | 2022-11-29 | 深圳大学 | Detection method, device and equipment for selfish mining behavior and storage medium |
CN115412454B (en) * | 2022-04-28 | 2023-07-07 | 深圳大学 | Detection method, device, equipment and storage medium of selfish mining behavior |
CN115913559A (en) * | 2022-07-05 | 2023-04-04 | 北京理工大学 | Method for synchronizing local smart consensus ledger based on network delay and computing power delay |
Also Published As
Publication number | Publication date |
---|---|
CN114401099B (en) | 2023-05-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Bhaskar et al. | Bitcoin mining technology | |
Göbel et al. | Increased block size and Bitcoin blockchain dynamics | |
Chicarino et al. | On the detection of selfish mining and stalker attacks in blockchain networks | |
Grunspan et al. | On profitability of selfish mining | |
CN108717630B (en) | Block output method and implementation system thereof | |
US11734260B2 (en) | Methods and apparatus for a distributed database within a network | |
Kiffer et al. | Stick a fork in it: Analyzing the ethereum network partition | |
CN104580253B (en) | A kind of method and device of processes user data | |
CN109360100A (en) | Method and device for fast confirmation of transaction based on blockchain technology | |
CN114401099A (en) | Block chain PoW selfish mining attack defense method based on network topology | |
US20200090213A1 (en) | Verifying ad requests | |
US20240111782A1 (en) | Methods and apparatus for a distributed database within a network | |
Liu et al. | An intelligent strategy to gain profit for bitcoin mining pools | |
CN110474818A (en) | Block chain network sniffer, Network Sniffing method and optimization method | |
Qiu et al. | Auction method to prevent bid-rigging strategies in mobile blockchain edge computing resource allocation | |
Zhang et al. | Optimal revenue analysis of the stubborn mining based on Markov decision process | |
Bing et al. | Optimized DPoS consensus strategy: Credit-weighted comprehensive election | |
Peterson et al. | Towards detection of selfish mining using machine learning | |
KR102192695B1 (en) | A method of operating Advertising services system based on Blockchain and a system for implementing the service environment | |
CN111565188A (en) | VANET trust model working method based on combination of message type and trust value confidence | |
Yu et al. | Low powered blockchain consensus protocols based on consistent hash | |
Zhang et al. | Broadcasting intermediate blocks as a defense mechanism against selfish-mine in bitcoin | |
Bhattacharya et al. | RT@ News: An analysis of news agency ego networks in a microblogging environment | |
Niya et al. | Bazo: A proof-of-stake (pos) based blockchain | |
Xian et al. | Improved consensus mechanisms against censorship attacks |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |