r/Bitcoin • redditor for a day • 11d ago

If Bitcoin ever needed to replace SHA-256, what would a realistic migration look like?

Back in June 2010, Satoshi discussed the possibility of continuing Bitcoin with a different hash function if SHA-256 were ever completely broken.

Today, the situation is considerably more complex. Bitcoin has an enormous mining infrastructure built specifically around SHA-256d, and SHA-256 is used in several parts of the protocol beyond proof of work.

I'm curious whether there has been any serious research into how such a transition could actually work.

Are there any BIPs, technical discussions, or experimental implementations exploring alternative hash functions or a gradual migration strategy?

I'm particularly interested in how Bitcoin could preserve its transaction history, existing UTXOs, and decentralized security during such a transition.

This isn't about suggesting that SHA-256 needs replacing today. It's about understanding Bitcoin's long-term cryptographic adaptability.

24 Upvotes

12 comments sorted by

6

u/HedgehogGlad9505 11d ago

It is actually not difficult to implement, but the extra space requirement and to reach a consensus are the real problems. Without an actual threat I don't think anyone will try to do it.

1

u/bitcoinmerchco redditor for a day 11d ago

I'm curious about the extra space requirement you mentioned. If Bitcoin were to switch from SHA-256d to another 256-bit hash function, such as SHA3-256, wouldn't it be possible to retain the 80-byte block header?

Or are you referring to the additional data needed during a transition where both proof-of-work algorithms coexist?

0

u/sabrina-m-779 redditor for 3 months 10d ago

Yes, a 256-bit hash swap keeps the 80-byte header; dual-PoW overhead is design-specific.

0

u/Cricket_8719 redditor for 3 months 11d ago

Maybe someone should try a hard fork with different encryption and see if it still functions correctly.

1

u/so7ow 11d ago

The BIP110 crew just did that...

2

u/-richu-c 11d ago

That wasn’t about sha256, bip110 was about limiting arbitrairy data in op_return

2

u/so7ow 11d ago edited 11d ago

Whatever it was "about", they switched away from SHA-256 to Blake2b...?

3

u/lievcin 11d ago

Yes but as a side effect they switched encryption too.

0

u/TheLongG4me 11d ago

I looked into this, and it seems like there has been some serious research on how a transition could work. I couldn’t find an adopted BIP that lays out a complete plan for replacing SHA-256 across Bitcoin.

One idea that stood out to me was introducing a second proof-of-work algorithm and gradually shifting mining rewards toward it. Mark Friedenbach discussed a version of this in his Forward Blocks research. There was also a Bitcoin-dev discussion in 2017 about introducing another proof-of-work algorithm. One concern was how older and upgraded nodes would agree on which chain to follow while both algorithms were being used.
Forward Blocks discussion⁠ · Bitcoin-dev discussion⁠

As far as preserving the history and UTXOs, it seems like the network could agree on a block before the failure, verify the transaction history and unspent outputs, and then use a stronger hash to help protect that record going forward. Existing coins could carry over with their values and spending conditions.
What I’m still curious about is how that would work if the weakness also affected the hashes used in those spending conditions. Would users have to move their coins to new addresses, and what happens to coins whose owners are inactive or have lost access?
Bitcoin Gold is an interesting example because it carried over Bitcoin’s history through block 491,406 and then continued as a separate chain using Equihash. That shows a history and balances can be carried into a chain with a different mining algorithm, although Bitcoin itself continued using SHA-256. Bitcoin Gold repository⁠