<p>Nick's answer is very helpful, but might not be sufficient to get us (and BitCoin) in the clear. There may be a valid and grave concern based on the fact that crypto hashing functions aren't proven to satisfy constraints 2 and 3, so they potentially can be weak. </p>

<p>Even though people could switch away from a crypto hashing function to a better one, what would allow us to know for sure that someone isn't silently using the weakness of the hashing function to steal? Going undetected would allow you to leech from the bitcoin system, perhaps by getting a enormous share of mining rewards without expending nearly as much computing power. This kind of arbitrage could allow you to get rich off of every nerd who uses BitCoin (admittedly myself included) and some venture capitalists (I'm getting there ;) ). And since we're speculating, wouldn't it be convenient to tie develop a currency based on crypto if you want to get really rich. Obviously, exploiting it without removing its potential for growth and adoption...</p>

<p>If you know the exploit to SHA-256 and know how to leech off BTC and other crypto currencies, the altruistic and honorable thing to do is publish the exploit. The egocentric thing to do would be to abuse it. </p>

<p>I hope that someone will prove me wrong about this potential for abuse.</p>

<p>If not, it basically comes down to this: with great power comes great responsibility! Everybody says trust isn't needed with BitCoin. It STILL comes down to trust, but now trust that no one came up with this loophole or that the one who did isn't breaking the system more than it's contributing societal value. </p>

<p>I'd really have big respect for the person for choosing honor above personal gain. Unless you siphon the gains to a good cause, but even then I'm sure that a single person isn't best capable of handling those amounts of value. A crowd or even a market knows better how to allocate funds somewhat optimally.</p>

CC BY-SA 3.0
2013-12-23T17:45:17.230Z
If you knew an exploit to a major crypo algorithms like SHA256, you could sniff people's passwords through SSL, crack their back accounts and drain them of fiat in a swift weekend.    I think bitcoin would be the least of the worlds concerns.
Erik Aronesty
CC BY-SA 3.0
2013-08-16T22:18:07.577Z
2013-08-18T16:35:09.373Z
2013-08-18T16:35:09.373Z
ErikDB
<p>Bitcoin uses SHA256 followed by RIPEMD-160, which I'll collectively call HASH160.</p>

<p>Good hashes have 4 properties: </p>

<ol>
<li>it is easy to compute the hash value for any given message </li>
<li>it is infeasible to generate a message that has a given hash</li>
<li>it is infeasible to modify a message without changing the hash</li>
<li>it is infeasible to find two different messages with the same hash</li>
</ol>

<p>Source: <a href="http://en.wikipedia.org/wiki/Cryptographic_hash_function" rel="nofollow">Wikipedia</a></p>

<p>We care about properties 1, 2, and 3. We know for a fact that property 1 is true about HASH160 - we can benchmark it. If properties 2 or 3 were false, then you could steal bitcoins. Not good.</p>

<p>It's a good thing that <a href="https://en.bitcoin.it/wiki/Script#Standard_Transaction_to_Bitcoin_address" rel="nofollow">the scripting language</a> is so flexible, and would allow people to switch to a different address type without forcing everyone to upgrade.</p>

<p>This is a current bitcoin transaction script: </p>

<pre><code> OP_DUP OP_HASH160 09432ab39083b5098b6f09432ab39083b5098b6f OP_EQUALVERIFY OP_CHECKSIG
</code></pre>

<p>Here's how that might change if HASH160 were broken:</p>

<pre><code>OP_DUP OP_HASH256 09432ab39083b5098b6f09432ab39083b5098b6f09432ab39083b5098b6f826496 OP_EQUALVERIFY OP_CHECKSIG
</code></pre>

<p>Note that we've swapped HASH160 for HASH256. Or, assuming both were broken:</p>

<pre><code>&lt;pubKey&gt; OP_CHECKSIG
</code></pre>

<p>Now we're forgoing hash functions entirely and putting in the ECDSA key explicitly. However, this would make bitcoin addresses about a hundred characters long.</p>

CC BY-SA 3.0
2014-11-15T20:55:23.680Z
Could you elaborate on what would be necessary to "switch to a different address type" insofar as what users with bitcoins on the old address type would have to do to move over. Would everyone just have to create new addresses and move all their bitcoins?
B T
CC BY-SA 3.0
2014-11-15T20:56:29.347Z
@BT Yes. The addresses would be much longer, though.
Nick ODell
CC BY-SA 3.0
2014-11-18T00:30:05.980Z
Got it, cool. That doesn't sound so bad actually then. At least, not catastrophic.
B T
CC BY-SA 4.0
2019-05-26T21:19:31.527Z
To spend bitcoins, you need to have the corresponding private key. The bitcoin address is derived from the public key. If the hash function could be compromised regarding 2. one could reveal the public key. This would still require elliptic curve cryptography to fall apart before an attacker could steal your money. An attack to 3. does not help for a bitcoin address at all. Finally if 4. would be weakened it would still not really help as you would have to randomly generate key-pairs to find a collision. You can already do that now but chances are bigger to find alien life in universe.
Jörg
CC BY-SA 3.0
2013-03-26T00:37:39.580Z
2014-11-18T00:32:30.750Z
2014-11-18T00:32:30.750Z
Nick ODell
<p>If not, what else would be needed to steal all funds from all people and completely break bitcoin? </p>

<p>I bet some will say ECSDA gives bitcoin an additional layer of protection. I counter this by saying ECSDA is dependent on a hash function such as SHA256. So I will ask this as well: What kind of ECSDA does bitcoin use and would it still be protected if SHA256 were broken?</p>

<p>Yes, I know I am illustrating an unlikely scenario but I still believe we should know what will happen.</p>

<p>If you want to mention other hash functions in relation to SHA256, you can. Feel free to explain how RIPEMD-160 would keep bitcoin safe in case of a SHA256 exploit.</p>

<address><cryptography><ecdsa><hacking><sha256>
If SHA256 and/or RIPEMD-160 were broken, would all bitcoin addresses be compromised?
John Smith
# If SHA256 and/or RIPEMD-160 were broken, would all bitcoin addresses be compromised?

(Asked by: username_0 on 2013-03-26)

If not, what else would be needed to steal all funds from all people and completely break bitcoin?

I bet some will say ECSDA gives bitcoin an additional layer of protection. I counter this by saying ECSDA is dependent on a hash function such as SHA256. So I will ask this as well: What kind of ECSDA does bitcoin use and would it still be protected if SHA256 were broken?

Yes, I know I am illustrating an unlikely scenario but I still believe we should know what will happen.

If you want to mention other hash functions in relation to SHA256, you can. Feel free to explain how RIPEMD-160 would keep bitcoin safe in case of a SHA256 exploit.

**Tags:** address, cryptography, ecdsa, hacking, sha256


---

## 2 answers

### Answer by username_3 on 2013-03-26. Score: 7 | Accepted answer

Bitcoin uses SHA256 followed by RIPEMD-160, which I'll collectively call HASH160.

Good hashes have 4 properties:

1. it is easy to compute the hash value for any given message
2. it is infeasible to generate a message that has a given hash
3. it is infeasible to modify a message without changing the hash
4. it is infeasible to find two different messages with the same hash

Source: [Wikipedia](http://en.wikipedia.org/wiki/Cryptographic_hash_function)

We care about properties 1, 2, and 3. We know for a fact that property 1 is true about HASH160 - we can benchmark it. If properties 2 or 3 were false, then you could steal bitcoins. Not good.

It's a good thing that [the scripting language](https://en.bitcoin.it/wiki/Script#Standard_Transaction_to_Bitcoin_address) is so flexible, and would allow people to switch to a different address type without forcing everyone to upgrade.

This is a current bitcoin transaction script:

```
 OP_DUP OP_HASH160 09432ab39083b5098b6f09432ab39083b5098b6f OP_EQUALVERIFY OP_CHECKSIG

```

Here's how that might change if HASH160 were broken:

```
OP_DUP OP_HASH256 09432ab39083b5098b6f09432ab39083b5098b6f09432ab39083b5098b6f826496 OP_EQUALVERIFY OP_CHECKSIG

```

Note that we've swapped HASH160 for HASH256. Or, assuming both were broken:

```
<pubKey> OP_CHECKSIG

```

Now we're forgoing hash functions entirely and putting in the ECDSA key explicitly. However, this would make bitcoin addresses about a hundred characters long.

> **Comments:**
> **username_4**: Could you elaborate on what would be necessary to "switch to a different address type" insofar as what users with bitcoins on the old address type would have to do to move over. Would everyone just have to create new addresses and move all their bitcoins?  
> **username_3**: @BT Yes. The addresses would be much longer, though.  
> **username_4**: Got it, cool. That doesn't sound so bad actually then. At least, not catastrophic.  
> **username_5**: To spend bitcoins, you need to have the corresponding private key. The bitcoin address is derived from the public key. If the hash function could be compromised regarding 2. one could reveal the public key. This would still require elliptic curve cryptography to fall apart before an attacker could steal your money. An attack to 3. does not help for a bitcoin address at all. Finally if 4. would be weakened it would still not really help as you would have to randomly generate key-pairs to find a collision. You can already do that now but chances are bigger to find alien life in universe.  

---

### Answer by username_1 on 2013-08-16. Score: 0

username_3's answer is very helpful, but might not be sufficient to get us (and BitCoin) in the clear. There may be a valid and grave concern based on the fact that crypto hashing functions aren't proven to satisfy constraints 2 and 3, so they potentially can be weak.

Even though people could switch away from a crypto hashing function to a better one, what would allow us to know for sure that someone isn't silently using the weakness of the hashing function to steal? Going undetected would allow you to leech from the bitcoin system, perhaps by getting a enormous share of mining rewards without expending nearly as much computing power. This kind of arbitrage could allow you to get rich off of every nerd who uses BitCoin (admittedly myself included) and some venture capitalists (I'm getting there ;) ). And since we're speculating, wouldn't it be convenient to tie develop a currency based on crypto if you want to get really rich. Obviously, exploiting it without removing its potential for growth and adoption...

If you know the exploit to SHA-256 and know how to leech off BTC and other crypto currencies, the altruistic and honorable thing to do is publish the exploit. The egocentric thing to do would be to abuse it.

I hope that someone will prove me wrong about this potential for abuse.

If not, it basically comes down to this: with great power comes great responsibility! Everybody says trust isn't needed with BitCoin. It STILL comes down to trust, but now trust that no one came up with this loophole or that the one who did isn't breaking the system more than it's contributing societal value.

I'd really have big respect for the person for choosing honor above personal gain. Unless you siphon the gains to a good cause, but even then I'm sure that a single person isn't best capable of handling those amounts of value. A crowd or even a market knows better how to allocate funds somewhat optimally.

> **Comments:**
> **username_2**: If you knew an exploit to a major crypo algorithms like SHA256, you could sniff people's passwords through SSL, crack their back accounts and drain them of fiat in a swift weekend.    I think bitcoin would be the least of the worlds concerns.  

---

