user115192: I am writing an indexer that will work with various blockchains and not just Bitcoin. I am wondering if it is safe to assume that block hashes will be unique for a given blockchain, across reorgs.
Is it possible that the data in two blocks ends up hashing to the same value...such that we now have two blocks with same hash either in the canonical chain or one in canonical and one in a reorged chain?

user208: Assuming SHA256 isn't broken, this isn't possible in Bitcoin, as the only way to find data that hashes to the same thing is when the data is the same. Since every Bitcoin block contains a hash of its parent, and thus indirectly commits to its entire ancestry, blocks with distinct history will always have distinct contents.
This is probably the case for many similar and not too similar systems as well, but it's hard to answer generically as the term blockchain tends to be very loosely defined only. It's also off topic here.

115192: <p>I am writing an indexer that will work with various blockchains and not just Bitcoin. I am wondering if it is safe to assume that block hashes will be unique for a given blockchain, across reorgs.</p>
<p>Is it possible that the data in two blocks ends up hashing to the same value...such that we now have two blocks with same hash either in the canonical chain or one in canonical and one in a reorged chain?</p>
 208: <p>Assuming SHA256 isn't broken, this isn't possible in Bitcoin, as the only way to find data that hashes to the same thing is when the data is the same. Since every Bitcoin block contains a hash of its parent, and thus indirectly commits to its entire ancestry, blocks with distinct history will always have distinct contents.</p>
<p>This is probably the case for many similar and not too similar systems as well, but it's hard to answer generically as the term blockchain tends to be very loosely defined only. It's also off topic here.</p>
