dedis / popstellar

Proof-of-personhood System
GNU Affero General Public License v3.0
35 stars 8 forks source link

Displaying Deterministic Username for a given Token #1915

Open Kaz-ookid opened 3 months ago

Kaz-ookid commented 3 months ago

Context

Throughout the app, we visually refer to users by their PoP Token, which is not user experience friendly at all. As a reference, a PoP token looks like this : ZSCjLTAu1HIUA9i6ooaoSIIdN58L8ZI90FAGKzYxAfA=. For example, when trying to send coins to someone we are given a list of all the tokens of the LAO members. It is impractical to find a given token. Other uses are in the chirps feed and other Social tabs, or in the list of attendees of a Roll Call.

At the end of this Issue will be given screenshots of the current app.

The Idea

FE1 and FE2 need to find a more user friendly way of referring to different users, and the main idea would be a username generated from the token itself. The username generation should be deterministic and collision free, to avoid duplicate and remain consistent through every device and systems. We also do not let the users the choice for their username, since it must reflect their given token deterministically, and also this could imply an identity leak if the user chooses an explicit username.

Implementation Ideas and Details

The first step of this implementation should be :

The username generator should not be the priority for this first step, however, the found solution is not excluded to be the best and final one. A nicely refactored code enables to change the username generator implementation easily.

A second step could be needed, and would include :

What has already been done

FE1 and FE2 have already implemented a common username generator. The usernames are a concatenation of two mnemonics words, and a 4 digits number. The number corresponds to the 4 first digits in a token's hash, starting from the left

Example:

token : d_xeXEsurEnyWOp04mrrMxC3m4cS-3jK_9_Aw-UYfww= mnemonics words generated form the hash : spoon, issue first 4 digits : 0434 final username : spoonissue0434

Annex : Screenshots

image image