what is by product of producing gold through mining