Even easier, just get tokens that carry no other information from ones government, and the government runs an API, that for a given token tells whether that token is valid. Can tokens be stolen? Maybe. Can your face be stolen? Today yes.
The communication in connection with a transaction would only go between the identity owner (Bob) and the provider (Cycle shop).
If discord needs to contact an API, then the government can associate the token with you, and you with discord, and know what you browse online. No thank you.