Sodium cyanide is an inorganic compound with the formula NaCN. It is a white, water-soluble solid. Cyanide has a high affinity for metals, which leads to the high toxicity of this salt. Its main application, in gold mining, also exploits its high reactivity toward metals. It is a moderately strong base. When treated with acid, it forms the toxic gas hydrogen cyanide: Sodium cyanide is an inorganic compound with the formula NaCN. It is a white, water-soluble solid. Cyanide has a high affinity for metals, which leads to the high toxicity of this salt. Its main application, in gold mining, also exploits its high reactivity toward metals. It is a moderately strong base. When treated with acid, it forms the toxic gas hydrogen cyanide: Sodium cyanide is produced by treating hydrogen cyanide with sodium hydroxide: Worldwide production was estimated at 500,000 tons in the year 2006. Formerly it was prepared by the Castner process involving the reaction of sodium amide with carbon at elevated temperatures. The structure of solid NaCN is related to that of sodium chloride. The anions and cations are each six-coordinate. Potassium cyanide (KCN) adopts a similar structure. Each Na+ forms pi-bonds to two CN− groups as well as two 'bent' Na---CN and two 'bent' Na---NC links. Because the salt is derived from a weak acid, sodium cyanide readily reverts to HCN by hydrolysis; the moist solid emits small amounts of hydrogen cyanide, which smells like bitter almonds (not everyone can smell it—the ability thereof is due to a genetic trait). Sodium cyanide reacts rapidly with strong acids to release hydrogen cyanide. This dangerous process represents a significant risk associated with cyanide salts. It is detoxified most efficiently with hydrogen peroxide (H2O2) to produce sodium cyanate (NaOCN) and water: Sodium cyanide is used mainly to extract gold and other precious metals in mining industry. This application exploits the high affinity of gold(I) for cyanide, which induces gold metal to oxidize and dissolve in the presence of air (oxygen) and water, producing the salt sodium gold cyanide (or gold sodium cyanide) and sodium hydroxide: A similar process uses potassium cyanide (KCN, a close relative of sodium cyanide) to produce potassium gold cyanide (KAu(CN)2). Few other methods exist for this extraction process. Several commercially significant chemical compounds are derived from cyanide, including cyanuric chloride, cyanogen chloride, and many nitriles. In organic synthesis, cyanide, which is classified as a strong nucleophile, is used to prepare nitriles, which occur widely in many specialty chemicals, including pharmaceuticals. Being highly toxic, sodium cyanide is used to kill or stun rapidly such as in widely illegal cyanide fishing and in collecting jars used by entomologists.