If you could figure out a mathematical shortcut to generate successful hashes, you could take over Bitcoin mining. The Ma majority box looks at the bits of A, B, and C. For each position, if the majority of the bits are 0, it outputs 0. Otherwise it outputs 1. That is, for each position in A, B, and C, look at the number of 1 bits. If it is zero or one, output 0. If it is two or three, output 1. The 0 box rotates the bits of A to form three rotated versions, and then sums them together modulo 2. In other words, if the number of 1 bits is odd, the sum is 1 otherwise, it is 0. The three values in the sum are A rotated right by 2 bits, 1. The Ch choose box chooses output bits based on the value of input E. If a bit of E is 1, the output bit is the corresponding bit of F. If a bit of E is 0, the output bit is the corresponding bit of G. In this way, the bits of F and G are shuffled together based on the value of E. The next box 1 rotates and sums the bits of E, similar to 0 except the shifts are 6, 1. The red boxes perform 3. A and E. The input Wt is based on the input data, slightly processed. This is where the input block gets fed into the algorithm. The input Kt is a constant defined for each round. As can be seen from the diagram above, only A and E are changed in a round. The other values pass through unchanged, with the old A value becoming the new B value, the old B value becoming the new C value and so forth. Although each round of SHA 2. Manual mining. The video below shows how the SHA 2. I perform the first round of hashing to mine a block. Completing this round took me 1. To explain whats on the paper. Ive written each block A through H in hex on a separate row and put the binary value below. The maj operation appears below C, and the shifts and 0 appear above row A. Likewise, the choose operation appears below G, and the shifts and 1 above E. In the lower right, a bunch of terms are added together, corresponding to the first three red sum boxes. In the upper right, this sum is used to generate the new A value, and in the middle right, this sum is used to generate the new E value. These steps all correspond to the diagram and discussion above. I also manually performed another hash round, the last round to finish hashing the Bitcoin block. In the image below, the hash result is highlighted in yellow. The zeroes in this hash show that it is a successful hash. Note that the zeroes are at the end of the hash. The reason is that Bitcoin inconveniently reverses all the bytes generated by SHA 2. Last pencil and paper round of SHA 2. Bitcoin block. What this means for mining hardware. Each step of SHA 2. Boolean operations and 3. If youve studied electronics, you can probably visualize the circuits already. For this reason, custom ASIC chips can implement the SHA 2. The image below shows a mining chip that runs at 2 3 billion hashessecond Zeptobars has more photos. The silicon die inside a Bitfury ASIC chip. This chip mines Bitcoin at 2 3 Ghashsecond. Image from Zeptobars. CC BY 3. 0. In contrast, Litecoin, Dogecoin, and similar altcoins use the scrypt hash algorithm, which is intentionally designed to be difficult to implement in hardware. It stores 1. 02. 4 different hash values into memory, and then combines them in unpredictable ways to get the final result. As a result, much more circuitry and memory is required for scrypt than for SHA 2. You can see the impact by looking at mining hardware, which is thousands of times slower for scrypt Litecoin, etc than for SHA 2. Bitcoin. The SHA 2. The elliptic curve algorithm for. Bitcoin transactions would be very painful to do by hand since it has lots of multiplication of 3. Doing one round of SHA 2. At this rate, hashing a full Bitcoin block 1. I would probably get faster with practice. In comparison, current Bitcoin mining hardware does several terahashes per second, about a quintillion times faster than my manual hashing. Needless to say, manual Bitcoin mining is not at all practical. A Reddit reader asked about my energy consumption. Theres not much physical exertion, so assuming a resting metabolic rate of 1. A typical energy consumption for mining hardware is 1. So Im less energy efficient by a factor of 1. The next question is the energy cost. A cheap source of food energy is donuts at 0. Electricity here is 0. I expected. Thus my energy cost per hash is about 6. Its clear Im not going to make my fortune off manual mining, and I havent even included the cost of all the paper and pencils Ill need. Its not exactly the number of zeros at the start of the hash that matters. To be precise, the hash must be less than a particular value that depends on the current Bitcoin difficulty level. The source of the constants used in SHA 2. The NSA designed the SHA 2. To avoid suspicion, the initial hash values come from the square roots of the first 8 primes, and the Kt values come from the cube roots of the first 6. Since these constants come from a simple formula, you can trust that the NSA didnt do anything shady at least with the constants. Unfortunately the SHA 2.