Bitcoin Solo Miner: The Odds in 2017
Years ago, I won a book as reward for completing a little challenge which consisted of solving the following problem:
While driving, I came across a milestone that read a two-digit number ab. One hour later, I saw a new milestone reading the same digits in reverse order ba. Another hour later, I encountered a new milestone with a three-digit number, the same digits as the first milestone separated by a zero: a0b. I was driving faster during the first hour and the difference between the two speed values is a two-digit number. Reversing the two digits on that number gives the value for the first speed e.g. if the speed difference is xy then the first speed value is yx. Can you find a and b?
When Brute Force is Faster
This problem can be solved through logic (not spoiling in case someone feels inspired). But timing was important so I opened my C++ IDE, wrote the brute-force search below, set a breakpoint to read the values and submitted the answer:
for (int x = 1; x <= 9; ++x) for (int y = 1; y <= 9; ++y) for (int a = 0; a <= 9; ++a) for (int b = 0; b <= 9; ++b) if ((!((b * 10 + a) - ((a * 10 + b) + (x * 10 + y)))) && ((a * 100 + b) - ((x * 10 + y) - (y * 10 + x)) == (b * 10 + a))) /* Solution found. */
Basically, it is comparable to what Bitcoin miners do for proof of work.
While academic cryptanalysts are constantly doing research and analysis to break cryptographic algorithms, no practical attack has been found so far on the SHA256 hash function so the fastest known way to find a block header hash below a specific target is by brute force search.
Steady or Lucky?
Miners are essentially playing a lottery game in which increasing their computational power would increase their odds of winning the current 12.5 BTC block reward (e.g. Block #487465) — about $50K at current BTC/USD rate of $4181.1.
Since the mining difficulty value is constantly adjusted to match the computational power at play, the blockchain does not suffer from increased hashing rates and miners are essentially inflating the system values — not their production speed.
The difficulty is currently high enough that pools of miners have been forming everywhere. By pooling their resources and sharing the revenue based on their respective computational power equity, even the smaller miners can earn steady revenue.
Solo mining requires much higher odds to be the first to confirm a block due to the current target threshold.
What would the odds be for a solo miner to win the jackpot?
According to Block #487465, today’s Bitcoin difficulty value is 1103400932964.29 so the expected number of hashes to compute in order to find one that is below the target value is:
1103400932964.29 x 232 = 4.739070921457514e+21 (or 4.7 sextillion)
The time required to compute these hashes at 1000 Gh/s (assuming an entry level personal ASIC miner could fairly produce that rate):
1103400932964.29 x 232 ÷ 1012 = 4739070921.46s (or 150 years)
We know that the difficulty value is adjusted every 2016 blocks so that it takes an average of 10 minutes to solve the problem so our chance to find a hash would be one in:
1103400932964.29 x 232 ÷ (600 x 1012) = 7898451.5
Shall I Buy a Lottery Ticket or…
The chance of winning the Bitcoin Block Reward is currently one in 7,898,451 every 10 minutes with 1000 Gh/s. To preserve the odds you would need to adjust your computational power to the difficulty.
- The chance of winning the Lottery jackpot with 5 matched numbers + bonus is one in 7,509,579.
- The chance of winning the Lottery jackpot with 6 matched numbers is one in 45,057,474
- The combined odds of becoming a Lottery millionaire are roughly 10 million to one per line.
Provided that you could try your luck every 10 minutes for a $200 hardware investment that would give you the hash rate used in this simulation, it is cheaper to mine Bitcoin for about the same odds as matching 5 numbers + bonus in the Lottery. However if your hope is to become millionaire (i.e. not just win), it is better to play the Lottery.
Well, that’s if you are feeling lucky because in both cases the odds are well against you…
My 2 satoshi.