<blockquote>
<p>My question is: Say I know that the message b 'added' with the number a gets mapped to my desired output. Why is it not possible for me, given a different block (b2) to find a corresponding number (a2), such that the hash of the result will map to the same number c?</p>
</blockquote>
<p>It's not possible because there are 2^256 (approximately 1 followed by 77 zeroes) possible hash results. You would have to try an awful lot of possible values for a2 to find one that happened to produce precisely the same hash output. The stars would burn out first.</p>
<blockquote>
<p>What is the operation that combines the block b with the number a that makes this impossible? Is it simple appending?</p>
</blockquote>
<p>No, it is not simple appending. That would produce very, very long numbers. It's an operation that has three important characteristics:</p>
<ol>
<li><p>It produces an output smaller than its input. This makes it irreversible because information is lost. You cannot reverse the hashing operation just as you cannot reverse addition. If I add two numbers and get 10, you cannot tell me which two numbers I added because that information has been lost.</p>
</li>
<li><p>A small change in the input produces large changes in the output. That is, changing a single bit of the input changes roughly half of the bits of the output, and it is not easily predictable which bits that will be. It mixes the input quite thoroughly to produce its output.</p>
</li>
<li><p>The output is long, 256 bits. As a result, brute force trial and error to get particular outputs is not practical.</p>
</li>
</ol>
<p>You can read more on the SHA-2 family of functions (which includes SHA-256) <a href="https://en.wikipedia.org/wiki/SHA-2" rel="nofollow noreferrer">here</a>.</p>

CC BY-SA 4.0
2021-02-25T01:08:51.400Z
2021-02-25T01:08:51.400Z
David Schwartz
<p>My understanding is the when you are mining bitcoin you are looking for a string, or maybe a binary number (a) such that if you 'add' a to the block (b) you get a number (c) whose hash begins with a bunch of zeros.</p>
<p>My question is: Say I know that the message b 'added' with the number a gets mapped to my desired output. Why is it not possible for me, given a different block (b2) to find a corresponding number (a2), such that the hash of the result will map to the same number c?</p>
<p>What is the operation that combines the block b with the number a that makes this impossible? Is it simple appending?</p>

CC BY-SA 4.0
2021-02-25T00:24:16.037Z
There are two very different questions you could be asking. When you say "to the same number c", do you mean the exact same number? Or do you mean some number with just as many beginning zeroes? Those are two very different questions that address very different types of threats and have very different answers.
David Schwartz
CC BY-SA 4.0
2021-02-25T00:33:00.983Z
I mean exactly the same number
Michał Kuczyński
<security><sha256><algorithms>
Why is SHA-256 mining secure?
Michał Kuczyński
# Why is SHA-256 mining secure?

(Asked by: username_0 on 2021-02-25)

My understanding is the when you are mining bitcoin you are looking for a string, or maybe a binary number (a) such that if you 'add' a to the block (b) you get a number (c) whose hash begins with a bunch of zeros.

My question is: Say I know that the message b 'added' with the number a gets mapped to my desired output. Why is it not possible for me, given a different block (b2) to find a corresponding number (a2), such that the hash of the result will map to the same number c?

What is the operation that combines the block b with the number a that makes this impossible? Is it simple appending?

**Tags:** security, sha256, algorithms

> **Comments:**
> **username_1**: There are two very different questions you could be asking. When you say "to the same number c", do you mean the exact same number? Or do you mean some number with just as many beginning zeroes? Those are two very different questions that address very different types of threats and have very different answers.  
> **username_0**: I mean exactly the same number  

---

## 1 answers

### Answer by username_1 on 2021-02-25. Score: 2

> My question is: Say I know that the message b 'added' with the number a gets mapped to my desired output. Why is it not possible for me, given a different block (b2) to find a corresponding number (a2), such that the hash of the result will map to the same number c?

It's not possible because there are 2^256 (approximately 1 followed by 77 zeroes) possible hash results. You would have to try an awful lot of possible values for a2 to find one that happened to produce precisely the same hash output. The stars would burn out first.

> What is the operation that combines the block b with the number a that makes this impossible? Is it simple appending?

No, it is not simple appending. That would produce very, very long numbers. It's an operation that has three important characteristics:

1. It produces an output smaller than its input. This makes it irreversible because information is lost. You cannot reverse the hashing operation just as you cannot reverse addition. If I add two numbers and get 10, you cannot tell me which two numbers I added because that information has been lost.
2. A small change in the input produces large changes in the output. That is, changing a single bit of the input changes roughly half of the bits of the output, and it is not easily predictable which bits that will be. It mixes the input quite thoroughly to produce its output.
3. The output is long, 256 bits. As a result, brute force trial and error to get particular outputs is not practical.

You can read more on the SHA-2 family of functions (which includes SHA-256) [here](https://en.wikipedia.org/wiki/SHA-2).


---

