-
Notifications
You must be signed in to change notification settings - Fork 5
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
Pbkdf2 support #45
Pbkdf2 support #45
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,6 +152,7 @@ You can use `new-mnemonic --help` to see all arguments. Note that if there are m | |
| `--folder` | String. Pointing to `./validator_keys` by default | The folder path for the keystore(s) and deposit(s) | | ||
| `--chain` | String. `mainnet` by default | The chain setting for the signing domain. | | ||
| `--execution_address` (or `--eth1_withdrawal_address`) | String. Eth1 address in hexadecimal encoded form | If this field is set and valid, the given Eth1 address will be used to create the withdrawal credentials. Otherwise, it will generate withdrawal credentials with the mnemonic-derived withdrawal public key in [ERC-2334 format](https://eips.ethereum.org/EIPS/eip-2334#eth2-specific-parameters). | | ||
| `--pbkdf2` | Flag | Will use pbkdf2 key derivation instead of scrypt as defined in EIP-2335. This can be a good alternative if you intend to work with a large number of keys. | | ||
|
||
###### `existing-mnemonic` Arguments | ||
|
||
|
@@ -164,6 +165,7 @@ You can use `existing-mnemonic --help` to see all arguments. Note that if there | |
| `--folder` | String. Pointing to `./validator_keys` by default | The folder path for the keystore(s) and deposit(s) | | ||
| `--chain` | String. `mainnet` by default | The chain setting for the signing domain. | | ||
| `--execution_address` (or `--eth1_withdrawal_address`) | String. Eth1 address in hexadecimal encoded form | If this field is set and valid, the given Eth1 address will be used to create the withdrawal credentials. Otherwise, it will generate withdrawal credentials with the mnemonic-derived withdrawal public key in [ERC-2334 format](https://eips.ethereum.org/EIPS/eip-2334#eth2-specific-parameters). | | ||
| `--pbkdf2` | Flag | Will use pbkdf2 key derivation instead of scrypt as defined in EIP-2335. This can be a good alternative if you intend to work with a large number of keys. | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The documentation should also be explicit about this being used for the resulting keystore file(s). |
||
|
||
###### Successful message | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,6 +105,12 @@ def generate_keys_arguments_decorator(function: Callable[..., Any]) -> Callable[ | |
param_decls=['--execution_address', '--eth1_withdrawal_address'], | ||
prompt=lambda: load_text(['arg_execution_address', 'prompt'], func='generate_keys_arguments_decorator'), | ||
), | ||
jit_option( | ||
default=False, | ||
is_flag=True, | ||
param_decls='--pbkdf2', | ||
help='Uses the pbkdf2 encryption method instead of scrypt.', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be moved into the internalization structure with the |
||
), | ||
] | ||
for decorator in reversed(decorators): | ||
function = decorator(function) | ||
|
@@ -115,7 +121,7 @@ def generate_keys_arguments_decorator(function: Callable[..., Any]) -> Callable[ | |
@click.pass_context | ||
def generate_keys(ctx: click.Context, validator_start_index: int, | ||
num_validators: int, folder: str, chain: str, keystore_password: str, | ||
execution_address: HexAddress, **kwargs: Any) -> None: | ||
execution_address: HexAddress, pbkdf2: bool, **kwargs: Any) -> None: | ||
mnemonic = ctx.obj['mnemonic'] | ||
mnemonic_password = ctx.obj['mnemonic_password'] | ||
amounts = [MAX_DEPOSIT_AMOUNT] * num_validators | ||
|
@@ -134,6 +140,7 @@ def generate_keys(ctx: click.Context, validator_start_index: int, | |
chain_setting=chain_setting, | ||
start_index=validator_start_index, | ||
hex_eth1_withdrawal_address=execution_address, | ||
use_pbkdf2=pbkdf2 | ||
) | ||
keystore_filefolders = credentials.export_keystores(password=keystore_password, folder=folder) | ||
deposits_file = credentials.export_deposit_data_json(folder=folder) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation should also be explicit about this being used for the resulting keystore file(s).