-
Notifications
You must be signed in to change notification settings - Fork 4
cli: Support import and export of key pairs #413
Comments
This is exactly how I pictured doing the |
I gave this some more thought and I'm not sure whether it's worth implementing this feature. The way I imagine the feature,
Now, note the number of cases and the steps that a user has to go through to friendly import and export key-pairs. Wouldn't it be much simpler to let the user know where the key-pairs are stored and let them copy-paste them between Lastly, this features comes in to address a use case that wouldn't have been necessary if it wasn't for this confusion created by our docs: https://radicle.community/t/spinning-up-a-testnet-node-first-user-experience/196/5. So I vote to not introduce this in the end but prettify the key-pairs.json file and document how to transfer keys between machines. |
What's wrong with that? As a user I would just call
As a user I would consider this default behavior unexpected and dangerous. My keys are extremely sensitive and I want full control and awareness of what's going on with them. I would prefer to see an error, unless I pass
Maybe we could get away with not having an interactive CLI if we add a
I find this solution much more error prone and dangerous. First we must add a command, which will tell the user the location of the file on their specific system. Then we're asking them to manually edit a dotfile in a machine format containing the keys to their assets. It's like giving a guy a scalpel and asking him to make an operation on his own open heart. I think that we should make it possible and natural to never touch this file. Another point is our freedom with the format - being user editable is a major design limitation. It must be readable by humans (no switch to BSON, no encryption), must never change its format (no switch to YAML, all the format updates must be optional) and must contain only data, which can be moved atomically (no state (e.g. operation counter), no global metadata (e.g. hash of the whole file)).
The docs confusion was the first time we've encountered the keys migration use case, but it's valid on its own. We must think about a way to move the keys, they mustn't be locked on one machine by design. |
Note that you point out the user-unfriendly step there: to perform a step, you first need to perform another one, which requires copy-pasting sensitive data to some location (say, a new terminal tab or a notes tool) where you can both see it and perform the second step, the one that you actually want to perform.
It's only as unexpecting as the user lets it be, right? they specify the paths... Anyway, my suggestion is to interactively ask the user whether that's really the intended action, so it's not more dangerous than your counter-proposal which I'd be fine with.
Could you expand?
I agree with your argument about the format.
I agree the feature makes sense to exist, but so probably do many more. I prefer to be lean and not implement every single feature that might potentially be used, that's all. |
This step is optional, it's only a helper when the user doesn't remember the name.
Key pair name isn't sensitive.
This command could return a list of names of the keys stored in the imported file.
Of course, it's an issue tracker, not a to-do list for today morning 😉 |
I know, my point is that is, most likely, something users would have to do more often than not.
I was imagining copying the whole things since it'd be too much effort to copy only the entry keys. There could also be the case that the user needs to check on the address and not on the key pair name. (for example, they have been using an address for mining but can't remember which name identifies it(
As a user, I'd much rather have the import being interactive. |
We need to be able to migrate the accounts between machines.
The proposition:
Add commands:
account export
, which exports accounts to a fileaccount import
, which imports accounts from a fileThe file should store the accounts' metadata, e.g. a human readable name. We can reuse the format of
accounts.json
.account export
should allow exporting either all the accounts or only the chosen ones, specified by their names.account import
should add all the accounts from the given file. When importing an account, which already exists, it should be silently ignored, when it's exactly the same (most importantly the seed), but should cause an error otherwise.The text was updated successfully, but these errors were encountered: