@yawnbox Signal server can lookup ACI (account identifier) by username because this is what Signal client asks it for:
https://github.com/signalapp/Signal-Server/blob/4aa42466952ad81a6a48e8fa71ad5c456e71a022/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountController.java#L382
getAccountIdentity always returns E164 (phone number) given the ACI:
https://github.com/signalapp/Signal-Server/blob/4aa42466952ad81a6a48e8fa71ad5c456e71a022/service/src/main/java/org/whispersystems/textsecuregcm/grpc/AccountsGrpcService.java#L88
Looks like the server can lookup phone number by username.