Dry ice is frozen carbon dioxide, chemical composition CO2. Dry ice is the solid form of what is a gas at standard temperature and pressure.
Sublimation is a term used to describe the change of a substance from one state to another by-passing an expected, intermediary state. So water thaws from ice (solid) to liquid then boils to steam (a gas). Dry ice, on the other hand, moves from solid to gas directly by-passing the liquid stage. In other words, solid carbon dioxide sublimates back into a gas at -78.5° Celsius (-109.3° Fahrenheit).
Carbon dioxide is heavier relative to surrounding composite air.
CO2 is "heavier than air." It pools in a closed container forcing other gases, in particular oxygen, up and out eliminating the environment in which animal organisms are able to thrive or even lie dormant. This is a very useful characteristic for the preservation of grains, legumes and other dry goods.
Carbon dioxide is highly poisonous in concentration. If used in a closed space, it has the effect of shutting down even voluntary breathing according to many sources. This means that if in a small, insufficiently ventilated room and/or near the floor, even death can quickly be the result of working with this gas in concentration, even after the victim is moved to a healthy environment because the body has switched breathing off in reaction to the concentration of CO2.
Not being a medical professional, I cannot verify this, but it's widely claimed on the web.
So, it's fun to play with, but beware.
Research turns up widely divergeant figures for the quantity of dry ice, anywhere from 1 ounce to nearly half a pound, for a 5-gallon bucket. I am not going to waste my time performing the calculations to convert gallons to volumetric space, so I've settled on 2 ounces (by weight) for 5 gallons.
I think the larger claims are based on over-looking that the bucket is going to be full of food.
Reports state that one pound of dry ice completely sublimated occupies 8.3 cubic feet by volume.
As I say, I haven't done the math, but one site asserts that a 6-gallon bucket is 0.78 cubic feet volumetrically. If you fill that space with gains or legumes, an estimated 0.25 cubic feet of space remain to be displaced by CO2.
Using twice as much dry ice as you probably need to fill the remaining space would amount to no more than 2 ounces for the 6-gallon bucket. This should be overkill for the 5-gallon plastic bucket, which is more common around these parts.
Weigh your dry ice using a kitchen scale. If you don't have one, buy one: if you're serious about storing food and preparing it to eat, you should not be without one.