The $100 Billion Guessing Game Behind Bitcoin
Forget the myth of glowing basement supercomputers cracking impossibly complex Nobel Prize equations to mint …
How modern calculators actually compute trigonometric functions using CORDIC, and the math powering cryptography and Bitcoin mining.
This subject explores the mathematical algorithms powering microprocessors, hardware calculators, and decentralized consensus networks.
Many people assume calculators compute $\sin(x)$ or $\cos(x)$ using Taylor/Maclaurin series expansions:
$$ \sin(x) = \sum_{k=0}^\infty \frac{(-1)^k}{(2k+1)!} x^{2k+1} = x - \frac{x^3}{6} + \frac{x^5}{120} - \dots $$However, evaluating higher-degree polynomials requires numerous multiplication operations and suffers from severe floating-point round-off errors at large angles. Hardware ALUs implement the CORDIC (Coordinate Rotation Digital Computer) algorithm instead.
CORDIC computes trigonometric functions iteratively using only bit-shifts and additions:
$$ \begin{pmatrix} x_{i+1} \\ y_{i+1} \end{pmatrix} = \begin{pmatrix} 1 & -d_i 2^{-i} \\ d_i 2^{-i} & 1 \end{pmatrix} \begin{pmatrix} x_i \\ y_i \end{pmatrix} $$Where the rotation direction $d_i \in \{-1, +1\}$ is chosen to drive the residual angle $z_i \to 0$. Because multiplication by $2^{-i}$ is simply an arithmetic binary right-shift, CORDIC executes in simple hardware without requiring expensive floating-point multipliers.
Bitcoin mining relies on finding a nonce $n$ such that the double SHA-256 hash of the block header $B$ falls strictly below a 256-bit target threshold $T$:
$$ \operatorname{SHA-256}(\operatorname{SHA-256}(B \parallel n)) < T $$Forget the myth of glowing basement supercomputers cracking impossibly complex Nobel Prize equations to mint …
The Story: The Pervasive Myth of the Pocket Calculator When you punch $\sin(37^\circ)$ into a pocket …