Bitcoin and the Art of Mining