feat: add ECDSA keystore support for enhanced security #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements ECDSA keystore support to address the security concerns raised in issue #16. The current approach of using raw private keys in environment variables exposes sensitive cryptographic material, creating security risks for node operators.
Related Issue
Closes #16
Changes Made
Core Infrastructure
src/utils/ecdsa_loader.go
)LoadECDSAKey()
function with keystore file support and environment variable fallbackGetECDSAKeystoreFlags()
for consistent flag definitions across commandsUpdated Commands
bin/avs-cli/arpa/arpa.go
)register-node
- supports bothPRIVATE_KEY
env var and keystore filesgenerate-registration-signature
- supports bothADMIN_1271_SIGNING_KEY
env var and keystore filesbin/avs-cli/update_ecdsa_signer.go
)PRIVATE_KEY
env var and keystore filesbin/avs-cli/witness-chain/prepareRegistration.go
)WATCHTOWER_PRIVATE_KEY
env var and keystore filesNew Command Line Flags
All updated commands now support:
--ecdsa-keystore
- Path to encrypted keystore file--ecdsa-password
- Password for keystore fileTesting
src/keystore/keystore_test.go
)src/utils/ecdsa_loader_test.go
)Documentation
Migration Path
For Node Operators (Recommended)
Backward Compatibility (Legacy)
Existing workflows using environment variables continue to work unchanged:
Testing
Security Improvements
Breaking Changes
None. This PR maintains full backward compatibility with existing environment variable usage.