Using Bluetooth to rapidly connect and send data?
Is there a way to do this with current Bluetooth (i.e. Bluetooth Low Energy, BLE, which is present on most all phones from the last few years)?
The answer is &quot;yes, probably&quot;. It's not &quot;yes, certainly&quot; because your requirements are still vague regarding battery life, amount of data transferred, and time for the communications. And there may be issues with specific phone operating systems (Android, iOS, or other) that interfere with your intent.
Basically you will need to develop an app that causes the phone to act as both a peripheral -- sending out advertisements -- and a central -- scanning for other phones that are advertising. It might alternate between these roles, or execute them concurrently. When a scanning phone picks up an advertising phone, it can verify it's never been connected to it before, then connect and perform the data exchange. Sending 20kB in a few seconds is possible with BLE data rates.
Both the advertising and the scanning will use battery energy, the scanning being the bigger consumer, but it will depend on the advertising frequency and the scanning interval. Move to the next step in getting your specs defined, then start developing a proof-of-concept app.