Gold and silver are extracted by complex formation with cyanide ions.
For example, silver present in the metal ore is treated with cyanide ions to form water soluble complex sodium dicyanoargentate (I). It is then treated with zinc which displaces silver form the complex.
Ag2S+4NaCN⇌2Na[Ag(CN)2]+Na2S
2Na[Ag(CN)2]Sodium dicyanoargentate(I)+Zn→Na2[Zn(CN)4]Sodium teracyano zincate (II)+2Ag↓
Note: Zinc is more electropositive than silver.