WO2024087347A1 - 一种区块链生成方法、系统及相应数据存储方法和系统 - Google Patents

一种区块链生成方法、系统及相应数据存储方法和系统 Download PDF

Info

Publication number
WO2024087347A1
WO2024087347A1 PCT/CN2022/138999 CN2022138999W WO2024087347A1 WO 2024087347 A1 WO2024087347 A1 WO 2024087347A1 CN 2022138999 W CN2022138999 W CN 2022138999W WO 2024087347 A1 WO2024087347 A1 WO 2024087347A1
Authority
WO
WIPO (PCT)
Prior art keywords
network node
data
check value
network
node
Prior art date
Application number
PCT/CN2022/138999
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
Priority claimed from CN202211304490.5A external-priority patent/CN117978395A/zh
Priority claimed from CN202211304470.8A external-priority patent/CN117938390A/zh
Application filed by 杭州舜时科技有限公司 filed Critical 杭州舜时科技有限公司
Publication of WO2024087347A1 publication Critical patent/WO2024087347A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials

Definitions

  • the present invention relates to blockchain technology, and in particular to a new blockchain generation method, system and corresponding data storage method and system.
  • the present invention utilizes a true random number generation device of a node to generate a true random number, selects a node to generate a new blockchain block through a consensus algorithm for the true random number between nodes, and uses the block to store data.
  • Blockchain technology has developed rapidly in the past decade and has a wide range of applications.
  • blockchain is a chain data structure that combines data blocks in a sequential manner in chronological order, and a distributed ledger that is cryptographically guaranteed to be tamper-proof and unforgeable.
  • blockchain technology is a new distributed infrastructure and computing paradigm that uses block chain data structures to verify and store data, uses distributed node consensus algorithms to generate and update data, uses cryptography to ensure the security of data transmission and access, and uses smart contracts composed of automated script codes to program and operate data.
  • Blockchain has great application prospects in finance, logistics, public services, digital copyright and other fields. Taking finance as an example, it has great potential application value in financial fields such as international exchange, letters of credit, equity registration and stock exchanges. Applying blockchain technology in the financial industry can eliminate the need for third-party intermediaries and achieve direct point-to-point connection, thereby greatly reducing costs and quickly completing transaction payments.
  • PoW Proof of Work
  • Its basic process is to add a one-time pseudo-random number (nonce) to the data of the previous block for each network node, and calculate a 256-bit hash value through the SHA-256 algorithm.
  • the node automatically obtains the right to generate a new block and obtains the corresponding bookkeeping reward.
  • blockchain requires a new generation mechanism that is truly fair and energy-saving for data storage and protection.
  • the present invention discloses a blockchain generation method and system based on a true random number generator, as well as a corresponding data storage method and system.
  • the execution process of the method of the present invention includes: hardware generation of true random numbers, software verification of true random numbers, joint hash value of true random numbers and digital signatures, node data synchronization, secondary hash value generation, hash value comparison extreme value selection node, newly selected node recording and broadcasting new blocks, etc.
  • the present invention provides a blockchain generation method, the method comprising:
  • Step (1) setting the interval time T between adjacent blocks in the blockchain, and performing a block generation countdown based on the interval time T;
  • each network node is provided with a true random number generator, and each network node's true random number generator generates a set of true random numbers of a predetermined size for randomness proof, or selects a set of random numbers of a second predetermined size from the true random numbers generated by each network node for randomness proof;
  • Step (3) each network node m generates a corresponding check value for the true random number generated by itself, encrypts it with a local private key, and generates a digital signature;
  • Step (4) each network node m synchronizes the checksum and digital signature encrypted by its own private key to other network nodes;
  • Step (6) Each network node calculates its own check value and the overall check value according to a predetermined calculation relationship to determine the calculation result. All network nodes select network nodes as accounting nodes according to predetermined rules based on the relationship between the calculation results of all network nodes. When the countdown ends, the accounting node packages the data it receives and stores to generate a new block.
  • the overall check value may also use the results of other calculation methods. As long as the calculation method is used, the calculation result of the overall check value is independent of the calculation order.
  • the present invention provides a data storage method, characterized in that the method comprises:
  • Step (1) Each network node generates or receives data to be recorded, temporarily stores the data to be recorded, and broadcasts the data to be recorded to other network nodes, and each network node generates a data list based on the data generated by itself and the data received;
  • Step (2) setting the interval time T between adjacent blocks in the blockchain, and performing a block generation countdown based on the interval time T;
  • Step (3) a true random number generator is provided in each network node, and the true random number generator of each network node generates a set of true random numbers of a predetermined size for randomness proof, or selects a set of random numbers of a second predetermined size from the true random numbers generated by each network node for randomness proof;
  • Step (4) each network node m generates a corresponding check value for the true random number generated by itself, encrypts it with a local private key, and generates a digital signature;
  • each network node m synchronizes the checksum and digital signature encrypted by its own private key to other network nodes;
  • Step (6) Each network node calculates its own check value and the overall check value according to a predetermined calculation relationship to determine the calculation result. All network nodes select network nodes as accounting nodes according to predetermined rules based on the relationship between the calculation results of all network nodes. When the countdown ends, the accounting node packages the data in the data list stored in itself to generate a new block.
  • the blockchain generation method or the storage method further includes:
  • Step (7) the accounting node sends the data of the new block to other network nodes for confirmation. After more than a predetermined number of nodes have verified the new block, a consensus is formed.
  • the blockchain generation method or the storage method further includes taking the time coordinate t(n+1) of the generation of the new block as the time point when the new block of this round is completed, and the countdown for the next round of block generation starts from this time point.
  • the step (2) in the blockchain generation method or the storage method includes selecting one or more bytes of random numbers r from the respectively generated true random numbers as a selection number, and selecting a random number R(m,n) for use as a randomness proof.
  • the step (4) in the blockchain generation method or the storage method includes each network node m sending the check value and digital signature encrypted by its own private key to other network nodes in the form of network broadcast, and other network nodes decrypt their check values and digital signatures through the public key K(m) of the corresponding node and put H(m,n) into the data list.
  • the process of selecting the accounting node in the step (6) in the blockchain generation method or the storage method includes: each network node calculates the difference between its own check value and the overall check value H Z (n), and selects the network node that ranks in a predetermined position in the difference between the overall check value and all network nodes as the accounting node.
  • the ranking in the predetermined position includes: the difference is ranked first or last.
  • the process of selecting the accounting node in the step (6) of the blockchain generation method or the storage method includes: broadcasting the check value H(m,n) of each network node to other network nodes first, and then adding the check value H(m,n) of the network node in the current block to the overall check value Hz (n-1) of the previous block and the digital signature of the network node, performing a check operation, and obtaining a new check value H'(m,n); broadcasting the new check value H'(m,n) to each network node, and each network node subtracting the H'(m,n) received from each other network node from the overall check value Hz (n-1) of the previous block, and determining the network node whose value of
  • each network node synchronizes its own data with other network nodes, and confirms the data synchronization status with other nodes every second predetermined time. If the data synchronization is completed, proceed to the next step. If the data synchronization is not completed, continue to wait. Preferably, this step sets a waiting time limit. If the data synchronization is not completed after the waiting time limit, the hash values and digital signatures of those network nodes that are fully obtained by each network node are selected and entered into the data list, and the node data that has not been fully obtained by each network node is eliminated.
  • the verification adopts hash verification
  • the verification value is a hash value
  • the predetermined operation rule in the step (6) includes subtraction, addition or multiplication.
  • the present invention also provides a blockchain system, the blockchain system includes multiple network nodes m, each network node m includes a timing device, a true random number generation device, a data storage device, a data communication device and a computing device, and each network node is connected to each other through its own data communication device to form the blockchain system.
  • the timing device is used to count down the block generation based on the preset interval time T between adjacent blocks;
  • each of the true random number generating devices In response to the countdown start instruction, each of the true random number generating devices generates a set of true random numbers of a predetermined size for randomness proof, or selects a set of random numbers of a second predetermined size from the true random numbers generated by each of the devices for randomness proof:
  • Each of the computing devices is used to generate a check value based on the true random number of the corresponding network node and synchronize it with the digital signature of the network node to other network nodes;
  • the data storage device is used to store data and verification information generated by itself as well as data and verification information from other network nodes;
  • the computing device of each network node is also used to calculate the overall verification value according to a first predetermined computing rule based on the verification values of all network nodes obtained synchronously, and the computing result of the first predetermined computing rule is independent of the computing order of each verification value, and the self-verification value and the overall verification value are calculated according to a second predetermined computing relationship to determine the computing result, wherein, among the computing results of all network nodes, the network nodes that meet the predetermined rules are used as accounting nodes, and the accounting nodes generate new blocks based on the data packaging received and stored by themselves at the end of the countdown.
  • the present invention also provides a blockchain system, which includes a plurality of network nodes m, each of which includes a timing device, a true random number generating device, a data storage device, a data communication device, and a computing device. Each network node is connected to each other through its own data communication device to form the blockchain system.
  • the timing device is used to count down the block generation based on the preset interval time T between adjacent blocks;
  • each of the true random number generating devices In response to the countdown start instruction, each of the true random number generating devices generates a set of true random numbers of a predetermined size for randomness proof, or selects a set of random numbers of a second predetermined size from the true random numbers generated by each of the devices for randomness proof:
  • Each of the computing devices is used to generate a check value based on the true random number of the corresponding network node and synchronize it with the digital signature of the network node to other network nodes;
  • the data storage device is used to store data and verification information generated by itself as well as data and verification information from other network nodes;
  • the computing device of each network node is also used to calculate the overall verification value according to a first predetermined computing rule based on the verification values of all network nodes obtained synchronously, and the computing result of the first predetermined computing rule is independent of the computing order of each verification value, and the self-verification value and the overall verification value are calculated according to a second predetermined computing relationship to determine the computing result, wherein, among the computing results of all network nodes, the network nodes that meet the predetermined rules are used as accounting nodes, and the accounting nodes generate new blocks based on the data packaging received and stored by themselves at the end of the countdown.
  • the blockchain system also includes an encryption device, which is used to generate a symmetric key of the corresponding network node based on a true random number, and to encrypt the data sent by itself based on its own symmetric key, and to decrypt the data of other network nodes based on the symmetric keys from other network nodes.
  • an encryption device which is used to generate a symmetric key of the corresponding network node based on a true random number, and to encrypt the data sent by itself based on its own symmetric key, and to decrypt the data of other network nodes based on the symmetric keys from other network nodes.
  • the accounting node is used to send the data of the new block to other network nodes for confirmation by other network nodes, and a new block consensus is formed after verification by more than a predetermined number of nodes.
  • the timing device is used to use the time coordinate t(n+1) of the generation of the new block as the time point when the new block of this round is completed, and to start the countdown for the next round of block generation from this time point.
  • the true random number generating device or the computing device selects one or more bytes of random numbers r from the generated true random numbers as a selection number, and selects a random number R(m,n) for use as a proof of randomness.
  • the data communication device of each network node m is used to send the verification value and digital signature of the network node m to other network nodes in the form of network broadcast, and the encryption devices of other network nodes decrypt their verification value and digital signature through the public key K(m) of the corresponding node, and put the verification value H(m,n) into the data list.
  • the computing device of each network node is used to calculate the difference between its own check value and the overall check value H Z (n), and the network node ranked in a predetermined position in the difference between the overall check value and all network nodes is used as the accounting node.
  • the ranking in the predetermined position includes: the difference is ranked first or last.
  • the communication device of each network node of the blockchain system is used to broadcast its check value H(m,n) to other network nodes first, and the computing device of the network node is used to add the check value H(m,n) of the network node in the current block to the overall check value Hz (n-1) of the previous block and the digital signature of the network node to perform a check operation to obtain a new check value H'(m,n); the communication device is also used to broadcast the new check value H'(m,n) to each network node, and each network node subtracts the H'(m,n) received from each other network node from the overall check value Hz (n-1) of the previous block, and determines the network node whose value of
  • each network node of the blockchain system synchronizes its own data with other network nodes, and confirms the data synchronization status with other nodes every second predetermined time. If the data synchronization is completed, the accounting node selection is performed. If the data synchronization is not completed, the waiting continues.
  • the verification adopts hash verification, the verification value is a hash value, and the predetermined operation rules include subtraction, addition or multiplication.
  • a data storage system including the blockchain system, each network node including a data acquisition unit, the data acquisition unit generates or acquires data to be recorded, temporarily stores the data to be recorded, and broadcasts the data to be recorded to other network nodes, each network node generates a data list based on its own data to be recorded and data received through broadcasting, and the blockchain system generates blocks based on the data in the data list.
  • True random numbers are generated by physical systems, also known as hardware random numbers. Since true random numbers come from the true randomness of the physical world and have nothing to do with computing, they can resist prediction and cracking by any algorithm, which also makes true random numbers widely used in the field of information security.
  • True random number hardware can be divided into two categories according to the principle of randomness generation: classical random number generator (TRNG) and quantum random number generator (QRNG).
  • Classical random numbers use the noise of macroscopic physical quantities, such as thermal noise in circuits, current noise of electronic components, frequency jitter noise of crystal oscillators, and external electromagnetic wave noise. Since the noise source of classical random number generators is sensitive to the surrounding environment, and the size and power consumption of chip-based devices are large, they are mainly made into PCI boards for use in relatively stable environments, such as servers and desktop computers.
  • quantum random number generators use quantum noise as a random number source, such as photon path selection shot noise, photon arrival time shot noise, etc. Since quantum random number generators mostly use weak light systems, the size and power consumption of chip devices are small, and the photon shot noise is not sensitive to external temperature and electromagnetic environment, so it is suitable for mobile terminals, such as smartphones and tablets, car computers, laptops, etc. For example, quantum random number chips designed by SKT-IDQ and manufactured by Samsung have been installed in large quantities on Samsung Galaxy Quantum series mobile phones.
  • the present invention provides true random numbers for fixed and mobile computer terminals in real time by setting a true random number chip device at each network node. After the terminal generates a true random number of fixed length, it first performs a randomness test based on the international standard of true random numbers through the installed blockchain software. Only after passing the test, the blockchain software further selects a random array of a specific length from the random number to perform a verification operation, such as a hash operation, to obtain an unalterable verification value H (m, n). The verification value is encrypted with an asymmetric private key and sent to each network node together with a digital signature. Where m is the network node number, starting from 1; n is the block number that generates the verification value, arranged in chronological order, and the following verification values are described using hash values as an example.
  • the present invention arranges the hash values of all nodes according to the node number, performs a secondary hash operation on them at each network node, obtains an overall hash value H(0,n), and subtracts it from the hash value H(m,n) from each network node.
  • the transaction data recorded by the node enters the newly generated blocks of this round.
  • the present invention adopts the method of broadcasting the hash value H(m,n) of each network node to other nodes first, and then adding H(m,n) to the hash value H(n-1) of the previous block and the digital signature of the node, and then performing hash operation to obtain a new hash value H'(m,n). Then H'(m,n) is also broadcast to each node, and each network node subtracts H'(m,n) received from other nodes from H(n-1).
  • the verification value is produced based on true random numbers, which can not only obtain the tamper-proof verification value H(m,n), but also realize the rapid and regular generation of new blocks, while ensuring data security, reducing the amount of calculation and power consumption, greatly improving the application convenience of blockchain technology, and having huge application value.
  • FIG1 is a schematic diagram of the architecture of the blockchain system of the present invention.
  • Figure 2 shows the process of generating a blockchain using randomness proof in a fully synchronized state.
  • Figure 3 shows the process of generating a blockchain using randomness proof in a non-complete data synchronization state.
  • Figure 4 shows the process of each node using true random numbers to encrypt block data for secure communication during the blockchain generation process.
  • this embodiment provides a blockchain system, which includes multiple network nodes m.
  • multiple network nodes m In this embodiment, four nodes are used as an example for description, and the four nodes can be interconnected using a star network or a ring network.
  • Each network node includes a timing device 101, a true random number generation device 102, a data storage device 103, a data communication device 104, and a computing device 105.
  • Each network node communicates with each other through its own data communication device to form a blockchain system.
  • the timing device 101 is used to count down block generation based on a preset interval time T between adjacent blocks.
  • the timing device 101 can be integrated into the CPU of the computing device or exist independently.
  • Each of the true random number generating devices 102 responds to a countdown start instruction, such as a system startup instruction issued by a control unit of the blockchain system, and generates a set of true random numbers of a predetermined size for use as proof of randomness, or selects a set of random numbers of a second predetermined size from the true random numbers generated by each of them for use as proof of randomness.
  • a countdown start instruction such as a system startup instruction issued by a control unit of the blockchain system
  • Each of the computing devices 105 is used to generate a check value based on the true random number of the corresponding network node and synchronize it with the digital signature of the network node to other network nodes.
  • the computing device 105 here can be used only for computing and can also take into account the control function, for example, it can be implemented by the CPU of the network node.
  • the data storage device 103 is used to store data and verification information generated by itself as well as data and verification information from other network nodes.
  • the computing device of each network node is also used to compute its own check value and the overall check value according to a predetermined computing relationship to determine the computing result, wherein among the computing results of all network nodes, the network node that meets the predetermined rules is used as the accounting node, and the accounting node generates a new block based on the data received and stored by itself at the end of the countdown.
  • the accounting node is also used to send the data of the new block to other network nodes for confirmation by other network nodes, and a new block consensus is formed after more than a predetermined number of nodes have passed the verification.
  • the blockchain system also includes an encryption device, which is used to generate a symmetric key of the corresponding network node based on a true random number, encrypt the data sent by itself based on its own symmetric key, and decrypt the data of other network nodes based on the symmetric keys from other network nodes.
  • an encryption device which is used to generate a symmetric key of the corresponding network node based on a true random number, encrypt the data sent by itself based on its own symmetric key, and decrypt the data of other network nodes based on the symmetric keys from other network nodes.
  • the timing device 101 is used to use the time coordinate t(n+1) of the generation of the new block as the time point when the new block of this round is completed, and to start the countdown for the next round of block generation from this time point.
  • the true random number generating device 102 or the computing device 105 is used to select a random number r of one or more bytes from the generated true random number as a selection number, and select a random number R (m, n) for randomness proof.
  • the data communication device 104 of each network node m is used to send the verification value and digital signature of the network node m to other network nodes in the form of network broadcast.
  • the encryption devices of other network nodes decrypt their verification value and digital signature through the public key K(m) of the corresponding node and put the verification value H(m,n) into the data list.
  • the computing device 105 of each network node is used to calculate the difference between its own check value and the overall check value H Z (n), and use the network node ranked in a predetermined position in the difference between the overall check value and all network nodes as the accounting node.
  • the ranking in the predetermined position includes: the difference is ranked first or last.
  • the communication device of each network node of the blockchain system is used to broadcast its check value H(m,n) to other network nodes first, and the computing device 105 of the network node adds the check value H(m,n) of the network node in the current block to the overall check value Hz (n-1) of the previous block and the digital signature of the network node to perform a check operation to obtain a new check value H'(m,n); the communication device 104 broadcasts the new check value H'(m,n) to each network node, and each network node subtracts the H'(m,n) received from each other network node from the overall check value Hz (n-1) of the previous block, and determines the network node whose value of
  • Each network node of the blockchain system synchronizes its own data with other network nodes in real time, and confirms the data synchronization status with other nodes every second predetermined time. If the data synchronization is completed, the accounting node selection is performed. If the data synchronization is not completed, the waiting continues.
  • the verification adopts hash verification, the verification value is a hash value, and the predetermined operation rules include subtraction, addition or multiplication.
  • Step 1 Preparation for the countdown to new block generation
  • randomness proof is used as the basis for block generation.
  • the use of randomness proof requires first setting the interval time T between blocks, that is, the blockchain generation cycle, and time control is performed through the timing device 101.
  • the time interval is usually set between 10 minutes and 30 minutes. If the interval time is not set, the generation speed of the blockchain cannot be controlled, and thus "sybil attacks" cannot be prevented.
  • T t(n)-t(n-1)
  • t(n) is the absolute time coordinate for the generation of the nth block, which is unified by the time system of global computers.
  • the n+1th block uses the time coordinate t(n) generated by the previous block as the starting point to start the countdown.
  • For the generation of the first block its time is the system startup time.
  • the new node can join the network.
  • the joining method is asymmetric cryptography, for example, a quantum random number chip is used to generate a true random initial vector G and a private key k, and the public key K is calculated through elliptic curve cryptography (ECC).
  • ECC elliptic curve cryptography
  • the new node broadcasts the public key K to other network nodes, and encrypts its own network access time, node number, IP address and other information with the private key k, and also broadcasts it to each node.
  • Other nodes decrypt the information of the new node through the public key K to complete the identity authentication of the new node.
  • each network node will record the public keys of all other network nodes.
  • Each network node has its own private key.
  • Each network node generates its own (generation here refers to the data to be recorded that is processed or received by the node and not from other network nodes) and encrypts it with the private key, then broadcasts it, and other nodes decrypt and record it with the public key.
  • Step 2 Network node hardware true random number generation
  • the generator 102 can use a classical random number source (TRNG) or a quantum random number chip (QRNG). Taking a 1Mb quantum random number chip of a mobile device as an example, the random number generation time is about 4.3 minutes. A 250kb quantum random number chip takes about 17 minutes. Therefore, the blockchain generation cycle T must be greater than the true random number generation time of each network node.
  • Step 3 Network node software true random number verification
  • the true random number generator 102 or the computing device 105 performs a randomness check on the locally generated 256Mb true random number to prevent the node from cheating with pseudo-random numbers.
  • the test can adopt international standards, such as NIST's 16 random number test methods. Only when all the test methods are passed, the generated random numbers are identified as true random numbers, and the random numbers are divided into 256 groups, each with 1Mb.
  • Step 4 Network node true random number and digital signature hash algorithm
  • the computing device 105 of the network node m uses a preset verification algorithm to generate a verification value for its true random number R(m,n), such as using the SHA-256 algorithm to calculate a 256b hash value H(m,n), and encrypt it with the local private key k(m).
  • the node uses k(m) to make a digital signature C(m), and the content can be the generation time information of R(m,n).
  • An asymmetric key method can be used between each network node, that is, the public key K(m) of each network node m is sent to other nodes through the communication device 104, and the public key K(m) is used to decrypt the content encrypted by the corresponding network node of k(m).
  • private keys can also be used between network nodes as a quantum key distribution (QKD) scheme, that is, the private key k(m) of node m can reach each other network node through the quantum key distribution network and be directly decrypted.
  • QKD quantum key distribution
  • Step 5 Network node hash value data synchronization
  • the network node m sends the hash value H(m,n) and digital signature C(m) encrypted by its own private key k(m) to other network nodes through the communication device 104 in the form of network broadcast.
  • Other network nodes decrypt the hash value and digital signature through the public key K(m) of network node m and put H(m,n) into the data list.
  • Each network node needs to complete data synchronization, that is, each network node obtains the hash value and digital signature of all network nodes that have completed steps 2 to 4 in this round.
  • Each network node confirms the data synchronization status to other nodes at regular intervals (such as 30s). If data synchronization is completed, proceed to the next step. If data synchronization is not completed, continue to wait.
  • This step can set a waiting time limit, such as T/10 from the countdown end point. If data synchronization is still not completed by this time limit, the hash values and digital signatures of those network nodes that are fully obtained by each network node are selected and entered into the data list, and the node data that has not been fully obtained by each network node are eliminated.
  • a waiting time limit such as T/10 from the countdown end point.
  • Step 7 Hash value comparison to select the new block generation node
  • This step is the accounting node determination link.
  • Each network node calculates the difference between Hz (n) and its own and other network nodes' hash values, i.e.
  • the network node corresponding to the smallest hash value difference is selected as the accounting node for this round, or all hash value differences are sorted, and the network node in the predetermined position is set as the accounting node. Since the hash value and digital signature of each network node are encrypted with their own private key, they cannot be denied.
  • Step 8 Confirm the new block generation network node
  • the network node that obtains the generated new block sends the block data to other network nodes for confirmation by other nodes. After more than 51% of the nodes pass the verification, it becomes a new block consensus.
  • the time coordinate t(n+1) of the new block generation contained in the new block data is the time point when the new block is completed in this round, and the countdown for the next round of block generation also starts from this time point.
  • the real time coordinate t(n) of generating a new block is slightly earlier than the completion of the countdown period T in this round, and the real time coordinate shall prevail. In the special case where the network is not smooth, the countdown period T may have been completed, but the node consensus has not yet been completed.
  • the network node’s consensus on the new block can overlap with the time when the next round of nodes obtain true random numbers, that is, the consensus of the new block in this round is formed before the completion of the next round of step 2, and each other network node stores the new block in its own data storage device 103.
  • the true random number can be used as a symmetric key, and an asymmetric key can be used to transmit the block data for encrypted communication, thereby making the data transmission of the blockchain network more secure.
  • the specific method is:
  • network nodes a and b when network node a generates a random number and verifies the random number, while proving the randomness, it selects a random number of fixed length from the random number being verified as the symmetric key.
  • Each network node uses a different random number as the symmetric key for each other node. For example, the symmetric key generated by network node a and network node b is recorded as k ab .
  • Network node a encrypts kab using the public key Kb from network node b and sends it to network node b.
  • Network node b uses its own private key k b to decrypt kab.
  • Network node b uses the symmetric key k ab of network node a to encrypt the record data that it is going to write into the new block and sends it to network node a.
  • Network node a uses the symmetric key k ab to decrypt the recorded data from network node b and prepare to write it into the new block.
  • the network node that wins the randomness proof obtains the right to record the new block, and then writes all the recorded data from other network nodes decrypted by the symmetric key into the new block.
  • this embodiment provides another optional solution.
  • the specific implementation method of generating the blockchain in this embodiment is the same as steps 1 to 4 under the complete data synchronization with fewer network nodes in Example 1. Starting from step 5, the following implementation method is adopted:
  • Step 5 Network node hash value broadcast
  • each network node m For each network node m, first send the hash value H(m,n) and digital signature C(m) encrypted by its own private key k(m) to other network nodes in the form of network broadcast. Other nodes decrypt the hash value and digital signature through the public key K(m) of network node m and put the hash value H(m,n) into the data list. Due to the large number of network nodes, network node m cannot wait until other nodes return confirmation data, so it automatically enters the next step after data broadcast.
  • Step 6 Secondary hashing algorithm of network nodes and previous block hash value
  • Network node m arranges its own 256b hash value H(m,n) and the packaged 256b overall hash value Hz (n-1) of the previous block in order to obtain a 512b array SH(m,n). Then perform a SHA-256 operation on this array to obtain a new 256b hash value H'(m,n).
  • This hash value is encrypted by the network node m's own private key k(m) and broadcast to other network nodes together with the digital signature C(m) of the network node m.
  • Other network nodes can use the overall hash value Hz (n-1) of the previous block to verify the consistency of the original hash value H(m,n) and the integrated new H'(m,n), that is, in the same way as above, each network node performs the following steps on all network nodes: arrange the corresponding network node's 256b original hash value H(m,n) and the packaged 256b overall hash value Hz (n-1) of the previous block in order to obtain a 512b array SH(m,n). Perform another SHA-256 operation on this array to obtain a new 256b integrated hash value H'(m,n).
  • Step 7 Threshold determination and new block generation verification
  • a network node m meets the following conditions: (1) it has obtained the original hash values H(m,n) and integrated H’(m,n) of more than 50% of the nodes in the entire blockchain network; (2) after calculating the network node m’s own
  • Step 8 Consensus selects network nodes to generate new blocks
  • step 7 If multiple nodes meet conditions (1) and (2) in step 7, and all generate new blocks and send them to multiple network nodes, there must be a network node that receives messages from multiple nodes defining itself as a bookkeeping node at the same time. Then each network node needs to further select consensus: multiple blocks that meet the conditions undergo a PK at each node, and the node that satisfies the smallest
  • This embodiment provides a data distributed storage and encrypted communication method based on blockchain. Since the generation of new blocks only requires a chip with low power consumption to provide hardware random numbers, it does not need to consume a lot of electricity for proof of work.
  • the data recorded by the blockchain of this embodiment can be used to store various data information. For example, effective distributed records can be made for various types of fixed asset information, various types of intellectual property information, household registration and student registration information, so that blockchain can better serve the society.
  • the system of this embodiment adopts the system of embodiment 1, except that the working process of the system is as follows:
  • Step (1) Each network node generates or obtains data to be recorded, temporarily stores the data to be recorded through the data storage device 103, and broadcasts the data to be recorded to other network nodes, and each network node generates a data list based on its own data to be recorded and the data received through the broadcast;
  • Step (2) the timing device 101 sets the interval time T between adjacent blocks in the blockchain, and counts down the block generation based on the interval time T;
  • Step (3) the true random number generator 102 in each network node generates a set of true random numbers of a predetermined size for use as a proof of randomness, or selects a set of random numbers of a second predetermined size from the true random numbers generated by each node for use as a proof of randomness;
  • Step (4) each network node m generates a corresponding check value for the true random number generated by itself, encrypts it with a local private key, and generates a digital signature;
  • each network node m synchronizes the checksum and digital signature encrypted by its own private key to other network nodes;
  • each network node calculates its own check value and the overall check value according to a predetermined calculation relationship to determine the calculation result. All network nodes select network nodes as accounting nodes according to predetermined rules based on the relationship between the calculation results of all network nodes. When the countdown ends, the accounting node packages the data in the data list stored in itself to generate a new block.
  • the method also includes the features and steps of additional limitations on the blockchain generation method in Example 1 and Example 2.
  • each network node when each network node generates a true random number, the recorded data of each network node is also sent to other network nodes for synchronous storage.
  • the node that wins through randomness proof automatically obtains the authority to record new blocks and generates new blocks with its own stored data.
  • a "credit value" data bound to a private key can be introduced into the block, and the initial value of the newly added node is 0.
  • the node that wins through randomness proof in each round will receive a certain credit value increase as a reward after the data in the generated block is verified by other nodes.
  • the credit value is bound to each network node.
  • the node that recorded the tampered data in the block will have its credit value deducted and will be punished to not participate in blockchain generation for a corresponding period of time. If the node that tampered with the data in this round happens to be the winning node, the blockchain generation in this round will be invalidated, and the blockchain will return to the previous block and start generating again. At this time, the node's credit value will be reduced to a negative number, and it will be permanently excluded from the blockchain node.
  • the true random numbers can be used as symmetric keys and transmitted using asymmetric keys to encrypt block data, making data transmission in the blockchain network more secure.
  • the specific methods are:
  • network node a After network node a completes the randomness check, it selects a random number of fixed length from the random numbers being checked as the symmetric key while performing randomness proof. A different random number is used as the symmetric key for each other node. For example, the symmetric key with network node b is denoted as k ab .
  • Network node a encrypts kab using the public key Kb from network node b and sends it to network node b.
  • Network node b uses its own private key k b to decrypt kab.
  • Network node b uses k ab to encrypt the record data that it is going to write into the new block and sends it to network node a.
  • Network node a uses k ab to decrypt the recorded data from network node b and prepare to write it into the new block.
  • the network node that wins the randomness proof obtains the right to record the new block, and then writes all the recorded data from other network nodes decrypted by the symmetric key into the new block.
  • the devices in the blockchain system of the present invention can perform more functions or the functions of each device in the system can be performed by other devices, or the timing device 101, the data storage device 103 and the computing device 105 can be implemented by computer equipment without setting up separate timing devices 101, data storage devices 103 and computing devices 105.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种区块链生成方法、系统以及相应的数据存储系统,该方法包括:真随机数的硬件生成、真随机数的检验、真随机数和数字签名联合哈希值、节点数据同步和二次哈希值、哈希值比对选定节点、新选节点记录并广播新区块。该方法通过每个网络节点用物理上的低功耗器件产生真随机数,并通过共识算法作真随机性证明生成新区块,可替代基于高能耗计算机工作量证明的区块链生成方法,大幅降低公有区块链的建设成本和能源消耗,促进区块链技术的普及。

Description

一种区块链生成方法、系统及相应数据存储方法和系统
相关申请
本申请主张于2022年10月24日提交的、名称为“一种区块链系统以及相应数据存储系统”的中国发明专利申请:202211304470.8的优先权,并且主张于2022年10月24日提交的、名称为“一种基于真随机数发生装置的区块链生成方法”的中国发明专利申请:202211304490.5的优先权。
技术领域
本发明涉及区块链技术,具体涉及一种新的区块链生成方法、系统以及相应数据存储方法和系统,本发明利用节点的真随机数发生装置产生真随机数,通过节点之间对真随机数的共识算法选择节点生成区块链新区块,并利用该区块来存储数据。
背景技术
区块链技术近十几年发展迅速,并且具有广泛的应用。狭义区块链是按照时间顺序,将数据区块以顺序相连的方式组合成的链式数据结构,并以密码学方式保证的不可篡改和不可伪造的分布式账本。广义区块链技术是利用块链式数据结构验证与存储数据,利用分布式节点共识算法生成和更新数据,利用密码学的方式保证数据传输和访问的安全、利用由自动化脚本代码组成的智能合约,编程和操作数据的全新的分布式基础架构与计算范式。
由于没有任何一个节点可以单独记录账本数据,从而避免了单一记账人被控制或者被贿赂而记假账的可能性。也由记账节点足够多,理论上讲除非所有的节点被破坏,否则账目就不会丢失,从而保证了账目数据的安全性。因此,区块链技术对数据的安全性具有重要意义。
区块链在金融、物流、公共服务、数字版权等领域具有巨大应用前景。以金融为例,其在国际汇兑、信用证、股权登记和证券交易所等金融领域有着潜在的巨大应用价值。将区块链技术应用在金融行业中,能够省去第三方中介环节,实现点对点的直接对接,从而在大大降低成本的同时,快速完成交易支付。
现有区块链技术一般采用“工作量证明”作为新区块生成的基础。“工作量证明”(PoW)是最先使用也是最广泛使用的区块链生成方法,其基本过程为每个网络节点对上一个区块的数据添加一个一次性的伪随机数(nonce),并通过SHA-256算法计 算出一个256位的哈希值。当某个节点计算出的哈希值满足一个给定的目标,则该节点自动获得了生成新区块的权利,获得相应的记账奖励。
由于“工作量证明”给定的目标通常是一个出现概率极小的结果,因此需要消耗大量计算资源才能得到。例如BTC的“工作量证明”需要计算出一个小于前80位都是0的256位数的哈希值(截止到2022年),这就需要节点不断输入伪随机的nonce试错,平均要试错2的80次方次,才能得到符合目标的哈希值。因此“工作量证明”也被称为“挖矿”。
虽然“工作量证明”能限制区块链的生成速度,防止新区块过快的“女巫攻击”,但是如此多的计算次数也导致大量的电力被浪费在计算试错上。
因此区块链需要一个真正公平,同时节约能耗的全新生成机制,用于进行数据的存储和保护。
发明内容
为了保持区块链生成的公平性同时节约大量能耗,本发明公开了一种基于真随机数发生装置的区块链生成方法、系统以及相应数据存储方法和系统。本发明方法执行过程包括:真随机数的硬件生成、真随机数的软件检验、真随机数和数字签名的联合哈希值、节点数据同步、二次哈希值生成、哈希值比对极值选定节点、新选节点记录并广播新区块等步骤。
具体而言,本发明提供了一种区块链生成方法,所述方法包括:
步骤(1)、设定区块链中相邻区块之间的间隔时间T,基于所述间隔时间T进行区块生成倒计时;
步骤(2)、每个网络节点中设置真随机数发生装置,通过每个网络节点的真随机数发生装置各自生成一组预定大小的真随机数用作随机性证明,或者从各自生成的真随机数中选取一组第二预定大小的随机数用作随机性证明;
步骤(3)、每个网络节点m对自己生成的真随机数生成相应的校验值,用本地私钥对其进行加密,并生成数字签名;
步骤(4)、每个网络节点m把经过自己私钥加密后的校验值和数字签名同步到其它网络节点;
步骤(5)、每个网络节点将同步获得的全部校验值相加,得到SH(n)=∑ mH(m,n), 并且每个网络节点对所获得的校验值之和SH(n)再次进行校验值计算,得到整体校验值H z(n),其中,m为网络节点编号,n为生成该校验值的区块编号;
步骤(6)、每个网络节点将自身校验值与整体校验值按照预定运算关系进行运算,确定运算结果,所有网络节点基于所有网络节点运算结果之间的关系,按预定规则选取网络节点作为记账节点,当所述倒计时结束时,所述记账节点将自身接收和存储的数据打包生成新区块。
需要说明的是,整体校验值除了采用校验值之和外,还可以采用其他运算方式的结果,只要按照该运算方式,整体校验值的计算结果与计算顺序无关即可。
另一方面,本发明提供一种数据存储方法,其特征在于,所述方法包括:
步骤(1)每个网络节点生成或者接收待记录数据,对所述待记录数据进行暂存,并且将所述待记录数据广播至其他网络节点,每个网络节点基于其自身生成的数据以及所接收到的数据生成数据列表;
步骤(2)、设定区块链中相邻区块之间的间隔时间T,基于所述间隔时间T进行区块生成倒计时;
步骤(3)、每个网络节点中设置真随机数发生装置,通过每个网络节点的真随机数发生装置各自生成一组预定大小的真随机数用作随机性证明,或者从各自生成的真随机数中选取一组第二预定大小的随机数用作随机性证明;
步骤(4)、每个网络节点m对自己生成的真随机数生成相应的校验值,用本地私钥对其进行加密,并生成数字签名;
步骤(5)、每个网络节点m把经过自己私钥加密后的校验值和数字签名同步到其它网络节点;
步骤(5)、每个网络节点将同步获得的全部校验值相加,得到SH(n)=∑ mH(m,n),并且每个网络节点对所获得的校验值之和SH(n)再次进行校验值计算,得到整体校验值H z(n),其中,m为网络节点编号,n为生成该校验值的区块编号;
步骤(6)、每个网络节点将自身校验值与整体校验值按照预定运算关系进行运算,确定运算结果,所有网络节点基于所有网络节点运算结果之间的关系,按预定规则选取网络节点作为记账节点,当所述倒计时结束时,所述记账节点将自身存储的数据列表中的数据打包生成新区块。
在一种优选实现方式中,所述区块链生成方法或所述存储方法还包括:
步骤(7)、所述记账节点将新区块的数据发送到其它网络节点,由其它网络节点确认,超过预定数目的节点验证通过后形成新区块共识。
在一种优选实现方式中,所述区块链生成方法或所述存储方法还包括,将新区块生成的时间坐标t(n+1)做为本轮新区块完成的时间点,下一轮区块生成的倒计时从该时间点开始。
在一种优选实现方式中,所述区块链生成方法或所述存储方法中的所述步骤(2)包括从各自生成的真随机数中选取一个或多个字节的随机数r作为挑选编号,挑选出随机数R(m,n),用做随机性证明。
在一种优选实现方式中,所述区块链生成方法或所述存储方法中的所述步骤(4)包括每个网络节点m把经过自己私钥加密后的校验值和数字签名以网络广播的形式发送到其它网络节点,其它网络节点通过相应节点的公钥K(m)解密其校验值和数字签名,将H(m,n)放入数据列表。
在一种优选实现方式中,所述区块链生成方法或所述存储方法中的所述步骤(6)中记账节点的选取过程包括:每个网络节点计算自身校验值与整体校验值H Z(n)之差,将所有网络节点中与整体校验值差值中排在预定位置的网络节点作为记账节点,优选地,所述排在预定位置包括:差值排在第一位或者最后一位。
在一种优选实现方式中,所述区块链生成方法或所述存储方法中的所述步骤(6)中记账节点的选取过程包括:将每个网络节点的校验值H(m,n)先广播到其它网络节点,然后将当前区块中该网络节点的校验值H(m,n)与上一个区块的整体校验值H Z(n-1)、以及该网络节点的数字签名相加,进行校验运算,获得新的校验值H’(m,n);将所述新的校验值H’(m,n)广播到各网络节点,每个网络节点将各自收到的每个其它网络节点的H’(m,n)与上一个区块的整体校验值H z(n-1)分别相减,确定各个网络节点中|H(n-1)-H’(m,n)|的值排在预定位置的网络节点,获得新区块的生成权,作为记账节点。
在一种优选实现方式中,所述区块链生成方法或所述存储方法中,每个网络节点向其他网络节点同步其自身的数据,并每隔第二预定时间向其它节点确认数据同步状态,如果数据同步完成,则进入下一步。如果数据同步未完成,则继续等待,优选地,该步骤设置一个等待时间期限,如果达到该等待时间期限数据同步仍未完成,则选取每个网络节点都全部获取的那些网络节点的哈希值和数字签名,进入数据列表,淘汰 掉没有被每个网络节点全部获取的那些节点数据。
在一种优选实现方式中,所述区块链生成方法或所述存储方法中,所述校验采用哈希校验,所述校验值为哈希值,所述步骤(6)中预定运算规则包括相减、相加或者相乘。
在一种优选实现方式中,本发明还提供本发明提供了一种区块链系统,所述区块链系统包括多个网络节点m,每个网络节点m包括计时装置、真随机数发生装置、数据存储装置、数据通信装置以及运算装置,各个网络节点之间通过各自的数据通信装置彼此通信连接,形成所述区块链系统,
所述计时装置用于基于预设的相邻区块之间的间隔时间T进行区块生成倒计时;
每个所述真随机数发生装置响应于倒计时开始指令,各自生成一组预定大小的真随机数用作随机性证明,或者从各自生成的真随机数中选取一组第二预定大小的随机数用作随机性证明:
每个所述运算装置用于基于相应网络节点的真随机数生成校验值连同该网络节点的数字签名同步到其他网络节点;
所述数据存储装置用于存储自身生成的数据和校验信息以及来自其他网络节点的数据和校验信息;
每个网络节点的运算装置还用于基于同步获得的全部网络节点的校验值按照第一预定运算规则计算整体校验值,该第一预定运算规则的运算结果与各个校验值的运算次序无关,并且将自身校验值与整体校验值按照第二预定运算关系进行运算,确定运算结果,其中,所有网络节点的运算结果中,满足预定规则的网络节点用作记账节点,所述记账节点在所述倒计时结束基于自身接收和存储的数据打包生成新区块。
在一种优选实现方式中,每个网络节点的运算装置还用于将同步获得的全部网络节点的校验值相加,得到校验值之和SH(n)=∑ mH(m,n),并且每个网络节点对所获得的校验值之和SH(n)再次进行校验值计算,得到整体校验值H z(n),其中,m为网络节点编号,n为生成该校验值的区块编号。
本发明还提供了一种区块链系统,所述区块链系统包括多个网络节点m,每个网络节点m包括计时装置、真随机数发生装置、数据存储装置、数据通信装置以及运算装置,各个网络节点之间通过各自的数据通信装置彼此通信连接,形成所述区块链系统,
所述计时装置用于基于预设的相邻区块之间的间隔时间T进行区块生成倒计时;
每个所述真随机数发生装置响应于倒计时开始指令,各自生成一组预定大小的真随机数用作随机性证明,或者从各自生成的真随机数中选取一组第二预定大小的随机数用作随机性证明:
每个所述运算装置用于基于相应网络节点的真随机数生成校验值连同该网络节点的数字签名同步到其他网络节点;
所述数据存储装置用于存储自身生成的数据和校验信息以及来自其他网络节点的数据和校验信息;
每个网络节点的运算装置还用于基于同步获得的全部网络节点的校验值按照第一预定运算规则计算整体校验值,该第一预定运算规则的运算结果与各个校验值的运算次序无关,并且将自身校验值与整体校验值按照第二预定运算关系进行运算,确定运算结果,其中,所有网络节点的运算结果中,满足预定规则的网络节点用作记账节点,所述记账节点在所述倒计时结束基于自身接收和存储的数据打包生成新区块。
在一种优选实现方式中,每个网络节点的运算装置还用于将同步获得的全部网络节点的校验值相加,得到校验值之和SH(n)=∑ mH(m,n),并且每个网络节点对所获得的校验值之和SH(n)再次进行校验值计算,得到整体校验值H z(n),其中,m为网络节点编号,n为生成该校验值的区块编号。
在一种优选实现方式中,所述的区块链系统还包括加密装置,所述加密装置用于基于真随机数生成相应网络节点的对称密钥,并且基于自身的对称密钥对自身发送数据进行加密,基于来自其他网络节点的对称密钥对其他网络节点的数据进行解密。
在一种优选实现方式中,所述记账节点用于将新区块的数据发送到其它网络节点,由其它网络节点确认,超过预定数目的节点验证通过后形成新区块共识。
在一种优选实现方式中,所述计时装置用于将新区块生成的时间坐标t(n+1)做为本轮新区块完成的时间点,并且从该时间点开始进行下一轮区块生成的倒计时。
在一种优选实现方式中,所述真随机数发生装置或者所述运算装置用于生成的真随机数中选取一个或多个字节的随机数r作为挑选编号,挑选出随机数R(m,n),用做随机性证明。
在一种优选实现方式中,每个网络节点m的数据通信装置用于将该网络节点m的校验值和数字签名以网络广播的形式发送到其它网络节点,其它网络节点的加密装 置通过相应节点的公钥K(m)解密其校验值和数字签名,将校验值H(m,n)放入数据列表。
在一种优选实现方式中,每个网络节点的所述运算装置用于计算自身校验值与整体校验值H Z(n)之差,将所有网络节点中与整体校验值差值中排在预定位置的网络节点作为记账节点,优选地,所述排在预定位置包括:差值排在第一位或者最后一位。
在一种优选实现方式中,所述的区块链系统的每个网络节点的通信装置用于将其校验值H(m,n)先广播到其它网络节点,该网络节点的运算装置用于将当前区块中该网络节点的校验值H(m,n)与上一个区块的整体校验值H Z(n-1)、以及该网络节点的数字签名相加,进行校验运算,获得新的校验值H’(m,n);所述通信装置还用于将所述新的校验值H’(m,n)广播到各网络节点,每个网络节点将各自收到的每个其它网络节点的H’(m,n)与上一个区块的整体校验值H z(n-1)分别相减,确定各个网络节点中|H(n-1)-H’(m,n)|的值排在预定位置的网络节点,获得新区块的生成权,作为记账节点。
在一种优选实现方式中,所述的区块链系统的每个网络节点向其他网络节点同步其自身的数据,并每隔第二预定时间向其它节点确认数据同步状态,如果数据同步完成,则进行记账节点选择,如果数据同步未完成,则继续等待,优选地,所述校验采用哈希校验,所述校验值为哈希值,所述预定运算规则包括相减、相加或者相乘。
一种包括所述区块链系统的数据存储系统,每个网络节点包括数据采集单元,所述数据采集单元生成或采集待记录数据,对所述待记录数据进行暂存,并且将所述待记录数据广播至其他网络节点,每个网络节点基于其自身的待记录数据以及通过广播接收到的数据生成数据列表,所述区块链系统基于所述数据列表中的数据进行区块生成。
发明原理及技术效果
真随机数由物理系统产生,也称硬件随机数。由于真随机数来自于物理世界的真随机性,与计算无关,因此可以抵抗任何算法的预测和破解,这也使得真随机数在信息安全领域应用广泛。
真随机数硬件按照随机性产生原理,可分为经典随机数发生器(TRNG)和量子随机数发生器(QRNG)两类。其中经典随机数采用宏观尺度物理量的噪声,如电路中的热噪声、电子元器件的电流噪声、晶振的频率抖动噪声、外界电磁波噪声等。由于经典随机数发生器的噪声来源对周围环境敏感,且做成芯片化器件的体积和功耗较 大,因此主要做成PCI板卡用在环境较稳定的场景下,如服务器,台式计算机等。
量子随机数发生器大多采用量子噪声作为随机数开源,如光子路径选择散粒噪声、光子到达时间散粒噪声等。由于量子随机数发生器多采用弱光系统,做成芯片化器件的尺寸和功耗较小,并且光子的散粒噪声对外界温度和电磁环境都不敏感,因此适合放在移动终端上,如智能手机和平板电脑、车载电脑、笔记本电脑等。如SKT-IDQ设计,三星代工的量子随机数芯片,已经大量安装在三星Galaxy Quantum系列手机上。
本发明通过在每个网络节点设置真随机数芯片化器件,为固定和移动计算机终端实时提供真随机数。终端生成固定长度真随机数后,首先通过已安装的区块链软件做基于真随机数国际标准的随机性检验,只有通过后,区块链软件才进一步在该随机数中选取特定长度的随机数组做校验运算,比如哈希运算,得到不可篡改的校验值H(m,n)。该校验值经过非对称密钥私钥加密,连同数字签名一起发送到各个网络节点。其中m为网络节点编号,从1开始;n为生成该校验值的区块编号,按照时间顺序排列,后面校验值均以哈希值为例进行描述。
在网络节点较少,每个网络节点都能获得其它节点的哈希值,即数据完全同步的情况下,本发明采用全部节点哈希值按照节点编号排列,在每个网络节点都对其做二次哈希运算的方法,得到一个整体哈希值H(0,n),并与来自每个网络节点的哈希值H(m,n)相减,得到|H(0,n)-H(m,n)|最小值的网络节点胜出,获得这一轮区块的生成权。该节点所记录的交易数据则进入这一轮新生成的区块中。
在网络节点较多,一些节点没有全部获得其它节点的哈希值,即数据非完全同步的情况下,本发明采用每个网络节点的哈希值H(m,n)先广播到其它节点,然后H(m,n)与上一个区块的哈希值H(n-1)、以及该节点的数字签名相加,再做哈希运算的方法,获得新的哈希值H’(m,n)。紧接着H’(m,n)也广播到各节点,每个网络节点都把收到其它节点的H’(m,n)与H(n-1)相减,得到|H(n-1)-H’(m,n)|最小值的网络节点在超过51%网络节点的确认情况下胜出,获得这一轮区块的生成权。
技术效果
采用本发明的区块链生成方法和系统,基于真随机数进行校验值的生产,既可以得到不可篡改的校验值H(m,n),又能实现新区块的快速、规律生成,保证数据安全的同时,减少了运算量和电力消耗,大幅度提高区块链技术的应用便捷性,具有巨大 的应用价值。
附图说明
下面所提供的附图主要是为了方便对本发明的进一步理解,构成本发明的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1为本发明的区块链系统的架构示意图。
图2为完全数据同步状态下,采用随机性证明生成区块链的过程。
图3为非完全数据同步状态下,采用随机性证明生成区块链的过程。
图4为在区块链生成过程中,各节点采用真随机数加密区块数据进行安全通信的过程。
具体实施方式
下面结合实施例及附图对本发明作进一步详细的描述,但本发明的实施方式不限于此。
本发明的具体实施方式主要是为了方便对本发明的进一步理解,构成本发明的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。
实施例1
如图1所示,本实施例提供了一种区块链系统,该区块链系统包括多个网络节点m,本实施例中以四个节点为例进行描述,四个节点可以采用星型网络或者环形网络进行互联。每个网络节点包括计时装置101、真随机数发生装置102、数据存储装置103、数据通信装置104以及运算装置105,各个网络节点之间通过各自的数据通信装置彼此通信连接,形成区块链系统。
所述计时装置101用于基于预设的相邻区块之间的间隔时间T进行区块生成倒计时,计时装置101可以集成在计算设备的CPU中,也可以单独存在。
每个所述真随机数发生装置102响应于倒计时开始指令,比如,区块链系统的控制单元发出的系统启动指令,各自生成一组预定大小的真随机数用作随机性证明,或者从各自生成的真随机数中选取一组第二预定大小的随机数用作随机性证明。
每个所述运算装置105用于基于相应网络节点的真随机数生成校验值连同该网 络节点的数字签名同步到其他网络节点。这里的运算装置105可以仅用于运算,可以兼顾控制功能,比如,由网络节点的CPU实现。
所述数据存储装置103用于存储自身生成的数据和校验信息以及来自其他网络节点的数据和校验信息。
每个网络节点的运算装置105还用于将同步获得的全部网络节点的校验值相加,得到校验值之和SH(n)=∑ mH(m,n),并且每个网络节点对所获得的校验值之和SH(n)再次进行校验值计算,得到整体校验值H z(n),其中,m为网络节点编号,n为生成该校验值的区块编号。
每个网络节点的运算装置还用于将自身校验值与整体校验值按照预定运算关系进行运算,确定运算结果,其中,所有网络节点的运算结果中,满足预定规则的网络节点用作记账节点,所述记账节点在所述倒计时结束基于自身接收和存储的数据打包生成新区块。所述记账节点还用于将新区块的数据发送到其它网络节点,由其它网络节点确认,超过预定数目的节点验证通过后形成新区块共识。
所述的区块链系统还包括加密装置,所述加密装置用于基于真随机数生成相应网络节点的对称密钥,并且基于自身的对称密钥对自身发送数据进行加密,基于来自其他网络节点的对称密钥对其他网络节点的数据进行解密。
所述计时装置101用于将新区块生成的时间坐标t(n+1)做为本轮新区块完成的时间点,并且从该时间点开始进行下一轮区块生成的倒计时。
所述真随机数发生装置102或者所述运算装置105用于从生成的真随机数中选取一个或多个字节的随机数r作为挑选编号,挑选出随机数R(m,n),用做随机性证明。
每个网络节点m的数据通信装置104用于将该网络节点m的校验值和数字签名以网络广播的形式发送到其它网络节点,其它网络节点的加密装置通过相应节点的公钥K(m)解密其校验值和数字签名,将校验值H(m,n)放入数据列表。
每个网络节点的所述运算装置105用于计算自身校验值与整体校验值H Z(n)之差,将所有网络节点中与整体校验值差值中排在预定位置的网络节点作为记账节点,优选地,所述排在预定位置包括:差值排在第一位或者最后一位。
当网络节点较多,无法实现完全同步时,所述的区块链系统的每个网络节点的通信装置用于将其校验值H(m,n)先广播到其它网络节点,该网络节点的运算装置105将当前区块中该网络节点的校验值H(m,n)与上一个区块的整体校验值H Z(n-1)、以及 该网络节点的数字签名相加,进行校验运算,获得新的校验值H’(m,n);所述通信装置104将所述新的校验值H’(m,n)广播到各网络节点,每个网络节点将各自收到的每个其它网络节点的H’(m,n)与上一个区块的整体校验值H z(n-1)分别相减,确定各个网络节点中|H(n-1)-H’(m,n)|的值排在预定位置的网络节点,获得新区块的生成权,作为记账节点。
所述区块链系统的每个网络节点实时向其他网络节点同步其自身的数据,并每隔第二预定时间向其它节点确认数据同步状态,如果数据同步完成,则进行记账节点选择,如果数据同步未完成,则继续等待,优选地,所述校验采用哈希校验,所述校验值为哈希值,所述预定运算规则包括相减、相加或者相乘。
下面详细介绍本发明的区块链系统生成区块链的详细过程:
步骤1:新区块生成倒计时准备
本实施例中,以“随机性证明”作为区块生成的基础。采用随机性证明需要首先设定区块之间的间隔时间T,即区块链生成周期,通过计时装置101进行时间控制,时间间隔通常设定在10分钟到30分钟之间。如果不设置间隔时间,就无法控制区块链的生成速度,从而无法防范“女巫攻击”。另T=t(n)-t(n-1),t(n)为第n个区块的生成绝对时间坐标,由全球计算机的时间系统统一。例如第n+1个区块以上一个区块生成的时间坐标t(n)做为起点,开始倒计时。对于首个区块的生成,则其时间即为系统启动时间。
在新区块生成倒计时准备后,新节点即可以加入网络。加入方式为非对称密码学方式,例如通过量子随机数芯片生成真随机的初始向量G和私钥k,通过椭圆曲线密码学(ECC)计算出公钥K。新节点将公钥K向其它网络节点广播,并将自己的入网时间、节点编号、IP地址等信息使用私钥k加密,也向各节点广播。其它节点通过公钥K解密出新入网节点的信息,完成新节点的身份验证。
这样,每个网络节点将记录所有其他网络节点的公钥,每个网络节点具有自己的私钥,各网络节点之间对自己生成(这里的生成指的是该节点处理或接收到的非来自其他网络节点的待记录数据)通过私钥进行加密,然后广播,其他节点通过公钥进行解密记录。
步骤2:网络节点硬件真随机数生成
每个网络节点的真随机数的发生装置102,生成一组32MB=256Mb的真随机数。 发生装置102可以采用经典随机数源(TRNG),量子随机数芯片(QRNG)。以移动设备1Mb的量子随机数芯片为例,随机数生成时间约为4.3分钟。而250kb的量子随机数芯片需要约17分钟。因此区块链生成周期T要大于每个网络节点的真随机数生成时间。
步骤3:网络节点软件真随机数检验
在每个网络节点m,真随机数发生装置102或者运算装置105对本地生成的256Mb的真随机数做随机性检验,防止节点使用伪随机数作弊。检验可采用国际标准,如NIST的16种随机数测试方法。只有全部通过测试方法,才将所生成的随机数认定为真随机数,并将随机数分为256组,每组1Mb。区块链软件紧接着从硬件上的真随机数的发生装置获取一个字节的随机数r作为该网络节点的挑选编号,从所生成的256Mb随机数中,挑选出随机数R(m,n),做随机性证明使用。例如r=128时,挑选第129组1Mb的随机数做R(m,n)。
步骤4:网络节点真随机数和数字签名哈希算法
网络节点m的运算装置105对自己的真随机数R(m,n)使用预设的校验算法进行校验值生成,比如使用SHA-256算法计算出一个256b的哈希值H(m,n),用本地私钥k(m)对其加密。同时节点使用k(m)制作数字签名C(m),内容可以为R(m,n)的生成时间信息。各个网络节点之间可采用非对称密钥方法,即每个网络节点m的公钥K(m)通过通信装置104发送到其它节点,公钥K(m)用于解密k(m)相应网络节点所加密的内容。同时网络节点之间也可以采用私钥做量子密钥分发(QKD)的方案,即节点m的私钥k(m)通过量子密钥分发网络,可达到其它每个网络节点,直接解密。
步骤5:网络节点哈希值数据同步
网络节点m把经过自己私钥k(m)加密后的哈希值H(m,n)和数字签名C(m)通过通信装置104以网络广播的形式发送到其它网络节点,其它网络节点通过网络节点m的公钥K(m)解密哈希值和数字签名,将H(m,n)放入数据列表。各网络节点需要完成数据同步,即每个网络节点都获取通过本轮所有完成步骤2到步骤4的网络节点的哈希值和数字签名。每个网络节点每隔一段时间(如30s)向其它节点确认数据同步状态。如果数据同步完成,则进入下一步。如果数据同步未完成,则继续等待。该步骤可设置一个等待时间期限,例如距离倒计时终点T/10,如果到这个时间期限数据同步仍未完成,则选取每个网络节点都全部获取的那些网络节点的哈希值和数字签名, 进入数据列表,淘汰掉没有被每个网络节点全部获取的那些节点数据。
步骤6:集体二次哈希算法
在数据完全同步的情况下,每个网络节点拥有参与本轮区块链生成的所有网络节点的哈希值和数字签名。此时每个网络节点的运算装置105将全部网络节点的哈希值相加,得到哈希值之和SH(n)=∑ mH(m,n),这样做加法的好处是满足交换律,即无论每个网络节点的数据列表如何排列,都会得到相同的SH(n)。此时每个网络节点对SH(n)再进行一轮SHA-256算法,得到一个整体的哈希值H z(n)。节点之间相互确认都得到了相同的整体H z(n)。
步骤7:哈希值比对选取新区块生成节点
该步骤为记账节点确定环节。每个网络节点都计算H z(n)与自己及其它网络节点哈希值的差,即|H z(n)-H(m,n)|,然后,将所有哈希值的差作比较,哈希值最小差对应的网络节点即选为本轮的记账节点,或者对所有哈希值的差进行排序,设定排在预定位置的网络节点为记账节点。由于每个网络节点的哈希值与数字签名都经过自己的私钥加密,因此不可抵赖。当某个网络节点的区块链软件得到自己的哈希值与整体哈希值H z(n)的差最小,便成为“获胜”节点,自动获得本次记账权,将自己存储的交易数据打包进下一个区块,正式生成新区块,并存储到数据存储装置103中。
步骤8:确认新区块生成网络节点
获取生成新区块的网络节点将区块数据发送到其它网络节点,由其它节点确认,超过51%节点验证通过后变形成新区块共识。此时新区块数据包含的新区块生成的时间坐标t(n+1)即为本轮新区块完成的时间点,下一轮区块生成的倒计时也从该时间点开始。一般情况下,生成新区块的真实时间坐标t(n)略早于本轮倒计时周期T的完成,以真实时间坐标为准。在网络不通畅的特殊情况下,可能出现倒计时周期T已走完,但节点共识仍未完成。此时新区块的时间坐标以t(n+1)=t(n)+T为准,下一轮区块生成的倒计时启动,网络节点对新区块的共识可以在时间上与下一轮个节点获取真随机数的时间重合一部分,即在下一轮步骤2完成之前形成本轮新区块共识,每个其他网络节点将新区块存储在自身的数据存储装置103中。
优选地,在数据的通信上,由于节点配备了真随机数生成装置,可以将真随机数作为对称密钥,使用非对称密钥传递,对区块数据做加密通信,从而使区块链网络的数据传输更安全。具体方法为:
(1)以网络节点a、b为例,当网络节点a生成随机数并对随机数完成校验后,在进行随机性证明的同时,从做检验的随机数中选取固定长度的随机数作为对称密钥。每个网络节点对其它各个节点使用不同的随机数作为对称密钥。如网络节点a生成与网络节点b的对称密钥记为k ab
(2)网络节点a使用来自网络节点b的公钥K b加密k ab,并发送给网络节点b。
(3)网络节点b使用自己的私钥k b解密出k ab。
(4)网络节点b使用网络节点a的对称密钥k ab加密自己准备写入新区块的记录数据,并发送给网络节点a。
(5)网络节点a使用对称密钥k ab解密来自网络节点b的记录数据,准备写入新区块。
(6)在随机性证明中胜出的网络节点获得新区块的记录权,则将全部通过对称密钥解密的来自其它网络节点的记录数据写入新区块。
实施例2
对于网络节点较多,无法实现完全同步的情况下,本实施例提供了另一种可选方案。
针对网络节点较多的非完全数据同步情况,本实施例中生成区块链的具体实施方式与实施例1中网络节点较少的完全数据同步下的步骤1到步骤4情况相同,从步骤5开始,采用下述实施方式:
步骤5:网络节点哈希值广播
对于每个网络节点m,首先把经过自己私钥k(m)加密后的哈希值H(m,n)和数字签名C(m)以网络广播的形式发送到其它网络节点,其它节点通过网络节点m的公钥K(m)解密哈希值和数字签名,将哈希值H(m,n)放入数据列表。由于网络节点数量比较大,网络节点m不能等到其它节点都返回确认数据,因此数据广播之后便自动进入下一步。
步骤6:网络节点与上一区块哈希值的二次哈希算法
网络节点m将自己的256b大小的哈希值H(m,n)与上一个区块的打包的256b大小的整体哈希值H z(n-1)顺序排列,得到一个512b大小的数组SH(m,n)。再对此数组进行一次SHA-256运算,得到一个新的256b哈希值H’(m,n)。该哈希值经过该网络节点m自身私钥k(m)加密后,与该网络节点m的数字签名C(m)一同广播发送到其它 网络节点。其它网络节点均可用上一个区块的整体哈希值H z(n-1)来验证原哈希值H(m,n)与整合后的新H’(m,n)的一致性,即通过上述同样的方式,在每个网络节点均对所有网络节点执行下述步骤:将对应网络节点的256b大小的原哈希值H(m,n)与上一个区块的打包的256b大小的整体哈希值H z(n-1)顺序排列,得到一个512b大小的数组SH(m,n)。再对此数组进行一次SHA-256运算,得到一个新的256b的整合哈希值H’(m,n)。
步骤7:阈值判断和新区块生成验证
当一个网络节点m满足以下条件:(1)获取了整个区块链网络中超过50%以上为了节点的原哈希值H(m,n)和整合H’(m,n);(2)经过计算该网络节点m自己的|H’(m,n)-H(m,n)|在所有节点中最小,或者按照数据大小的顺序,排在特定位置。则该节点自动行使本次记账权,即将自己存储的交易数据打包生成新区块。然后将新区块和该网络节点m自己的数字签名发送给其它网络节点。在网络不畅的情况下,如果在本轮区块生成倒计时T结束时没有节点满足条件(1),则全部网络节点本轮随机数和哈希值数据无效,各节点重新回到步骤1开始,本轮区块的时间坐标相应增加T。
步骤8:共识选取生成新区块网络节点
如果步骤7中有多个节点满足了条件(1)和条件(2),都生成了新区块并发送到多个网络节点,则必然会存在某个网络节点,同时接收到多个节点将自己定义为记账节点的消息,则各网络节点需要进一步共识选取:满足条件的多个区块在各节点经过一次PK,满足|H’(m,n)-H(m,n)|最小的节点胜出,它记录的新区块成为共识的新区块。各节点都对该区块做一次确认广播,超过50%节点数量确认后,形成新区块共识。该步骤可在下一轮个节点获取真随机数的时间内完成,即在下一轮步骤2完成之前形成本轮新区块共识。
实施例3
本实施例提供了一种基于区块链的数据分布式存储和加密通信方法。由于新区块生成只需要较小功耗的芯片提供硬件随机数,不需要消耗大量电力进行工作量证明。本实施例的区块链记录的数据可以用于进行各种数据信息的存储。比如,对于各类固定资产信息、各类知识产权信息、户籍和学籍信息都可以做到有效的分布式记录,使区块链更好地服务于社会。
本实施例的系统采用实施例1的系统,只是系统的工作过程如下:
步骤(1)每个网络节点生成或获取待记录数据,通过数据存储装置103对所述待记录数据进行暂存,并且将所述待记录数据广播至其他网络节点,每个网络节点基于其自身的待记录数据以及通过广播接收到的数据生成数据列表;
步骤(2)、计时装置101设定区块链中相邻区块之间的间隔时间T,基于所述间隔时间T进行区块生成倒计时;
步骤(3)、每个网络节点中的真随机数发生装置102各自生成一组预定大小的真随机数用作随机性证明,或者从各自生成的真随机数中选取一组第二预定大小的随机数用作随机性证明;
步骤(4)、每个网络节点m对自己生成的真随机数生成相应的校验值,用本地私钥对其进行加密,并生成数字签名;
步骤(5)、每个网络节点m把经过自己私钥加密后的校验值和数字签名同步到其它网络节点;
步骤(5)、每个网络节点将同步获得的全部哈希值相加,得到SH(n)=∑ mH(m,n),并且每个网络节点对所获得的校验值之和SH(n)再次进行校验值计算,得到整体校验值H z(n),其中,m为网络节点编号,n为生成该校验值的区块编号;
步骤(6)、每个网络节点将自身校验值与整体校验值按照预定运算关系进行运算,确定运算结果,所有网络节点基于所有网络节点运算结果之间的关系,按预定规则选取网络节点作为记账节点,当所述倒计时结束时,所述记账节点将自身存储的数据列表中的数据打包生成新区块,优选地,所述方法还包括实施例1和实施例2中对区块链生成方法进行附加限定的特征和步骤。
也就是说,在数据的存储上,每个网络节点在生成真随机数的过程中,各网络节点的记录的数据也发送给其它网络节点做同步存储。通过随机性证明胜出的节点自动获得记录新区块的权限,将自己存储的数据生成新区块。为防止一些节点篡改数据,区块可引入一个和私钥绑定的“信用值”数据,新加入的节点初始值为0。每一轮通过随机性证明胜出的节点,在生成区块中的数据经过其它节点验证无误后,获得一定的信用值增加作为奖励。信用值与各个网络节点绑定。
当区块篡改数据,被其它节点验证时发现,则在该区块中记录篡改数据的节点信用值减分,并惩罚相应时间不能参加区块链生成。如果本轮篡改数据的节点恰好为胜出节点,则该轮区块链生成作废,区块链回到上一个区块重新开始生成,此时该节 点的信用值减为负数,永久被排除在区块链节点之外。
在数据的通信上,由于节点配备了真随机数生成装置,可以将真随机数作为对称密钥,使用非对称密钥传递,对区块数据做加密通信,从而使区块链网络的数据传输更安全。具体方法为:
(1)网络节点a完成随机性检验后,在进行随机性证明的同时,从做检验的随机数中选取固定长度的随机数作为对称密钥。对其它每个节点使用不同的随机数作为对称密钥。如与网络节点b的对称密钥记为k ab
(2)网络节点a使用来自网络节点b的公钥K b加密k ab,并发送给网络节点b。
(3)网络节点b使用自己的私钥k b解密出k ab。
(4)网络节点b使用k ab加密自己准备写入新区块的记录数据,并发送给网络节点a。
(5)网络节点a使用k ab解密来自网络节点b的记录数据,准备写入新区块。
(6)在随机性证明中胜出的网络节点获得新区块的记录权,则将全部通过对称密钥解密的来自其它网络节点的记录数据写入新区块。
需要说明的是,本发明各个实施例中虽然对执行各个功能的装置进行了描述,但是本领域技术人员应该理解,本发明区块链系统中的装置可以执行更多功能或者系统中各个装置的功能可以由其他装置执行,或者计时装置101、数据存储装置103以及运算装置105可以由计算机设备来实现,而不设立单独的计时装置101、数据存储装置103以及运算装置105。
本领域技术人员应该理解,上述实施例仅仅是对本发明的示意性实现方式的解释,并非对本发明包含范围的限定。实施例中的细节并不构成对本发明范围的限制,在不背离本发明的精神和范围的情况下,任何基于本发明技术方案的等效变换、简单替换等显而易见的改变,均落在本发明保护范围之内。

Claims (15)

  1. 一种区块链生成方法,其特征在于,所述方法包括:
    步骤(1)、设定区块链中相邻区块之间的间隔时间T,基于所述间隔时间T进行区块生成倒计时;
    步骤(2)、每个网络节点中设置真随机数发生装置,通过每个网络节点的真随机数发生装置各自生成一组第一预定大小的真随机数用作随机性证明,或者从各自生成的真随机数中选取一组第二预定大小的随机数用作随机性证明;
    步骤(3)、每个网络节点m对自己生成的真随机数生成相应的校验值,用本地私钥对其进行加密,并生成数字签名;
    步骤(4)、每个网络节点m把经过自己私钥加密后的校验值和数字签名同步到其它网络节点;
    步骤(5)、每个网络节点将同步获得的全部校验值相加,得到校验值之和SH(n)=∑ mH(m,n),并且每个网络节点对所获得的校验值之和SH(n)再次进行校验值计算,得到整体校验值H z(n)或者获取上一区块的整体校验值,其中,m为网络节点编号,n为生成该校验值的区块编号;
    步骤(6)、每个网络节点将自身校验值与整体校验值按照预定运算关系进行运算,确定运算结果,所有网络节点基于所有网络节点运算结果之间的关系,按预定规则选取网络节点作为记账节点,当所述倒计时结束时,所述记账节点将自身接收和存储的数据打包生成新区块。
  2. 根据权利要求1所述的区块链生成方法,其特征在于,所述方法还包括:
    步骤(7)、所述记账节点将新区块的数据发送到其它网络节点,由其它网络节点确认,超过预定数目的节点验证通过后形成新区块共识。
  3. 根据权利要求2所述的区块链生成方法,其特征在于,所述方法还包括,将新区块生成的时间坐标t(n+1)做为本轮新区块完成的时间点,下一轮区块生成的倒计时从该时间点开始,所述步骤(2)包括从各自生成的真随机数中选取一个或多个字节的随机数r作为挑选编号,挑选出随机数R(m,n),用做随机性证明,所述步骤(4)包括每个网络节点m把经过自己私钥加密后的校验值和数字签名以网络广播的形式发送到其它网络节 点,其它网络节点通过相应节点的公钥K(m)解密其校验值和数字签名,将H(m,n)放入数据列表
  4. 根据权利要求1所述的区块链生成方法,其特征在于,所述步骤(6)中记账节点的选取过程包括:每个网络节点计算自身校验值与整体校验值H Z(n)之差,将所有网络节点中与整体校验值差值中排在预定位置的网络节点作为记账节点,优选地,所述排在预定位置包括:差值排在第一位或者最后一位;或者
    将每个网络节点的校验值H(m,n)先广播到其它网络节点,然后将当前区块中该网络节点的校验值H(m,n)与上一个区块的整体校验值H Z(n-1)、以及该网络节点的数字签名相加,进行校验运算,获得新的校验值H’(m,n);
    将所述新的校验值H’(m,n)广播到各网络节点,每个网络节点将各自收到的每个其它网络节点的H’(m,n)与上一个区块的整体校验值H z(n-1)分别相减,确定各个网络节点中|H(n-1)-H’(m,n)|的值排在预定位置的网络节点,获得新区块的生成权,作为记账节点。
  5. 根据权利要求1所述的区块链生成方法,其特征在于,每个网络节点向其他网络节点同步其自身的数据,并每隔第二预定时间向其它节点确认数据同步状态,如果数据同步完成,则进入下一步。如果数据同步未完成,则继续等待,优选地,该步骤设置一个等待时间期限,如果达到该等待时间期限数据同步仍未完成,则选取每个网络节点都全部获取的那些网络节点的哈希值和数字签名,进入数据列表,淘汰掉没有被每个网络节点全部获取的那些节点数据。
  6. 根据权利要求1所述的区块链生成方法,其特征在于,所述校验采用哈希校验,所述校验值为哈希值,所述步骤(6)中预定运算规则包括相减、相加或者相乘。
  7. 一种利用权利要求1-6中所述方法进行数据存储的方法,其特征在于,所述方法包括:
    步骤(1)每个网络节点生成或获取待记录数据,对所述待记录数据进行暂存,并且将所述待记录数据广播至其他网络节点,每个网络节点基于其自身的待记录数据以及通过广播接收到的数据生成数据列表;按照权利要求1-6之一所述方法 生成新区块,将自身存储的数据列表中的数据作为新区块数据。
  8. 一种区块链系统,其特征在于,所述区块链系统包括多个网络节点m,每个网络节点m包括计时装置、真随机数发生装置、数据存储装置、数据通信装置以及运算装置,各个网络节点之间通过各自的数据通信装置彼此通信连接,形成所述区块链系统,
    所述计时装置用于基于预设的相邻区块之间的间隔时间T进行区块生成倒计时;
    每个所述真随机数发生装置响应于倒计时开始指令,各自生成一组预定大小的真随机数用作随机性证明,或者从各自生成的真随机数中选取一组第二预定大小的随机数用作随机性证明:
    每个所述运算装置用于基于相应网络节点的真随机数生成校验值连同该网络节点的数字签名同步到其他网络节点;
    所述数据存储装置用于存储自身生成的数据和校验信息以及来自其他网络节点的数据和校验信息;
    每个网络节点的运算装置还用于基于同步获得的全部网络节点的校验值按照第一预定运算规则计算整体校验值或者获取上一区块的整体校验值,该第一预定运算规则的运算结果与各个校验值的运算次序无关,并且将自身校验值与整体校验值按照第二预定运算关系进行运算,确定运算结果,其中,所有网络节点的运算结果中,满足预定规则的网络节点用作记账节点,所述记账节点在所述倒计时结束基于自身接收和存储的数据打包生成新区块。
  9. 根据权利要求8所述的区块链系统,其特征在于,每个网络节点的运算装置还用于将同步获得的全部网络节点的校验值相加,得到校验值之和SH(n)=∑ mH(m,n),并且每个网络节点对所获得的校验值之和SH(n)再次进行校验值计算,得到整体校验值H z(n),其中,m为网络节点编号,n为生成该校验值的区块编号。
  10. 根据权利要求8所述的区块链系统,其特征在于,还包括加密装置,所述加密装置用于基于真随机数生成相应网络节点的对称密钥,并且基于自身的对称密钥对自身发送数据进行加密,基于来自其他网络节点的对称密钥对其他网络节点的数据进行解密。
  11. 根据权利要求8所述的区块链系统,其特征在于,所述计时装置用于将新区块生成的时间坐标t(n+1)做为本轮新区块完成的时间点,并且从该时间点开始进 行下一轮区块生成的倒计时,所述真随机数发生装置或者所述运算装置用于生成的真随机数中选取一个或多个字节的随机数r作为挑选编号,挑选出随机数R(m,n),用做随机性证明。
  12. 根据权利要求8所述的的区块链系统,其特征在于,每个网络节点m的数据通信装置用于将该网络节点m的校验值和数字签名以网络广播的形式发送到其它网络节点,其它网络节点的加密装置通过相应节点的公钥K(m)解密其校验值和数字签名,将校验值H(m,n)放入数据列表,每个网络节点的所述运算装置用于计算自身校验值与整体校验值H Z(n)之差,将所有网络节点中与整体校验值差值中排在预定位置的网络节点作为记账节点,优选地,所述排在预定位置包括:差值排在第一位或者最后一位。
  13. 根据权利要求8所述的的区块链系统,其特征在于,每个网络节点的通信装置用于将其校验值H(m,n)先广播到其它网络节点,该网络节点的运算装置用于将当前区块中该网络节点的校验值H(m,n)与上一个区块的整体校验值H Z(n-1)、以及该网络节点的数字签名相加,进行校验运算,获得新的校验值H’(m,n);所述通信装置还用于将所述新的校验值H’(m,n)广播到各网络节点,每个网络节点将各自收到的每个其它网络节点的H’(m,n)与上一个区块的整体校验值H z(n-1)分别相减,确定各个网络节点中|H(n-1)-H’(m,n)|的值排在预定位置的网络节点,获得新区块的生成权,作为记账节点,所述记账节点用于将新区块的数据发送到其它网络节点,由其它网络节点确认,超过预定数目的节点验证通过后形成新区块共识。
  14. 根据权利要求8所述的的区块链系统,其特征在于,每个网络节点向其他网络节点同步其自身的数据,并每隔第二预定时间向其它节点确认数据同步状态,如果数据同步完成,则进行记账节点选择,如果数据同步未完成,则继续等待,优选地,所述校验采用哈希校验,所述校验值为哈希值,所述预定运算规则包括相减、相加或者相乘。
  15. 一种包括权利要求8-14之一所述区块链系统的数据存储系统,其特征在于,每个网络节点包括数据采集单元,所述数据采集单元生成或采集待记录数据,对所述待记录数据进行暂存,并且将所述待记录数据广播至其他网络节点,每个网络节点基于其自身的待记录数据以及通过广播接收到的数据生成数据列表,所述区块链系统基于所述数据列表中的数据进行区块生成。
PCT/CN2022/138999 2022-10-24 2022-12-14 一种区块链生成方法、系统及相应数据存储方法和系统 WO2024087347A1 (zh)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202211304490.5A CN117978395A (zh) 2022-10-24 2022-10-24 一种基于真随机数的区块链生成方法
CN202211304470.8 2022-10-24
CN202211304470.8A CN117938390A (zh) 2022-10-24 2022-10-24 一种区块链系统以及相应数据存储系统
CN202211304490.5 2022-10-24

Publications (1)

Publication Number Publication Date
WO2024087347A1 true WO2024087347A1 (zh) 2024-05-02

Family

ID=90829852

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/138999 WO2024087347A1 (zh) 2022-10-24 2022-12-14 一种区块链生成方法、系统及相应数据存储方法和系统

Country Status (1)

Country Link
WO (1) WO2024087347A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110474774A (zh) * 2018-05-09 2019-11-19 三星Sds株式会社 基于区块链的系统中的区块创建方法及区块链节点
CN110780848A (zh) * 2019-10-16 2020-02-11 上海链度科技有限公司 基于区块链分布式随机过程的双随机生成方法和监管系统
US20200106605A1 (en) * 2018-09-28 2020-04-02 Benjamin Allan Mord Information integrity in blockchain and related technologies
WO2020070515A1 (en) * 2018-10-05 2020-04-09 Dragon Infosec Ltd A consensus method and framework for a blockchain system
CN111448579A (zh) * 2017-10-04 2020-07-24 丁津泰 量子证明区块链
US20200252211A1 (en) * 2019-01-31 2020-08-06 Cobinhood Ltd. Method for generating secure randomness on blockchain

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111448579A (zh) * 2017-10-04 2020-07-24 丁津泰 量子证明区块链
CN110474774A (zh) * 2018-05-09 2019-11-19 三星Sds株式会社 基于区块链的系统中的区块创建方法及区块链节点
US20200106605A1 (en) * 2018-09-28 2020-04-02 Benjamin Allan Mord Information integrity in blockchain and related technologies
WO2020070515A1 (en) * 2018-10-05 2020-04-09 Dragon Infosec Ltd A consensus method and framework for a blockchain system
US20200252211A1 (en) * 2019-01-31 2020-08-06 Cobinhood Ltd. Method for generating secure randomness on blockchain
CN110780848A (zh) * 2019-10-16 2020-02-11 上海链度科技有限公司 基于区块链分布式随机过程的双随机生成方法和监管系统

Similar Documents

Publication Publication Date Title
CN109964446B (zh) 一种基于投票的共识方法
WO2022027531A1 (zh) 区块链构建方法、系统、存储介质、计算机设备及应用
Wang et al. Challenges of blockchain in new generation energy systems and future outlooks
Lu et al. Zebralancer: Private and anonymous crowdsourcing system atop open blockchain
CN108833081B (zh) 一种基于区块链的设备组网认证方法
US20230171098A1 (en) Computer-implemented system and method for time release encryption over a blockchain network
US20220237600A1 (en) Blockchain-based resource transfer method, apparatus, node device, and storage medium
EP3961455A1 (en) Data verification methods, apparatuses, and devices
Zhou et al. DLattice: A permission-less blockchain based on DPoS-BA-DAG consensus for data tokenization
CN113595971A (zh) 一种基于区块链的分布式数据安全共享方法、系统和计算机可读介质
US20230316273A1 (en) Data processing method and apparatus, computer device, and storage medium
TW202029044A (zh) 區塊鏈交易的產生方法和裝置
US20200351074A1 (en) System for synchronizing a cryptographic key state through a blockchain
Zhao et al. Privacy protection scheme based on remote anonymous attestation for trusted smart meters
Wang et al. Blockchain-based dynamic energy management mode for distributed energy system with high penetration of renewable energy
US20200250655A1 (en) Efficient, environmental and consumer friendly consensus method for cryptographic transactions
CN110750329B (zh) 基于fpga实现虚拟机运算的方法及装置
Li et al. A blockchain-based credible and secure education experience data management scheme supporting for searchable encryption
WO2021057167A1 (zh) 基于fpga的安全智能合约处理器的交易处理方法及装置
Xu et al. An efficient blockchain‐based privacy‐preserving scheme with attribute and homomorphic encryption
WO2021057124A1 (zh) 基于fpga实现隐私区块链的方法及装置
Su et al. Distributed attribute-based signature with attribute dynamic update for smart grid
Cai et al. Trustless and bias-resistant game-theoretic distributed randomness
Tang et al. Hedera: A permissionless and scalable hybrid blockchain consensus algorithm in multiaccess edge computing for IoT
Islam A privacy-preserving transparent central bank digital currency system based on consortium blockchain and unspent transaction outputs

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: 22963325

Country of ref document: EP

Kind code of ref document: A1