|A basic infographic for gunpowder, showing that the products of combustion are solid products (56%), gaseous products (43%), and water (1%); the great volume change explains its use in the gunpowder engine. |
The simplified chemical reaction for the combustion of gunpowder is:
The following shows the reactant and products in terms of states, which includes a one-percent water product (not shown above):
Solid (100%) → solids (56%) + gases (43%) + liquid (1%)
Gunpowder releases 3 megajoules per kilogram and contains its own oxidant, which ca be compared to dynamite (4.7 megajoules per kilogram), or gasoline (47.2 megajoules per kilogram; but gasoline requires an oxidant, so an optimized gasoline and O2 mixture contains 10.4 megajoules per kilogram).
In 808, the anon author of Taishang Shengzu Jindan Mijue, made a reference to gunpowder; the substance is said to have been “discovered” while trying to make the “elixir of life” .
In 1267, Roger Bacon, in his Opus Maius, and later in his Opus Tertium (1268), having learned about gunpowder from the Chinese, described what seems to be a firecracker: 
“We have an example of these things (that act on the senses) in (the sound and fire of] that children's toy which is made in many [diverse] parts of the world; i.e. a device no bigger than one's thumb. From the violence of that salt called saltpetre (together with sulphur and willow charcoal, combined into a powder]' so horrible a sound is made by the bunting of a thing so small, no more than a bit of parchment (containing it], that we find (the ear assaulted by a noise] exceeding the roar of strong thunder, and a flash brighter than the most brilliant lightning. (Especially if one is taken unawares this terrible flash is very alarming. If an instrument of large size were used, no one could with-stand the noise and blinding light; and if the instrument were made of solid material, the violence of the explosion would be much greater.”— Roger Bacon (1267), Opus Maius 
This saltpeter was studied by Bacon's contemporary Albertus Magnus (1205-1280).
● Gunpowder engine
● Gunpowder theory of life
1. Daintith, John. (2005). Oxford Dictionary of Science (pg. 376). Oxford University Press.
2. Needham, Joseph. (1987). Science and Civilization in China: Volume 5, Chemistry and Chemical Technology, Part 7, Military Technology: The Gunpowder Epic (Roger Bacon, pgs. 48-49). Cambridge.
3.. Anon. (2014). “The Chemistry of Gunpowder” (Ѻ), CompoundChem.com, Jul 2.
● Gunpowder – Wikipedia.