0

This may be a bad question, but I am just getting started and you have to start somewhere.

I have seen it discussed that generating the same public key as someone else is theoretically possible but has such a low probability that we don’t need to think about what would happen if this event occurred. I am content with this.

But, if I go and create a public key tomorrow (which I understand to be a completely offline thing) it seems that it could be simple to at least check and see if that public key has ever been used in a transaction before. I believe I have read that nodes keep a list of public keys with unspent Bitcoin for quick verification in processing transactions, this could theoretically be used for the check I describe. This would make me feel more certain that at that time I do indeed have a public key distinct from all other public keys (the only possibility being that someone might have that same public key, but has never received Bitcoin).

So I understand the probability is horrendously low, I’m not concerned about it actually happening, I just want to understand in a theoretical since but if that check would be simple enough to to perform as a just in case. Is such a check possible?

2 Answers 2

4

You have pretty much answered your own question.

Yes, such a check would be possible, but it would have a cost (need a database lookup, at least). That cost isn't worth it, because the risk of actually finding an address that has been created by someone else before is so utterly mindbogglingly small - it just won't ever happen.

Furthermore, even if such a check would be done, it would have severe limitations:

  • Only full nodes (which have access to their own unspent coin list) could do it directly; other wallets would need to query another service, which is inherently a privacy risk.
  • Hardware wallets are obviously unable to do this at all, as by definition they cannot access the internet.
  • Even on full nodes, generally no by-address index exists of the unspent coins list; only a list optimized for access by created-by-txid. Since it's an unspent coins list, it cannot account for addresses that were used in the past but don't currently have any coins assigned to them.
  • Even ignoring all that, such a check can only account for addresses that have actually been used. There are probably far more addresses created (and thus someone already has the key for) than have ever been sent to.
1

Unfortunately if we want to keep the software performant, we simply can't be implementing new logic that is expensive and we are absolutely certain will never be used. Your concern would be better placed elsewhere in software safety, reliability or operational security than in situations which we simply know are impossible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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