Summary of the invention
The embodiment of the present invention is designed to provide a kind of network scalability block chain implementation method, to solve tradition
The public very weak technical problem of block chain network scalability.
To achieve the above object, described the embodiment of the invention provides a kind of network scalability block chain implementation method
Implementation method, which includes: all verifying nodes, will be assigned in different groups at the beginning of each round knows together the period and is formed
Several fragments;Each fragment is according to the prestige integral of corresponding group interior joint generated by historical behavior with the election of positively related probability
It leads out;Transaction initiator sends transaction to the responsible fragment for handling the transaction, what the subsequent districting operation was led based on fragment
Common recognition synchronized algorithm, generates transaction block and prestige block;Based on the behavior for all verifiers that know together, all-network verifies node
Prestige scoring calculating is carried out by credit rating mechanism and is reached common understanding for reputation;It scores to calculate in prestige and complete
Afterwards, network verification node generates the prestige block using common signature, and the prestige block includes prestige scoring, has confirmed that
Transaction block lists, previous prestige block and common signature;And when each knows together end cycle, each fragment group is raw
At a state block, the record of trade block chain and prestige block chain is packaged, subsequent network verification node is based on coming from institute
There is the state block of fragment, the credit value for synchronizing and updating storage starts next common recognition period after terminating.
Preferably, it is described verifying node using it is previous common recognition the period state block cryptographic Hash come generate random number from
And randomness is introduced, it then verifies node and is randomized to either in each fragment.
Preferably, in the election mechanism of the leader, higher than the verifying node that prestige integrates sequence median with prestige product
Positively related probability is divided to lead as fragment.
Preferably, every transaction has unique identification, input UTXO list and output UTXO list;All-network verifying section
Point sends transaction to the fragment for being responsible for input UTXO, and exports the UTXO listed in these transaction.
Preferably, it in the common recognition synchronized algorithm based on fragment leader, for fragment i, is removed for verifying transaction id
It is the transaction of i after adding 1 with the remainder of fragment group number.
Preferably for trading in piece, the common recognition synchronized algorithm based on fragment leader includes: that the leader in piece will wrap
List signature containing transaction id is sent to the node in all;Each network verification node checks the transaction in transaction List Table
ID is simultaneously determined to receive, is refused or can not confirm the transaction;Network verification node passes to piece after their decision is signed
Interior leader;Leader generates transaction block after the decision for collecting verifying node, which includes all-network verifier's
The signature of signature and leader;Each network verification node checks the information of Correlation block;If it exceeds half is verified
Node sounds an alarm, then leader will be removed out network in piece, while the fragment regenerates leader;When several transaction
Block generates, and does not receive alarm, and network verification node will calculate the credit value of respective nodes, generates letter after common signature
Praise block.
It trades preferably for across piece, in the common recognition synchronized algorithm based on fragment leader, input fragment arranges transaction
Table and transaction determine that list is sent to relevant output fragment and other input fragment.
Preferably, the transaction of the network verification node determines that list includes multiple signatures, and each signature is for signing
The a subset of transaction List Table, the transaction in a subset are sent to identical output fragment to reduce bandwidth cost.
Preferably, the common recognition synchronized algorithm based on fragment leader is by the way of parallel processing, if different friendships
It does not conflict with one another easily, then by the parallel processing transaction in different blocks;The method of the parallel processing includes: each transaction column
Table, transaction determine list and block of trading includes the number of iterations for being used to indicate the wheel common recognition period;And leader is once from net
The All Activity that network verifying node receives previous round determines, so that it may send new transaction List Table.
Preferably, the formula that the prestige scoring calculates are as follows:
Wherein, l is the number of transaction of generation after previous credit rating period prestige block;T (j) is the friendship of transaction j
Easy volume;S (j) is the zoom factor of transaction j, for differently rewarding or punishing the behavior of verifying node;The prestige scoring meter
It is that different zoom factors is arranged in different behaviors in calculation, the punishment of dishonest conduct is made to be greater than the reward of dishonest behavior, for
" unknown " decision, network verification node, which will not both obtain reputation, will not lose reputation.
The embodiment of the present invention has the advantages that
1) embodiment of the present invention proposes the structure of parallel-chain, transaction and common recognition is separated into two chains, to improve block chain
The scalability of network;Common recognition part is carried out in prestige chain, and prestige chain network pays close attention to safety, is supported and is traded with speed appropriate
The high speed of chain network is traded;
2) embodiment of the present invention is enhanced the safety of block chain network using credit rating mechanism and improves excitation, is based on
On the one hand the prestige common recognition mechanism of node history performance filters out the honest and excellent network node of process performance, while giving it
More expectation networks contributions and reward;On the other hand it is easier to find potential Web Grafiti person and malicious node and timely
Rejected network, it is ensured that the safety of block chain network.
3) based on every advantage of credit rating mechanism, the embodiment of the present invention proposes the network based on credit rating mechanism point
Piece method, the network leader that node that is honest and haveing excellent performance has bigger probability to become fragment after being sliced, to realize network height
The safety of block chain network is not reduced while handling capacity.
Embodiment 1
Allocation methods are one of current raising most promising directions of block chain scalability.By by the transaction on network
It is divided into different fragments, each node on network need to only handle the transaction of sub-fraction, hand over other network node parallel proofs
Easily, extensive work can be completed.Current allocation methods are broadly divided into: network fragment, refer to that, using randomness, network is taken out at random
Node is taken to form fragment, to prevent malicious node from excessively filling single piece;Transaction fragment, in a system based on UTXO,
System distributes a fragment according to the address of sender to ensure that two honeysuckle transaction will be verified in identical fragment, is
System can reliably detect honeysuckle transaction, without carrying out any communication across piece;State fragment, in state fragment
In the case of, a part of each fragment reserved state, this is that allocation methods are most difficult to a kind of scheme realized.
Refering to what is shown in Fig. 1, a kind of network scalability block chain implementation method provided in an embodiment of the present invention includes: fragment
, credit rating mechanism synchronous with leader's election, the common recognition based on fragment leader and global synchronization algorithm.The embodiment of the present invention passes through
A kind of common recognition mechanism of credit rating mechanism construction carries out network fragment based on this, improves the scalability of block chain network, mention net
The trading processing speed of network.
It is a kind of block link network of network scalability block chain implementation method provided in an embodiment of the present invention with reference to Fig. 2
Network system structure diagram.It carries out fragment and leader first to elect, then common recognition synchronizes, while this two parts is comprised in this hair
In the credit mechanism of bright embodiment design;Common recognition terminates, and relationship trading global synchronization is finally packed into block chain network.
Fragment is elected with leader, and in this process, all verifying nodes are at the beginning of each round knows together the period
Several fragments are formed by being assigned in different groups, each fragment group can select the leader of the group.Detailed process is as follows: when new
At the beginning of one new common recognition period e, all verifying nodes be assigned in different groups and according to group interior joint by
The prestige that historical behavior generates, which is integrated, elects leader with positively related probability.Particularly, verifying node uses preceding state
The cryptographic Hash of block generates random number to introducing randomness, and then, node is allocated in each fragment.
Further, the verifying node ensures total prestige of each fragment by slicing algorithm during being probabilistically assigned
It is worth of substantially equal, the slicing algorithm includes:
Input:
Random sequence:Wherein, e indicates e-th of common recognition period, SBH table
Show the cryptographic Hash of each verifying node state block, k indicates k-th of verifying node;
Accumulative reputation collection:Wherein, w indicates accumulative letter
It praises score and calculates period, r indicates that the accumulative reputation of each verifying node, k indicate k-th of verifying node;
Output:
Fragment member always collects: C={ c1,c2,…,cn, wherein n indicates that n-th of fragment, c indicate the member of each fragment
Collection;
Fragment leader's collection: L={ l1,l2,…,ln, wherein n indicates that n-th of fragment, l indicate the leader of each fragment;
Initialization,Wherein, i is recycled from 1 to n;
With Seed in circulationeFor random generator RNG;
By accumulative reputation collection RwIn elementAccumulative reputation sequence is formed according to being ranked up from big to small
Collect Rsort:
Wherein, sort is indicated accumulative reputation collection RwIn elementAccording to being ranked up from big to small;
For RsortEach ofIt executes:
Find a sequence { t1,t2,…,tj, form the subset of CAnd meet:
In minimum value;
A random integers x is generated from random generator RNG;
Will with it is eachCorresponding verifying node vgIt distributes toWherein, u=x divided by j remainder+1;
Until all verifying nodes are probabilistically assigned rear end loop.
In addition, the verifying node for integrating sequence median higher than prestige is integrated in the election mechanism design of leader with prestige
Positively related probability is led as fragment.Specifically, leader's election algorithm of the election mechanism of the leader includes:
Each of C element c is always collected for fragment membern, it executes:
Rm=is included in cnIn all verifying nodes add up reputation median;
For being included in cnIn each verifying node vj, it executes:
IfThen, a random floating point is generated from random generator RNG:
IfThen, pi,j=+∞
Work as pi,m=(pi,1,pi,2,…pi,j) in minimum value when, ln=vm;
One cnExecution terminates;
Until traversal fragment member always collects each element in C, fragment member, which always collects C, to terminate to execute circulation;
Leader's election algorithm end loop.
Common recognition based on fragment leader is synchronous, and transaction initiator sends transaction (tx) to the responsible fragment for handling the transaction,
The common recognition synchronized algorithm that the subsequent districting operation is led based on fragment, generates transaction block and prestige block;In addition, for across piece
It trades, across the piece mechanism of atomicity is used in this embodiment of the present invention, to ensure honeysuckle do not occur.
Similar with bit coin with reference to Fig. 4, every transaction (tx) will have unique identification in embodiments of the present invention, input
UTXO list and output UTXO list;All-network verifying node sends transaction to the fragment for being responsible for input UTXO, and defeated
The UTXO listed in these transaction out, UTXO (Unspent Transaction Outputs) are the substantially single of bit coin transaction
Position, is the transaction output not spent, it is the key concept that the transaction of bit coin is generated and verified.For fragment i, in this hair
In bright embodiment, it will be used to verify after transaction id adds 1 divided by the remainder of fragment group number the transaction for being i.Due to the input of UTXO
It may be from different fragments, the implementation method being related in the embodiment of the present invention is capable of handling in piece and across piece transaction.
With reference to Fig. 4, for trading in piece, the common recognition synchronized algorithm based on fragment leader includes: that the leader in piece (divides
Piece leads lj) by comprising transaction id list signature (TxList,L is led for fragmentjSignature) be sent in all
Node (fragment member Vi);Each network verification node checks the transaction id in transaction List Table and determines to receive, refuse still
It can not confirm the transaction;Network verification node signs their decision (TxDec, SigiFor each network verification node
Signature) after pass to leader in piece;Leader generates transaction block after the decision for collecting verifying node, which includes institute
There is the signature (sig of network verification person1、sig2…sigi…sigm) and leader signatureEach network verification section
Point checks the information of Correlation block;With reference to Fig. 3, if it exceeds half verifying node sounds an alarm, then leader in piece
It will be removed out network, while the fragment regenerates leader;When several transaction blocks generations, and do not receive police
Report, network verification node will calculate the credit value of respective nodes, generate prestige block after common signature.
With reference to Fig. 4, for trading across piece, in the common recognition synchronized algorithm based on fragment leader, input fragment will trade
List (TxList) and transaction determine that list (TxDecSet) is sent to relevant output fragment and other input fragment.
It is noted that transaction or across piece transaction either in piece, the transaction of the network verification node determines list
It (TxDecSet) include multiple signature sig1、sig2…sigi…sigm, each signature is for signing a son of transaction List Table
Collect, the transaction in a subset is sent to identical output fragment to reduce bandwidth cost;For some friendship across piece fragment
Easily, if correlation UTXO is not used by or locks, fragment will receive, and otherwise will refuse the transaction;Input fragment and output point
Piece will all lock correlation UTXO;Connecing for list is determined when receiving the transaction comprising the input UTXO from all correlated inputs fragments
When being proved, output fragment adds the transaction on transaction block;It is connect when input fragment is received from other correlated inputs fragment
When being proved, by release relationship trading and its UTXO;And if one of input fragment refuses the transaction, relevant input
With output fragment by abort transactoin.
It is described to be led based on fragment in order to further increase the trading processing ability of implementation method disclosed by the embodiments of the present invention
The common recognition synchronized algorithm led is by the way of parallel processing, will be in different blocks if different transaction does not conflict with one another
Parallel processing transaction;More specifically, the method for the parallel processing includes: each transaction List Table, transaction decision list and transaction
Block includes the number of iterations for being used to indicate the wheel common recognition period;And leader once receives previous round from network verification node
All Activity determine, so that it may send new transaction List Table.The common recognition agreement in the embodiment of the present invention is looked back, due to using same
Agreement is walked, it guarantees before the transaction List Table for receiving current round, and most honesty nodes, which are completed, determines the transaction of previous round
Determine the work that list is sent to leader.Therefore, network verification node can determine whether new transaction List Table is effective.
Credit rating mechanism, credit rating mechanism effectively support fragment above-mentioned, common recognition synchronization scheme.Based on common recognition
The behavior of all verifiers, all-network verifying node pass through credit rating mechanism and carry out prestige scoring calculating and for prestige
Score is reached common understanding.By accumulating credit rating, fragment can be more safe and efficient with leader's election mechanism.To in a piece
Transaction, after end cycle of knowing together, the reputation in fragment can be by all fragment members according to transaction conclusion collection and friendship
Easy block is independent and consistently calculates, and the mechanism of reputation, which can according to need, carries out pluggable design, the prestige scoring
The formula of calculating are as follows:
Wherein, l is the number of transaction of generation after previous credit rating period prestige block;T (j) is the friendship of transaction j
Easy volume;S (j) is the zoom factor of transaction j, for differently rewarding or punishing the behavior of verifying node.
The prestige scoring is that different zoom factors is arranged in different behaviors in calculating, and keeps the punishment of dishonest conduct big
In the reward of dishonest behavior.Since illegal transaction is by by more dangerous than being abandoned, if some network verification node
Provide "Yes" and most of other provide "No", then network verification node will be given more punishment.For " unknown " decision,
Network verification node, which will not both obtain reputation, will not lose reputation because these verifying nodes usually have it is lower
Performance, (CPU, hard disk and bandwidth etc.) can not be communicated in time.
With reference to Fig. 3, in figure:For the fragment c in the e-1 period of knowing together1Prestige block,It knows together for e-th
The fragment c in period1Honest node prestige block,For the fragment c in e-th of period of knowing together1Malicious node/potential malice
Node prestige block,For fragment c1Honest node state block,For fragment c1Malicious node/potential malice section
Dotted state block, TB are honest node transaction block, and TB ' is malicious node/potential malicious node transaction block, and Nonce is close
Code is any or non-repetitive random number being only only used once in learning, and after the completion of prestige scores and calculates, network is tested
It demonstrate,proves node and generates the prestige block, the transaction block that the prestige block includes prestige scoring, has confirmed that using common signature
List, previous prestige block and common signature.Specifically, the generation of the prestige block is led by block and network verification
Node runs two continuous rounds, including announces and promise to undertake, challenges and respond the ashed information label of first previous cycle prestige block
Name, the quantity and identity information of verifier of these signatures comprising agreeing to block, subdivision planning digital multisignatures in addition, if it exceeds
The network verification node of half is signed on block, then receives block of trading;The prestige block, which provides evidence, proves to be more than half
Network verification node receive transaction block.In a common recognition period, prestige block can be packed into prestige chain by fragment.
Global synchronization algorithm, when each knows together end cycle, each fragment group generates a state block, will hand over
The record of easy block chain and prestige block chain is packaged, and subsequent network verification node is based on the state block from all fragments, together
The credit value for walking and updating storage starts next common recognition period after terminating.In order to reduce the entire mutual ditch of block chain node
Logical huge network overhead, the network verification node generate the state block, the net using the mode of multiple party signatures
Network verifying node generates fragment of the random number for next common recognition period using the mode of proof of work in state block
It is elected with leader.
Although above having used general explanation and specific embodiment, the present invention is described in detail, at this
On the basis of invention, it can be made some modifications or improvements, this will be apparent to those skilled in the art.Therefore,
These modifications or improvements without departing from theon the basis of the spirit of the present invention are fallen within the scope of the claimed invention.