ethereum / go-ethereum

Go implementation of the Ethereum protocol
https://geth.ethereum.org
GNU Lesser General Public License v3.0
47.19k stars 19.98k forks source link

Make `clef` scalable #20363

Open holiman opened 4 years ago

holiman commented 4 years ago

The clef binary is meant to be a secure key management tool, which can be used to separate key management from the actual node operation.

It inherently uses the same data model that's already in the go-ethereum library, which is,

However, there is one usecase which doesn't really fit; when a user has millions of keys. The problem with the keystore is,

Primary problem

This works fine for a handful of addresses, but does not scale.

In order to cater for this type of usecase, we would need an additional data storage format -- not based on keystore files. A problem with keystore files, is that although the actual address is commonly in the actual filename, this has never been mandated.

Secondary problem

There is also a secondary problem: apart from the actual key data, clef maintains a separate database of metadata, contaiing

If a user has 5M keystores, it should also be possible to have 5M passwords. Currently, this would probably not scale well. Although each password is individually encrypted in an aes-gcm container (so the entire thing doesn't need to be decrypted), I suspect that it might be pretty slow to access one of them, since the whole thing is loaded into memory first.

Possible solutions

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

tmm360 commented 2 years ago

Don't close. I think it's an important improvement.