In the middle of the Tang dynasty, a Daoist burned a batch of something in his furnace room.
He mixed sulfur, realgar and saltpeter together, added honey, and set it over the fire to roast.
The room was small. One furnace, one tripod, a few clay jars, charcoal stacked in the corner. He blended the ingredients with his hands and stirred the coals with a slip of bamboo, his face less than a foot from the mouth of the furnace.
The heat struck his face and singed his eyebrows.
Less than a foot.
The furnace blew apart.
One dull bang.
Fire came out, burned his hands, burned his face, and set the roof alight.
The incident was written into a book called The Essential Digest of the True Origin and the Wondrous Way. The man who wrote it was not describing a new weapon. He was warning his colleagues. Do not put these things together, he wrote. Put them together and something happens.
That warning is the first appearance of gunpowder in writing anywhere.
He added one more line. Such cases, he said, are too many to count.
The Man Who Wanted to Live Forever
The men in the furnace rooms were not trying to kill anyone. They were trying to live longer.
The First Emperor of Qin sent fleets to sea looking for the drug of immortality. He searched his whole life and never found it. Emperor Wu of the Han kept a household of masters of methods, gave them noble titles, and let them work for decades. Nothing came of it.
From the Warring States down to the Tang, these men hunted one thing. A medicine that would keep a person from dying, or at least hold off old age a while longer. The materials were minerals, herbs and metals. The methods were written in scriptures and passed down through generations, and nobody ever told the whole recipe to anyone.
Sulfur was one of the standard ingredients. It is hot by nature. It was said to strengthen the male principle and drive off malign influence. It was also difficult to use. Heat it and it flies off, stinking, and catches fire easily.
Several Tang emperors took elixirs and died young. The pills were full of sulfur, cinnabar and lead. They made a man feverish and restless, and then they put him to bed for the last time.
So the alchemists invented a step they called subduing the fire.
The phrase means holding the fire down. What it actually described was practical work. You heat sulfur together with something else until the sulfur changes character and stops burning so eagerly.
Saltpeter was the other standard ingredient. White, cool to the touch, able to soften the five metals. Alchemists prized it because it made other substances change.
Saltpeter had one nuisance. It drinks water. Leave it in a jar and it goes damp and cakes into lumps.
Saltpeter had one property nobody understood. It is an oxidizer. When it burns it releases oxygen of its own, so a fire can keep going where there is no air to feed it.
The men in the furnace rooms did not know that. They knew only that mixtures containing saltpeter burned strangely fast and strangely hard, and that a sealed jar would burst.
Saltpeter, sulfur, charcoal. Bring the three together, get the proportions right, and the result is an explosion.
Three things.
Through the Tang the proportions crept closer.
Sun Simiao, the most famous physician of the age, left a method for subduing sulfur with saltpeter and the seeds of the honey locust. The seeds char as they burn, and charred seeds are charcoal.
In 808 a Daoist writing under the name Qing Xuzi set down a recipe called subduing fire with alum. Two taels of sulfur, two taels of saltpeter, three and a half qian of a vine called ma dou ling, which also burns down to charcoal.
Sulfur, saltpeter, charcoal. All three, in one jar.
By modern reckoning the saltpeter in that recipe is far too low. It would flare and scorch, not detonate. But it is already the ancestor of gunpowder.
Here is the part that deserves a pause. In the same centuries, in Baghdad and in Cologne and in Oxford, men were bent over the same kind of furnace doing the same kind of work, hunting the same impossible medicine with the same short list of minerals. Their rooms smelled the same. Their eyebrows were singed in the same way. The difference is only that the Chinese record survived, with a date and a warning attached, and the record says plainly what the mixture did to the man holding the spoon.
Nobody in those rooms knew what they were making. They knew that some furnaces burst, and that bursting furnaces killed people.
Onto the Battlefield
Gunpowder took more than a century to leave the furnace room.
By the early tenth century, armies in the splintered states of the Five Dynasties were using something called flying fire. A packet of powder was tied to an arrow shaft, lit, and shot from a bow. It landed on a tower and burned there.
Under the Northern Song the court set up an office of military works with a powder workshop of its own. Workshops in the capital drew materials against a quota and delivered goods against a quota. The making of gunpowder had entered the government manual. It was no longer private work done in a back room.
This was not an explosion. It was arson with a delivery system. But the powder had become a weapon.
In 1044, in the fourth year of the Qingli reign, a military compendium called the General Outline of Military Affairs was printed.
It was an official encyclopedia of war, compiled under two senior officials, Zeng Gongliang and Ding Du. It gives three gunpowder formulas. One for a poison smoke ball. One for a caltrop fireball. One for the powder used in fireballs generally.
The formulas are specific. Every ingredient is given in taels and qian, the units of the apothecary and the foundry. The proportion of saltpeter has reached fifty to sixty percent.
These are the earliest datable military gunpowder formulas in the world. Europe would not produce anything comparable until the thirteenth century.
The book even records the procedure. Grind the saltpeter fine and sieve it. Mix it with sulfur and charcoal powder. Use warm water. Keep flame away.
It also describes a device called the thunderbolt fireball. Powder wrapped in paper or cloth, lit, thrown. It lands, bursts, and puts out smoke.
The recipe for the poison smoke ball contains something a modern reader does not expect. Arsenic.
Arsenic, croton seed and wolfsbane went into it, not to make a louder bang but to make a poisonous smoke that would drive men out of a gatehouse. The earliest military gunpowder was a smoke screen and a gas. The explosion was incidental.
In 1132 the official Chen Gui was holding the city of De’an.
With Jin soldiers around the walls he used something new. Powder packed into a thick bamboo tube, carried by two men, lit and aimed at the attackers, throwing flame.
That is the beginning of the tubular firearm. It could not yet launch a projectile. It was a flame thrower with a charge inside. But the powder had been put inside a tube.
The histories give its size in three words. A long bamboo pole. Two men to carry it, one man to light it.
In 1232 the city of Kaifeng was under siege.
The Jin defenders were shut inside against the Mongols. They had a device they called thunder that shakes the sky. An iron pot packed with powder, a fuse lit, dropped over the wall. The sound carried a hundred li. The iron broke apart and the fragments went through armour.
This was a shell, not a tube. Bamboo burns. Iron bursts.
That was an explosion. Not a fire.
In 1259, at Shouchun, the history of the Song army records one sentence.
A great bamboo tube, with a pellet seated inside. Light it. When the flame dies, the pellet flies out with a noise like a cannon, audible more than a hundred and fifty paces away.
What the pellet was made of, the history does not say. Stone, some say. Iron, say others. A shard of porcelain, say a few.
There is no settled answer.
Whatever it was, this was the first weapon that used burning powder to push an object out of a barrel.
A Tube of Bronze
Bamboo splits.
A few shots and the tube splits along the grain. To hit harder, the barrel needed a different material.
The craftsmen of the Yuan dynasty changed to bronze.
In 1298, the second year of the Dade reign, a bronze bowl-mouth gun was cast. It was found centuries later near the site of the Yuan summer capital. The barrel carries an inscription in the Phags-pa script. It is thirty-four point seven centimetres long and weighs six point two kilograms.
It is the earliest metal barrel gun with a secure date that anyone has found.
The oldest one.
Thirty-four years later, in the third year of the Zhishun reign, another was cast.

That one is in the National Museum of China today. Thirty-five point three centimetres long, a bore of ten point five centimetres, six point nine four kilograms. The muzzle is shaped like a bowl, wide at the mouth and narrow in the chamber, and the chamber itself swells slightly. Two square holes at the rear take the pins that hold it to a wooden frame.
The frame propped the gun at a fixed angle. If you wanted more range, you dragged the frame forward.
Nineteen characters are cut into the barrel. The fourteenth day of the second month, third year of Zhishun. The Border Pacification Army. Number three hundred. Ma Shan.
Ma Shan was probably the founder.
The date, the unit, the serial number, the man who cast it.
Number three hundred.
Batch production.
Those three characters matter more than any others in the inscription. This was not a trial piece. It was standard equipment turned out in runs, and at least two hundred and ninety-nine had gone before it.
The Yuan powder was different too. Sixty percent saltpeter, twenty percent sulfur, twenty percent charcoal.
That ratio is already close to modern black powder.
Compared with the Song mixtures, there were fewer impurities and more fuel. It burned faster. The pressure was higher.
The army had units for it. A gunner army. A gunner myriarch office.
Men who did nothing else.
The gun of 1332 was cast for a unit whose name means the Border Pacification Army. Where that unit fought, the histories do not say. But pacification means a field formation, not a garrison on a wall.
The Road West
Gunpowder went west on Mongol horses.
In three campaigns the Mongol armies carried their powder makers with them. Craftsmen marched with the columns, and the technique was used at siege after siege.
In 1274 the Yuan fleet hit the coast of Japan at Hakata Bay. Japanese picture scrolls painted the thing that roared and smoked as a ball that fell, burst and produced sound and light at once. The Japanese gave it a name of their own. Iron cannon.
The Arabs called saltpeter Chinese snow. The word appears in Arabic writing of the thirteenth century.
The Persians called it Chinese salt. Two names for one fact. The stuff came from the east.
Europe first met gunpowder at Legnica in 1241. The Mongol army used smoke and noise to panic the horses of European knights. Europe remembered that battle for a long time and never worked out what the substance had been.
It took seventy years to understand, and another hundred to build a cannon.
In 1267 Roger Bacon mentioned in writing a substance that would burst, made from saltpeter and sulfur. He did not give the formula. He hid it in cipher, and there is reason to think he was afraid of what would happen if the wrong people read it.
In 1326 the city records of Florence list a cannon and iron shot.
The Europeans learned to mix powder before they learned to cast guns. A fourteenth-century European formula runs about half saltpeter, with sulfur and charcoal at a quarter each. Damp, it behaved like mud. Dry, it behaved like stone. It had to be mixed on the spot. Only in the fifteenth century did the saltpeter climb to three quarters.
What actually put Europe ahead was the foundry. Chinese barrels were mostly forged from iron and hooped, one ring after another, and an uneven hoop meant a burst breech. Europeans learned to cast a bronze gun in one piece, with an even wall that could take a heavier charge.
Pour the metal, let it cool, bore it out, drill the touch hole.
In 1453, at Constantinople, the Ottoman army used great bombards founded by a Hungarian gunsmith. Fifty-odd days of firing opened a wall that had held for a thousand years.
From the bronze gun of 1332 to the bombard of 1453 is a hundred and twenty-one years.
In those hundred and twenty-one years European gun founding went from nothing to everything, from hooped staves to single castings, and then past the east.
The road inside China ran differently.
In 1388 Mu Ying broke an elephant formation in Yunnan by splitting his musketeers into three ranks. The front rank fired and stepped back to reload. The next rank fired. The manoeuvre later acquired a name. Three-stage volley.
The point of the three-stage volley was not the gun. It was discipline. Loading took dozens of separate motions, and one man a beat slow broke the whole line.
Under the Yongle emperor the Ming formed a Divine Machine Battalion, armed and trained for firearms alone, and ranked it with the two older corps of the capital army.
After 1521 breech-loading Frankish guns came in from the sea, and Ming foundries copied them quickly. In 1626, at Ningyuan, Yuan Chonghuan used great red-barbarian cannon to throw back the Later Jin army.
Later still, the Qing court made horse archery the foundation of the state, and work on firearms slowed.
In 1840 British gunboats came up to the mouth of the Yangtze. Many of the guns facing them were of a design two centuries old.
In that same year, villages across China were still letting off firecrackers at New Year.
The bronze gun of the third year of Zhishun was found in 1935 at a temple called Yunju in the hills southwest of Beijing.
It went to a museum, was given a number, and now sits under lights behind glass.
The nineteen characters are still there, still legible.
Cut deep.
So are the four characters that say number three hundred.