You don't need to assume block hashes will be unique for a given blocks chain.
If you are fearful it could cause a collision, then assume block hashes will be unique for a given blocks chain and for a block mining date and time.
That's going to fix your problem, which is to correctly model blocks and block chains, in your application's data layer.
Then, when ...
"What you're really asking about is the collision resistance of SHA-256. A collision has never been found ..."
Correct me if I am wrong, but in my opinion although extremely unlikely, collisions must exist because the header is 80 byte = 640 bits, which is less than the hash length of 256 bits.
Yes, I believe there can be many nonce values that produce a hash whose numeric value is less than the current target. Particularly as other data can be varied too. The probability obviously depends on the target.
The order in which a miner tries nonce values is not prescribed but is any order chosen by the miner.
How does solving a block work in ...
First of all, the relation between security level and the number of bits involved is non-trivial, and depends on the sort of attack we're talking about. For what follows, there are roughly 3 ones that matter:
preimage resistance of a hash function: This is how hard it is for an attacker to find a piece of data that hashes to a given hash. So,...
In Bitcoin's consensus rules (block and transaction validity rules):
Transactions hashes (txids and wtxids) are computed as double-SHA256 of their serialization (without and with witness data, respectively).
Block Merkle roots are computed by repeatedly pairwise double-SHA256 hashing, starting from the list of txids in a block, until only a single element ...
If the number of leaves is exactly a power of two (i.e., n = 2k), then the number of hashes performed is exactly n-1. This is easy to see: every hash operation takes two inputs, and reduces them to a single one. After n-1 operations, that means n nodes are reduced to 1, and that one is the Merkle root.
When the number of leaves is not a power of two, it's a ...