Skip to content

Improve AccountId alias handling and extend functionality #1008

@manishdait

Description

@manishdait

The AccountID protobuf definition allows the alias field to contain either:

  • an EVM address (20 bytes), or
  • an alias public key (ED25519 or ECDSA)

Currently, the Python SDK does not reliably distinguish between these formats when decoding alias. This leads to inconsistencies with other SDKs (Java, JavaScript, etc.) and may cause confusion when working with accounts that use alias_key or EVM addresses.

Proposed Solutions:

  • Properly decode alias as either a public key or EVM address
  • Add helper methods to populate missing account numbers or EVM addresses from the mirror node
  • Add serialization helpers (to_bytes / from_bytes)
  • Update from_string and add from_evm_address to simplify creation
  • Make AccountId behavior consistent with other SDKs (Java, JavaScript, etc.)

Metadata

Metadata

Assignees

Labels

Blockchain / DLTIssues engineering distributed ledger functionalityenhancementNew feature or requestintermediaterequires some knowledge of the codebase with some defined steps to implement or examples

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions