What is the minimum energy (or CPU operations) required for someone to confirm one block on their own, to launch a double-spend attack?
How can I calculate this from the current difficulty or hashrate?
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.Sign up to join this community
There is no minimum. In theory, you could find a valid block on your very first attempt. The best we can do is an average.
Here's the average energy required to find one valid block using CPU mining:
average energy required = difficulty * 232 / 2*10^6 * joules
Or, at current difficulty, 1.018×10^14 joules.
difficulty * 232
The average number of hashes to find a block.
2*10^6 * joules
According to the Bitcoin wiki, the typical mining efficiency for CPUs is 2 Mhash/J.
Here is how to compute this in general. I am intentionally not going to give an example using current numbers, since (a) it will instantly be obsolete, and (b) it will encourage people to ask for an updated answer, rather than learning to work it out for themselves.
Determine the current network difficulty. Google "bitcoin difficulty" for the current figure. Call it D.
Multiply D by 2^32, which is about 4.3e9. Call this new number H. This represents the average number of hashes needed to mine one block.
Look up the hashes per unit energy for current mining hardware. Check https://en.bitcoin.it/wiki/Mining_hardware_comparison for the device with the highest number in the Mhash/J column. Multiply this Mhash/J number by 1 million (1e6) to determine the number of hashes per joule performed by this hardware. Call this number E.
Divide H by E. This gives you the number of joules of energy needed to mine one block.
If you would prefer to measure energy in kilowatt-hours (a typical billing unit for electric utilities), then divide the previous number by 3.6e6.