MultiversX Tracker is Live!

Finding Hash with 11 leading zeroes

Bitcoin Stack Exchange

Bitcoin News / Bitcoin Stack Exchange 114 Views

proof of work - Finding Hash with 11 leading zeroes - Bitcoin Stack Exchange

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

Anybody can ask a question

Anybody can answer

The best answers are voted up and rise to the top

Asked

Viewed 47 times

For an exercise, I'm trying to find a sha256 hash with 11 leading zeroes.

For this reason, I wrote a Python script that basically tries all intergers from 1 to N and brute forces the hash. Now my N is at 16^11.

Am I mistaken or is there a problem with my code as there must be a nonce somewhere between 1 and 16^11 where the hash has 11 leading zeroes?

Thank you for your input!

New contributor
Howdy is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
4

Every attempted a hash has an independent probability of 1 in 1611 of having 11 leading zeroes.

That means a probability of not finding such a hash after n attempts is equal to the probability that n attempts are all unsuccesful: (1 - 16-11)n

That means the probability that you are successful increases with n, but never reaches 1:

  • 1% chance after 176,807,378,144 attempts (~169.34).
  • 5% chance after 902,361,177,698 attempts (~169.93).
  • 20% chance after 3,925,582,869,332 attempts (~1610.46).
  • 50% chance after 12,193,974,156,573 attempts (~1610.87).
  • 80% chance after 28,313,531,182,477 attempts (~1611.17).
  • 95% chance after 52,701,479,495,622 attempts (~1611.40).
  • 99% chance after 81,015,010,678,098 attempts (~1611.55).
  • 99.9% chance after 121,522,516,017,148 attempts (~1611.70).
  • ...
1

No,the "nonce" could be alternate.Not limited in 1 to N. But the expect time of finding a target hash is 16^11,that meaning if u try 16^11 different "nonce" u are likely get a target.

New contributor
shawn ha is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

there must be a nonce somewhere between 1 and 16^11 where the hash has 11 leading zeroes [in fixed-length hexadecimal encoding]?

  1. You cannot assume this.

  2. Bitcoin doesn't encode in hexadecimal and then test for number of leading zeroes. The test it uses is literally if (hash <= hashTarget)

As you probably know, for current hashTarget values, miners expect to exhaust all nonce values and vary other block values such as the so-called "extranonce" etc - and retry many many times.


See

you need difficulty * 248 / 65535 attempts.

Also note that's on average. You might never find one. The probability of finding a sufficiently small hash after n attempts is never 100% for any finite n.


Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
πŸ’° Install these recommended apps:
πŸ’² SocialGood - 100% Crypto Back on Everyday Shopping
πŸ’² xPortal - The DeFi For The Next Billion
πŸ’² CryptoTab Browser - Lightweight, fast, and ready to mine!
πŸ’° Register on these recommended exchanges:
🟑 Binance🟑 Bitfinex🟑 Bitmart🟑 Bittrex🟑 Bitget
🟑 CoinEx🟑 Crypto.com🟑 Gate.io🟑 Huobi🟑 Kucoin.



Comments