There Will Be Coins: A Security Analysis of the Bitcoin Mining Network