Gunpowder is an explosive substance, used as a propellant for firearms. There are two type, "black powder" and "smokeless powder." Almost all modern guns use smokeless powder.
Gunpowder burns more slowly than most explosives. This reduces peak pressures in a gun, but makes it less suitable for shattering rock or fortifications.
Smokeless powder consists of almost pure nitrocellulose, corned into small spherical balls using solvents such as ether. Larger balls explode more slowly. Cannon powder has the largest balls. Fast-firing pistol and rifle powders are made by extruding shapes with more area. Drying is usually performed under a vacuum. The solvents are condensed and recycled.
Black powder consists of the granular ingredients sulfur (S), charcoal (provides carbon to the reaction) and saltpeter (saltpetre, potassium nitrate, KNO3). The optimum proportions for gunpowder are : Saltpetre 74.64%, Sulphur 11.85%, Charcoal 13.51%.
The basic ratio is:
2 parts Sulfur : 3 parts Charcoal : 15 parts Saltpetre
Black powder is also corned to change its firing rate. Corning black powder is very dangerous because black powder explodes when ground. Corning must be done with the powder wet.
History
The Chinese are often credited with the invention of gunpowder but the first certain reference is by Roger Bacon in 1248. Certainly the Chinese were using an extremely wide variety of incendiary weapons since the 10th century but these were psychological not physical weapons. Fire, smoke, flashes, bangs and primitive rockets were all used by the Chinese armies, but firearms which require an explosive (not incendiary) reaction, were seen first in Europe. Within 70 years of Bacon's comments, early cannons are mentioned in various places in Europe, in a manner suggesting they were already well known.
If the earlier Chinese references were to explosive gunpowder it is hard to see how their otherwise advanced military science failed to capitalise on this discovery to produce firearms. This problem may have led to the myth that the Chinese were peaceful and used their discovery only for the manufacture of fireworks. In fact in the 13th century the Chinese and Mongols, under Chingis Khan, were part of perhaps the most vicious and effective military force the world has seen.
Certainly the significance of the secret ingredient - saltpeter - was introduced from China, probably via the Arabs, but it was in Europe that the problems of gunpowder were solved (mixture, engraining etc.) and when combined with expanding knowledge in metallurgy, led to a rapid development of cannons and other firearms.
External links: