Skip to content

Create validator wallet#481

Merged
popenta merged 5 commits into
feat/nextfrom
create-validator-wallet
Feb 13, 2025
Merged

Create validator wallet#481
popenta merged 5 commits into
feat/nextfrom
create-validator-wallet

Conversation

@popenta
Copy link
Copy Markdown
Collaborator

@popenta popenta commented Feb 11, 2025

Added functionality to create a validator wallet.
Also added functionality to sign a message using a validator wallet and to verify a messages using a bls validator pubkey.

@popenta popenta self-assigned this Feb 11, 2025
@popenta popenta marked this pull request as draft February 11, 2025 12:10
Base automatically changed from validators-refactoring to feat/next February 12, 2025 10:22
@popenta popenta marked this pull request as ready for review February 12, 2025 10:22
Comment thread multiversx_sdk_cli/cli_wallet.py Outdated
"Create a new wallet and print its mnemonic; optionally save as password-protected JSON (recommended) or PEM (not recommended)",
)
sub.add_argument(
"--validator-wallet",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether we should have a separate sub-command, instead.

E.g.

mxpy wallet ... (for user wallets)
mxpy validator-wallet ...

Especially since other sub-sub-commands of mxpy wallet do not make sense for this kind of wallets (e.g. bech32, convert etc.). Actually, some convert functionality could be useful (e.g. PEM to raw hex), but, overall, maybe we can have them separately.

💭

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to a separate sub-command

Comment thread multiversx_sdk_cli/sign_verify.py Outdated

def sign_message_by_validator(message: str, validator: ValidatorSigner) -> SignedMessage:
message_computer = MessageComputer()
serialized_message = message_computer.compute_bytes_for_signing(Message(message.encode()))
Copy link
Copy Markdown
Contributor

@andreibancioiu andreibancioiu Feb 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For validator wallets, this is not e regular use-case. In the few cases when validator wallets are required to sign a message, they sign the plain variant (raw bytes). Not this special enveloping:

As far as I know (see validators CLI of mxpy).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

sub.add_argument("--message", required=True, help="the message you want to sign")
sub.add_argument("--pem", required=True, type=str, help="the path to a validator pem file")
sub.add_argument(
"--validator-index",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can also be simply "index".

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, fixed

)
sub.add_argument("--infile", required=True, help="the pem file of the wallet")
sub.add_argument(
"--index",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@popenta popenta merged commit a9cc650 into feat/next Feb 13, 2025
@popenta popenta deleted the create-validator-wallet branch February 13, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants