Under the hood of Bitfury Clarke - how our new mining chip works

    In late September, we presented a new ASIC chip, designed specifically for SHA256 mining in the Bitcoin network. Today will tell what's inside.


    Image: Bitfury Group

    A couple of words about bitcoin mining


    The purpose of mining is to protect the blockchain network. Miners use their hardware to solve complex computational problems that ensure the integrity of transactions in the network and eliminate double-spending attacks . In parallel, mining is a mechanism for generating cryptocurrency, which miners receive as a reward (now - 12.5 bitcoins per block).

    The computational tasks in question are related to the selection of a hash that matches the transactions in the block. The sought value is based on the hash of the previous block, a random number (called nonce), and the sum of the transaction hashes for the last ten minutes. In this case, two conditions must be fulfilled: the hash must correspond to the declared complexity of mining and have a strictly defined number of zero bits at the beginning. To assess the complexity of the use of decomposition in a modified Taylor series.

    Hashes in the bitcoin blockchain are calculated using the SHA256 algorithm. It includes 64 iterations, during which there is a "mixing" of the transaction bits in the block using the shift and "modulo 2 addition" operations. The result of using the SHA256 function is considered irreversible; for this reason, the target hash is found by brute force. In more detail about mining and mining pools, in which participants of blockchain-networks are united in order to speed up the decision of the blocks, we wrote in our blog .

    Previously, CPUs and GPUs were used to iterate over nonce and hash selection, but over time, due to the increasing complexity of mining (it varies depending on the total computing power of all participants in the bitcoin network), specialized ASIC integrated circuits were designed .
    We at Bitfury are also developing such solutions. In total, we have created five generations of mining chips, and in September we presented the sixth one - a speech about ASIC Clarke, sharpened specifically for solving SHA256 hashes.

    How does Clarke work?


    Clarke is made on 14-nm process technology and is implemented in the form factor FC- LGA 35L size 6x6 mm. The second case has more efficient wiring of power circuits on the board. The chip solves 120 gigabytes per second, but it gives the opportunity to adjust the performance depending on what the miner needs now - a larger hashrate or low power consumption. In particular, it is possible to achieve an energy efficiency ratio of 55 mJ / gigahesh, since 0.3 volts is enough to power the chip. The structure of Clarke looks like this:


    Clock Generator. He sets the clock for the chip. Voltage levels : VSS = 0, VDD = 1.

    A serial control interface connected to an external serial bus controller. It is similar to the SPI bus with MOSI and MISO data contacts (used to transfer data from the master to the slave and vice versa) connected by the SDATA line.

    The interface is responsible for transmitting commands. Here are some of them: task write to write a new task, force task switch to force buffer switching, read nonces to read nonce values, etc. All commands have one pattern and contain code, length, data field, chip status byte, data from buffer nonce and checksums.


    Checksums are the arithmetic sum of bytes, starting with zero. For example, the checksum of the command 04 03 03 8c 18 00 will be equal to AE.

    Control system nonce. Manages the process of calculating the hash based on the mask. The mask “lies” in the task buffer and is used to set the range of calculations. It defines bits in the nonce that will remain unchanged when searching for a new value.

    Task buffers Needed to calculate hashes (their length is 20 double words). There are two buffers in total, which allows you to quickly switch between tasks. While the first buffer is occupied by the hash solution, data is written to the second for the following calculations.

    8154 kernel ring hash. They use the double SHA256 algorithm.

    Nonce buffer.This is a circular buffer with a length of 12 double words, where hash solutions are written. For example, we led the process of data exchange in the chip, which occurs during the calculation of hashes (in the spoiler below):

    Chip data exchange (in English)
    // Program clock generator to value 0x20 and prescaler=1 (disabled) Send: 0803038c1800
    Recv: f0b200b2
    // Set nonce mask to 0x00000000
    Send: 200300000000 Recv: f0230023
    // Force task switch Send: 020000
    Recv: f0020002
    // Send task
    Wi 0=CD3F992C 1=037F8197 2=A58E091A
    MS0 A=0CAD7CD1 B=CBE38FD9 C=D14DC164 D=F90EB10B E=819621CF F=358D45CD G=8C14CAE3 H=538EF887 MS3 A=5FF18CDD B=8CDA24A4 C=180266F9 D=0CAD7CD1 E=B0CA39FA F=DD30B962 G=36D2CBC6 H=819621CF NONCE=D5D0E8B9
    Send:_014fa607d67b614925737be76bce53a41ba12b3c8b659f27ef6726be6049f924522d2b3c8b659c78616c779 a13c81a609
    35067953386a9d52b3d0f24a3b0a607d67bb2a8cc5326708e0ef55b267700000000 Recv: 0fb200b2
    // Force task switch
    Send: 020000
    Recv: 0f020002
    // Read nonce buffer
    Send: 040000 Recv:_0f04000000000000000000000000000000000000000000000000000000003ffffffc7f7a42132ffffffc 1ffffffc0001ffbf8c
    FIFO[0] = aaaaaaaa
    FIFO[1] = aaaaaaaa
    FIFO[2] = aaaaaaaa
    FIFO[3] = aaaaaaaa
    FIFO[4] = aaaaaaaa
    FIFO[5] = aaaaaaaa
    FIFO[6] = aaaaaaaa
    FIFO[7] = 3ffffffc
    FIFO[8] = d5d0e8b9 < — nonce value
    FIFO[9] = 2ffffffc < — task switch marker
    FIFO[A] = 1ffffffc < — task switch marker
    FIFO[B] = aaab5515



    Where will the chip be used


    Now we are installing new devices into our own mining servers and BlockBox mobile data centers . We also modify bitcoin farms in Canada, Iceland, Georgia and Norway ( launched at the beginning of the year ).

    Clarke chips will be available as a commercial product. In particular, they come with Bitfury Tardis miners , designed for large organizations. In Tardis, there are 5–8 boards that can calculate up to 80 terahesh per second. This miner can be upgraded - in the future, the ASIC Clarke installed in it will be replaced with new chips.



    This is our short video introducing the concept of a new chip:


    Also popular now: