Bacon Bits
Hero
A barrel of gunpowder will not do 20d6 points of damage.
The problem is not that it's enough gunpowder. It's the barrel. Black powder is a low explosive. if you put a pile of it on the ground and ignite and it will... burn. What makes it go boom is the increased pressure which keeps increasing until the container explodes. So the barrel is what explodes, and it will burst fairly quickly. I would guestimate in the 4d6 range?
Being a low explosive matters a lot less than you think. For example, think how easily a cannonball or musketball is rammed into a gun barrel. There isn't a huge amount of resistance there, but it creates a tremendous amount of destruction without needing high explosives to do it.
There's many examples of catastrophic gunpowder explosions in history, too.
There was a magazine explosion at the Siege of Almeida.
When the French bombardment opened on August 26 at 6 AM, several quarters of the town were quickly set on fire, and the defending guns of the nearest three batteries overwhelmed. However, the defences held. The governor was confident in withstanding the assault, until a shell made a freak hit. The great magazine in the castle had been used through the day to supply the defenders, and at some point a leaky powder keg had left a trail of powder leading up to the courtyard. At around 7 PM, one French shell landed in the courtyard, igniting a gunpowder trail that led through the still open door, and set off a chain reaction into the magazine. The ensuing explosion killed 600 defenders and wounded 300 more. The castle that housed the gunpowder was razed and sections of the defenses were damaged, leaving a crater still visible today.
It's very unlikely that gunpowder of this era was stored in anything other than wooden barrels or kegs.
At the Battle of Torrington in 1646, an explosion of gunpowder explicitly recorded as being within barrels occurred:
The fighting at the barricades lasted two hours at push of pike. At last the Cornish infantry gave way and retreated into the town, where bitter fighting continued. A stray spark ignited the Royalist magazine in Torrington church, where eighty barrels of gunpowder were stored. The explosion destroyed the church, killed all the prisoners held there and narrowly missed killing Fairfax.
See also:
Destruction of the Parthenon, 1687. Yes, that Parthenon. It was much more intact until stored gunpowder within it exploded and "...three of the sanctuary’s four walls nearly collapsed and three-fifths of the sculptures from the frieze fell. Nothing of the roof apparently remained in place. Six columns from the south side fell, eight from the north, as well as whatever remained from eastern porch, except for one column. The columns brought down with them the enormous marble architraves, triglyphs and metopes."
Indeed, virtually all of the largest artificial non-nuclear explosions prior to WWI were caused by explosions of gunpowder, many of them resulting in catastrophic damage and loss of life. All of these would have been a low explosive gunpowder of one flavor or another, almost certainly stored in wooden barrels, casks, or kegs.
There have even been theoretical reproductions of the explosion that would of resulted from the Gunpowder Plot in 1605:
Point being that it's really not difficult to make a extraordinarily powerful explosion with gunpowder stored in barrels.