chainbound / bolt

Bolt: permissionless proposer commitments on Ethereum
https://docs.boltprotocol.xyz
MIT License
73 stars 15 forks source link

feat(cli): Add `web3signer` KeySource #365

Open merklefruit opened 3 weeks ago

merklefruit commented 3 weeks ago

Relevant links:

This is analogue to #309 but for Web3Signer.

EdwardJES commented 5 days ago

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

merklefruit commented 4 days ago

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 commented 3 days ago

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 commented 3 days ago

Awesome, here for any questions :)

EdwardJES commented 2 days ago

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 commented 1 day ago

@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 commented 4 hours ago

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, though it will add complexity and scope, https://docs.web3signer.consensys.io/how-to/load-keys.

Thank you.