The Ten Heavenly Stems are one of the two cyclical sets, alongside the Twelve Earthly Branches, that Chinese calendrical reckoning has combined into a single sixty-term sequence, the sexagenary cycle, for at least three thousand years. Their earliest attested use has nothing to do with fate calculation: Shang dynasty oracle bone inscriptions from roughly 1250 to 1050 BC already name the ten stems, Jia, Yi, Bing, Ding, Wu, Ji, Geng, Xin, Ren and Gui, as the ten days of the Shang royal ritual week, each day given over to sacrifices for a specific set of royal ancestors whose posthumous names themselves incorporated a stem.
Only later did the stems accumulate the cosmological correspondences that make them recognizable to a modern reader: each stem was assigned one of the Five Phases, wood, fire, earth, metal and water, taken in pairs so that two stems share each phase, and within each pair one stem was classified yang and the other yin, giving the full set of ten a complete and internally balanced structure of phase and polarity. Combined with the Twelve Earthly Branches, which carry their own animal and phase correspondences, the stems generate the sixty distinct year, month, day and hour designations of the ganzhi system still used today in the Chinese calendar, in Bazi four pillars fate calculation, and in the naming conventions of Chinese historical chronicles.