How does a bitcoin mining rig work