Hacker News new | ask | show | jobs
by philfrasty 3300 days ago
Can someone explain why bitcoin adresses can be created (offline) without blockchain-validation for duplicates?

Even if the chances are very small I mean...like....gone is gone...no bank to call for a false transaction.

4 comments

Addresses are created offline for scalability reasons, meaning that not having to interact with the blockchain is a feature, not a bug.

There are 2 levels of collision that are theoretically possible. The tldr is that both are really hard, way harder than mining itself, so you'd better spend your time mining that trying to find collisions in the address space.

The first level is that you can generate the same private key, i.e. guessing exactly 256 bit. Prob is 1/2^256.

The second level is that you find a collision in hashing the public key onto the address. Hash is a combination of sha256+rimemd160, but in fact it's a hash onto 160 bits, so the probability of finding a collision is 1/2^80 because of the birthday paradox.

When you generate a new address, you can certainly add an extra step and verifiy if it's used already in the blockchain. If you find a collision, though, please send it to me before discarding it :)

Bitcoin addresses are basically a public key, so you can generate them offline the same way you can generate pgp keys, openssl keys, SSH keys you use to access GitHub etc.

The chances of a collision are so astronomically low that our sun will probably run out of fuel and explode before two identical keys are generated.

With the comfort of a public blockchain at hand why not eliminate this case at address-creation time?
Let's do some back-of-the-envelope calculations.

Let's say the probability of someone cloning a Velociraptor within the next 20 years is 1 in 1 trillion. Let's say that given a Velociraptor has been cloned, it has a probability of 1 in 1 million of escaping. Let's say that given a Velociraptor is on the lam, it has a 1 in 100 billion chance of breaking into your house. Let's say that if there's a Velociraptor in your house, checking for it increases your chance of survival by 1%.

Let's assume there are 1 quadrillion Bitcoin addresses created.

Under the assumption of correct implementation, checking for velociraptors in your closet is literally more rational than checking for duplicate addresses.

Now, there is some value in checking for duplicate keys as a safeguard against implementation bugs, but that's best covered by generating a billion addresses on your own and checking for duplicates within your personal set.

From now on, I'm going to start my explanations about how Bitcoin addresses work with opening a closet to look for velociraptors.
A very succinct way of explaining it, thanks!
Not worth the effort. You could absolutely make a wallet that does this, but you'd have to either do a lookup with a trusted third party, or keep around a bloom filter of used addresses to query against (probably about a gigabyte). We're talking about "winning a lottery jackpot several times in a row" odds.
Blockchain's function is only to prevent double spend. Note that addresses are just a virtual term, in reality when you send money to an address you are setting up a "lock" (predicate) that can be unlocked only by a private key associated with public key that hashes to this address.
You clearly don't understand the scale, here.
You could, but it's simply not necessary. I have not verified the numbers, but I think this answer gives a better idea of the scale we are talking about:

https://bitcoin.stackexchange.com/a/3205

Consider that if you do find a collision, you would be able to take any bitcoin outstanding to said address on the blockchain.

Framed this way, you can see that in fact if your defensiveness is necessary, addresses would be extremely unsafe against targeted attack.

doesn't answer my question.

(accepted answer includes) „...It may be "theoretically" possible...“