WO2020244510A1 - 一种基于vrf的权益随机共识方法及系统 - Google Patents

一种基于vrf的权益随机共识方法及系统 Download PDF

Info

Publication number
WO2020244510A1
WO2020244510A1 PCT/CN2020/093962 CN2020093962W WO2020244510A1 WO 2020244510 A1 WO2020244510 A1 WO 2020244510A1 CN 2020093962 W CN2020093962 W CN 2020093962W WO 2020244510 A1 WO2020244510 A1 WO 2020244510A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
block
sequence
verification
nodes
Prior art date
Application number
PCT/CN2020/093962
Other languages
English (en)
French (fr)
Inventor
聂明
庄致彬
曹喆佶
张皓琨
Original Assignee
聂明
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 聂明 filed Critical 聂明
Publication of WO2020244510A1 publication Critical patent/WO2020244510A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • 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/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC

Definitions

  • the present invention relates to computer technology, in particular to a VRF-based random consensus method and system for rights and interests.
  • Blockchain is a combination of Internet protocols and technologies about trust. The purpose is to build a distributed deployment and real-time synchronization system, in which data can only be added but cannot be tampered with, while allowing multiple parties to participate in the establishment of data according to the consensus mechanism And maintenance to ensure that each valid user on the chain has completely consistent data.
  • consensus algorithm One of the core issues in realizing this distributed deployment is the consensus algorithm among different users.
  • Common consensus algorithms include proof of work POW, proof of equity POS, delegated equity proof DPOS, practical Byzantine fault-tolerant PBFT, and consensus consensus algorithms.
  • proof of work POW proof of work
  • proof of equity POS proof of equity POS
  • delegated equity proof DPOS delegated equity proof DPOS
  • practical Byzantine fault-tolerant PBFT practical Byzantine fault-tolerant PBFT
  • consensus consensus algorithms no matter what kind of consensus algorithm, it can not really solve the contradiction between the scalability, decentralization and security of the blockchain.
  • a complex consensus algorithm is required between nodes, which takes up a lot of resources, which seriously affects the block generation efficiency of the blockchain, that is, scalability.
  • a random consensus method for equity based on VRF includes:
  • the screening of the blocking node from the network node distribution sequence based on the blocking node sequence includes:
  • the node of the network distribution sequence queries according to its own index value, the value of the corresponding bit on the block-breaking node sequence is 1, then it is regarded as the block-breaking node;
  • the index value indicates the position of the node in the network distribution sequence node.
  • the selection of verification nodes from the network node distribution sequence based on the verification node sequence includes:
  • the node of the network distribution sequence queries the corresponding value on the verification node sequence according to its own index value, the value of the corresponding value is 1, then it is used as a verification node;
  • the index value indicates the position of the node in the network distribution sequence node.
  • multiple nodes in the network node distribution sequence may belong to the same user at the same time, and the user with multiple nodes is a super node, and each super node calculates rights and interests based on information such as the amount of its own assets Value, holding a corresponding number of nodes according to the size of the equity value, each node occupies a position in the network node distribution sequence, and has a corresponding index value.
  • the length of the new BeconHash sequence is equal to the length of the network node distribution sequence.
  • the generating a block node sequence and a verification node sequence based on the new BeconHash includes:
  • the number of nodes in the block node sequence or verification node sequence is greater than or equal to one third of the corresponding total number of nodes.
  • the method further includes:
  • Each of the blocking nodes sequentially blocks blocks according to the corresponding waiting time and the length of the waiting time.
  • a block-breaking node does not generate a block within the waiting time or the generated block is not accepted, it will directly agree on the block generated by the next block-breaking node according to the waiting time;
  • the calculating the waiting time of each of the blocking nodes includes:
  • Each block node calculates the current round waiting time of the node according to the index value of the node, the preset block generation waiting timeout period and the block generation time constant.
  • the method further includes:
  • the validating node runs the practical Byzantine fault-tolerant algorithm and the practical Byzantine fault-tolerant algorithm is judged. When it is judged that the block is confirmed by more than two-thirds of the validating nodes, the block is accepted.
  • the method before calculating the new BeconHash based on the seed parameters in the genesis block, the latest block hash value of the existing block, and the existing BeconHash, the method further includes:
  • All nodes are recorded through a binary sequence. Each bit with a value of 1 in the sequence represents an existing node. According to the position of this bit in the entire network node distribution sequence, the node gets the corresponding index value; each new node When joining, randomly select the vacant position and pass the verification of other nodes to obtain the index value corresponding to the node, and all nodes synchronize the new network node distribution sequence.
  • a VRF-based random consensus system for equity including:
  • Node server At least 9 nodes in the blockchain participate in consensus and generate new blocks
  • Each node server needs to include:
  • Storage module used to store existing blocks, seed parameters, BeconHash, network node distribution sequence, node index value in network node distribution sequence, block node sequence, verification node sequence, equity information, standard waiting time, block waiting Information such as timeout duration and block duration constant;
  • Calculation module used to calculate BeconHash, block node sequence, verification node sequence, standard waiting time and waiting time of each node, etc.;
  • Account module used to summarize transactions and produce new ledgers (blocks);
  • Network module used to ensure the establishment and guarantee of communication between each node server
  • Verification module a practical Byzantine fault-tolerant algorithm when selected as a verification node
  • Synchronization module used to synchronize information such as new blocks and network node distribution sequences.
  • the present invention guarantees that the random election of block-breaking nodes and verification nodes is unpredictable by the attacker, and at the same time allows users with higher rights and interests to have a greater probability of being selected.
  • the BeconHash sequence is random and uniformly distributed.
  • the block node sequence and the verification node sequence finally generated based on the BeconHash sequence and the network node distribution sequence have the same probability of being selected as the block node.
  • the probability of each node being selected as a verification node is also equal, and the number of nodes owned by the super node is allocated according to the rights and interests, so this consensus algorithm can realize the equity random consensus method.
  • the present invention determines the order of block-breaking through the calculation of the node waiting time, and any block-breaker does not generate a new block within the specified time and reaches a consensus directly skips the block-breaking step of entering the next block-making node, so based on this right
  • the blockchain of the random consensus algorithm can hardly fork, and the block efficiency is extremely high.
  • Fig. 1 is a flowchart of a block breaking method applied to a blockchain according to an embodiment.
  • Fig. 1 is a flowchart of a block breaking method applied to a blockchain according to an embodiment. As shown in Figure 1, the method includes:
  • Step 110 Calculate a new BeconHash based on the seed parameters in the genesis block, the latest block hash value of the existing block, and the existing BeconHash;
  • Step 120 Generate block node sequence and verification node sequence based on the new BeconHash
  • Step 130 filter out the block node from the network node distribution sequence based on the block node sequence
  • step 140 the verification node is selected from the network node distribution sequence based on the verification node sequence
  • Step 150 Generate a block based on the blocking node and the verification node and reach a consensus.
  • seed parameters there are seed parameters. Specifically, after the initial random seed parameter (seed) in the genesis block, the seed parameter is stored in each newly generated block.
  • VRF Verifiable Random Function
  • Verifiable Random Function which is a verifiable random function. This embodiment is implemented based on VRF.
  • the method Before calculating the new BeconHash based on the seed parameters in the genesis block, the latest block hash value of the existing block, and the existing BeconHash, the method further includes:
  • All nodes are recorded through a binary sequence. Each bit with a value of 1 in the sequence represents an existing node. According to the position of this bit in the entire network node distribution sequence, the node gets the corresponding index value; each new node When joining, randomly select the vacant position and pass the verification of other nodes to obtain the index value corresponding to the node, and all nodes synchronize the new network node distribution sequence.
  • all nodes can be recorded through a sufficiently long binary sequence.
  • Each bit in the sequence with a value of 1 represents an existing node.
  • the node gets the corresponding index (Idx) value.
  • a new BeconHash (Chinese: consistent hash value) is calculated. You can first obtain the seed parameter (seed), the latest blockhash of an existing block and the existing BeconHash (preBeconHash), and perform one or more hash mappings according to the preset algorithm to obtain a new BeconHash.
  • the existing BeconHash (preBeconHash) is the previous BeconHash (preBeconHash). The previous one is for the relatively new BeconHash.
  • the node grouping sequence is calculated.
  • the hash sequence BeconHash is divided, calculated and combined to generate two new hash sequences, and the two new hash sequences are operated with the network node distribution sequence to generate the block node sequence and the verification node sequence.
  • filtering out the block node from the network node distribution sequence based on the block node sequence includes:
  • the node of the network distribution sequence searches for the value of the corresponding bit in the block-breaking node sequence according to its own index value, it is regarded as the block-breaking node.
  • the index value indicates the position of the node in the network distribution sequence node.
  • the selection of verification nodes from the network node distribution sequence based on the verification node sequence includes:
  • the node of the network distribution sequence queries the corresponding value of the corresponding value on the verification node sequence according to its own index value, it is regarded as a verification node; the index value indicates the position of the node in the network distribution sequence node.
  • each node judges whether it is a blocking node according to the sequence of the blocking node.
  • the node queries whether the value of the corresponding bit in the block node sequence is 1 according to its own Idx value, and if it is, it is used as the block node in this round.
  • Each block node calculates the waiting time of the node according to a preset algorithm, and each node blocks blocks in turn according to the length of the waiting time.
  • the verification node runs the practical Byzantine fault-tolerant algorithm and the practical Byzantine fault-tolerant algorithm is used to make a judgment.
  • the block is accepted.
  • each node judges whether it is a verification node according to the verification node sequence.
  • the node queries whether the value of the corresponding bit in the verification node sequence is 1 according to its own Idx value, and if it is, it is regarded as the verification node of this round.
  • the validating node runs the practical Byzantine fault-tolerant algorithm PBFT (Practical Byzantine Fault Tolerance) to judge, when a new block is confirmed by more than two-thirds of the validating nodes, the block been accepted.
  • PBFT Practical Byzantine Fault Tolerance
  • the waiting time of the blocking node will be the next block blocking node until the waiting time of all blocking nodes in this round is exceeded, a new round of random election will be conducted And hit the block.
  • multiple nodes in the network node distribution sequence may belong to the same user at the same time.
  • multiple nodes may belong to the same user at the same time, and this user is called a super node. That is, users with multiple nodes are super nodes.
  • Each super node calculates the equity value based on the amount of its own assets, and holds a corresponding number of nodes according to the size of the equity value.
  • Each node occupies a position in the network node distribution sequence and has a corresponding index (Idx) value.
  • the BeconHash calculation includes multiple rounds of hash operations, and the length of the final output BeconHash sequence is equal to the length of the network node distribution sequence.
  • generating a block node sequence and a verification node sequence in the new BeconHash includes:
  • a new BeconHash sequence can be generated in step 110, and then the new block node sequence and verification node sequence are obtained.
  • the method further includes:
  • the waiting time is the waiting time for the corresponding block node to perform block
  • Each block node blocks blocks according to the corresponding waiting time and the length of the waiting time.
  • calculating the waiting time of each blocking node includes:
  • Each block node calculates the current round waiting time of the node according to the index value of the node, the preset block generation waiting timeout period and the block generation time constant.
  • the calculation method of the standard waiting time may be the integer type of the BeconHash sequence modulo the total number of current blocking nodes;
  • the calculation method of the waiting time of each node may be: the node Idx value and the standard waiting time are summed, the sum is the modulus of the block generation waiting timeout period, and the modulus is then multiplied with the block generation period constant.
  • T i (Idx i +T standard mod T timeout )*T unit
  • T i the waiting time of node i
  • T standard the standard waiting time
  • T timeout the timeout period of waiting for block generation
  • T unit constant with the block generation period.
  • the present invention guarantees that the random election of block-breaking nodes and verification nodes is unpredictable by the attacker, and at the same time allows users with higher rights to have a greater probability of being selected.
  • the BeconHash sequence is random and uniformly distributed.
  • the block node sequence and the verification node sequence finally generated based on the BeconHash sequence and the network node distribution sequence have the same probability of being selected as the block node.
  • the probability of each node being selected as a verification node is also equal, and the number of nodes owned by the super node is allocated according to the rights and interests, so this consensus algorithm can realize the equity random consensus method.
  • the present invention determines the order of block-breaking through the calculation of the node waiting time, and any block-breaker does not generate a new block within the specified time and reaches a consensus directly skips the block-breaking step of entering the next block-making node, so based on this right
  • the block chain of the random consensus algorithm can hardly fork, and the block efficiency is extremely high.
  • This embodiment also provides a VRF-based random consensus system for equity, including:
  • Node server At least 9 nodes in the blockchain participate in consensus and generate new blocks
  • Each node server needs to include:
  • Storage module used to store existing blocks, seed parameters, BeconHash, network node distribution sequence, node index value in network node distribution sequence, block node sequence, verification node sequence, equity information, standard waiting time, block waiting Information such as timeout duration and block duration constant;
  • Calculation module used to calculate BeconHash, block node sequence, verification node sequence, standard waiting time and waiting time of each node, etc.;
  • Account module used to summarize transactions and produce new ledgers (blocks);
  • Network module used to ensure the establishment and guarantee of communication between each node server
  • Verification module a practical Byzantine fault-tolerant algorithm used when selected as a verification node
  • Synchronization module used to synchronize information such as new blocks and network node distribution sequences.
  • the implementation of the device embodiment may refer to the content in the above method embodiment.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Power Engineering (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Between Computers (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明涉及一种一种基于VRF的权益随机共识方法及系统,所述方法包括:基于创世区块中的种子参数、最新的已有区块的区块哈希值和已有的BeconHash,计算新的BeconHash;基于新的BeconHash生成打块节点序列和验证节点序列;基于打块节点序列从网络节点分布序列中筛选出打块节点;基于验证节点序列从网络节点分布序列中筛选出验证节点;基于打块节点和验证节点生成区块并达成共识。本发明可以提供一种区块链的安全可靠、随机性强且每轮只有部分节点参与共识的高效的共识方法。

Description

一种基于VRF的权益随机共识方法及系统 技术领域
本发明涉及计算机技术,特别是涉及一种基于VRF的权益随机共识方法及系统。
背景技术
区块链是一种关于信任的互联网协议和技术的结合,目的是构建一种分布式部署并且实时同步的系统,其中的数据只可以添加而不能篡改,同时允许多方根据共识机制参与数据的建立和维护,保证链上的每个有效用户具备完全一致的数据。
而实现这种分布式部署的一个核心问题就是不同用户之中的共识算法,常见的共识算法包括工作量证明POW、权益证明POS、委托权益证明DPOS、实用拜占庭容错PBFT和一致性共识算法等。但是无论是哪种共识算法,始终无法真正解决区块链的可扩展性、去中心化和安全性之间难以兼顾的矛盾。为了保证去中心化的特性以及高安全的要求,节点之间需要进行复杂的共识算法,占用大量的资源,严重影响区块链的出块效率,也即可扩展性。
发明内容
基于此,有必要针对出场效率低下的问题,提供一种基于VRF的权益随机共识方法及系统。
一种基于VRF的权益随机共识方法,所述方法包括:
基于创世区块中的种子参数、最新的已有区块的区块哈希值和已有的BeconHash,计算新的BeconHash;
基于新的BeconHash生成打块节点序列和验证节点序列;
基于打块节点序列从网络节点分布序列中筛选出打块节点;
基于验证节点序列对网络节点分布序列中筛选出验证节点;
基于打块节点和验证节点生成区块并达成共识。
在其中一个实施例中,所述基于打块节点序列从网络节点分布序列中筛选出打块节点,包括:
如果所述网络分布序列的节点根据自己的索引值查询对应在打块节点序列上的对应位的值为1,则作为打块节点;
所述索引值表示节点在网络分布序列节点中的位置。
在其中一个实施例中,所述基于验证节点序列对网络节点分布序列中筛选出验证节点,包括:
如果所述网络分布序列的节点根据自己的索引值查询对应在验证节点序列上的对应值的值为1,则作为验证节点;
所述索引值表示节点在网络分布序列节点中的位置。
在其中一个实施例中,所述网络节点分布序列中的多个节点可以同时属于同一个用户,所述拥有多个节点的用户为超级节点,每个超级节点依据自己资产的数量等信息计算权益值,根据权益值大小持有对应数目的节点,每个节点在网络节点分布序列中占据一个位置,并拥有对应的索引值。
在其中一个实施例中,所述新的BeconHash序列的长度与网络节点分布序列的长度相等。
在其中一个实施例中,所述基于新的BeconHash生成打块节点序列和验证节点序列,包括:
将所述新的BeconHash从中间均分为两个序列BHLeft和BHRight;
对BHLeft按位取反,得到BHLeftR;
对BHRight按位取反,得到BHRightR;
连接BHLeft和BHLeftR,得到BHLeft||BHLeftR作为预备打块节点序列;
预备打块节点序列BHLeft||BHLeftR与网络节点分布序列做与运算,得到打块节点序列;
连接BHRight和BHRightR,得到预备验证节点序列BHRight||BHRightR;
将预备验证节点序列BHRight||BHRightR与网络节点分布序列做与运算,再与打块节点序列的取反做与运算,得到验证节点序列。
在其中一个实施例中,所述打块节点序列或验证节点序列中的节点数目大 于或等于对应总节点数目的三分之一。
在其中一个实施例中,所述筛选出打块节点之后,所述方法还包括:
计算每个所述打块节点的等待时间,所述等待时间为对应打块节点进行打块的等待时间;
每个所述打块节点根据对应的等待时间,依照等待时间的长度依次打块。
如果一个打块节点没有在等待时间内生成区块或者生成的区块未被接受,则根据等待时间直接对下一个打块节点生成的区块进行共识;
当时间超过了已选出的所有打块节点的等待时间后,计算新的BeconHash并进行新的一轮随机选举。
在其中一个实施例中,所述计算每个所述打块节点的等待时间,包括:
计算本轮的标准等待时间;
每个打块节点根据本节点的索引值、预设的出块等待超时时长和出块时长常量计算本节点本轮的等待时间。
在其中一个实施例中,所述筛选出验证节点之后,所述方法还包括:
生成区块后,验证节点运行实用拜占庭容错算法实用拜占庭容错算法进行判断,当判断出该区块被超过三分之二的验证节点确认后,该区块被接受。
在其中一个实施例中,所述基于创世区块中的种子参数、最新的已有区块的区块哈希值和已有的BeconHash,计算新的BeconHash之前,所述方法还包括:
通过二进制序列记录所有节点,序列中每一个值为1的位代表一个已有的节点,根据这一位在整个网络节点分布序列中的位置,该节点得到对应的索引值;每一个新的节点加入时,随机选择空余的位置并通过其他节点的验证后,获得该节点对应的索引值,所有节点同步新的网络节点分布序列。
一种基于VRF的权益随机共识系统,包括:
节点服务器:区块链中至少存在9个节点参与共识,生成新区块;
每一个节点服务器需要包括:
存储模块:用于存储已有区块、种子参数、BeconHash、网络节点分布序列、网络节点分布序列中节点的索引值、打块节点序列、验证节点序列、权益 信息、标准等待时间、出块等待超时时长和出块时长常量等信息;
计算模块:用于计算BeconHash、打块节点序列、验证节点序列、标准等待时间和每个节点的等待时间等;
账户模块:用于汇总交易,并生产新的账本(区块);
网络模块:用于保证各个节点服务器的通讯建立和保障;
验证模块:用于在被选为验证节点时的实用拜占庭容错算法;
同步模块:用于同步新的区块和网络节点分布序列等信息。
结合以上所述,本发明在保证打块节点和验证节点的随机选举,攻击者无法预知的同时,让权益更高的用户拥有更大的概率被选中。根据哈希算法的特性,BeconHash序列是随机的且均匀分布的,基于BeconHash序列和网络节点分布序列最终生成的打块节点序列和验证节点序列中每个节点被选为打块节点的概率相等,而每个节点被选为验证节点的概率也相等,而超级节点所拥有的节点数目是根据权益分配的,因此本共识算法可以实现权益随机共识方法。
本发明通过节点等待时间的计算决定打块的次序,并且任一打块者没有在规定时间内生成新区块并达成共识则直接跳过进入下一个打块节点的打块步骤,因此基于本权益随机共识算法的区块链可以做到几乎不分叉,并且打块效率极高。
通过采用本专利公开的技术方法,采用可验证随机函数的方式选择见证人用户和打块用户,可以同时满足去中心化、可扩展性和安全性的多方面的要求。本共识算法中没有矿工,所有用户都有可能被选为见证人,但是见证人和打块者的选举是不可预测的,仅有在选举结束后才能确定,规避了被预先攻击的风险。
通过采用本专利公开的技术方法,在生成新的区块时,只有被选举出的一部分用户参与达成共识,大幅降低了共识算法运行的计算量,降低了资源占用,从根本上增加了区块链公链的效率并保证了区块链公链的高安全性。
附图说明
图1为一实施例的应用于区块链中的打块方法的流程图。
具体实施方式
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
图1为一实施例的应用于区块链中的打块方法的流程图。如图1所示,该方法包括:
步骤110,基于创世区块中的种子参数、最新的已有区块的区块哈希值和已有的BeconHash,计算新的BeconHash;
步骤120,基于新的BeconHash生成打块节点序列和验证节点序列;
步骤130,基于打块节点序列从网络节点分布序列中筛选出打块节点;
步骤140,基于验证节点序列对网络节点分布序列中筛选出验证节点;
步骤150,基于打块节点和验证节点生成区块并达成共识。
对于区块链,存在有种子参数。具体而言,在创世区块中初始随机种子参数(seed)后,该种子参数保存在每一个新生成的区块中。
VRF全称Verifiable Random Function,也就是可验证随机函数。本实施例是基于VRF实现的。
所述基于创世区块中的种子参数、最新的已有区块的区块哈希值和已有的BeconHash,计算新的BeconHash之前,所述方法还包括:
通过二进制序列记录所有节点,序列中每一个值为1的位代表一个已有的节点,根据这一位在整个网络节点分布序列中的位置,该节点得到对应的索引值;每一个新的节点加入时,随机选择空余的位置并通过其他节点的验证后,获得该节点对应的索引值,所有节点同步新的网络节点分布序列。
对于网络节点分布序列的生成和更新,本实施例中,可以通过足够长的二进制序列记录所有节点,序列中每一个值为1的位代表一个已有的节点,根据这一位在整个网络节点分布序列中的位置,该节点得到对应的索引(Idx)值。每一个新的节点加入时,随机选择空余的位置并通过其他节点的验证后,获得该节点对应的Idx值,所有节点同步新的网络节点分布序列;
本实施例中,当前一次选出的所有打块节点都超出其等待时间时,计算新 的BeconHash(中文:一致性哈希值)。可以首先获得种子参数(seed),最新的一个已有区块的哈希值blockhash和已有的BeconHash(preBeconHash),根据预置算法进行一次或多次哈希映射,得到新的BeconHash。本实施例中,已有的BeconHash(preBeconHash)为前一次的BeconHash(preBeconHash)。所述前一次为相对新的BeconHash而言。
本实施例中,计算节点分组序列。对哈希序列BeconHash进行分拆和计算、组合,生成两个新的哈希序列,两个新的哈希序列分别与网络节点分布序列运算生成打块节点序列和验证节点序列。
本实施例中,基于打块节点序列从网络节点分布序列中筛选出打块节点,包括:
如果网络分布序列的节点根据自己的索引值查询对应在打块节点序列上的对应位的值为1,则作为打块节点。索引值表示节点在网络分布序列节点中的位置。
本实施例中,基于验证节点序列对网络节点分布序列中筛选出验证节点,包括:
如果网络分布序列的节点根据自己的索引值查询对应在验证节点序列上的对应值的值为1,则作为验证节点;索引值表示节点在网络分布序列节点中的位置。
具体的,每个节点根据打块节点序列判断自己是否为打块节点。节点根据自己的Idx值查询打块节点序列上的对应位的值是否为1,若是,则作为本轮次的打块节点。每个打块节点根据预置的算法计算该节点的等待时间,各节点依照等待时间的长度依次打块。
本实施例中,生成区块后,验证节点运行实用拜占庭容错算法实用拜占庭容错算法进行判断,当判断出该区块被超过三分之二的验证节点确认后,该区块被接受。
其中,每个节点根据验证节点序列判断自己是否为验证节点。节点根据自己的Idx值查询验证节点序列上的对应位的值是否为1,若是,则作为本轮次的验证节点。当一个节点生成新的区块后,验证节点运行实用拜占庭容错算法 实用拜占庭容错算法PBFT(Practical Byzantine Fault Tolerance)进行判断,当一个新区块被超过三分之二的验证节点确认后,该区块被接受。
如果预设的规定时间内没有新区块被接受,打块节点的等待时间进行下一个打块节点的打块,直到超出本轮次所有的打块节点的等待时间,进行新的一轮随机选举和打块。
本实施例中,网络节点分布序列中的多个节点可以同时属于同一个用户。
本实施例中,多个节点可以同时属于同一个用户,称这个用户为超级节点。即拥有多个节点的用户为超级节点。每个超级节点依据自己资产的数量等信息计算权益值,根据权益值大小持有对应数目的节点,每个节点在网络节点分布序列中占据一个位置,并拥有对应的索引(Idx)值。
本实施例中,BeconHash计算包括多轮哈希运算,并且最终输出的BeconHash序列的长度与网络节点分布序列的长度相等。
本实施例中,于新的BeconHash生成打块节点序列和验证节点序列,包括:
将新的BeconHash从中间均分为两个序列BHLeft和BHRight;
对BHLeft按位取反,得到BHLeftR;
对BHRight按位取反,得到BHRightR;
连接BHLeft和BHLeftR,得到BHLeft||BHLeftR作为预备打块节点序列;
预备打块节点序列BHLeft||BHLeftR与网络节点分布序列做与运算,得到打块节点序列;
连接BHRight和BHRightR,得到预备验证节点序列BHRight||BHRightR;
将预备验证节点序列BHRight||BHRightR与网络节点分布序列做与运算,再与打块节点序列的取反做与运算,得到验证节点序列。
本实施例中,如果打块节点序列或验证节点序列取到节点数目小于总节点数目的三分之一,可以由步骤110生成新的BeconHash序列,随后得到新的打块节点序列和验证节点序列,与本轮次已有的打块节点序列和验证节点序列做按位或运算,重复此过程直至打块节点序列和验证节点序列所包含的节点数目达到总节点数目的三分之一。
本实施例中,所述作为打块节点之后,方法还包括:
计算每个打块节点的等待时间,等待时间为对应打块节点进行打块的等待时间;
每个打块节点根据对应的等待时间,依照等待时间的长度依次打块。
本实施例中,计算每个打块节点的等待时间,包括:
计算本轮的标准等待时间;
每个打块节点根据本节点的索引值、预设的出块等待超时时长和出块时长常量计算本节点本轮的等待时间。
本实施例中,标准等待时间的计算方法可以为BeconHash序列的整数型对当前打块节点总数的取模;
本实施例中,每个节点的等待时间的计算方法可以为,节点Idx值与标准等待时间求要和,和数对出块等待超时时长取模,模数再与出块时长常量求积。
T i=(Idx i+T standard mod T timeout)*T unit
T i:节点i的等待时间;T standard:标准等待时间;T timeout:出块等待超时时长;T unit:和出块时长常量。
结合以上所述,本发明在保证打块节点和验证节点的随机选举,攻击者无法预知的同时,让权益更高的用户拥有更大的概率被选中。根据哈希算法的特性,BeconHash序列是随机的且均匀分布的,基于BeconHash序列和网络节点分布序列最终生成的打块节点序列和验证节点序列中每个节点被选为打块节点的概率相等,而每个节点被选为验证节点的概率也相等,而超级节点所拥有的节点数目是根据权益分配的,因此本共识算法可以实现权益随机共识方法。
本发明通过节点等待时间的计算决定打块的次序,并且任一打块者没有在规定时间内生成新区块并达成共识则直接跳过进入下一个打块节点的打块步骤,因此基于本权益随机共识算法的区块链可以做到几乎不分叉,并且打块效率极高。
通过采用本专利公开的技术方法,采用可验证随机函数的方式选择见证人用户和打块用户,可以同时满足去中心化、可扩展性和安全性的多方面的要求。本共识算法中没有矿工,所有用户都有可能被选为见证人,但是见证人和打块者的选举是不可预测的,仅有在选举结束后才能确定,规避了被预先攻击的风 险。
本实施例中,在生成新的区块时,只有被选举出的一部分用户参与达成共识,大幅降低了共识算法运行的计算量,降低了资源占用,从根本上增加了区块链公链的效率并保证了区块链公链的高安全性。
本实施例还提供了一种基于VRF的权益随机共识系统,包括:
节点服务器:区块链中至少存在9个节点参与共识,生成新区块;
每一个节点服务器需要包括:
存储模块:用于存储已有区块、种子参数、BeconHash、网络节点分布序列、网络节点分布序列中节点的索引值、打块节点序列、验证节点序列、权益信息、标准等待时间、出块等待超时时长和出块时长常量等信息;
计算模块:用于计算BeconHash、打块节点序列、验证节点序列、标准等待时间和每个节点的等待时间等;
账户模块:用于汇总交易,并生产新的账本(区块);
网络模块:用于保证各个节点服务器的通讯建立和保障;
验证模块:用于在被选为验证节点时的实用拜占庭容错算法;
同步模块:用于同步新的区块和网络节点分布序列等信息。
可以理解,以上系统可以实现以上方法实施例中的具体内容,不同的模块可以实现对应方法实施例中的具体内容。
需要指出的是,以上实施例的装置的实现方式与以上方法的实现方式,装置实施例的实现具体可以参照以上方法实施例中的内容。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。

Claims (12)

  1. 一种基于VRF的权益随机共识方法,其特征在于,所述方法包括:
    基于创世区块中的种子参数、最新的已有区块的区块哈希值和已有的BeconHash,计算新的BeconHash;
    基于新的BeconHash生成打块节点序列和验证节点序列;
    基于打块节点序列从网络节点分布序列中筛选出打块节点;
    基于验证节点序列对网络节点分布序列中筛选出验证节点;
    基于打块节点和验证节点生成区块并达成共识。
  2. 根据权利要求1所述的方法,其特征在于,所述基于打块节点序列从网络节点分布序列中筛选出打块节点,包括:
    如果所述网络分布序列的节点根据自己的索引值查询对应在打块节点序列上的对应位的值为1,则作为打块节点;
    所述索引值表示节点在网络分布序列节点中的位置。
  3. 根据权利要求1所述的方法,其特征在于,所述基于验证节点序列对网络节点分布序列中筛选出验证节点,包括:
    如果所述网络分布序列的节点根据自己的索引值查询对应在验证节点序列上的对应值的值为1,则作为验证节点;
    所述索引值表示节点在网络分布序列节点中的位置。
  4. 根据权利1所述的方法,其特征在于,所述网络节点分布序列中的多个节点可以同时属于同一个用户,所述拥有多个节点的用户为超级节点,每个超级节点依据自己资产的数量等信息计算权益值,根据权益值大小持有对应数目的节点,每个节点在网络节点分布序列中占据一个位置,并拥有对应的索引值。
  5. 根据权利要求1所述的方法,其特征在于,所述新的BeconHash序列的长度与网络节点分布序列的长度相等。
  6. 根据权利要求1所述的方法,其特征在于,所述基于新的BeconHash生成打块节点序列和验证节点序列,包括:
    将所述新的BeconHash从中间均分为两个序列BHLeft和BHRight;
    对BHLeft按位取反,得到BHLeftR;
    对BHRight按位取反,得到BHRightR;
    连接BHLeft和BHLeftR,得到BHLeft||BHLeftR作为预备打块节点序列;
    预备打块节点序列BHLeft||BHLeftR与网络节点分布序列做与运算,得到打块节点序列;
    连接BHRight和BHRightR,得到预备验证节点序列BHRight||BHRightR;
    将预备验证节点序列BHRight||BHRightR与网络节点分布序列做与运算,再与打块节点序列的取反做与运算,得到验证节点序列。
  7. 根据权利要求6所述的方法,其特征在于,所述打块节点序列或验证节点序列中的节点数目大于或等于对应总节点数目的三分之一。
  8. 根据权利要求2所述的方法,其特征在于,所述筛选出打块节点之后,所述方法还包括:
    计算每个所述打块节点的等待时间,所述等待时间为对应打块节点进行打块的等待时间;
    每个所述打块节点根据对应的等待时间,依照等待时间的长度依次打块;
    如果一个打块节点没有在等待时间内生成区块或者生成的区块未被接受,则根据等待时间直接对下一个打块节点生成的区块进行共识;
    当时间超过了已选出的所有打块节点的等待时间后,计算新的BeconHash并进行新的一轮随机选举。
  9. 根据权利要求8所述的方法,其特征在于,所述计算每个所述打块节点的等待时间,包括:
    计算本轮的标准等待时间;
    每个打块节点根据本节点的索引值、预设的出块等待超时时长和出块时长常量计算本节点本轮的等待时间。
  10. 根据权利要求1所述的方法,其特征在于,所述筛选出验证节点之后,所述方法还包括:
    生成区块后,验证节点运行实用拜占庭容错算法实用拜占庭容错算法进行判断,当判断出该区块被超过三分之二的验证节点确认后,该区块被接受。
  11. 根据权利要求1所述的方法,其特征在于,所述基于创世区块中的种子参数、最新的已有区块的区块哈希值和已有的BeconHash,计算新的BeconHash之前,所述方法还包括:
    通过二进制序列记录所有节点,序列中每一个值为1的位代表一个已有的节点,根据这一位在整个网络节点分布序列中的位置,该节点得到对应的索引值;每一个新的节点加入时,随机选择空余的位置并通过其他节点的验证后,获得该节点对应的索引值,所有节点同步新的网络节点分布序列。
  12. 一种基于VRF的权益随机共识系统,其特征在于,包括:
    节点服务器:区块链中至少存在9个节点参与共识,生成新区块;
    每一个节点服务器需要包括:
    存储模块:用于存储已有区块、种子参数、BeconHash、网络节点分布序列、网络节点分布序列中节点的索引值、打块节点序列、验证节点序列、权益信息、标准等待时间、出块等待超时时长和出块时长常量等信息;
    计算模块:用于计算BeconHash、打块节点序列、验证节点序列、标准等待时间和每个节点的等待时间等;
    账户模块:用于汇总交易,并生产新的区块;
    网络模块:用于保证各个节点服务器的通讯建立和保障;
    验证模块:用于在被选为验证节点时的实用拜占庭容错算法;
    同步模块:用于同步新的区块和网络节点分布序列等信息。
PCT/CN2020/093962 2019-06-03 2020-06-02 一种基于vrf的权益随机共识方法及系统 WO2020244510A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910477367.5A CN110213038A (zh) 2019-06-03 2019-06-03 一种基于vrf的权益随机共识方法及系统
CN201910477367.5 2019-06-03

Publications (1)

Publication Number Publication Date
WO2020244510A1 true WO2020244510A1 (zh) 2020-12-10

Family

ID=67790388

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/093962 WO2020244510A1 (zh) 2019-06-03 2020-06-02 一种基于vrf的权益随机共识方法及系统

Country Status (2)

Country Link
CN (1) CN110213038A (zh)
WO (1) WO2020244510A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110213038A (zh) * 2019-06-03 2019-09-06 中城智慧科技有限公司 一种基于vrf的权益随机共识方法及系统
CN110601834B (zh) * 2019-09-30 2023-02-10 深圳市迅雷网络技术有限公司 一种共识方法、装置、设备及可读存储介质
CN111182043B (zh) * 2019-12-23 2022-08-12 南京亚信智网科技有限公司 哈希值的分配方法及装置
CN114463009B (zh) * 2022-04-13 2022-06-28 成都理工大学 一种用于提高大规模能源节点交易安全性的方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108614748A (zh) * 2018-04-19 2018-10-02 上海分布信息科技有限公司 一种拜占庭容错的方法及其通证经济的治理系统
CN108667614A (zh) * 2018-04-19 2018-10-16 上海分布信息科技有限公司 一种拜占庭容错方法及其实现系统
CN108900380A (zh) * 2018-07-14 2018-11-27 上海分布信息科技有限公司 一种节点管理方法及其实现系统
US20190147438A1 (en) * 2016-05-04 2019-05-16 Silvio Micali Distributed transaction propagation and verification system
CN110213038A (zh) * 2019-06-03 2019-09-06 中城智慧科技有限公司 一种基于vrf的权益随机共识方法及系统

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10432411B2 (en) * 2016-05-10 2019-10-01 Acronis International Gmbh System and method for file time-stamping using a blockchain network
CN107124403A (zh) * 2017-04-14 2017-09-01 朱清明 区块链中共识区块的生成方法与计算设备
CN107623686B (zh) * 2017-09-12 2019-09-17 深圳先进技术研究院 区块链共识达成方法、装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190147438A1 (en) * 2016-05-04 2019-05-16 Silvio Micali Distributed transaction propagation and verification system
CN108614748A (zh) * 2018-04-19 2018-10-02 上海分布信息科技有限公司 一种拜占庭容错的方法及其通证经济的治理系统
CN108667614A (zh) * 2018-04-19 2018-10-16 上海分布信息科技有限公司 一种拜占庭容错方法及其实现系统
CN108900380A (zh) * 2018-07-14 2018-11-27 上海分布信息科技有限公司 一种节点管理方法及其实现系统
CN110213038A (zh) * 2019-06-03 2019-09-06 中城智慧科技有限公司 一种基于vrf的权益随机共识方法及系统

Also Published As

Publication number Publication date
CN110213038A (zh) 2019-09-06

Similar Documents

Publication Publication Date Title
WO2020244510A1 (zh) 一种基于vrf的权益随机共识方法及系统
AU2020205231B2 (en) Methods and apparatus for efficiently implementing a distributed database within a network
US11411721B2 (en) Systems and methods for selecting and utilizing a committee of validator nodes in a distributed system
AU2017272163B2 (en) Verification system and method with extra security for lower-entropy input records
WO2021032138A1 (zh) 一种基于区块链系统的共识方法、装置及系统
EP4002181A1 (en) A consensus method and framework for a blockchain system
US11157487B2 (en) Trusted storage method and system based on directed acyclic graph structure
CN111865920A (zh) 一种网关认证和身份鉴权的平台及其方法
CN110741600A (zh) 提供去中心化协议以找回加密资产的计算机实现的系统和方法
EP3555757A1 (en) Methods and apparatus for a distributed database that enables deletion of events
Butler et al. Optimizing BGP security by exploiting path stability
CN110061850A (zh) 变色龙哈希函数的碰撞计算方法及可编辑区块链构造方法
WO2017079652A1 (en) Cryptographic transactions system
CN109919771B (zh) 一种应用分层区块链技术的工业互联网交易装置
CN111371905B (zh) 一种基于云计算的区块链分层共识证明系统与方法
JP7339965B2 (ja) ノードのネットワークにおいてデータ・パケットを伝搬するためのシステム及び方法
WO2019081919A1 (en) STORING AND VERIFYING DATA
CN110599144B (zh) 一种区块链节点的入网方法以及装置
Zhao et al. Evaluating DAG-based blockchains for IoT
WO2013172743A1 (ru) Способ защищенного взаимодействия устройства клиента с сервером по сети интернет
Giuliari et al. Colibri: a cooperative lightweight inter-domain bandwidth-reservation infrastructure
CN109450685A (zh) 一种基于局部链节点离线的共识方法及节点
CN112699136B (zh) 一种跨链存证方法及相关装置
CN113923217A (zh) 一种基于dag的异步拜占庭共识方法及系统
Alzahrani et al. Key management in information centric networking

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20819404

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20819404

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20819404

Country of ref document: EP

Kind code of ref document: A1