-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing a standard key manager API #439
Comments
hi @joaquim-verges, Thank you for your proposal. It would be great to have these improvements to web3signer.
Let us know if you have any more questions either here or on our discord channel. |
Thanks for your input! Could you drop an invite to the Discord channel? I agree this API routes should be served on a different namespace since the permissions will likely be very different |
Thank you @jframe ! Started working on this and have follow up question on 2. Right now there is an assumption that each runner has a single Open API spec resource (yaml file), and a single a. Put the new API definitions in the existing b. Have a separate yaml spec for the new API. Correct me if I'm wrong, but this would requiring creating a separate c. Another option could be to register additional routes in code on the existing Let me know what you think about these approaches, or if you can think of a better one? |
hi @joaquim-verges, So for option b, looks like the vertx openapi module we are using doesn't support multiple openapi specs for a single I think option a will probably be the way to go with separating out the yaml files. It fits the existing pattern with each Runner having their own set of endpoints provided by a single openapi spec so will be easier to get started with. If you are able to seperate the key manager api to a seperate openapi spec file using $ref or another approach that would still keep the open api files relatively clean. |
Thanks @jframe - that's where I was leaning towards as well. Will re-organize the yaml file a bit to keep it clean. |
@jframe @dapplion here's another question/concern: Currently:
With the new API allowing to import keys, how do you envision the user flow? Can I import keys while my web3signer is running and dynamically add a new signing key or should it require a restart? The latter would be simpler of course, we could just save the imported keystores into their own files and let the user know they need to restart their signer for the new keys to take effect? (same for delete keys i guess?) @dapplion maybe you have a better idea of what the user flow should look like in this case? |
It is possible to load new keys without restarting web3signer by using the reload endpoint. From a user flow perspective I think the ideal would be that as soon as the key was imported it would be available to use i.e. sign and available on the list keys endpoint. @dapplion Is this the intent of the import success case that once it is decrypted and in the key manager storage it is available to sign with? |
Yep, the imported keys should be live straight away (which is how we're implementing it in Teku). And for the delete case it's critically important that the keys are removed and can no longer sign before returning from the call. And that returned slashing protection data should be completely up to date. I wrote up a plan for handling this in memory in Teku at Consensys/teku#4559 which may be useful - we'd also have to delete the files on disk to prevent them loading again on the next restart (I think we'd do that before deleting from memory to ensure we can). |
@joaquim-verges Yes keys must be importable and deletable while the application is running without requiring any restart. |
@dapplion got it. One more question: should the keys imported via the API be persisted? Like if I restart web3signer, should it launch again with the previously imported keys? Asking to know if it's enough to keep the keys imported via API in memory or if they need to be persisted on disk somewhere. I assume we want to persist the keys on disk, but want to make sure that's ok from a security standpoint? |
Yes, imported keys must be persisted in disk. If that's not clear in the API spec please feel free to drop a comment there. |
Ok, here's in my mind the list of tasks needed to make this happen:
Let me know if I covered everything, and if it sounds accurate. |
Task breakdown looks great! Feel free to add it to the main issue body with
so it easier to get for external readers |
@joaquim-verges Removing keys dynamically at runtime isn't currently supported. So we will have to take the approach of removing it from memory first and make unable to be signed before removing the key file and returning the result. This also need to be done in such a way that other signers sharing the database can't sign. This is something we will probably want to add to the ArtifactSignerProvider. |
Adding auth would be great. |
Definitely would be. We have a ticket to implement that with #545 |
I'm looking to help out on this proposal by @dapplion.
Working branch: https://github.com/joaquim-verges/web3signer/tree/keymanager
The branch will be broken down into individual PRs for each of the main tasks below.
Tasks breakdown
Context
The high level goal of this work is to increase client diversity by making it easy for individual stakers to spin up a minority client.
Working backwards from that high level goal, a possible solution would be to:
@dapplion has a proposal for such standard API
From there, a solution could be to implement that standard API in web3signer, and have the minority clients use web3signer as their remote signer following the EIP-3030 standard.
Any client doing this could get a simple, standard frontend "for free" to manage keys, and therefore would unlock the possibility to list them in a platform like DAppNode, greatly simplifying the workflow for individual stakers.
Open questions
Before I attempt an implementation of this API, I have some questions I'm hoping to get some answers to.
Let me know if I'm thinking about this the right way, and please correct any of my assumptions!
The text was updated successfully, but these errors were encountered: