Notes: Rosencrantz on Diverse Double-Compiling

Last updated Software Supply Chain Security Papers

Diverse Double-Compiling to Harden Cryptocurrency Software

Source review and reproducible builds alone cannot establish that a compiler binary faithfully implements its source. A trusting-trust attack can survive compiler upgrades without appearing anywhere in the source tree.

Diverse Double-Compiling (DDC) addresses this by rebuilding the compiler source through an independently trusted compiler, then using that result to rebuild the compiler again and comparing the resulting executable with the compiler under test. Assuming deterministic builds and sufficient toolchain diversity, equality provides evidence that the executable corresponds to the reviewed source; divergence exposes either build nondeterminism, a defect, or possible subversion.

The thesis demonstrates this concretely with TCC: a compromised compiler reinfects its successor while also modifying cryptocurrency transaction code, and DDC detects the subversion. More interestingly, attempts to extend the technique to GCC expose the practical problem: real build graphs quickly expand the trusted surface to assemblers, linkers, loaders, OSes, firmware, and hardware.