CN110933183A - Block chain-based number shaking method and system - Google Patents
Block chain-based number shaking method and system Download PDFInfo
- Publication number
- CN110933183A CN110933183A CN201911293460.7A CN201911293460A CN110933183A CN 110933183 A CN110933183 A CN 110933183A CN 201911293460 A CN201911293460 A CN 201911293460A CN 110933183 A CN110933183 A CN 110933183A
- Authority
- CN
- China
- Prior art keywords
- shaking
- private key
- number shaking
- modulus
- unit
- 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 70
- 230000008569 process Effects 0.000 claims abstract description 42
- 238000000605 extraction Methods 0.000 claims abstract description 11
- 230000004044 response Effects 0.000 claims description 21
- 238000012545 processing Methods 0.000 claims description 8
- 238000004804 winding Methods 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000007792 addition Methods 0.000 description 1
- 230000004075 alteration Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000012797 qualification Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- G—PHYSICS
- G07—CHECKING-DEVICES
- G07C—TIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
- G07C15/00—Generating random numbers; Lottery apparatus
- G07C15/006—Generating random numbers; Lottery apparatus electronically
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/14—Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
- H04L63/1441—Countermeasures against malicious traffic
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/50—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
Abstract
The invention discloses a number shaking method and a number shaking system based on a block chain, wherein the number shaking method comprises the following steps: the number shaking equipment creates a new instance of the intelligent number shaking contract and calls the new instance to start executing the number shaking; the number shaking equipment creates random value private keys with the number of y in the number shaking intelligent contract; the number shaking equipment respectively carries out hash operation on each private key to obtain a hash integer value of each private key; performing modulus extraction on the number x of the selectable sets through each hash code integer value to obtain y moduli; the number shaking equipment creates an element private key in the number shaking intelligent contract, and each element in the optional set is filled with the private key through the element private key; performing hash operation on each filled element, and reordering the elements in the optional set according to the hash operation result; and performing index operation on the elements in the reordered selectable set through the y moduli and acquiring corresponding elements. The invention has the advantages that the number shaking process can be verified and cannot be tampered, and the number shaking result is public and fair.
Description
Technical Field
The invention relates to the technical field of block chains, in particular to a shaking method and a shaking system based on a block chain.
Background
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. From the application perspective, the blockchain is a distributed shared account book and a database, and has the characteristics of decentralization, no tampering, trace leaving in the whole process, traceability, collective maintenance, public transparency and the like. The characteristics ensure the honesty and the transparency of the block chain and lay a foundation for creating trust for the block chain.
At present, various number shaking technologies and applications widely influence life and work of people, such as number shaking for arranging examination positions and number shaking for determining the qualification of license plates. The basis of the number shaking technology is a random value algorithm, the existing random value algorithm is a mathematically distributed pseudo-random algorithm, meanwhile, random values are all generated in a computer, the generation process of the random values is not really disclosed, and meanwhile, because the random value algorithm is too professional, and a number shaking program is a relation between a black box and a black box program, the number shaking result is often questioned by participants; furthermore, when the number shaking result is wrong for some reason, the number shaking party can modify the generated number shaking result at will, which deepens the number shaking result to be more questioned by the participating party.
The above is only for the purpose of assisting understanding of the technical solutions of the present application, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly solves the defect that the number shaking process is not transparent in the number shaking method in the prior art, and provides the number shaking method and the number shaking system based on the block chain.
In order to solve the technical problems, the invention adopts the following technical scheme:
the block chain node receives a shaking request, wherein the shaking request comprises an optional set, the number x of the optional set and the number y of the shaking results;
triggering a number shaking intelligent contract, wherein the number shaking intelligent contract is used for executing a number shaking process;
the number shaking equipment creates a new instance of the intelligent number shaking contract according to the number shaking request, and calls the new instance to start executing the number shaking;
the number shaking equipment creates random value private keys with the number of y in the number shaking intelligent contract according to the number y of the number shaking results;
the number shaking equipment respectively carries out hash operation on each private key to obtain a hash integer value of each private key;
the number shaking equipment respectively performs modulus extraction on the number x of the selectable sets through each hash code integer value to obtain y moduli, wherein the moduli are positive integers smaller than x;
the number shaking equipment creates an element private key in the number shaking intelligent contract, and each element in the optional set is filled with the private key through the element private key;
the number shaking equipment respectively performs hash operation on each filled element, and reorders the elements in the optional set according to the hash operation result;
and the number shaking equipment performs index operation on the elements in the reordered selectable set through the y moduli and acquires corresponding elements, wherein the corresponding elements are the number shaking results.
Optionally, the number shaking method further comprises:
the method comprises the steps that a block chain node receives a number shaking data chaining request sent by number shaking equipment, wherein the number shaking data comprise y number of number shaking results, y random value private keys and element private keys;
triggering a storage intelligent contract, wherein the storage intelligent contract is used for executing the number shaking data to a chain winding process.
Optionally, the number shaking method further comprises:
the block chain node receives a shaking data query request and sends the shaking data query request to the shaking equipment;
the block chain node receives a shaking data query response sent by the shaking equipment, and sends the shaking data query response to the intelligent storage contract, wherein the shaking data query response comprises shaking data;
triggering a storage intelligent contract, wherein the storage intelligent contract is used for responding the number shaking data inquiry to execute a cochain process.
Optionally, the step of performing hash operation on each private key by the number shaking device to obtain a hash integer value of each private key includes:
the number shaking equipment converts each private key into 16-system character strings respectively;
and the shaking equipment respectively performs hash operation on the converted 16-system character strings to obtain a hash integer value of each 16-system character string.
Optionally, the number shaking device performs modulo on the number x of the selectable sets by using each hash code integer value to obtain y moduli, where the modulus is a positive integer smaller than x, and the method includes the following steps:
the number shaking equipment respectively performs modulus extraction on the number x of the selectable sets through each hash code integer value, and the modulus is a positive integer smaller than x;
and if the repeated modulus is obtained at least twice in the modulus taking process of the number shaking equipment, the repeated modulus is invalidated, the number shaking equipment acquires a new random value private key corresponding to the repeated modulus, hashcode operation is respectively carried out on the new random value private key to obtain a hashcode integer value corresponding to the new random value private key, and the modulus of the selectable set number x is respectively taken through the hashcode integer value of the new random value private key until y nonrepeated moduli are obtained.
Optionally, the private key is a random value of 256 bits.
The invention also discloses a number shaking system based on the block chain, which comprises the following components:
a receiving unit and a processing unit; the processing unit comprises an initialization unit, a private key creation unit, a hash code operation unit, an analog-digital acquisition unit and a shaking number output unit;
the system comprises a receiving unit, a generating unit and a processing unit, wherein the receiving unit is used for receiving a shaking request, and the shaking request comprises an optional set, the number x of the optional set and the number y of the shaking results;
the initialization unit is used for triggering the intelligent contract of number shaking, the intelligent contract of number shaking is used for executing the process of number shaking, the initialization unit creates a new instance of the intelligent contract of number shaking according to the request of number shaking, and the new instance is called to start executing the number shaking;
the private key creating unit is used for creating random value private keys with the number y in the number shaking intelligent contract according to the number y of the number shaking results;
the hash operation unit is used for performing hash operation on each private key to obtain a hash integer value of each private key;
a modulus obtaining unit, configured to obtain y moduli by performing modulus extraction on the number x of the selectable sets through each hash code integer value, where the modulus is a positive integer smaller than x;
the private key creating unit is used for creating an element private key in the number shaking intelligent contract and filling each element in the optional set with the private key through the element private key;
a hash operation unit, configured to perform hash operation on each filled element, and reorder the elements in the selectable set according to a hash operation result;
and the number shaking and outputting unit is used for performing index operation on the elements in the reordered selectable set through y moduli and acquiring corresponding elements, wherein the corresponding elements are number shaking results.
Optionally, the number shaking device further comprises: the data chaining unit receives a number shaking data chaining request sent by number shaking equipment, the number shaking data comprises y number shaking results, y random value private keys and element private keys, the data chaining unit triggers a storage intelligent contract, and the storage intelligent contract is used for executing a chaining process on the number shaking data.
Optionally, the number shaking device further comprises: the data query unit receives a shaking number data query request and sends the shaking number data query request to the number shaking equipment, the data query unit receives a shaking number data query response sent by the number shaking equipment and sends the shaking number data query response to the intelligent storage contract, the shaking number data query response comprises shaking number data, the data query unit triggers the intelligent storage contract, and the intelligent storage contract is used for executing an uplink process on the shaking number data query response.
Optionally, the modulus obtaining unit performs modulus operation on the number x of the optional sets respectively through each hash code integer value, where a modulus is a positive integer smaller than x;
and if the repeated modulus is obtained at least twice in the modulus obtaining process of the modulus obtaining unit, the repeated modulus is invalidated, the modulus obtaining unit obtains a new random value private key corresponding to the repeated modulus, hashcode operation is respectively carried out on the new random value private key to obtain a hashcode integer value corresponding to the new random value private key, and modulus obtaining is respectively carried out on the number x of the selectable sets through the hashcode integer value of the new random value private key until y nonrepeated moduli are obtained.
The invention adopts the technical scheme, and has the following beneficial effects:
the invention provides a shaking method based on a block chain, which has high reliability because block chain data has the characteristics of openness and transparency and is not easy to be tampered; meanwhile, by providing the storage intelligent contract, the number shaking data generated in the number shaking process of the number shaking equipment is directly input into the storage intelligent contract and is directly output to the public account book of the block chain through the storage intelligent contract, the public browsing and checking can be performed on the block chain, and the number shaking result and the public justice of the number shaking process are ensured.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a schematic flow diagram of a blockchain-based number shaking method;
fig. 2 is a schematic structural diagram of a block chain-based pan mark system.
Detailed Description
To make the objects, aspects and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the following detailed description and the accompanying drawings, it being understood that the description is illustrative only and is not intended to limit the scope of the present invention. Moreover, in the following description, second speed for well-known structures and techniques are omitted to avoid unnecessarily obscuring the concepts of the present invention.
The first embodiment is as follows:
fig. 1 is a schematic flow diagram of a blockchain-based number shaking method.
As shown in fig. 1, to solve the above problem, an embodiment of the present invention provides a block chain-based number shaking method, including the following steps:
the block chain node receives a shaking request, wherein the shaking request comprises an optional set, the number x of the optional set and the number y of the shaking result;
triggering a number shaking intelligent contract, wherein the number shaking intelligent contract is used for executing a number shaking process;
the number shaking equipment creates a new instance of the intelligent number shaking contract according to the number shaking request, and calls the new instance to start executing the number shaking;
the number shaking equipment creates random value private keys with the number of y in the number shaking intelligent contract according to the number y of the number shaking results;
the number shaking equipment respectively carries out hash operation on each private key to obtain a hash integer value of each private key;
the number shaking equipment respectively performs modulus extraction on the number x of the selectable sets through each hash code integer value to obtain y moduli, wherein the moduli are positive integers smaller than x;
the number shaking equipment creates an element private key in the number shaking intelligent contract, and each element in the optional set is filled with the private key through the element private key;
the number shaking equipment respectively performs hash operation on each filled element, and reorders the elements in the optional set according to the hash operation result;
and the number shaking equipment performs index operation on the elements in the reordered optional set through the y moduli and acquires corresponding elements, wherein the corresponding elements are the number shaking results.
Optionally, the block chain-based shaking method further includes:
the block chain node receives a number shaking data chaining request sent by number shaking equipment, wherein the number shaking data comprise y number shaking results, y random value private keys and element private keys;
and triggering a storage intelligent contract, wherein the storage intelligent contract is used for executing the cochain process on the number shaking data.
Optionally, the block chain-based shaking method further includes:
the block chain node receives the request for inquiring the shaking data and sends the request for inquiring the shaking data to the shaking equipment;
the block chain node receives a shaking data query response sent by the shaking equipment, sends the shaking data query response to store an intelligent contract, and the shaking data query response comprises shaking data;
and triggering a storage intelligent contract, wherein the storage intelligent contract is used for responding to the number shaking data inquiry to execute the uplink process.
It should be noted that the uplink process is a conventional process in the art and will not be described in detail. For example: under the workload certification PoW consensus mode, packaging and verifying data, wherein a block link point robbing accounting right can place the packaged block in the next block of the current block to serve as a new block uplink; the uplink data is in plaintext and is not encrypted.
Optionally, the number shaking device performs hash operation on each private key respectively to obtain a hash integer value of each private key, including the following steps:
the number shaking equipment converts each private key into 16-system character strings respectively;
and the shaking equipment respectively performs hash operation on the converted 16-system character strings to obtain a hash integer value of each 16-system character string.
Optionally, the number shaking device performs modulo on the number x of the optional sets by using each hash code integer value to obtain y moduli, where a modulus is a positive integer smaller than x, and the modulo is performed by the number shaking device:
the number shaking equipment respectively performs modulus extraction on the number x of the selectable sets through each hash code integer value, and the modulus is a positive integer smaller than x;
and if the repeated modulus is obtained at least twice in the modulus taking process of the number shaking equipment, the repeated modulus is invalidated, the number shaking equipment acquires a new random value private key corresponding to the repeated modulus, hashcode operation is respectively carried out on the new random value private key to obtain a hashcode integer value corresponding to the new random value private key, and the modulus of the number x of the selectable sets is respectively taken through the hashcode integer value of the new random value private key until y nonrepeated moduli are obtained.
Optionally, the private key is a random value of 256 bits.
The private key data are calculated from 256-bit random values each time, the calculation results are different, the calculation of the power of 10 (77) is possibly repeated, the existing computer cannot be cracked violently, and the security of the number shaking process is enhanced.
The application provides a shaking method based on a block chain, and as block chain data has the characteristics of openness and transparency, and the block chain data is high in safety and not easy to tamper, the reliability is high; meanwhile, by providing the storage intelligent contract, the number shaking data generated in the number shaking process of the number shaking equipment is directly input into the storage intelligent contract and is directly output to the public account book of the block chain through the storage intelligent contract, the public browsing and checking can be performed on the block chain, and the number shaking result and the public justice of the number shaking process are ensured.
It should be noted that in the application, the number shaking equipment directly performs information interaction with the nodes of the block chain, the nodes of the block chain directly store the information on the block chain, and a centralized server is not provided, so that the number shaking data is more public and credible; rather than the existing rocker device interacting with a centralized server.
In one example: the number shaking method is applied to lottery drawing in a company annual meeting, for example: the number of companies is 100, 5 lottery winners such as 5 lottery can be drawn at one time by using the lottery number algorithm, and the lottery drawing steps are as follows:
the block chain node receives a number shaking request, wherein the number shaking request comprises a name list of 100 employees of a company, the number of the company is 100, and the number of winning people is 5;
triggering a number shaking intelligent contract, wherein the number shaking intelligent contract is used for executing a number shaking process;
the number shaking equipment creates a new instance of the intelligent number shaking contract according to the number shaking request, and calls the new instance to start executing the number shaking;
the number of the winning numbers is judged to be 5 by the number shaking equipment, 5 random value private keys are created in the number shaking intelligent contract, and each private key is a 256-bit random value;
the number shaking equipment respectively carries out hash operation on each private key to obtain a hash integer value of each private key;
the number shaking equipment respectively performs modulus extraction on the total number 100 of input employees through each hash code integer value to obtain 5 moduli, wherein the moduli are positive integers smaller than 100; and if the repeated modulus is obtained at least twice in the modulus taking process of the number shaking equipment, the repeated modulus is invalidated, the number shaking equipment acquires a new random value private key corresponding to the repeated modulus, hashcode operation is respectively carried out on the new random value private key to obtain a hashcode integer value corresponding to the new random value private key, and the modulus is respectively taken on the total number 100 of the input staff through the hashcode integer value of the new random value private key until 5 nonrepeated moduli are obtained.
The number shaking equipment adds a randomly generated element private key to the data content of input 100 employee names for private key filling, hashcode operation is respectively carried out on the data content of each filled employee name, names of 100 employees are reordered according to the hashcode operation result, and the element private key is directly created by a number shaking intelligent contract;
the number-shaking equipment performs index operation on 100 newly-sequenced staff names and acquires the names of corresponding staff according to the 5 moduli acquired in the process, wherein the names of the corresponding staff are the number of the winners of the lottery, namely 5 winners are selected;
the intelligent contract is stored to execute the chaining process on the number of winning people, all random value private keys participating in operation, the staff name data content after 100 staff name data contents are filled by the private keys and 5-bit winning staff names, the intelligent contract and the intelligent contract for shaking numbers both provide query interfaces, the data content and the shaking number result generated in the shaking number process can be queried at any time, and the chaining data are all plaintext and are not encrypted.
Example two:
fig. 2 is a schematic structural diagram of a block chain-based pan mark system.
As shown in fig. 2, to solve the above problem, an embodiment of the present invention provides a block chain-based shaking number system, including:
a receiving unit and a processing unit; the processing unit comprises an initialization unit, a private key creation unit, a hash code operation unit, an analog-digital acquisition unit and a shaking number output unit;
the receiving unit receives a shaking request which comprises selectable sets, the number x of the selectable sets and the number y of shaking results;
the initialization unit triggers a number shaking intelligent contract which is used for executing a number shaking process, and the initialization unit creates a new instance of the number shaking intelligent contract according to a number shaking request and calls the new instance to start executing the number shaking;
the private key creating unit creates random value private keys with the number y in the number shaking intelligent contract according to the number y of the number shaking results;
the hash operation unit respectively performs hash operation on each private key to obtain a hash integer value of each private key;
the modulus obtaining unit respectively performs modulus obtaining on the number x of the selectable sets through each hash code integer value to obtain y moduli, wherein the modulus is a positive integer smaller than x;
the private key creating unit creates an element private key in the number shaking intelligent contract, and each element in the optional set is filled with the private key through the element private key;
the hash operation unit respectively performs hash operation on each filled element, and reorders the elements in the selectable set according to the hash operation result;
and the number shaking and outputting unit performs index operation on the elements in the reordered optional set through y moduli and acquires corresponding elements, wherein the corresponding elements are the number shaking results.
The number shaking system further comprises: the data chaining unit receives a number shaking data chaining request sent by the number shaking equipment, the number shaking data comprises y number shaking results, y random value private keys and element private keys, the data chaining unit triggers a storage intelligent contract, and the storage intelligent contract is used for executing a chaining process on the number shaking data.
The number shaking system further comprises: the data query unit receives the number shaking data query request and sends the number shaking data query request to the number shaking equipment, the data query unit receives the number shaking data query response sent by the number shaking equipment and sends the number shaking data query response to store an intelligent contract, the number shaking data query response comprises number shaking data, the data query unit triggers the intelligent contract to be stored, and the intelligent contract is used for enabling the number shaking data query response to execute the uplink process.
The modulus obtaining unit respectively performs modulus obtaining on the number x of the optional sets through each hash code integer value, wherein the modulus is a positive integer smaller than x;
and if the repeated modulus is obtained at least twice in the modulus obtaining process of the modulus obtaining unit, the repeated modulus is invalidated, the modulus obtaining unit obtains a new random value private key corresponding to the repeated modulus, hashcode operation is respectively carried out on the new random value private key to obtain a hashcode integer value corresponding to the new random value private key, and the modulus of the number x of the selectable sets is respectively obtained through the hashcode integer value of the new random value private key until y nonrepeated moduli are obtained.
The working process of the present invention corresponds to the above method process, and is not described herein again.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
It should be noted that:
while preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
Those of skill would further appreciate that the various illustrative steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In addition, it should be noted that the specific embodiments described in the present specification may differ in the shape of the components, the names of the components, and the like. All equivalent or simple changes of the structure, the characteristics and the principle of the invention which are described in the patent conception of the invention are included in the protection scope of the patent of the invention. Various modifications, additions and substitutions for the specific embodiments described may be made by those skilled in the art without departing from the scope of the invention as defined in the accompanying claims.
Claims (10)
1. A shaking method based on a block chain is characterized by comprising the following steps:
the block chain node receives a shaking request, wherein the shaking request comprises an optional set, the number x of the optional set and the number y of the shaking results;
triggering a number shaking intelligent contract, wherein the number shaking intelligent contract is used for executing a number shaking process;
the number shaking equipment creates a new instance of the intelligent number shaking contract according to the number shaking request, and calls the new instance to start executing the number shaking;
the number shaking equipment creates random value private keys with the number of y in the number shaking intelligent contract according to the number y of the number shaking results;
the number shaking equipment respectively carries out hash operation on each private key to obtain a hash integer value of each private key;
the number shaking equipment respectively performs modulus extraction on the number x of the selectable sets through each hash code integer value to obtain y moduli, wherein the moduli are positive integers smaller than x;
the number shaking equipment creates an element private key in the number shaking intelligent contract, and each element in the optional set is filled with the private key through the element private key;
the number shaking equipment respectively performs hash operation on each filled element, and reorders the elements in the optional set according to the hash operation result;
and the number shaking equipment performs index operation on the elements in the reordered selectable set through the y moduli and acquires corresponding elements, wherein the corresponding elements are the number shaking results.
2. The block chain based number shaking method of claim 1, further comprising:
the method comprises the steps that a block chain node receives a number shaking data chaining request sent by number shaking equipment, wherein the number shaking data comprise y number of number shaking results, y random value private keys and element private keys;
triggering a storage intelligent contract, wherein the storage intelligent contract is used for executing the number shaking data to a chain winding process.
3. The tile chain-based shaking method of claim 2, further comprising:
the block chain node receives a shaking data query request and sends the shaking data query request to the shaking equipment;
the block chain node receives a shaking data query response sent by the shaking equipment, and sends the shaking data query response to the intelligent storage contract, wherein the shaking data query response comprises shaking data;
triggering a storage intelligent contract, wherein the storage intelligent contract is used for responding the number shaking data inquiry to execute a cochain process.
4. The block chain-based shaking method of claim 1,
the number shaking equipment respectively performs hash operation on each private key to obtain a hash integer value of each private key comprises the following steps:
the number shaking equipment converts each private key into 16-system character strings respectively;
and the shaking equipment respectively performs hash operation on the converted 16-system character strings to obtain a hash integer value of each 16-system character string.
5. The block chain-based shaking method of claim 1,
the number shaking equipment respectively performs modulus extraction on the number x of the selectable sets through each hash code integer value to obtain y moduli, wherein the modulus is a positive integer smaller than x and comprises the following steps:
the number shaking equipment respectively performs modulus extraction on the number x of the selectable sets through each hash code integer value, and the modulus is a positive integer smaller than x;
and if the repeated modulus is obtained at least twice in the modulus taking process of the number shaking equipment, the repeated modulus is invalidated, the number shaking equipment acquires a new random value private key corresponding to the repeated modulus, hashcode operation is respectively carried out on the new random value private key to obtain a hashcode integer value corresponding to the new random value private key, and the modulus of the selectable set number x is respectively taken through the hashcode integer value of the new random value private key until y nonrepeated moduli are obtained.
6. The block chain-based shaking method of claim 1,
the private key is a random value of 256 bits.
7. A rocker system based on a blockchain, comprising:
a receiving unit and a processing unit; the processing unit comprises an initialization unit, a private key creation unit, a hash code operation unit, an analog-digital acquisition unit and a shaking number output unit;
the system comprises a receiving unit, a generating unit and a processing unit, wherein the receiving unit is used for receiving a shaking request, and the shaking request comprises an optional set, the number x of the optional set and the number y of the shaking results;
the initialization unit is used for triggering the intelligent contract of number shaking, the intelligent contract of number shaking is used for executing the process of number shaking, the initialization unit creates a new instance of the intelligent contract of number shaking according to the request of number shaking, and the new instance is called to start executing the number shaking;
the private key creating unit is used for creating random value private keys with the number y in the number shaking intelligent contract according to the number y of the number shaking results;
the hash operation unit is used for performing hash operation on each private key to obtain a hash integer value of each private key;
a modulus obtaining unit, configured to obtain y moduli by performing modulus extraction on the number x of the selectable sets through each hash code integer value, where the modulus is a positive integer smaller than x;
the private key creating unit is used for creating an element private key in the number shaking intelligent contract and filling each element in the optional set with the private key through the element private key;
a hash operation unit, configured to perform hash operation on each filled element, and reorder the elements in the selectable set according to a hash operation result;
and the number shaking and outputting unit is used for performing index operation on the elements in the reordered selectable set through y moduli and acquiring corresponding elements, wherein the corresponding elements are number shaking results.
8. The blockchain-based rocker number system of claim 7, further comprising:
the data chaining unit receives a number shaking data chaining request sent by number shaking equipment, the number shaking data comprises y number shaking results, y random value private keys and element private keys, the data chaining unit triggers a storage intelligent contract, and the storage intelligent contract is used for executing a chaining process on the number shaking data.
9. The blockchain-based rocker number system of claim 8, further comprising:
the data query unit receives a shaking number data query request and sends the shaking number data query request to the number shaking equipment, the data query unit receives a shaking number data query response sent by the number shaking equipment and sends the shaking number data query response to the intelligent storage contract, the shaking number data query response comprises shaking number data, the data query unit triggers the intelligent storage contract, and the intelligent storage contract is used for executing an uplink process on the shaking number data query response.
10. The blockchain-based rocker system of claim 7,
the modulus obtaining unit respectively performs modulus obtaining on the number x of the optional sets through each hash code integer value, wherein the modulus is a positive integer smaller than x;
and if the repeated modulus is obtained at least twice in the modulus obtaining process of the modulus obtaining unit, the repeated modulus is invalidated, the modulus obtaining unit obtains a new random value private key corresponding to the repeated modulus, hashcode operation is respectively carried out on the new random value private key to obtain a hashcode integer value corresponding to the new random value private key, and modulus obtaining is respectively carried out on the number x of the selectable sets through the hashcode integer value of the new random value private key until y nonrepeated moduli are obtained.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911293460.7A CN110933183A (en) | 2019-12-16 | 2019-12-16 | Block chain-based number shaking method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911293460.7A CN110933183A (en) | 2019-12-16 | 2019-12-16 | Block chain-based number shaking method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110933183A true CN110933183A (en) | 2020-03-27 |
Family
ID=69862770
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911293460.7A Pending CN110933183A (en) | 2019-12-16 | 2019-12-16 | Block chain-based number shaking method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110933183A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111884807A (en) * | 2020-07-13 | 2020-11-03 | 腾讯科技(深圳)有限公司 | Article reservation method, apparatus, device and medium based on block chain |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180109516A1 (en) * | 2016-10-13 | 2018-04-19 | Coinplug, Inc. | Method for providing certificate service based on smart contract and server using the same |
CN109615759A (en) * | 2018-12-06 | 2019-04-12 | 西南电子技术研究所(中国电子科技集团公司第十研究所) | It is random to take out number number of shaking system |
CN110164022A (en) * | 2019-06-13 | 2019-08-23 | 北京艾摩瑞策科技有限公司 | A kind of random number of shaking method and its equipment on block chain |
CN110223440A (en) * | 2019-06-13 | 2019-09-10 | 北京艾摩瑞策科技有限公司 | A kind of random number of shaking method and apparatus of application block chain |
-
2019
- 2019-12-16 CN CN201911293460.7A patent/CN110933183A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180109516A1 (en) * | 2016-10-13 | 2018-04-19 | Coinplug, Inc. | Method for providing certificate service based on smart contract and server using the same |
CN109615759A (en) * | 2018-12-06 | 2019-04-12 | 西南电子技术研究所(中国电子科技集团公司第十研究所) | It is random to take out number number of shaking system |
CN110164022A (en) * | 2019-06-13 | 2019-08-23 | 北京艾摩瑞策科技有限公司 | A kind of random number of shaking method and its equipment on block chain |
CN110223440A (en) * | 2019-06-13 | 2019-09-10 | 北京艾摩瑞策科技有限公司 | A kind of random number of shaking method and apparatus of application block chain |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111884807A (en) * | 2020-07-13 | 2020-11-03 | 腾讯科技(深圳)有限公司 | Article reservation method, apparatus, device and medium based on block chain |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106874461B (en) | A kind of workflow engine supports multi-data source configuration security access system and method | |
CN104811300B (en) | The key updating method of cloud storage and the implementation method of cloud data accountability system | |
CN103425941B (en) | The verification method of cloud storage data integrity, equipment and server | |
CN101741852B (en) | Authentication method, system and device | |
JP2008524727A5 (en) | ||
CN1221900C (en) | User's identity authentication method of dynamic electron cipher equipment and its resources sharing system | |
CN102946384B (en) | User authentication method and equipment | |
CN104574122A (en) | Two-dimensional code anti-counterfeit and random product packaging goods-fleeing preventing method | |
CN105488423B (en) | A kind of the audit check system and method for data file | |
Teja et al. | Secured voting through Blockchain technology | |
CN106685640B (en) | Electronic evidence fixed information generation method and electronic evidence fixed server | |
CN108833117B (en) | Private key storage and reading method and device and hardware equipment | |
KR20190078668A (en) | Apparatus and Methods for Verifiable Lottery | |
CN109981249A (en) | Encrypting and decrypting method and device based on zip mode dynamic hashing and NLFSR | |
CN110933183A (en) | Block chain-based number shaking method and system | |
CN115270193A (en) | Data file secure sharing method and device based on block chain and under cooperative synchronization | |
CN110149198A (en) | A kind of autonomous system and method that safeguard protection and storage controllably are carried out to data | |
CN101729250A (en) | Verification method, equipment and system of increment provable data integrity (IPDI) | |
CN106612274A (en) | Homogeneity-based shared data verification algorithm in cloud computing | |
TWI664849B (en) | Method, computer program product and processing system for generating secure alternative representation | |
CN107707532B (en) | URL (Uniform resource locator) generation and query parameter verification method, device, equipment and storage medium | |
US20200213095A1 (en) | Method and device for the computer aided processing of a random bit pattern | |
KR101703880B1 (en) | Forward-secure aggregate sequential signature apparatus for secure logging and method of the same | |
CN105338004B (en) | The applicable public audit method with secret protection of low-performance equipment under cloud environment | |
CN109644137A (en) | The certification based on token with signature information |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200327 |