etherfi-protocol / etherfi-avs-operator-CLI

MIT License
2 stars 3 forks source link

Loading encrypted key file rather than using private key #16

Open rootwarp opened 2 months ago

rootwarp commented 2 months ago

To send transaction, ECDSA key is required and registerBLS command load ECDSA key from PRIVATE_KEY environment variable, which contains private key of the account.

In here, there are two issues.

  1. Raw private key exposes on public. As always, no one wants to expose this for safety especially node operators.
  2. eigenLayer CLI creates encrypted key file, so AVS operators are familiar with to handle this in general. To get the private key, some extra steps are required for AVS operators and we can reducing unnecessary steps.

If we agree with above, we could make it by,

Set ECDSA_KEY_FILE instead of raw private key, additionally, we should remove environment variable and use flags instead as mentioned at #15 .

If the command can get ECDSA Key file path, use Keystore.LoadECDSA() to load ECDSA Key from keyfile at keystore/keystore.go

seongyun-ko commented 2 months ago

Agreed :)