What is preventing me from simply constructing a hash that's lower than the current target? Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?What values are hashed in the SHA-256 algorithm, and what would be the next iteration until a possible header is found?Why change the nonce instead of just rehashing?How is a block header hash compared to the target (bits)?How does mining process takes Approximately 10 minutes?Why check for multiple nonces despite finding a golden nonce?if a Bitcoin mining nounce is just 32 bits long how come is it increasingly difficult to find the winning hash?With the current hashrate, how does it still take 10min to solve a bitcoin block?Why the nonce is difficult to find in Bitcoin?Calculating the target from the hash leading off bitsWhat is the exact input for the hash function?

3 doors, three guards, one stone

Is above average number of years spent on PhD considered a red flag in future academia or industry positions?

Why is "Captain Marvel" translated as male in Portugal?

When is phishing education going too far?

What causes the vertical darker bands in my photo?

How to bypass password on Windows XP account?

Diagram with tikz

How discoverable are IPv6 addresses and AAAA names by potential attackers?

Is it true that "carbohydrates are of no use for the basal metabolic need"?

What does the "x" in "x86" represent?

Disable hyphenation for an entire paragraph

Is there a concise way to say "all of the X, one of each"?

What happens to sewage if there is no river near by?

What LEGO pieces have "real-world" functionality?

Right-skewed distribution with mean equals to mode?

What do you call a phrase that's not an idiom yet?

Single word antonym of "flightless"

What are the pros and cons of Aerospike nosecones?

How to deal with a team lead who never gives me credit?

What do you call a plan that's an alternative plan in case your initial plan fails?

Can a non-EU citizen traveling with me come with me through the EU passport line?

How do I keep my slimes from escaping their pens?

iPhone Wallpaper?

How can I fade player character when he goes inside or outside of the area?



What is preventing me from simply constructing a hash that's lower than the current target?



Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?What values are hashed in the SHA-256 algorithm, and what would be the next iteration until a possible header is found?Why change the nonce instead of just rehashing?How is a block header hash compared to the target (bits)?How does mining process takes Approximately 10 minutes?Why check for multiple nonces despite finding a golden nonce?if a Bitcoin mining nounce is just 32 bits long how come is it increasingly difficult to find the winning hash?With the current hashrate, how does it still take 10min to solve a bitcoin block?Why the nonce is difficult to find in Bitcoin?Calculating the target from the hash leading off bitsWhat is the exact input for the hash function?










4















I just started learning about Bitcoin, and something I can figure out is why miners have to use a random process (hashing a nonce) to get lower than the target. For example, if the target is



00000000000001ae00000000000000


why not just produce



000000000000000000000000000001


to become the winner? I have no practical experience mining, I'm guessing my ignorance lies in the requirements of how a hash is produced. If so, where can I find about those requirements? Thanks.




EDIT: For clarity, I mean this in the sense of what part of the technology requires me to use a hash function? Rather than in the sense of just constructing something that looks like a valid hash.










share|improve this question









New contributor




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















  • 2





    Other nodes checking your hash will notice that you are lying: the hash does not match the calculated hash. The only thing you can do to influence weather your hash matches the calculated hash is to change the nonce and try - this is in fact the proof of work algorithm - change nonce, calculate hash, see if it fits the target and try, try again. You are always welcome to voluntarily choose a harder target but statistically that means other people would be able to find a matching hash before you

    – slebetman
    Apr 12 at 6:38






  • 2





    Also, you have a slight misunderstanding. The process is not hashing the nonce, it is hashing the block. Of course hashing the block will generate a fixed hash value which may never match the target. The solution? Allow miners to add their own garbage/ignored data to the block - the nonce - then hash the whole thing. If the hash don't match the target you need to change the nonce and retry. In this way it is impossible to pre-calculate the hash using a pre-generated nonce because you have no control over the other data in the block

    – slebetman
    Apr 12 at 6:42















4















I just started learning about Bitcoin, and something I can figure out is why miners have to use a random process (hashing a nonce) to get lower than the target. For example, if the target is



00000000000001ae00000000000000


why not just produce



000000000000000000000000000001


to become the winner? I have no practical experience mining, I'm guessing my ignorance lies in the requirements of how a hash is produced. If so, where can I find about those requirements? Thanks.




EDIT: For clarity, I mean this in the sense of what part of the technology requires me to use a hash function? Rather than in the sense of just constructing something that looks like a valid hash.










share|improve this question









New contributor




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















  • 2





    Other nodes checking your hash will notice that you are lying: the hash does not match the calculated hash. The only thing you can do to influence weather your hash matches the calculated hash is to change the nonce and try - this is in fact the proof of work algorithm - change nonce, calculate hash, see if it fits the target and try, try again. You are always welcome to voluntarily choose a harder target but statistically that means other people would be able to find a matching hash before you

    – slebetman
    Apr 12 at 6:38






  • 2





    Also, you have a slight misunderstanding. The process is not hashing the nonce, it is hashing the block. Of course hashing the block will generate a fixed hash value which may never match the target. The solution? Allow miners to add their own garbage/ignored data to the block - the nonce - then hash the whole thing. If the hash don't match the target you need to change the nonce and retry. In this way it is impossible to pre-calculate the hash using a pre-generated nonce because you have no control over the other data in the block

    – slebetman
    Apr 12 at 6:42













4












4








4








I just started learning about Bitcoin, and something I can figure out is why miners have to use a random process (hashing a nonce) to get lower than the target. For example, if the target is



00000000000001ae00000000000000


why not just produce



000000000000000000000000000001


to become the winner? I have no practical experience mining, I'm guessing my ignorance lies in the requirements of how a hash is produced. If so, where can I find about those requirements? Thanks.




EDIT: For clarity, I mean this in the sense of what part of the technology requires me to use a hash function? Rather than in the sense of just constructing something that looks like a valid hash.










share|improve this question









New contributor




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












I just started learning about Bitcoin, and something I can figure out is why miners have to use a random process (hashing a nonce) to get lower than the target. For example, if the target is



00000000000001ae00000000000000


why not just produce



000000000000000000000000000001


to become the winner? I have no practical experience mining, I'm guessing my ignorance lies in the requirements of how a hash is produced. If so, where can I find about those requirements? Thanks.




EDIT: For clarity, I mean this in the sense of what part of the technology requires me to use a hash function? Rather than in the sense of just constructing something that looks like a valid hash.







mining-theory hash






share|improve this question









New contributor




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











share|improve this question









New contributor




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









share|improve this question




share|improve this question








edited Apr 12 at 3:25







Zduff













New contributor




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









asked Apr 11 at 19:53









ZduffZduff

1285




1285




New contributor




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





New contributor





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






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







  • 2





    Other nodes checking your hash will notice that you are lying: the hash does not match the calculated hash. The only thing you can do to influence weather your hash matches the calculated hash is to change the nonce and try - this is in fact the proof of work algorithm - change nonce, calculate hash, see if it fits the target and try, try again. You are always welcome to voluntarily choose a harder target but statistically that means other people would be able to find a matching hash before you

    – slebetman
    Apr 12 at 6:38






  • 2





    Also, you have a slight misunderstanding. The process is not hashing the nonce, it is hashing the block. Of course hashing the block will generate a fixed hash value which may never match the target. The solution? Allow miners to add their own garbage/ignored data to the block - the nonce - then hash the whole thing. If the hash don't match the target you need to change the nonce and retry. In this way it is impossible to pre-calculate the hash using a pre-generated nonce because you have no control over the other data in the block

    – slebetman
    Apr 12 at 6:42












  • 2





    Other nodes checking your hash will notice that you are lying: the hash does not match the calculated hash. The only thing you can do to influence weather your hash matches the calculated hash is to change the nonce and try - this is in fact the proof of work algorithm - change nonce, calculate hash, see if it fits the target and try, try again. You are always welcome to voluntarily choose a harder target but statistically that means other people would be able to find a matching hash before you

    – slebetman
    Apr 12 at 6:38






  • 2





    Also, you have a slight misunderstanding. The process is not hashing the nonce, it is hashing the block. Of course hashing the block will generate a fixed hash value which may never match the target. The solution? Allow miners to add their own garbage/ignored data to the block - the nonce - then hash the whole thing. If the hash don't match the target you need to change the nonce and retry. In this way it is impossible to pre-calculate the hash using a pre-generated nonce because you have no control over the other data in the block

    – slebetman
    Apr 12 at 6:42







2




2





Other nodes checking your hash will notice that you are lying: the hash does not match the calculated hash. The only thing you can do to influence weather your hash matches the calculated hash is to change the nonce and try - this is in fact the proof of work algorithm - change nonce, calculate hash, see if it fits the target and try, try again. You are always welcome to voluntarily choose a harder target but statistically that means other people would be able to find a matching hash before you

– slebetman
Apr 12 at 6:38





Other nodes checking your hash will notice that you are lying: the hash does not match the calculated hash. The only thing you can do to influence weather your hash matches the calculated hash is to change the nonce and try - this is in fact the proof of work algorithm - change nonce, calculate hash, see if it fits the target and try, try again. You are always welcome to voluntarily choose a harder target but statistically that means other people would be able to find a matching hash before you

– slebetman
Apr 12 at 6:38




2




2





Also, you have a slight misunderstanding. The process is not hashing the nonce, it is hashing the block. Of course hashing the block will generate a fixed hash value which may never match the target. The solution? Allow miners to add their own garbage/ignored data to the block - the nonce - then hash the whole thing. If the hash don't match the target you need to change the nonce and retry. In this way it is impossible to pre-calculate the hash using a pre-generated nonce because you have no control over the other data in the block

– slebetman
Apr 12 at 6:42





Also, you have a slight misunderstanding. The process is not hashing the nonce, it is hashing the block. Of course hashing the block will generate a fixed hash value which may never match the target. The solution? Allow miners to add their own garbage/ignored data to the block - the nonce - then hash the whole thing. If the hash don't match the target you need to change the nonce and retry. In this way it is impossible to pre-calculate the hash using a pre-generated nonce because you have no control over the other data in the block

– slebetman
Apr 12 at 6:42










2 Answers
2






active

oldest

votes


















5















EDIT: For clarity, I mean this in the sense of what part of the technology requires me to use a hash function? As opposed, to just constructing something that looks like a valid hash.




When determining whether or not a block is valid, each and every bitcoin node on the network will take the header of that block, and run it through a hashing algorithm to see what the output is. If the output is lower than the target value, then the block is valid (assuming that the rest of the block is also valid, of course).



Notice something important: the hash value itself is not explicitly stored in the block. So you cannot just append some fabricated value that falls below the target value onto the block in lieu of a valid PoW. To create a valid block, you must construct it such that all other network nodes can independently verify it as being valid, and to do so, they use a hash function.



As Pieter mentioned, hash functions are unpredictable 'one-way' functions. The only way to find a valid output is by trying a huge number of possible inputs, and 'getting lucky', so to speak.






share|improve this answer























  • It's not quite that simple. The hash needs to be resistant to pre-image attacks.

    – jpmc26
    Apr 12 at 1:08






  • 3





    @jpmc26 Any useful cryptographic hash function should be.

    – immibis
    Apr 12 at 4:00






  • 1





    @jpmc26 A cryptographic hash function is commonly understood to mean indistinguishable from random, which implies preimage and collision resistant. This doesn't hold for non-cryptographic hash functions.

    – Pieter Wuille
    Apr 12 at 14:17


















5














Hash functions are unpredictable.



You can't simply find an input to the hash function that produces such an output. The only way to accomplish that is by trying lots and lots of candidate blocks as input. If the target is 1000 times smaller, it requires 1000 times as many tries.






share|improve this answer























  • Deleted comment. Please see edit to question.

    – Zduff
    Apr 11 at 20:05











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "308"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






Zduff is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fbitcoin.stackexchange.com%2fquestions%2f85994%2fwhat-is-preventing-me-from-simply-constructing-a-hash-thats-lower-than-the-curr%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









5















EDIT: For clarity, I mean this in the sense of what part of the technology requires me to use a hash function? As opposed, to just constructing something that looks like a valid hash.




When determining whether or not a block is valid, each and every bitcoin node on the network will take the header of that block, and run it through a hashing algorithm to see what the output is. If the output is lower than the target value, then the block is valid (assuming that the rest of the block is also valid, of course).



Notice something important: the hash value itself is not explicitly stored in the block. So you cannot just append some fabricated value that falls below the target value onto the block in lieu of a valid PoW. To create a valid block, you must construct it such that all other network nodes can independently verify it as being valid, and to do so, they use a hash function.



As Pieter mentioned, hash functions are unpredictable 'one-way' functions. The only way to find a valid output is by trying a huge number of possible inputs, and 'getting lucky', so to speak.






share|improve this answer























  • It's not quite that simple. The hash needs to be resistant to pre-image attacks.

    – jpmc26
    Apr 12 at 1:08






  • 3





    @jpmc26 Any useful cryptographic hash function should be.

    – immibis
    Apr 12 at 4:00






  • 1





    @jpmc26 A cryptographic hash function is commonly understood to mean indistinguishable from random, which implies preimage and collision resistant. This doesn't hold for non-cryptographic hash functions.

    – Pieter Wuille
    Apr 12 at 14:17















5















EDIT: For clarity, I mean this in the sense of what part of the technology requires me to use a hash function? As opposed, to just constructing something that looks like a valid hash.




When determining whether or not a block is valid, each and every bitcoin node on the network will take the header of that block, and run it through a hashing algorithm to see what the output is. If the output is lower than the target value, then the block is valid (assuming that the rest of the block is also valid, of course).



Notice something important: the hash value itself is not explicitly stored in the block. So you cannot just append some fabricated value that falls below the target value onto the block in lieu of a valid PoW. To create a valid block, you must construct it such that all other network nodes can independently verify it as being valid, and to do so, they use a hash function.



As Pieter mentioned, hash functions are unpredictable 'one-way' functions. The only way to find a valid output is by trying a huge number of possible inputs, and 'getting lucky', so to speak.






share|improve this answer























  • It's not quite that simple. The hash needs to be resistant to pre-image attacks.

    – jpmc26
    Apr 12 at 1:08






  • 3





    @jpmc26 Any useful cryptographic hash function should be.

    – immibis
    Apr 12 at 4:00






  • 1





    @jpmc26 A cryptographic hash function is commonly understood to mean indistinguishable from random, which implies preimage and collision resistant. This doesn't hold for non-cryptographic hash functions.

    – Pieter Wuille
    Apr 12 at 14:17













5












5








5








EDIT: For clarity, I mean this in the sense of what part of the technology requires me to use a hash function? As opposed, to just constructing something that looks like a valid hash.




When determining whether or not a block is valid, each and every bitcoin node on the network will take the header of that block, and run it through a hashing algorithm to see what the output is. If the output is lower than the target value, then the block is valid (assuming that the rest of the block is also valid, of course).



Notice something important: the hash value itself is not explicitly stored in the block. So you cannot just append some fabricated value that falls below the target value onto the block in lieu of a valid PoW. To create a valid block, you must construct it such that all other network nodes can independently verify it as being valid, and to do so, they use a hash function.



As Pieter mentioned, hash functions are unpredictable 'one-way' functions. The only way to find a valid output is by trying a huge number of possible inputs, and 'getting lucky', so to speak.






share|improve this answer














EDIT: For clarity, I mean this in the sense of what part of the technology requires me to use a hash function? As opposed, to just constructing something that looks like a valid hash.




When determining whether or not a block is valid, each and every bitcoin node on the network will take the header of that block, and run it through a hashing algorithm to see what the output is. If the output is lower than the target value, then the block is valid (assuming that the rest of the block is also valid, of course).



Notice something important: the hash value itself is not explicitly stored in the block. So you cannot just append some fabricated value that falls below the target value onto the block in lieu of a valid PoW. To create a valid block, you must construct it such that all other network nodes can independently verify it as being valid, and to do so, they use a hash function.



As Pieter mentioned, hash functions are unpredictable 'one-way' functions. The only way to find a valid output is by trying a huge number of possible inputs, and 'getting lucky', so to speak.







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 11 at 20:50









chytrikchytrik

7,5422628




7,5422628












  • It's not quite that simple. The hash needs to be resistant to pre-image attacks.

    – jpmc26
    Apr 12 at 1:08






  • 3





    @jpmc26 Any useful cryptographic hash function should be.

    – immibis
    Apr 12 at 4:00






  • 1





    @jpmc26 A cryptographic hash function is commonly understood to mean indistinguishable from random, which implies preimage and collision resistant. This doesn't hold for non-cryptographic hash functions.

    – Pieter Wuille
    Apr 12 at 14:17

















  • It's not quite that simple. The hash needs to be resistant to pre-image attacks.

    – jpmc26
    Apr 12 at 1:08






  • 3





    @jpmc26 Any useful cryptographic hash function should be.

    – immibis
    Apr 12 at 4:00






  • 1





    @jpmc26 A cryptographic hash function is commonly understood to mean indistinguishable from random, which implies preimage and collision resistant. This doesn't hold for non-cryptographic hash functions.

    – Pieter Wuille
    Apr 12 at 14:17
















It's not quite that simple. The hash needs to be resistant to pre-image attacks.

– jpmc26
Apr 12 at 1:08





It's not quite that simple. The hash needs to be resistant to pre-image attacks.

– jpmc26
Apr 12 at 1:08




3




3





@jpmc26 Any useful cryptographic hash function should be.

– immibis
Apr 12 at 4:00





@jpmc26 Any useful cryptographic hash function should be.

– immibis
Apr 12 at 4:00




1




1





@jpmc26 A cryptographic hash function is commonly understood to mean indistinguishable from random, which implies preimage and collision resistant. This doesn't hold for non-cryptographic hash functions.

– Pieter Wuille
Apr 12 at 14:17





@jpmc26 A cryptographic hash function is commonly understood to mean indistinguishable from random, which implies preimage and collision resistant. This doesn't hold for non-cryptographic hash functions.

– Pieter Wuille
Apr 12 at 14:17











5














Hash functions are unpredictable.



You can't simply find an input to the hash function that produces such an output. The only way to accomplish that is by trying lots and lots of candidate blocks as input. If the target is 1000 times smaller, it requires 1000 times as many tries.






share|improve this answer























  • Deleted comment. Please see edit to question.

    – Zduff
    Apr 11 at 20:05















5














Hash functions are unpredictable.



You can't simply find an input to the hash function that produces such an output. The only way to accomplish that is by trying lots and lots of candidate blocks as input. If the target is 1000 times smaller, it requires 1000 times as many tries.






share|improve this answer























  • Deleted comment. Please see edit to question.

    – Zduff
    Apr 11 at 20:05













5












5








5







Hash functions are unpredictable.



You can't simply find an input to the hash function that produces such an output. The only way to accomplish that is by trying lots and lots of candidate blocks as input. If the target is 1000 times smaller, it requires 1000 times as many tries.






share|improve this answer













Hash functions are unpredictable.



You can't simply find an input to the hash function that produces such an output. The only way to accomplish that is by trying lots and lots of candidate blocks as input. If the target is 1000 times smaller, it requires 1000 times as many tries.







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 11 at 19:58









Pieter WuillePieter Wuille

48.3k3100163




48.3k3100163












  • Deleted comment. Please see edit to question.

    – Zduff
    Apr 11 at 20:05

















  • Deleted comment. Please see edit to question.

    – Zduff
    Apr 11 at 20:05
















Deleted comment. Please see edit to question.

– Zduff
Apr 11 at 20:05





Deleted comment. Please see edit to question.

– Zduff
Apr 11 at 20:05










Zduff is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















Zduff is a new contributor. Be nice, and check out our Code of Conduct.












Zduff is a new contributor. Be nice, and check out our Code of Conduct.











Zduff is a new contributor. Be nice, and check out our Code of Conduct.














Thanks for contributing an answer to Bitcoin Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fbitcoin.stackexchange.com%2fquestions%2f85994%2fwhat-is-preventing-me-from-simply-constructing-a-hash-thats-lower-than-the-curr%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Sum ergo cogito? 1 nng

419 nièngy_Soadمي 19bal1.5o_g

Queiggey Chernihivv 9NnOo i Zw X QqKk LpB