Its actual origins are obscure, but the earliest records of it date from 9th century China. These records tell of Chinese alchemists searching for an elixir of life who first stumbled across what we know today as sodium and potassium nitrate.
Nitrates react rapidly and violently when burned and are the key ingredient in what would come to be known as gunpowder. The Chinese didn't quite know what to make of this new and volatile substance. One early account reported this experiment: "some have heated together the saltpeter, sulfur and carbon of charcoal with honey; smoke and flames result, so that their hands and faces have been burnt, and even the whole house burnt down." For over a hundred years this early form of gunpowder remained primarily a source of amusement used in the creation of early fireworks and magicians tricks.
Regardless of its humble origins, gunpowder was the first explosive chemical propellant recorded in history.
Cannon
Though the Chinese eventually started using gunpowder weapons in the 10th century, it is the Turks who generally get the credit of formulating gunpowder into a high enough quality to be used effectively in combat. Cannon appeared in Europe about the beginning of the 12th century. Early cannon or "gonnes" (hence the name gonne or gunne powder) tended to be gigantic, unwieldy monsters rather as dangerous to the user as to the intended enemy, but they were impressively frightening, thus ensuring their place on the field of war.
As chemistry and metal casting technology improved during the Middle Ages, better and stronger cannon with more effective charges and projectiles came into being, eventually creating what we know today as artillery. Both bronze and iron were used to make cannons throughout the 18th and 19th centuries. Each metal has advantages and disadvantages, depending on where and how the gun is intended to be used. Cast iron was more commonly used because it was lighter and less expensive (a 24-pounder iron cannon cost $21,614 in 2015 U.S. dollars; a bronze cannon would cost $46,374). Most fortifications preferred the iron. On the other hand, iron was more vulnerable to the elements and rusted easily. Iron guns would become brittle and dangerous over a short period of time and were subject to exploding. When expended, an iron cannon was scrapped.
Bronze, although heavier, withstood the stress of firing much better, and less metal was needed to construct the weapon. The non-rusting bronze was preferred for the damp environments of ships and seacoast forts. A bronze cannon had nearly twice the life expectancy of an iron gun, and once expended, the bronze could be melted down and recast into a new weapon. Early Spanish bronze artillery could also be described as beautiful works of art. Some are basic in design while others are very ornately detailed. Today, all the bronze guns at the Castillo are covered in a green patina. When first made, they were bright and shiny, like a new penny. Most of the bronze guns have several key features in common. At the back, you can find the name of the maker, the city where it was made, and the date when the gun was manufactured. Moving towards the muzzle, you will find the royal coat of arms of the Spanish King & Queen who reigned during the making of the weapon. Next are a couple of raised handles called dolphins. Moving closer to the front of the gun, a banner bears the cannon’s name. Four of the Castillo's cannons also have a second, larger banner that reads “Violati Fulmina Regis” (thunderbolts of an offended/angry king). Each trunnion (the pivot bars on the sides of the gun) lists where the metal was acquired, the gun’s maintenance record, and how much the weapon weighs. Other features found on some of the cannons include capture dates stamped by the US Army.
It was in the 17th and 18th century with the global expansion of European colonization and commerce that gunpowder came into its own in the form of small arms, i.e., portable gunpowder weapons small enough to be used by the individual soldier, most notably the smoothbore musket. Their introduction at such a critical period of history literally changes the world.