Skip to content
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

feat(cli): Add web3signer KeySource #365

Open
Tracked by #307
merklefruit opened this issue Nov 7, 2024 · 11 comments
Open
Tracked by #307

feat(cli): Add web3signer KeySource #365

merklefruit opened this issue Nov 7, 2024 · 11 comments
Assignees
Labels
C: bolt-cli Component: bolt CLI
Milestone

Comments

@merklefruit
Copy link
Collaborator

merklefruit commented Nov 7, 2024

Relevant links:

This is analogue to #309 but for Web3Signer.

@merklefruit merklefruit changed the title Integrate with Web3Signer feat(cli): Add web3signer KeySource Nov 7, 2024
@merklefruit merklefruit added the C: bolt-cli Component: bolt CLI label Nov 7, 2024
@EdwardJES
Copy link

Hey @merklefruit, are you guys open to community contributions at the moment?

@merklefruit
Copy link
Collaborator Author

merklefruit commented Nov 25, 2024

Hey @EdwardJES for sure!

We also have a few "good-first-issue" issues sprinkled here and there, but we can provide guidance if you are interested in something more specific

@EdwardJES
Copy link

Okay awesome @merklefruit. This issue really interests me actually. I'll take a deeper look throughout the week on this API and post any details/questions I may have. Ty 🙏

@merklefruit
Copy link
Collaborator Author

Awesome, here for any questions :)

@mempirate mempirate added this to the v0.3.2 milestone Nov 27, 2024
@EdwardJES
Copy link

EdwardJES commented Nov 27, 2024

Hey @merklefruit, I think I'll focus on getting the signing and listing (these map to the post and get requests in https://consensys.github.io/web3signer/web3signer-eth2.html#tag/Public-Key/operation/ETH2_LIST) commands in a draft PR as a first milestone. I think what would really help me is if you could provide an example of the usage of both of these commands, please 🙏 .

I've also been reading this as a reference: https://lighthouse-book.sigmaprime.io/validator-web3signer.html.

@merklefruit
Copy link
Collaborator Author

@EdwardJES sure!

so the goal is to add web3signer as KeySource so that we can use it in our pubkeys and delegate commands.
The delegate command is the most important, and it is used to read a keystore and generate signed delegation messages.
Here is an example:

bolt delegate --delegatee-pubkey 87a0...d3b3 local-keystore --path validators/ --password-path secrets/

in this example the KeySource is LocalKeystore which looks for an EIP-2335 keystore.
We also have one KeySource for Dirk and this issue is to add Web3Signer to that list.

For how I imagine this to be used:

bolt delegate --delegatee-pubkey 87a0...d3b3 web3signer [options]

[options] here will depend on what Web3Signer actually needs to connect, I haven't looked into its authorization methods yet.
Let me know if this is helpful in any way or if I can help clear up other parts.

post and get requests in consensys.github.io/web3signer/web3signer-eth2.html#tag/Public-Key/operation/ETH2_LIST) commands in a draft PR as a first milestone.

that sounds awesome.

@EdwardJES
Copy link

EdwardJES commented Nov 29, 2024

Hey @merklefruit, thank you for the prompt and detailed reply. That makes sense.

I just wanted to clarify another thing 🙏. The Web3Signer ETH2 REST API, specifically https://consensys.github.io/web3signer/web3signer-eth2.html#tag/Signing/operation/ETH2_SIGN does not support signing over arbitrary payloads, such as a delegation and only supports those listed in the type field of the schema. This makes having the Web3Signer server as a keysource a bit tough.

I believe the pubkeys command is still possible via https://consensys.github.io/web3signer/web3signer-eth2.html#tag/Public-Key/operation/ETH2_LIST.

There may be a path forward for the delegate command using the Web3Signer CLI, but unsure if this was the intention for this issue, https://docs.web3signer.consensys.io/how-to/load-keys.

Thank you.

@merklefruit
Copy link
Collaborator Author

Ah, good point, this throws a wrench in our plan to generate delegations.

However, I see that Web3Signer has implemented the commit-boost signing api here: Consensys/web3signer#1045 (just 2 days ago!)

I think we could use it for our goal since it allows for a generic consensus signature to be generated over an objectRoot, which is what we need. However since this feature is not released on Web3Signer yet, we'll have to either test by building it from source or wait for a release.

Even if there are no docs, it looks like they are following the commit-boost api specs that can be found here: https://commit-boost.github.io/commit-boost-client/api.

@EdwardJES
Copy link

Nice find! Awesome, I don't think the pending release should be a blocker. I'll work from this 💪

@EdwardJES
Copy link

EdwardJES commented Dec 3, 2024

Update: things are progressing well. I have the account listing and and signing tests passing for commit boost using the Web3Signer. I think I'll be able to have a draft PR up by end of the working week.

@merklefruit
Copy link
Collaborator Author

Great! Thanks for the update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: bolt-cli Component: bolt CLI
Projects
None yet
Development

No branches or pull requests

3 participants