The origin of gunpowder and its history is quite complex. Gun powder or black powder was given its name in the 19th century. Black powder consisted of three elements. A nitrate, usually potassium nitrate, was used to supply oxygen for the chemical reaction. Charcoal provided the carbon for the reaction. Sulfur served as fuel and more importantly lowered the the temperature necessary to ignite the mixture, increasing the rate of combustion.
In ancient China, alchemists following the teaching of Taoism are the biggest contributors to the earliest invention of gunpowder. Emperor Wu Di of the Han Dynasty (156-87 B.C.) financed alchemist research looking for the secrets of eternal life. Alchemists performed many scientific experiments in the name of religion, while not even realizing that science was taking place. The Taoist alchemists performed some experimenting with sulfur and saltpeter, and then heating the substances to transform them into a new substance. Heated sulfur and saltpeter makes a substance similar to gunpowder.
While the B.C. Chinese alchemists laid the foundation by realizing the power of sulfur and saltpeter, it was not until the 8th century Tang dynasty that the sulfur and saltpeter were mixed with charcoal creating the first explosive. However, at this time it was not being used as a weapon. The Chinese began experimenting with bamboo tubes, filling them with the newly invented concoction. They soon realized the tubes would launch arrows themselves due to escaping gas, creating the first rockets.
In the Middle East, sometimes after 1240, Arabic recipes for gunpowder were first recorded. The first “cannon in history” was used in the Battle of Ain Jalut in 1260 against the Mongols. Some scholars say it was the Mongols who actually brought the idea to the Arabs, and that the first cannon was not built until sometime in the 14th century by the Arabs. This weapon is undisputed and is considered the primary example of the first hand-cannon and precursor to the necessities needed to create a handgun.
In mainland Europe, around the year 1250, the Norwegians mentioned in their writings that “coal and sulfur” were the best weapons for combat with other ships. In 1267. Roger Bacon first described firecrackers which were made with saltpeter, sulfur and charcoal from hazelwood. Around 1300, the early Europeans developed a recipe for flying fire, which is the same “recipe” used in modern gunpowder.
The British first used gunpowder in the middle of the 14th century. The Tower of London was being used to manufacture gunpowder. The British were the first to mass produce gunpowder for purposes of weaponry. The short English Civil war that occurred from 1642-1645 brought in a complete industry of creating gunpowder. The British continued to mass produce gunpowder for centuries, leading the world in mass production. In the present day, the British Isles left the gunpowder industry in 1976, and actually operate no gunpowder factories, but import all gunpowder from surrounding countries.
The creation of gunpowder is the foundation for the invention of the gun, the cannon, the bomb, and the science of ballistics. An interesting little fact, in 1673, an attempt to make the first internal combustion engine was unsuccessful, but paved the way for later success. Today, gunpowder is produced massively by most countries of the world as for private use and as an export.
Sources:
http://en.wikipedia.org/wiki/History_of_gunpowder
http://inventors.about.com/od/chineseinventors/a/gunpowder.htm
http://chemistry.about.com/od/historyofchemistry/a/gunpowder.htm
http://www.bbc.co.uk/history/british/civil_war_revolution/gunpowder_robinson_01.shtml