what is the byproduct of mining metals