2

What if two public keys have the same hash? Although the chance is very very small, I am still interested in what would happen.

Suppose that Alice makes a transaction to Bob using Pay To Public Key Hash (P2PKH) style signature script.

But Carmen has another public key, and the hash of Carmen's public key and Bob's are the same.

When Carmen turns on the Bitcoin wallet software, is there any extra balance?

Can Carmen spend the balance?

2

In your scenario, Carmen can simply see and spend the money as if it was theirs.

The network does not have any way of distinguishing this event.

1

Spending a P2PKH script has the following conditions:

  • The public key must hash to the expected hash
  • The signature must be valid when verified with that public key.

So yes, Carmen would see extra balance and would be able to spend it.

However, that's really impractical

Not the answer you're looking for? Browse other questions tagged or ask your own question.