That's black powder -- used until about 1900.
Modern gunpowder is made by soaking cellulose - like cotton - in nitric acid to form nitrocellulose.
Weelll, its actually a little more complex than that. "Guncotton" which you describe above was discovered in 1838, but modern propellants are a bit more complex. Even those that only contain nitrocellulose are highly processed.
See: