Mercury fulminate [or fulminate of mercury, Hg(ONC)2] was first prepared in 1800 by Edward Charles Howard. It is an explosive that mainly was used in favor of flints to ignite black powder in a firearm. It's pretty easy to make... the synthesis involves dissolving mercury in nitric acid and adding ethanol to the solution. However, you end up precipitating a white to grayish-brown powder (depending on purity) like what you see in this photo and not big chunks of glassy crystals, as seen in 'Breaking Bad'.
Although mercury fulminate is easy to prepare, you don't want to try it. The explosive is highly sensitive to just about everything... shock, sparks, flame, friction, and heat. I don't think Walt could have been so casual handling a bag of it without having a little accident. If you don't blow yourself up with the compound, you could gas yourself with fumes from the synthesis (reaction should be done outdoors or inside a fume hood). Then there is the product... mercury compounds are toxic. The mercury doesn't magically disappear when the compound explodes.
The episode got me wondering. If you were in charge of props for a tv show and were asked to come up with 'crystal meth', what would you use? I'm going to guess using the illegal drug would not be an option. I am betting they used rock candy. What do you think?
Breaking Bad - Elements in the Body | Breaking Bad - Hydrofluoric Acid
Photo: Mercury fulminate is a grayish powder of orthorhombic crystals. (Tobias Maximilian Mittrach, Wikipedia Commons)