How do they find this number? By guessing at random. The hash function makes it impossible to predict what the output will be. So, miners guess the mystery number and apply the hash function to the combination of that guessed number and the data in the block. The resulting hash has to start with a pre-established number of zeroes. There's no way of knowing which number will work, because two consecutive integers will give wildly varying results. What's more, there may be several nonces that produce the desired result, or there may be none (in which case the miners keep trying, but with a different block configuration).
For the bitcoin timestamp network, a valid proof of work is found by incrementing a nonce until a value is found that gives the block's hash the required number of leading zero bits. Once the hashing has produced a valid result, the block cannot be changed without redoing the work. As later blocks are chained after it, the work to change the block would include redoing the work for each subsequent block.
“These companies are using extraordinary amounts of electricity – typically thousands of times more electricity than an average residential customer would use,” a spokesperson for the New York State Department of Public Service told Wired. “The sheer amount of electricity being used is leading to higher costs for customers in small communities because of a limited supply of low-cost hydropower.”
Let’s say a hacker wanted to change a transaction that happened 60 minutes, or six blocks, ago—maybe to remove evidence that she had spent some bitcoins, so she could spend them again. Her first step would be to go in and change the record for that transaction. Then, because she had modified the block, she would have to solve a new proof-of-work problem—find a new nonce—and do all of that computational work, all over again. (Again, due to the unpredictable nature of hash functions, making the slightest change to the original block means starting the proof of work from scratch.) From there, she’d have to start building an alternative chain going forward, solving a new proof-of-work problem for each block until she caught up with the present.
Still, even supporters acknowledge that that glorious future is going to use a lot of electricity. It’s true that many of the more alarming claims—for example, that by 2020, bitcoin mining will consume “as much electricity as the entire world does today,” as the environmental website Grist recently suggested—are ridiculous: Even if the current bitcoin load grew a hundredfold, it would still represent less than 2 percent of total global power consumption. (And for comparison, even the high-end estimates of bitcoin’s total current power consumption are still less than 6 percent of the power consumed by the world’s banking sector.) But the fact remains that bitcoin takes an astonishing amount of power. By one estimate, the power now needed to mine a single coin would run the average household for 10 days.