CN111142842A - Method and system for generating random time on block chain - Google Patents
Method and system for generating random time on block chain Download PDFInfo
- Publication number
- CN111142842A CN111142842A CN201811306431.5A CN201811306431A CN111142842A CN 111142842 A CN111142842 A CN 111142842A CN 201811306431 A CN201811306431 A CN 201811306431A CN 111142842 A CN111142842 A CN 111142842A
- Authority
- CN
- China
- Prior art keywords
- random number
- block chain
- data
- random
- consensus
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 26
- 230000008569 process Effects 0.000 claims description 4
- 230000002427 irreversible effect Effects 0.000 abstract description 3
- 230000007246 mechanism Effects 0.000 abstract description 2
- 230000007935 neutral effect Effects 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 2
- 238000003756 stirring Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/58—Random or pseudo-random number generators
- G06F7/588—Random number generators, i.e. based on natural stochastic processes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
- G06Q20/3829—Payment protocols; Details thereof insuring higher security of transaction involving key management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Physics & Mathematics (AREA)
- Accounting & Taxation (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Finance (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Economics (AREA)
- Technology Law (AREA)
- Marketing (AREA)
- Development Economics (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The block chain is a distributed decentralized public account book and has the characteristics of being irreversible and not being tampered. It adopts intelligent contract and consensus mechanism to store protocol and data in nodes. The method establishes a credible, safe, neutral and autonomous decentralized platform through algorithm self-constraint. However, the block chain protocol has its own limitations, and it has been a difficult problem to generate random numbers and achieve consensus thereon. The invention provides a quick and effective means for acquiring the random number for the block chain and the intelligent contract of the block chain by introducing a new random number consensus method into the block chain.
Description
Technical Field
The invention relates to the technical field of internet, in particular to an implementation mode of a block chain technology.
Background
The block chain is a distributed decentralized public account book and has the characteristics of being irreversible and not being tampered. It adopts intelligent contract and consensus mechanism to store protocol and data in nodes. The method establishes a credible, safe, neutral and autonomous decentralized platform through algorithm self-constraint. However, the block chain protocol has its own limitations, and it has been a difficult problem to generate random numbers and achieve consensus thereon. The invention provides a quick and effective means for acquiring the random number for the block chain and the intelligent contract of the block chain by introducing a new random number consensus method into the block chain.
Disclosure of Invention
A first aspect of the embodiments of the present invention is to provide a method for implementing a random number on a block chain, including:
the block chain network contains a random number generation network.
The random number generation network is generated by all node votes.
The smart contract virtual machine supports random number rand byte instructions.
The smart contract virtual machine rand byte instruction requests the random number generation network for the random number.
A random number pool is maintained in the random number generation network, and even multiple random number requests using the same index return the same random number value.
And the random number index is subjected to Hash generation according to the current block position, the position of the block where the transaction is located and the position of the instruction pointer of the intelligent contract virtual machine when the intelligent contract is executed.
Random numbers in the random number network are generated from data in the entropy pool.
The data of the entropy pool is internal and external random events according to random number nodes: the network input data, the speed of the network input data, the rotating speed of the node fan and the temperature data of the CPU are subjected to Hash stirring for multiple times.
The random number is encrypted during the transfer using the public key of the smart contract to ensure that the random number can only be decrypted by the requested smart contract.
A first aspect of embodiments of the present invention is to provide a system for implementing random numbers on a block chain, including and implementing the method described in the first aspect.
Compared with the prior art, the invention has the beneficial effects that:
the block chain random number generation method and system provided by the embodiment of the invention provide an effective method for generating credible random numbers on the block chain through the quickly established block chain consensus, and solve the problem of generating random numbers on the block chain.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flowchart of a method for generating a blockchain random number according to an embodiment of the present invention.
Fig. 2 is a block chain network node diagram provided by an embodiment of the present invention.
Fig. 3 is a block chain random number entropy pool structure diagram provided in an embodiment of the present invention.
Fig. 4 is a schematic diagram of a block chain intelligent contract virtual machine according to an embodiment of the present invention.
Fig. 5 is a diagram of an internal structure of a blockchain intelligent contract virtual machine according to an embodiment of the present invention.
FIG. 6 is a block chain random number rand bytecode instruction execution diagram according to an embodiment of the invention.
Detailed Description
In order to make the objects, contents and advantages of the present invention clearer, the following detailed description of the embodiments of the present invention will be made in conjunction with the accompanying drawings and examples. The following examples are only for illustrating the technical solutions of the present invention more clearly, and the protection scope of the present invention is not limited thereby.
Interpretation of terms:
block chains: the block chain is a chain data structure formed by combining data blocks in a sequential connection mode according to a time sequence, and is a distributed account book which is guaranteed in a cryptographic mode and cannot be tampered and forged. The blockchain technology is a brand new distributed infrastructure and computing mode that uses blockchain data structures to verify and store data, uses distributed node consensus algorithms to generate and update data, uses cryptography to secure data transmission and access, and uses intelligent contracts composed of automated script codes to program and manipulate data.
Intelligent contract: an intelligent contract is a set of commitments defined in digital form, including agreements on which contract participants can enforce the commitments. An intelligent contract is a computer protocol intended to propagate, validate or execute contracts in an informational manner. Smart contracts allow trusted transactions to be conducted without third parties, which transactions are traceable and irreversible.
First, the key features for explaining the technical scheme of the invention are as follows:
the block chain system establishes a random number consensus network in the block chain. The nodes of the random number network are voted from all nodes on the blockchain network. The first N nodes with the most votes form the random number generation subsystem. The N nodes adopt a time slice polling mode to acquire the random number generation right of the block chain network in a time-sharing mode.
Fig. 1 illustrates the manner in which such a random number system generates random numbers.
In random number generation, each random number block node maintains a respective entropy pool and contributes random data to the entropy pools of other nodes. As shown in FIG. 2, the entropy pool data source is divided into a plurality of parts, which include random data S201 from other out-blocking nodes, interval time S202 of received network data packets, CPU fan speed S203, and CPU temperature S204. And the data of the entropy pools are subjected to hash stirring for m times to form final entropy pool data.
The entropy pool generation formula is expressed as: s = hash (hash (. hash (S1, S2, S3, S4)))
Wherein:
s1 is network data from other random number nodes;
s2 is the time interval sequence of data packets from other random number nodes;
s3 is the rotation speed of the current fan;
s4 is the current CPU temperature.
And the random number generation formula is expressed as: v = hash (X1, X2, X3)
Wherein:
x1 is the value of the last random number;
x2 is a hash of entropy pool data;
x3 is the random number index passed from the smart contract.
The random number index X3 is formulated as: i = hash (P1, P2, P2)
Wherein:
p1 is the block number of the current block chain when performing this transaction;
p2 is the transaction's sequence number in the block when this transaction is performed;
p3 is the location of the smart contract virtual machine instruction pointer when performing this transaction.
After the random number generation node generates the random number, the random number is broadcasted in the random number network and is stored in the random number pool of each random number node.
FIG. 4 illustrates an information flow diagram of a blockchain intelligence contract from development to execution in this embodiment. In the development phase, smart contracts are created by developers using a high-level smart development language 301. An intelligent contract written in a high-level language is compiled into intelligent contract byte instructions 302 by an intelligent contract compiler. When a user submits a request to execute an intelligent contract, intelligent contract byte instructions 302 are loaded into the intelligent contract virtual machine 303 for execution.
Fig. 5 shows a structure of the intelligent contract virtual machine in the present embodiment. It is composed of an instruction memory space 403, a heap memory space 401, a stack memory space 404, and an instruction execution unit 402. The instruction execution unit comprises an instruction pointer pointing to the current instruction position, a stack pointer pointing to the current stack top position, and a stack pointer pointing to the current stack position.
Fig. 6 shows a case of the random number section instruction rand instruction execution stack in this embodiment. The Rand instruction is a 0-operand byte instruction, and the execution result of the Rand instruction is that a 64-bit random number is generated at the top of the stack of the intelligent contract virtual machine stack storage space.
In the embodiment of the invention, through the method, the random numbers are quickly generated in the whole block chain network, and the intelligent contract is ensured to be correctly executed.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above functions may be distributed by different functional modules according to needs, that is, the internal structure of the system is divided into different functional modules to complete all or part of the above described functions. For the specific working process of the system described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Claims (10)
1. A method for generating random number on block chain includes containing a consensus random number generation subsystem in block chain; the random number generation subsystem is generated by a delegation rights certification consensus; the block chain acquires a random number through the consensus random number generation system; the random number is encrypted using the public key of the smart contract during the transfer process to ensure that the random number can only be decrypted by the requested smart contract using the private key of the smart contract.
2. The method of claim 1, wherein the smart contracts for blockchain nodes virtually implement a random number rand byte code instruction that requests a random number from the random number generating subsystem.
3. A method according to claim 1 or 2, wherein the random number generation subsystem maintains a pool of random numbers internally, i.e. multiple random number requests using the same index will all return the same random number value.
4. The method of claim 3, wherein the random number index is hashed according to a current block position, a position of a block where the transaction is located, and a position of an instruction pointer of the virtual machine of the intelligent contract when the intelligent contract is executed.
5. A method according to claim 1 or 2, characterized in that the random numbers in the random number network are generated from data in an entropy pool; the data of the entropy pool is internal and external random events according to random number nodes: the network input data, the speed of the network input data, the rotating speed of the node fan and the temperature data of the CPU are processed by Hash processing for multiple times.
6. A block chain system is characterized in that a block chain comprises a consensus random number generation subsystem; the random number generation subsystem is generated by a delegation rights certification consensus; the block chain acquires a random number through the consensus random number generation system; the random number is encrypted using the public key of the smart contract during the transfer process to ensure that the random number can only be decrypted by the requested smart contract using the private key of the smart contract.
7. The method of claim 6, wherein the smart contracts of blockchain nodes virtually implement random number rand bytecode instructions; the random number rand byte instruction requests a random number from the random number generation subsystem.
8. A method according to claim 6 or 7, wherein the random number generation subsystem maintains a pool of random numbers internally, i.e. multiple random number requests using the same index will all return the same random number value.
9. The method of claim 8, wherein the random number index is hashed according to a current block location when the intelligent contract is executed, a location of a block where the transaction is located, and a location of an instruction pointer of the virtual machine of the intelligent contract.
10. The method according to claim 6 or 7, characterized in that the random numbers in the random number network are generated from data in an entropy pool; the data of the entropy pool is internal and external random events according to random number nodes: the network input data, the speed of the network input data, the rotating speed of the node fan and the temperature data of the CPU are processed by Hash processing for multiple times.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811306431.5A CN111142842A (en) | 2018-11-05 | 2018-11-05 | Method and system for generating random time on block chain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811306431.5A CN111142842A (en) | 2018-11-05 | 2018-11-05 | Method and system for generating random time on block chain |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111142842A true CN111142842A (en) | 2020-05-12 |
Family
ID=70515175
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811306431.5A Pending CN111142842A (en) | 2018-11-05 | 2018-11-05 | Method and system for generating random time on block chain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111142842A (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030023396A1 (en) * | 2001-07-02 | 2003-01-30 | Boehm Fritz A. | Random number indexing method and apparatus that eliminates software call sequence dependency |
CN102541508A (en) * | 2010-12-29 | 2012-07-04 | 鸿富锦精密工业(深圳)有限公司 | True random number generating system and method |
CN104317551A (en) * | 2014-10-17 | 2015-01-28 | 北京德加才科技有限公司 | Ultrahigh-safety true random number generation method and ultrahigh-safety true random number generation system |
CN107301546A (en) * | 2017-05-03 | 2017-10-27 | 北京众享比特科技有限公司 | Generating random number and methods for using them and device |
CN107392770A (en) * | 2017-08-09 | 2017-11-24 | 北京云知科技有限公司 | A kind of random-number generating method and system based on block chain |
JP2018050973A (en) * | 2016-09-29 | 2018-04-05 | 日本電気株式会社 | Random number generation system, random number generation device, random number generation method and program |
WO2018104728A1 (en) * | 2016-12-05 | 2018-06-14 | Quanta Technology Ltd | Random number generation |
CN108365960A (en) * | 2017-12-29 | 2018-08-03 | 北京欧链科技有限公司 | Random number providing method and device |
-
2018
- 2018-11-05 CN CN201811306431.5A patent/CN111142842A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030023396A1 (en) * | 2001-07-02 | 2003-01-30 | Boehm Fritz A. | Random number indexing method and apparatus that eliminates software call sequence dependency |
CN102541508A (en) * | 2010-12-29 | 2012-07-04 | 鸿富锦精密工业(深圳)有限公司 | True random number generating system and method |
CN104317551A (en) * | 2014-10-17 | 2015-01-28 | 北京德加才科技有限公司 | Ultrahigh-safety true random number generation method and ultrahigh-safety true random number generation system |
JP2018050973A (en) * | 2016-09-29 | 2018-04-05 | 日本電気株式会社 | Random number generation system, random number generation device, random number generation method and program |
WO2018104728A1 (en) * | 2016-12-05 | 2018-06-14 | Quanta Technology Ltd | Random number generation |
CN107301546A (en) * | 2017-05-03 | 2017-10-27 | 北京众享比特科技有限公司 | Generating random number and methods for using them and device |
CN107392770A (en) * | 2017-08-09 | 2017-11-24 | 北京云知科技有限公司 | A kind of random-number generating method and system based on block chain |
CN108365960A (en) * | 2017-12-29 | 2018-08-03 | 北京欧链科技有限公司 | Random number providing method and device |
Non-Patent Citations (3)
Title |
---|
李淼: "区块链模式下金融业创新与监管研究" * |
王群;李馥娟;王振力;梁广俊;徐杰;: "区块链原理及关键技术" * |
高长军: "于非对称加密技术的数字货币存在的风险和挑战" * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3201819B1 (en) | Automated verification of a software system | |
US10148442B2 (en) | End-to-end security for hardware running verified software | |
JP6983890B2 (en) | Computer-enhanced systems and methods for enabling complex functions on the blockchain while maintaining security-based limits on script size and opcode limits. | |
Launchbury et al. | Efficient lookup-table protocol in secure multiparty computation | |
CN110020856B (en) | Method, node and storage medium for realizing mixed transaction in block chain | |
WO2016113738A1 (en) | Secret shared random access machine | |
CN110609679B (en) | Data processing method, device, computer readable storage medium and computer equipment | |
EP3977390B1 (en) | Blockchain transaction processing systems and methods | |
CN115622684B (en) | Privacy computation heterogeneous acceleration method and device based on fully homomorphic encryption | |
US11750403B2 (en) | Robust state synchronization for stateful hash-based signatures | |
US11575515B2 (en) | Post-quantum secure remote attestation for autonomous systems | |
EP4020270A1 (en) | Attestation support for elastic cloud computing environments | |
US11327732B2 (en) | Method for executing smart contract, blockchain node, and storage medium | |
CN115698938A (en) | Protection of transformations in cryptographic operations by intermediate randomization | |
CN110738567A (en) | Transaction processing method and device of safe intelligent contract processor based on FPGA | |
CN111142842A (en) | Method and system for generating random time on block chain | |
US11500845B2 (en) | Blockchain transaction processing systems and methods | |
US11924320B2 (en) | Devices and methods for protecting cryptographic programs | |
CN112906073A (en) | Method for realizing block chain secret calculation general model | |
CN108268254B (en) | Flash file function library calling method and device, electronic equipment and medium | |
Pu et al. | Computing privacy-preserving edit distance and Smith-Waterman problems on the GPU architecture | |
US20230379138A1 (en) | Format-preserving data encryption | |
KR102398543B1 (en) | Verifiable block chain virtual machine with zero knowledge algorithm | |
Kromes et al. | Accelerating Blockchain Applications on IoT Architecture Models-Solutions and Drawbacks | |
Deitos et al. | Parallelizing secure linear programming |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20200512 |
|
WD01 | Invention patent application deemed withdrawn after publication |