If Bitcoin addresses can be generated offline, then the Bitcoin network doesn't check for duplicate addresses while generating a new one. Can't I just make a script and generate milions of Bitcoin addresses and then make a profit when someone will have one of those addresses and sends bitcoins there?
How does the Bitcoin network prevent this?