Skip to content
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

Streamline key and alias specifications for AccountCreateTransaction #2177

Open
0xivanov opened this issue Jan 16, 2025 · 0 comments
Open

Streamline key and alias specifications for AccountCreateTransaction #2177

0xivanov opened this issue Jan 16, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@0xivanov
Copy link
Contributor

0xivanov commented Jan 16, 2025

Description

New methods need to be added to the SDK in order to streamline account key specifications with considerations for alias.

The following APIs need to be added in AccountCreateTransaction:

  • setKeyWithAlias(ECDSAKey) - Sets ECDSA private key, derives and sets it's EVM address in the background. Essentially does setKey(Key) + setAlias(Alias)
  • setKeyWithAlias(Key, ECDSAKey) - Allows for setting the account key and a separate key that the EVM address should be derived from. A user must sign the transaction with both keys for this flow to be successful.
  • setKeyWithoutAlias(Key) - Explicitly calls out that the alias is not set.

The following APIs need to be deprecated in AccountCreateTransaction:

  • setKey(Key)

Test plan

  1. When an account is created with an ECDSA key with setKeyWithAlias , then the created account has the ECDSA key as its key and the ECDSA key as its alias.
  2. When an account is created with a Key and an ECDSA key with setKeyWithAlias, then the created account has the Key as its key and the ECDSA key as its alias.
  3. When an account is created with a Key with setKeyWithoutAlias, then the created account has the Key as its key and no alias.

Example

  1. Create an account with an ECDSA key using setKeyWithAlias .
  2. Query the account and verify its key and alias match the ECDSA key.
  3. Create another account with a Key and an ECDSA key using setKeyWithAlias .
  4. Query the account and verify its key matches the Key and its alias matched the ECDSA key.
  5. Create another account with a Key using setKeyWithoutAlias.
  6. Query the account and verify its key matches the Key and it has no alias.
@0xivanov 0xivanov added the enhancement New feature or request label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants