dat-workshop icon indicating copy to clipboard operation
dat-workshop copied to clipboard

Improve migrations and serialization of keys and data

Open dgrmunch opened this issue 4 years ago • 1 comments

In order to improve migration processes from one device to another, it would be useful to have:

Serialized keys in specificed location

  • An easy way to specify a location for the private key would improve migrations.
  • The possibility of exporting/importing this private key in plain text rather than a binary file would make easier keeping it in a piece of paper, a mnemonic, or a tattoo :D

I think that in a public cryptography-based system is always useful to have handy the key-pairs. This way for any hypercore or hyperdrive you create, you would have a direct access to the public and private keys and could use them both in adition to the expected use, for example for signing and encrypting emails with the same identity.

Additional serialization in JSON

  • I don't know if there is more info which could be useful to keep serialized in json. I was exploring the envs location and found a bunch of folders with binary files I could not understand 🗡️

dgrmunch avatar Sep 16 '20 05:09 dgrmunch

One thing we should not in addition to this is that you need to have a backup of your content somewhere online before you can use your keys, and you need to make sure your new local copy is fully synced with that backup before you try to add anything to it.

Otherwise you risk "forking" the history of your hyperdrive on your new device and corrupting your hyperdrive. Ideally recovering a drive from your secret key should look like this:

  • Open the drive as read-only without the secret key
  • Wait for it to fully sync with all remote peers
  • Close it
  • Open it again with the secret key
  • It should now be safe to write to

Another thing to note is that for Hyperdrive, we actually need two secret keys, one for the metadata feed and one for the content feed.

Potentially it'd be useful to back up your master key from the corestore so you can re-generate all your old hyperdrive and hypercore keys from it.

RangerMauve avatar Sep 17 '20 14:09 RangerMauve