Expect the unexpected…
Gunpowder was invented in China sometime during the first millennium AD. The earliest possible reference to gunpowder appeared in 142 AD during the Eastern Han dynasty when the alchemist Wei Boyang, also known as the “father of alchemy”, wrote about a substance with gunpowder-like properties. He described a mixture of three powders that would “fly and dance” violently in his Cantong Qi, otherwise known as the Book of the Kinship of Three, a Taoist text on the subject of alchemy.
…
While it was almost certainly not their intention to create a weapon of war, Taoist alchemists continued to play a major role in gunpowder development due to their experiments with sulfur and saltpeter involved in searching for eternal life and ways to transmute one material into another.
…
[8th century Taoist text] Zhenyuan miaodao yaolüe (真元妙道要略) warned against an assortment of dangerous formulas, one of which corresponds with gunpowder: “Some have heated together sulfur, realgar (arsenic disulfide), and saltpeter with honey; smoke [and flames] result, so that their hands and faces have been burnt, and even the whole house burned down.”
Alchemists called this discovery fire medicine (“huoyao” 火藥), and the term has continued to refer to gunpowder in China into the present day, a reminder of its heritage as a side result in the search for longevity increasing drugs.
Wikipedia – History of Gunpowder