The origin of gunpowder dates back more than four thousand years. To make a firecracker, you pack this mixture into a tightly rolled tube of cardboard, or paper, insert a fuse, and seal the ends. Sulfur is one of the essential minerals of life, and has long been prescribed for various ailments. As we noted, saltpeter is made up of one atom of potassium, one atom of nitrogen, and three of oxygen. The key ingredient to oxidation is oxygen .
Potassium nitrate is a very rich source of oxygen.
In gunpowder, due to the abundance of oxygen, the carbon and sulfur burn very quickly. Because the potassium nitrate supplies the oxygen, gunpowder will burn in a vacuum, or inside a tightly wound tube of cardboard. The burning reaction releases hot gases that try to expand. If one end of the tube is not tightly sealed, then the gases will exit from this end creating a rocket or cone-type firework. Gunpowder got its name from the time of flintlocks and muskets.