ticktackim / ticktack-workplan

This is the main repo for continuous workplan. For official site, visit
http://ticktack.im
56 stars 6 forks source link

Allow user to retrieve identity private key #122

Closed soapdog closed 6 years ago

soapdog commented 6 years ago

I want a simple user interface for people to be able to export the key.

Need to talk about implementation of how you insert a key back in, and how you know when you’re up to sync with your old self (so you can post without forking)

you can move a key it is not safe to copy and use it in both places

mixmix commented 6 years ago

Minimal things to export ? :

(this could be a test in itself)


We also need to lock the interface from posting while a person gets in sync with themselves. We need to know which pubs to trust about where we're up to. This might require the Ticktack pubs to follow everyone using Ticktack... which means a change to how ticktack gets you using invites.

mixmix commented 6 years ago

When a user first starts Ticktack they're asked :

Then the app starts into different modes based on what they choose.

:warning: - VERY IMPORTANT to save the thing they chose and whether they are up to sync with themselves, because if we don't and they close the app they could easily fork their identity

soapdog commented 6 years ago

Plan B

If the steps mentioned above don't work, a potential plan B is:

Basically an automation of the process we've been currently following for identity recovery. It is a bit messy, and that's why this is plan B and not plan A.

ticktackim commented 6 years ago

@mixmix @soapdog
Currently, I only have designer to make ui to retrieve Secret file, no gossip file. Do you think we must need this to sync the old self? Besides, then do you think we should implement pub invite code for Sprint 4 version based on the previous Sprint 3 ui designs?

soapdog commented 6 years ago

@mixmix

Retrieving the latest sequence for a user

I've been working on our need to find the latest sequence for a given user stored on our pub servers. That got me deep inside the bowels of the scuttlebot replication plugin and muxrpc (which are both a bit beyond my current understanding). While I pondered how to go forward, I had an idea which would greatly simplify this but I wanted to check with someone else before I dive deeper into this.

We'll be only checking the latest sequence with ticktack own pubs, all of which run a ssb-viewer plugin and are listening with standard HTTP protocols. I could simply craft a little url endpoint there that you pass a user id and it returns a JSON object with the latest sequence, like:

http://share2.ticktack.im/latestsequence/@su32i2tvhf

returning:

{
  "id": "@su32i2tvhf",
  "latestSequence": 1246
}

Instead of going deep into talking to pubservers over muxrpc. What do you think? I'd much rather implement it that way.

ticktackim commented 6 years ago

@soapdog @mixmix Do you think we need consult with @dominic for this issue?

发自我的 iPhone

在 2018年5月1日,22:39,Andre Alves Garzia notifications@github.com 写道:

@mixmix

Retrieving the latest sequence for a user

I've been working on our need to find the latest sequence for a given user stored on our pub servers. That got me deep inside the bowels of the scuttlebot replication plugin and muxrpc (which are both a bit beyond my current understanding). While I pondered how to go forward, I had an idea which would greatly simplify this but I wanted to check with someone else before I dive deeper into this.

We'll be only checking the latest sequence with ticktack own pubs, all of which run a ssb-viewer plugin and are listening with standard HTTP protocols. I could simply craft a little url endpoint there that you pass a user id and it returns a JSON object with the latest sequence, like:

http://share2.ticktack.im/latestsequence/@su32i2tvhf

returning:

{ "id": "@su32i2tvhf", "latestSequence": 1246 } Instead of going deep into talking to pubservers over muxrpc. What do you think? I'd much rather implement it that way.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

soapdog commented 6 years ago

Also for the backup file, I am thinking about an encrypted JSON file with the following structure:

{
  "date": "date of the backup",
  "latestSequence": "latest sequence at the time of the backup",
 "secret": {
    ... contents of secret
  },
  "gossip": {
    ... contents of gossip
  }
}

I know that having the latest sequence there is not enough as the user might have posted after doing the backup but it gives us a number that is known to be real, the user has at least that amount of messages (so why not have it there... might be useful).

mixmix commented 6 years ago

hey @soapdog exposing a url could work ok as a first pass. Make it open on both pub servers for redundency... Also, so long as you write your code modular, we can swap in how that sequence is found at a later date. if you're modifying the pubs to do this that's fine as long as it's doesn't take more than 3 hours (made up number)? if it's going to take longer I think geting the sequence from the bowels of scuttlebot gossip is a better plan and we should just get @dominictarr to help with that.

soapdog commented 6 years ago

@mixmix it might be good to get input from @dominictarr, maybe he can do this in a ssb way which is better than my web way. I am not married to my solution here, it is just the solution I think I can implement because I don't think I know how to implement it from ssb gossipy side.

soapdog commented 6 years ago

Export is now working with the following items being added to the export file (which is in JSON format):

At the moment I am not encrypting the export with a password. A good strategy is to make it all work and then add the password routines. Makes it easier to debug.

When the First time usage wizard launches, it allows the user to select between two options:

soapdog commented 6 years ago

I've finally got the import feature working. The code is messy right now, I am cleaning it up and pushing it. I know of some race conditions that need to be solved before we push this to the public such as "making sure that if the user closes the app in the middle of the initial sync, that the process resumes when launched again".

As a little teaser, I have it recorded at this vimeo video