SYSTEM AND METHOD FOR PROVIDING SHARED HASH ENGINES ARCHITECTURE FOR A BITCOIN BLOCK CHAIN
20170300877 · 2017-10-19
Inventors
Cpc classification
G09C1/00
PHYSICS
H04L2209/56
ELECTRICITY
H04L2209/125
ELECTRICITY
H04L9/3239
ELECTRICITY
H04L9/0637
ELECTRICITY
International classification
G06Q20/06
PHYSICS
H04L9/32
ELECTRICITY
Abstract
A method and system for sharing hash calculations across N parallel mining threads, the method comprising: finding N Merkle root hash values that have identical marginal portions of a predetermined size, calculating a corresponding mid-state hash for each of the N Merkle root hash values, and transmitting the N Merkle root hash values along with the corresponding mid-state values to the N parallel mining threads.
Claims
1. A method for sharing hash calculations across N parallel mining threads, the method comprising: finding N Merkle root hash values that have identical marginal portions of a predetermined size; calculating a corresponding mid-state hash for each of the N Merkle root hash values; and transmitting the N Merkle root hash values along with the corresponding mid-state values to the N parallel mining threads.
2. The method according to claim 1, further comprising producing by a CPU Merkle packets that include Merkle tree branches and provides them to a Merkle generator.
3. The method according to claim 1, further comprising receiving by a Merkle generator a Merkle packet from a CPU, performing a Merkle root hash algorithm and looking for winner Merkle root hashes that have identical marginal portions.
4. The method according to claim 3, further comprising: receiving a Merkle packet from a CPU and storing it in a Merkle memory; reading the Merkle memory and feeding a hash engine with Merkle branch data, each time with a new extra nonce; performing Merkle hash calculations and checking, for a certain extra nonce value, if the Merkle hash value is a winner Merkle hash value; and sending winner Merkle hash values to a Merkle generator manager, which is further configured to send them to the CPU.
5. The method according to claim 3, further comprising: transmitting winner Merkle hash values to the CPU; adding the winner Merkle hash values to a collision table to collect batches of N Merkle Winners; and when a batch of N Merkle Winners is formed, forwarding the batch to the N parallel mining threads.
6. The method according to claim 1, further comprising: receive job packets from the CPU and to forward the job packets to an engine controller of a multithreading engine; producing signatures by iterations over a defined range of nonces; and for a produced signature, checking if the signature is valid.
7. The method according to claim 6, wherein the producing of signatures further comprises: producing N first-stage hashes respective to received N different mid-states; and producing a signature by a second-stage hash for at least one of the N first-stage hashes.
8. A system for sharing hash calculations across N parallel mining threads, the system comprising: a central processing unit (CPU), the CPU comprises a Merkle generator to find N Merkle root hash values that have identical marginal portions of a predetermined size and calculate a corresponding mid-state hash for each of the N Merkle root hash values; and an N-thread parallel engine to process the N Merkle root hash values in parallel.
9. The system according to claim 9, wherein the CPU produces Merkle packets that include Merkle tree branches and provides them to the Merkle generator.
10. The system according to claim 9, wherein the Merkle generator receives a Merkle packet from the CPU, performs a Merkle root hash algorithm and looks for winner Merkle root hashes that have identical marginal portions.
11. The system according to claim 9, wherein the Merkle generator comprises: a Merkle generator manager configured to initiate a Merkle scan process; a Merkle memory, wherein the Merkle generator is configured to receive a Merkle packet from the CPU and store it in the Merkle memory; a block feeder; and a hash engine, wherein the block feeder is configured to read the Merkle memory and feed the hash engine with Merkle branch data, each time with a new extra nonce, and wherein the hash engine is configured to perform Merkle hash calculations and check, for a certain extra nonce value, if the Merkle hash value is a winner Merkle hash value, and to send winner Merkle hash values to the Merkle generator manager, which is further configured to send them to the CPU.
12. The system according to claim 9, wherein the N-thread parallel engine comprises: an engines manager; and at least one multithreading engine, comprising: an engine controller; and an engine core, wherein the engines manager is configured to receive job packets from the CPU and to forward the job packets to the engine controller, and wherein the engine core is configured to receive the respective N different mid-states along with the shared marginal portion and to produce signatures by iterations over a defined range of nonces.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0027] For a better understanding of embodiments of the invention and to show how the same may be carried into effect, reference will now be made, purely by way of example, to the accompanying drawings in which like numerals designate corresponding elements or sections throughout.
[0028] In the accompanying drawings:
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037] The drawings together with the following detailed description make apparent to those skilled in the art how the invention may be embodied in practice.
DETAILED DESCRIPTION OF THE INVENTION
[0038] With specific reference now to the drawings in detail, it is stressed that the particulars shown are by way of example and for purposes of illustrative discussion of the preferred embodiments of the present invention only, and are presented in the cause of providing what is believed to be the most useful and readily understood description of the principles and conceptual aspects of the invention. In this regard, no attempt is made to show structural details of the invention in more detail than is necessary for a fundamental understanding of the invention, the description taken with the drawings making apparent to those skilled in the art how the several forms of the invention may be embodied in practice.
[0039] Before explaining at least one embodiment of the invention in detail, it is to be understood that the invention is not limited in its application to the details of construction and the arrangement of the components set forth in the following description or illustrated in the drawings. The invention is applicable to other embodiments or of being practiced or carried out in various ways. Also, it is to be understood that the phraseology and terminology employed herein is for the purpose of description and should not be regarded as limiting.
[0040] Embodiments of the present invention provide a system and method for parallel processing of shared data across hash engines, thus providing a more efficient mining process that consumes less processing power and/or enables faster mining with the same processing power.
[0041] Reference is now made to
[0042] The method may include, as indicated in block 110, finding N Merkle root hash values that have identical marginal portions of a predetermined size. Since the identical marginal portions are included in the second header chunk, while the main, varying, portion of the
[0043] Merkle root hash values are included in the first header chunk, a different mid-state hash may be calculated by the host computer for each of the N Merkle root hash values, as indicated in block 120. Then, as indicated in block 130, the N Merkle root hash values may be transmitted along with the corresponding mid-state values to the N engines (or to an engine that can support the N mining threads in parallel). Alternatively, in some embodiments, the engines may receive along with the corresponding mid-state values only the corresponding marginal portion of the Merkle root hash values instead of receiving the entire hash Merkle root values.
[0044] In the hashing process by the engine, the data being processed is the second chunk of the block header, which may be shared by the parallel engines/threads, for example by shared data pipe, e.g. shared expander logic. Since the marginal portion of the Merkle root hash values is shared between the parallel engines/threads, each of the parallel engines, or each of the parallel mining threads, has a reduced amount of data to process and thus, for example, requires less processing power. For example, when shared between N engines, the required expander logic is reduced by (N−1)/N.
[0045] Reference is now made to
[0046] CPU 10 produces Merkle packets that include Merkle tree branches and provides them to Merkle generator 12.
[0047] Merkle generator 12 may receive a Merkle packet from CPU 10, perform a Merkle root hash algorithm and look for Merkle root hashes that have a collision potential. A collision may occur, for example, whenever a marginal portion of the Merkle root hash value equals a certain predetermined value, and thus, for example, Merkle generator 12 can find N hash Merkle root values with the same marginal portion. Such hash Merkle root hash values may be defined as “winner” or “win” Merkle hash values. In some embodiments, a Merkle hash is considered a win Merkle hash if the K MSbits (most significant bits) of the marginal portion equal a certain predetermined value.
[0048] Reference is now made to
[0049] Reference is now made to
[0050] As shown in block 520, once received by the CPU, the CPU adds the winner Merkle hash value to a collision table, to collect batches of N Merkle Winners. As shown in block 530, when a batch of N Merkle Winners is formed, the batch is forwarded to the N parallel mining engines shown in
[0051] Reference is now made to
[0052] Reference is now made to
[0053] In the above description, an embodiment is an example or implementation of the inventions. The various appearances of “one embodiment,” “an embodiment” or “some embodiments” do not necessarily all refer to the same embodiments.
[0054] Although various features of the invention may be described in the context of a single embodiment, the features may also be provided separately or in any suitable combination. Conversely, although the invention may be described herein in the context of separate embodiments for clarity, the invention may also be implemented in a single embodiment.
[0055] Reference in the specification to “some embodiments”, “an embodiment”, “one embodiment” or “other embodiments” means that a particular feature, structure, or characteristic described in connection with the embodiments is included in at least some embodiments, but not necessarily all embodiments, of the inventions.
[0056] It is to be understood that the phraseology and terminology employed herein is not to be construed as limiting and are for descriptive purpose only.
[0057] The principles and uses of the teachings of the present invention may be better understood with reference to the accompanying description, figures and examples.
[0058] It is to be understood that the details set forth herein do not construe a limitation to an application of the invention.
[0059] Furthermore, it is to be understood that the invention can be carried out or practiced in various ways and that the invention can be implemented in embodiments other than the ones outlined in the description above.
[0060] It is to be understood that the terms “including”, “comprising”, “consisting” and grammatical variants thereof do not preclude the addition of one or more components, features, steps, or integers or groups thereof and that the terms are to be construed as specifying components, features, steps or integers.
[0061] If the specification or claims refer to “an additional” element, that does not preclude there being more than one of the additional element.
[0062] It is to be understood that where the claims or specification refer to “a” or “an” element, such reference is not be construed that there is only one of that element.
[0063] It is to be understood that where the specification states that a component, feature, structure, or characteristic “may”, “might”, “can” or “could” be included, that particular component, feature, structure, or characteristic is not required to be included.
[0064] The descriptions, examples, methods and materials presented in the claims and the specification are not to be construed as limiting but rather as illustrative only.
[0065] Meanings of technical and scientific terms used herein are to be commonly understood as by one of ordinary skill in the art to which the invention belongs, unless otherwise defined.
[0066] The present invention may be implemented in the testing or practice with methods and materials equivalent or similar to those described herein.
[0067] While the invention has been described with respect to a limited number of embodiments, these should not be construed as limitations on the scope of the invention, but rather as exemplifications of some of the preferred embodiments. Other possible variations, modifications, and applications are also within the scope of the invention.