For an on-device solution in exposure notification, an infected phone and healthy phones would exchange Bluetooth keys. Only the infected phone uploads the Bluetooth keys to the server, and then all the other healthy phones download this global key file locally to their phone and see if there's an overlap between the keys that they have and the keys downloaded from the server. As you can see, because it's an on-device calculation and download only, the server does not know anything about John or his contacts. At the same time, if somebody did receive an exposure alert, the server does not know who exactly got the exposure alert.
We have an official exposure notification app deployed in 7 places, details can be found in the link below.