More than half a century has passed since the discovery of the genetic code, but its origin is still one of the greatest mysteries in life science, although a plenty of theories have been proposed so far, as none can explain satisfactorily why the genetic code evolved in such a way, especially in the context of the biochemical system, a relation of part to whole. Here, a new hypothesis is proposed, according to which ATP is at the origin of the genetic code by its coevolution with the pristine biochemical system of the protocell. This hypothesis shows how primitive life with its genetic code emerged through a series of processes from energy flow to information communication mediated by ATP. First, ATP is the only energetic product of photosynthesis, and is at the energetic heart of the extant biochemical systems. Second, ATP serves as not only an energy carrier but also an informatization molecule, as ATP could energetically elongate chains of both polynucleotides and polypeptides, thus providing a bridge between these molecules and eventually mediating biochemical innovation in the protocell from energy transformation to informatization, a process for creating and managing information. Informatization was inevitably coupled with structuralization (processes for organizing or incorporating cellular structures), cyclizing polynucleotides and polypeptides into a feedback loop of reciprocal causation. The triplet codon might be only for stereochemical handling of amino acids through, e.g., Watson–Crick pairing interactions. It is only the evolutionary completion of the genetic code from RNA to DNA that, contrary to the central dogma, marked the dawn of cellular life, when Darwinian evolution began to operate. The ATP hypothesis sheds light on the origin of life, together with the formation of both photosynthetic and biochemical systems, which remains largely unknown thus far.