Addresses are not "registered" anywhere.
The only way your wallet will know that someone generated the address will be if they send bitcoins to it. Oh, what a horrible problem to have if someone sends you so many bitcoins that they crash your wallet.
Well that is the problem, if it isnt registered into the network, then how does the network know that that address is mine and not some1 elses address.
Because you are the only person that has the private key for that address. If you don't have exclusive control of the private key, then you don't have any bitcoins.
Because if that address doesnt exist yet in the network, then if I generate that address offline, and dont broadcast that.
Correct.
But if John next door generates that addres too,
He can't. Not unless there is something wrong with the software that you are using to create the address.
and he does broadcast it, then if somebody sends me a sum to my address, actually it will go to John.
Correct. If you use faulty software that incorrectly creates a bitcoin address, then it is possible for John to create the same bitcoin address. Then, you will BOTH receive any bitcoins that are sent to that address, and it will be a race to see who spends them first.
This is the part that I never understood about BTC, so I would appreciate it if some1 could clarify.
It is difficult to explain without getting into some technical details that I fear may be more than you are ready to understand, but I'll try.
To create a bitcoin address, you first choose a private key. (Not a password, not a master key) Most bitcoin software hides this part from you. It creates a private key that it keeps hidden from you and doesn't tell you about. Since most software doesn't tell you about the private key, many people don't even realize it's there but it is.
The private key is chosen as a number between 1 and 1.158 X 10
77. The size of that range is HUGE. It is bigger than most people can comprehend. Now if you just picked a "favorite" number then you'd have a chance that two people would have the same "favorite". This would be BAD. So instead, a completely random number in the range is picked by the software. As long as the software does this properly, the odds that the same number will be chosen twice is astronomically small. The odds are so small, that it
literally isn't worth worrying about. If you're going to worry about that, then you should start worrying about the possibility that all the oxygen molecules in the room will spontaneously gather together in one corner of the room and you'll suffocate and die.
Next the public key is calculated using Secp256k1 Elliptic Curve. Given a private key (and knowledge about the appropriate curve) it is very fast and easy to calculate the public key. However, it isn't possible with any current mathematics to calculate the private key from the public key. Finally the public key is run through a few more calculations to result in a bitcoin address.
So, the odds are so great against two people generating the same bitcoin address that there is no need to "register" or "broadcast" an address. All you need to do is keep your private key secret. Your bitcoin software should do this by encrypting all the private keys that it generates. It should do this by using properly random methods of generating private keys. It should do this by generating the transaction signatures properly. It should do this by discouraging you from re-using a bitcoin address more than once.