ByronAddress
- class cometa.address.byron_address.ByronAddress(ptr)[source]
Bases:
objectRepresents a Byron-era Cardano address.
Byron addresses are the original address format from the Byron era of Cardano. They use Base58 encoding and contain attributes such as an encrypted derivation path and optional network magic for testnet identification.
- classmethod from_credentials(root, attributes, address_type)[source]
Creates a Byron address from a root hash and attributes.
- Parameters:
root (Blake2bHash) – The root hash of the address (typically a hash of the public key).
attributes (ByronAddressAttributes) – Address attributes including derivation path and network magic.
address_type (ByronAddressType) – The type of Byron address (PUBKEY, SCRIPT, or REDEEM).
- Returns:
A new ByronAddress instance.
- Raises:
CardanoError – If address creation fails.
- Return type:
Example
>>> root = Blake2bHash.from_hex("00" * 28) >>> attrs = ByronAddressAttributes.mainnet() >>> addr = ByronAddress.from_credentials(root, attrs, ByronAddressType.PUBKEY)
- classmethod from_address(address)[source]
Creates a ByronAddress from a generic Address.
- Parameters:
address (Address) – A generic Address that must be a Byron address.
- Returns:
A new ByronAddress instance.
- Raises:
CardanoError – If the address is not a Byron address.
- Return type:
- classmethod from_base58(base58_string)[source]
Creates a ByronAddress from a Base58-encoded string.
- Parameters:
base58_string (str) – The Base58-encoded address string (e.g., “Ae2td…”).
- Returns:
A new ByronAddress instance.
- Raises:
CardanoError – If parsing fails.
- Return type:
Example
>>> addr = ByronAddress.from_base58("Ae2tdPwUPEZ...")
- classmethod from_bytes(data)[source]
Creates a ByronAddress from raw bytes.
- Parameters:
data (bytes | bytearray) – The serialized address bytes.
- Returns:
A new ByronAddress instance.
- Raises:
CardanoError – If parsing fails.
- Return type:
- property root: Blake2bHash
Returns the root hash of the address.
- property attributes: ByronAddressAttributes
Returns the address attributes.
- property address_type: ByronAddressType
Returns the Byron address type.