oddsdk / odd-app-template

A sveltekit web app template for the ODD SDK.
https://odd-template.fission.app
MIT License
29 stars 10 forks source link

Add username support for filesystem recovery #92

Closed bgins closed 1 year ago

bgins commented 1 year ago

Summary

Problem

The proposed plan for filesystem recovery will recover the filesystem and assign it to a new user. We want users to have the experience of keeping their username, while underneath assigning them a new account.

Impact

Without this feature users may be upset they have lost their username when they recover their filesystem.

Solution

As a proposed solution, we append a # and the user's DID (or a portion of it) to the username to guarantee that it is unique. When a user recovers their filesystem, we create a new key pair and register them with the new DID in their username.

One complication is that a username with a # will not be URL-safe and should be hashed/encoded so it works in DNS and when performing device linking. We've started to explore a more flexible username system in https://talk.fission.codes/t/of-webnative-usernames-and-identifiers/3031 and https://github.com/fission-codes/webnative/issues/385, but perhaps we can move this work forward without depending on these changes to Webnative? What if we didn't use a # for example, but picked something known safe as a separator?

Also, we don't need to use the DID in the username. It just needs to be something to make the new name unique!

One other nice to have is a short string appended to the username. For example, selecting six characters from the DID is easier for user's to read and could become important when sharing private files. (This assumes six characters are enough to give us enough uniqueness.)