Specific embodiment
It is described in detail to various aspects of the present invention below in conjunction with the drawings and specific embodiments.Wherein, many institute's weeks
Module, unit and its mutual connection, link, communication or the operation known are not shown or do not elaborate.Also, institute
Feature, framework or the function of description can combine in any way in one or more embodiments.Those skilled in the art
Member is it should be appreciated that following various embodiments are served only for the protection scope for example, and is not intended to limit the present invention.May be used also
To be readily appreciated that, module or unit or processing mode in each embodiment described herein and shown in the drawings can by it is various not
It is combined and designs with configuration.
The technical problem to be solved in the present invention is that overcoming the shortcomings of that existing block catenary system can not resist quantum attack, mention
The block catenary system of quantum attack can be resisted for one kind.In order to solve the above technical problems, major programme of the invention is as follows:
In one block catenary system, each node users call specific key schedule, obtain corresponding public-private key pair, lead to
Cross the anti-quantum attack for realizing using public key algorithm and ring signatures algorithm based on coding and communicating and trade in block chain
Characteristic.
The process that the node data processing method of the block chain of embodiment according to the present invention is shown referring to Fig. 1, Fig. 1 is shown
It is intended to.Node Processing Method shown in FIG. 1 relates generally to processing of transferring accounts of trading, this method can include: step S101, step
S102, step S103 and step S104, wherein step S101, counterpart keys generate, step S102, and corresponding Hash generates, step
S103, corresponding signature step, step S104, corresponding verification processing.Above-mentioned step is carried out below with reference to specific embodiment
Explanation.
S101, first node are generated according to preset key schedule for carrying out public signature key-private to Transaction Information
Key to and hash function, wherein first node be block chain in initiate transaction any one node.
Include multiple nodes in block catenary system, can be in communication with each other between these nodes, first node can be block
Any one in chain node initiates the node of transaction, for example, being properly termed as node of transferring accounts.
In certain embodiments of the present invention, each node calls specific key schedule in block catenary system,
Corresponding public-private key pair is obtained, by using public key algorithm and ring signatures algorithm based on coding, is realized in block chain
The anti-quantum of middle communication and transaction attacks characteristic.
In embodiments of the present invention, first node is generated according to preset key schedule for Transaction Information
The public-private key signed to and hash function include: using probabilistic polynomial time algorithm generate public-private key to and breathe out
Uncommon function, public key and private key are to other than it can sign to Transaction Information, can be also used between two nodes
Secret communication provides safety assurance.Wherein, probabilistic polynomial time algorithm is a classification of key schedule, and the key is raw
It is a kind of probabilistic polynomial time algorithm at algorithm.In some specific embodiments, key schedule may include following 7
Step:
(1) first node determines that the k for correcting t bit-errors ties up binary Goppa code Ci, code length n=2m, wherein t, k, i, n and m
For positive integer and n is greater than k, and i is number of the first node in block chain node;
(2) binary Goppa code C is determinediCorresponding check matrixAnd syndrome decoding algorithm
(3) the random invertible matrix V of binary of (n-k) × (n-k) is determinediWith the binary random permutation matrix P of n × ni;
(4) one-way Hash function h () is determined;
(5) it calculatesHi is the random invertible matrix V of the binaryi, check matrixIt is set at random with binary
Change matrix PiProduct;
(6) public-private key pair is generatedWherein PK is public key, and SK is
Private key;
(7) system public parameter (t, C are generatedi, Hi, h ()), wherein t is the digit corrected, CiIt is the first of i for number
The binary Goppa code of node, HiFor the public key for the first node that number is i, h is one-way Hash function.
Goppa code in step (1) is a kind of special linear block codes, and some Goppa codes meet following formula: n=
2m;K=n-mt;Goppa code can carry out efficient coding, and Goppa code can be used as secret trap door information, may be implemented unidirectional
Trapdoor algorithm, to construct public key encryption and signature algorithm.
One-way Hash function is safe one-way Hash function in above-mentioned steps.Those skilled in the art can choose known
Any one one-way Hash function of meet demand, embodiment of the present invention do not limit this.
The system public parameter generated in above-mentioned steps (7), is that first node is disclosed to other nodes of block catenary system
Parameter, other nodes in block chain are available to arrive these disclosed parameters.
It in certain embodiments of the present invention, can be it for the public key generated by above-mentioned key schedule
Wallet address is generated, and other nodes that the wallet address corresponds to block chain are disclosed.
The Transaction Information of this node is generated Hash digest using the hash function by S102, first node.
In embodiments of the present invention, the Transaction Information of this node can be relevant Transaction Information of transferring accounts.These are handed over
Easy information M can generate Hash digest by the one-way Hash function generated in step S101.For example, following public affairs can be used
Formula (1) is completed:
T=h (M) (1)
Wherein, T is Hash digest, and M is Transaction Information.
S103, first node sign to the Hash digest according to the private key of this node, obtain Hash digest signature.
Ring signatures technology is as a kind of special group ranking, it does not have trusted party, not the establishment process of group, for testing
Signer is full energy matries for card person.Ring signatures provide a kind of ingenious method that anonymity betrays the pot to the roses, and apply in block
It can effectively ensure that the privacy information of user in catenary system.The anonymization of transaction is thoroughly realized using ring signatures technology, is protected
The privacy information of user in system.
In certain embodiments of the present invention, step S103 may include that first node selects some public key ring sequence
Column, which is a subset of all ring members, specifically, may include following step:
(1031) word is randomly choosedCalculate initial ring sequenceSuch as Fig. 4
Shown, wherein q=0,1,2 ..., L are the numbers of word in public key ring, and L is the sum of word in public key ring,Represent two element field
On (n-k) dimensional vector, n be Goppa code length, k be Goppa code dimension;
(1032) forwarding ring sequence is generated, to i=r+1 ..., l-1,0,1 ..., r-1, randomly chooses word
(Hamming weight t) is calculatedAs shown in Figure 4, whereinIndicate exclusive or
Operation;
(1033) it is calculated using trapdoor functionSo thatSearch so thatEnergy
The minimum value of the q enough decoded
(1034) it calculates in the space for the word that weight is predetermined valueIndex Wherein i1< i2< ... < iqIt is defined asNonzero digit position;
(1035) it selects preset value (for example, 0) as glue value, enables Then the signature of Hash digest isAs shown in Figure 4.
In the string number (i.e. vector) that Hamming weight is only 0 and 1 in above-mentioned steps, 1 number.
Trapdoor function in step (1033) can be known to the skilled in the art one of a variety of trapdoor functions,
Embodiment of the present invention does not limit this.
In step (1034) and (1035), predetermined value can be 9, that is to say, that can choose the sky for the word that weight is 9
Between index.Represent combinatorial formulaFor example: assuming thatIts Hamming weight is 3, non-zero
The position of position is first, third position, the 5th (being zero-bit first respectively from left to right ...), i.e. i1=1, i2=3, iq
=i3=5, so It isSimplify indicate.
Glue value can refer to known value, because needing to use formula when verifying signature Only known siValue could calculate si+1Value, can choose s0Value be used as known to push away
It leads, in some embodiments, it is also possible to select other values.
The Transaction Information, Hash digest signature and the public key ring are broadcast to area by step S104, first node
The accounting nodes of block chain, so that the public key ring that the accounting nodes are broadcasted according to the first node plucks the Hash of first node
It signs and is verified, complete book keeping operation.
In embodiments of the present invention, first node, i.e. sending node, by what is generated in Transaction Information M, step 1035
The Hash digest of Transaction Information M is signedIt is carried out with the forwarding ring that step 1032 generates
After encapsulation is packaged, the accounting nodes of block chain are broadcast to, for example, miner.
Accounting nodes receive the data that Transaction Information M, Hash digest signature sigma and public key ring are packaged, and are verified.Book keeping operation
Node can be any one node of block catenary system.In some embodiments, the verification process of accounting nodes can include:
From the index of Hash digest signature sigmaMiddle recovery zi;Then it calculatesJudge sl=s0It is whether true;If sl=s0At
Vertical, then miner is verified, and beneficiary receives transfer amounts, otherwise authentication failed, transaction failure.
The node security transaction processing method for the block chain that embodiment of the present invention provides, the private key pair of each node users
Transaction Information is signed, and public key is used to verify trading signature, and generates wallet address for public key.Transaction initiator, i.e.,
Node of transferring accounts calculates initial ring sequence s in signatureR+1, qWith forwarding ring sequence sI+1, qWhen using node users oneself randomly choose
Public key ring sequence L, by oneself private key and public key ring sequence L complete signature, thus conceal transaction initiator identity
Information achievees the purpose that anonymous deal.At the same time, miner receive broadcast come comprising Transaction Information, Hash digest signature and
When forwarding the data packet of ring sequence, signature authentication is carried out using public key ring.If being verified, can only illustrate it is certain in public key ring
The transaction of owner's signature of one public key, and can not determine that transaction is initiated by which node, to solve transaction section
The data-privacy problem of point.Transaction Information is recorded in new block by miner after being verified, and beneficiary receives transfer amounts,
Transaction is completed.
In the block catenary system of embodiment of the present invention, Node Processing Method is in addition to may include above-mentioned Transaction Information
Except processing, it may also include the secret communication between node two-by-two.At the block chain node data that embodiment of the present invention provides
Reason includes two aspect of trading processing and secure communication between node.Communication between two nodes may include initializing
The reception and decryption of journey, message sending node to the encryption and transmission, message recipient node of message to message.Specifically, such as
Shown in Fig. 2, it may include step S201, corresponding first node encrypting step, step S202, corresponding second node decryption step.Under
Face is in conjunction with specific embodiments illustrated above-mentioned steps.
Step S201, first node receive the public key that second node is sent, and are added according to the received public key of institute to message
It is close, encryption message is obtained, sends the second node for the encryption message.The second node uses the second node
The encryption message is decrypted in private key.Wherein, first node can be message sending node, and second node can be message
Receiving node, for example, it may be other any one nodes in block catenary system other than message sending node.
In some embodiments, first node encrypts message according to the received public key of institute, obtains encryption message
Can include: first node message m to be sent is divided into the n-dimensional vector that Hamming weight is tIts
In, φN, t() shows a kind of transformation,Represent the n-dimensional vector on two element field;Encryption message is determined according to following formula (2)
(i.e. ciphertext) s:
S=HBeT (2)
Wherein, HBFor the public key of second node, eTFor the transposition of the n-dimensional vector.
Step S202, the encryption message that second node sends first node using the private key of the node itself, i.e. ciphertext,
It is decrypted.Specifically, can include: the private key of message recipient node B (corresponding second node) oneself isIt calculatesIt is translated with decoding algorithm
CodeThen clear-text message is Generation
Table is to (VB -1S) it is decoded, decoding result is I.e. explanation can be with by this decipherment algorithm
It is recovered in plain text by ciphertext.It should be noted that those skilled in the art can choose known any decoding algorithm, this
Invention embodiment does not limit this.
The block chain node data processing method that embodiment of the present invention provides can resist quantum attack, each node
The private key of user is used to solve confidential information or sign to Transaction Information, and public key is used to encryption information and verifying transaction label
Name, and wallet address is generated by public key.Transaction initiator, that is, node of transferring accounts calculate initial ring sequence and forwarding ring in signature
Node users oneself randomly selected public key ring L is used when sequence, and signature is completed by the private key and public key ring L of oneself, thus
The identity information for concealing transaction initiator, achievees the purpose that anonymous deal.At the same time, miner receives the data packet that broadcast comes
When, signature authentication is carried out using public key ring.If being verified, can only illustrate be some public key in public key ring owner's label
The transaction of administration, and can not determine that transaction is initiated by which node, to solve the problems, such as the data-privacy of transaction node.Mine
Transaction Information is recorded in new block by work after being verified, and beneficiary receives transfer amounts, and transaction is completed.
It should be noted that all node users are in the same ring in the block catenary system of anti-quantum attack,
And the characteristics of ring signatures meet spontaneity and anonymity, this is also the block catenary system of anti-quantum attack just.Its spontaneity
To say, in the block catenary system of anti-quantum attack, can increase at any time or change system in node users, and each section
Point user is the member in ring.The public key of node users discloses in systems, as long as each node is random when initiating transaction
One group of public key ring is selected, is signed further according to the private key of oneself, can realize the anonymity of signature, to realize anonymous turn
Account.
In the block catenary system of anti-quantum attack, above-mentioned secret communication and transaction transfer procedure are using based on coding
Public key algorithm, can guarantee data confidentiality, transaction anonymity while resist quantum attack.
The block chain node communication processing method that embodiment of the present invention provides, has used the public key encryption based on coding to calculate
Method resists quantum attack, and the communication information is carried out by message sender using the public key of recipient's node users when inter-node communication
The node users of encryption based on coding, message receiver are checked using the private key decryption of oneself, ensure that in rear quantum environment
The confidentiality of information in lower block catenary system.
To resist quantum attack, the ring signatures algorithm based on coding is also used in block catenary system, node of transferring accounts exists
Using the ring signatures algorithm based on coding when signing to Transaction Information, miner is carried out by the public key ring for node offer of transferring accounts
Verifying, ensure that the privacy of the both parties in block catenary system under rear quantum environment.
Fig. 3 and Fig. 4 respectively illustrates the process of block chain node data processing, wherein process shown in Fig. 3 pays close attention to two
Message communicating between node, Fig. 4 pay close attention to the trading processing between two nodes.
As shown in figure 3, node A first and node B just calls key raw when the block catenary system of anti-quantum attack is added
At algorithm, the public-private key pair of oneself is obtained;Node A is using the public key of node B according to the Encryption Algorithm based on coding to message
Encrypting and transmitting gives node B;Node B decrypts cipher-text message according to the decipherment algorithm based on coding using the private key of oneself, reads
It wins the confidence breath.Due in communication process use the cryptographic algorithm based on coding so that message under the calculation power of quantum computer according to
So there is confidentiality.
Node A initiates the process of transaction, as shown in figure 4, being described in detail below: all anti-first including node A
The block chain node of quantum attack calls key schedule, obtains the public-private key pair of oneself, is generated accordingly by public key
Location;Node A handles Transaction Information using hash function, generates Hash digest;Node A randomly chooses public key ring to transaction
The Hash digest of information carries out anonymity signature;Node A is by Transaction Information, the Hash digest of the Transaction Information and the label of Hash digest
Name is packaged, and broadcasts to all miners in block catenary system;Miner in system keeps accounts according to power is calculated, and finally can only
There is a miner to obtain book keeping operation power, is tested as miner B signs to it using the public key ring that node A is sent after obtaining book keeping operation power
Card;It trades if being verified success, beneficiary receives transfer amounts, completes the process of anonymous deal.Due in process of exchange
Ring signatures algorithm of the middle use based on coding, the process of ring signatures is as shown in figure 5, make block catenary system in the ring of quantum calculation
Still meet anonymity under border.
In conclusion the node data processing method for the block chain that embodiment of the present invention provides, by leading between node
Using the public key algorithm based on coding when letter and transaction, to realize the block chain number of nodes that can resist quantum attack
According to processing.The algorithm being related in the present invention can satisfy security requirement, and the system has nodal information full energy matries
Feature.
Embodiment of the present invention also provides a kind of computer equipment.As shown in fig. 6, computer equipment 600 includes memory
601 and processor 602, wherein the memory is stored with computer instruction;The processor is configured to execute the calculating
Machine instructs so that the computer equipment executes node data processing method recited above.
Embodiment of the present invention also provides a kind of computer-readable non-volatile memory medium, is stored thereon with computer
Instruction, the computer instruction realize node data processing method recited above when being executed by processor.Wherein, the machine
Readable storage medium may be embodied in the storage medium on first kind node, and may include the storage on the second class node
Medium.In block catenary system, these storage mediums are non-volatile storage mediums.
Through the above description of the embodiments, those skilled in the art can be understood that the present invention can be by
The mode of software combination hardware platform is realized.Based on this understanding, technical solution of the present invention makes tribute to background technique
That offers can be embodied in the form of software products in whole or in part, which can store is situated between in storage
In matter, such as ROM/RAM, magnetic disk, CD, including some instructions use is so that a computer equipment (can be individual calculus
Machine, server, smart phone or network equipment etc.) it executes described in certain parts of each embodiment of the present invention or embodiment
Method.
Term and wording used in description of the invention are just to for example, be not intended to constitute restriction.Ability
Field technique personnel should be appreciated that under the premise of not departing from the basic principle of disclosed embodiment, to above embodiment
In each details can carry out various change.Therefore, the scope of the present invention is only determined by claim, in the claims, unless
It is otherwise noted, all terms should be understood by the broadest reasonable meaning.