The Discovery of Gunpowder
In 142 A.D., during the Han dynasty, a man by the name of Wei Boyang became the very first person we know of today to write about gunpowder. He described the three materials used for it would make it "dance and fly" violently. People are not yet sure though whether Boyang was actually writing about gunpowder, but it is the only explosive we know of that only uses three materials. Around 300 A.D. though, Ge Hong, a Jin dynasty scientist, has written about gunpowder directly, describing the materials and the result.
One material used for gunpowder is Sulfer. Sulfer is naturally found underground as a yellowish rock.
The next material is Charcoal. All you need to do to make Charcoal is to burn wood in a metal drum over a fire.
The last material is Potassium Nitrate, or saltpeter. There are multiple ways to make it, but it's most likely that the ancient Chinese used animal urine to make it. They would let it decay, and over time, potassium nitrate crystals would appear in it. Then simply wash it with water.
How Gunpowder Was Used
When they discovered it was flammable, the Chinese didn't know how to make it explode, making it's use less effective. They would mainly use it for fireworks later on, in which we use to celebrate events with color.
Later on, once they discovered how to make it explode, they began creating weaponry using gunpowder to launch the projectile out of the barrel. Around this time, the Europeans and throuought the Middle East have also discovered gunpowder. In 1364, the first firearm, known as the fire lance, was introduced to the world, revolutionizing weaponry. The fire lance was supposed to be a man held flame thrower, but the Chinese found out that they could put projectiles in the barrel, and it would come out when the weapon was fired. Firearms were adopted by everyone in the world around the 1390s.
During the 16th century, the musket was created in Spain. This weapon used gunpowder and a large lead ball rammed into the barrel. Although the Chinese didn't adopt the musket for their weapon, most of Europe was using this gun. This is the weapon used during the American revolution, along with the French Revolution. This was one of the main weapons that brung gunpowder to it's peak in weaponry. It wasn't until 1886 that bullet we know today were invented, making all muskets obsolete just overnight. The rest is history.