Certificate

class pycardano.certificate.StakeCredential(credential: Union[VerificationKeyHash, ScriptHash])

Bases: ArrayCBORSerializable

Represents a stake credential in the Cardano blockchain.

A stake credential can either be a verification key hash or a script hash, used to identify stake rights and permissions.

credential: Union[VerificationKeyHash, ScriptHash]
classmethod from_primitive(values: Union[list, tuple]) StakeCredential

Restore a primitive value to its original class type.

Parameters:
  • cls (ArrayBase) – The original class type.

  • values (List[Primitive]) – A list whose elements are CBOR primitives.

Returns:

Restored object.

Return type:

ArrayBase

Raises:

DeserializeException – When the object could not be restored from primitives.

class pycardano.certificate.StakeRegistration(stake_credential: StakeCredential)

Bases: ArrayCBORSerializable

Represents a stake address registration certificate in the Cardano blockchain.

This certificate is used to register a stake address on the blockchain, enabling participation in staking and delegation.

stake_credential: StakeCredential
classmethod from_primitive(values: Union[list, tuple]) StakeRegistration

Restore a primitive value to its original class type.

Parameters:
  • cls (ArrayBase) – The original class type.

  • values (List[Primitive]) – A list whose elements are CBOR primitives.

Returns:

Restored object.

Return type:

ArrayBase

Raises:

DeserializeException – When the object could not be restored from primitives.

class pycardano.certificate.StakeDeregistration(stake_credential: StakeCredential)

Bases: ArrayCBORSerializable

Represents a stake address deregistration certificate in the Cardano blockchain.

This certificate is used to deregister a stake address, withdrawing it from participation in staking and delegation.

stake_credential: StakeCredential
classmethod from_primitive(values: Union[list, tuple]) StakeDeregistration

Restore a primitive value to its original class type.

Parameters:
  • cls (ArrayBase) – The original class type.

  • values (List[Primitive]) – A list whose elements are CBOR primitives.

Returns:

Restored object.

Return type:

ArrayBase

Raises:

DeserializeException – When the object could not be restored from primitives.

class pycardano.certificate.StakeDelegation(stake_credential: StakeCredential, pool_keyhash: PoolKeyHash)

Bases: ArrayCBORSerializable

Represents a stake delegation certificate in the Cardano blockchain.

This certificate is used to delegate stake to a specific stake pool, allowing participation in the proof-of-stake protocol.

stake_credential: StakeCredential
pool_keyhash: PoolKeyHash
classmethod from_primitive(values: Union[list, tuple]) StakeDelegation

Restore a primitive value to its original class type.

Parameters:
  • cls (ArrayBase) – The original class type.

  • values (List[Primitive]) – A list whose elements are CBOR primitives.

Returns:

Restored object.

Return type:

ArrayBase

Raises:

DeserializeException – When the object could not be restored from primitives.

class pycardano.certificate.PoolRegistration(pool_params: PoolParams)

Bases: ArrayCBORSerializable

Represents a stake pool registration certificate in the Cardano blockchain.

This certificate is used to register a new stake pool on the network, including all its operational parameters and metadata.

pool_params: PoolParams
to_primitive()

Convert the instance and its elements to CBOR primitives recursively.

Returns:

A CBOR primitive.

Return type:

Primitive

Raises:

SerializeException – When the object or its elements could not be converted to CBOR primitive types.

classmethod from_primitive(values: Union[list, tuple]) PoolRegistration

Restore a primitive value to its original class type.

Parameters:
  • cls (ArrayBase) – The original class type.

  • values (List[Primitive]) – A list whose elements are CBOR primitives.

Returns:

Restored object.

Return type:

ArrayBase

Raises:

DeserializeException – When the object could not be restored from primitives.

class pycardano.certificate.PoolRetirement(pool_keyhash: PoolKeyHash, epoch: int)

Bases: ArrayCBORSerializable

Represents a stake pool retirement certificate in the Cardano blockchain.

This certificate is used to signal that a stake pool will cease operations at a specified epoch.

pool_keyhash: PoolKeyHash
epoch: int
classmethod from_primitive(values: Union[list, tuple]) PoolRetirement

Restore a primitive value to its original class type.

Parameters:
  • cls (ArrayBase) – The original class type.

  • values (List[Primitive]) – A list whose elements are CBOR primitives.

Returns:

Restored object.

Return type:

ArrayBase

Raises:

DeserializeException – When the object could not be restored from primitives.

class pycardano.certificate.StakeRegistrationConway(stake_credential: StakeCredential, coin: int)

Bases: ArrayCBORSerializable

Represents a stake registration certificate in the Conway era of Cardano.

This certificate is used to register stake rights with an associated deposit amount in the Conway era.

stake_credential: StakeCredential
coin: int
classmethod from_primitive(values: Union[list, tuple]) StakeRegistrationConway

Restore a primitive value to its original class type.

Parameters:
  • cls (ArrayBase) – The original class type.

  • values (List[Primitive]) – A list whose elements are CBOR primitives.

Returns:

Restored object.

Return type:

ArrayBase

Raises:

DeserializeException – When the object could not be restored from primitives.

class pycardano.certificate.StakeDeregistrationConway(stake_credential: StakeCredential, coin: int)

Bases: ArrayCBORSerializable

Represents a stake deregistration certificate in the Conway era of Cardano.

This certificate is used to deregister stake rights and reclaim the deposit in the Conway era.

stake_credential: StakeCredential
coin: int
classmethod from_primitive(values: Union[list, tuple]) StakeDeregistrationConway

Restore a primitive value to its original class type.

Parameters:
  • cls (ArrayBase) – The original class type.

  • values (List[Primitive]) – A list whose elements are CBOR primitives.

Returns:

Restored object.

Return type:

ArrayBase

Raises:

DeserializeException – When the object could not be restored from primitives.

class pycardano.certificate.VoteDelegation(stake_credential: StakeCredential, drep: DRep)

Bases: ArrayCBORSerializable

Represents a vote delegation certificate in the Conway era of Cardano.

This certificate is used to delegate voting rights to a DRep (Delegate Representative).

stake_credential: StakeCredential
drep: DRep
classmethod from_primitive(values: Union[list, tuple]) VoteDelegation

Restore a primitive value to its original class type.

Parameters:
  • cls (ArrayBase) – The original class type.

  • values (List[Primitive]) – A list whose elements are CBOR primitives.

Returns:

Restored object.

Return type:

ArrayBase

Raises:

DeserializeException – When the object could not be restored from primitives.

class pycardano.certificate.StakeAndVoteDelegation(stake_credential: StakeCredential, pool_keyhash: PoolKeyHash, drep: DRep)

Bases: ArrayCBORSerializable

Represents a combined stake and vote delegation certificate.

This certificate allows simultaneous delegation of both staking rights to a pool and voting rights to a DRep.

stake_credential: StakeCredential
pool_keyhash: PoolKeyHash
drep: DRep
classmethod from_primitive(values: Union[list, tuple]) StakeAndVoteDelegation

Restore a primitive value to its original class type.

Parameters:
  • cls (ArrayBase) – The original class type.

  • values (List[Primitive]) – A list whose elements are CBOR primitives.

Returns:

Restored object.

Return type:

ArrayBase

Raises:

DeserializeException – When the object could not be restored from primitives.

class pycardano.certificate.StakeRegistrationAndDelegation(stake_credential: StakeCredential, pool_keyhash: PoolKeyHash, coin: int)

Bases: ArrayCBORSerializable

Represents a combined stake registration and delegation certificate.

This certificate allows simultaneous registration of stake rights and delegation to a stake pool.

stake_credential: StakeCredential
pool_keyhash: PoolKeyHash
coin: int
classmethod from_primitive(values: Union[list, tuple]) StakeRegistrationAndDelegation

Restore a primitive value to its original class type.

Parameters:
  • cls (ArrayBase) – The original class type.

  • values (List[Primitive]) – A list whose elements are CBOR primitives.

Returns:

Restored object.

Return type:

ArrayBase

Raises:

DeserializeException – When the object could not be restored from primitives.

class pycardano.certificate.StakeRegistrationAndVoteDelegation(stake_credential: StakeCredential, drep: DRep, coin: int)

Bases: ArrayCBORSerializable

Represents a combined stake registration and vote delegation certificate.

This certificate allows simultaneous registration of stake rights and delegation of voting rights to a DRep.

stake_credential: StakeCredential
drep: DRep
coin: int
classmethod from_primitive(values: Union[list, tuple]) StakeRegistrationAndVoteDelegation

Restore a primitive value to its original class type.

Parameters:
  • cls (ArrayBase) – The original class type.

  • values (List[Primitive]) – A list whose elements are CBOR primitives.

Returns:

Restored object.

Return type:

ArrayBase

Raises:

DeserializeException – When the object could not be restored from primitives.

class pycardano.certificate.StakeRegistrationAndDelegationAndVoteDelegation(stake_credential: StakeCredential, pool_keyhash: PoolKeyHash, drep: DRep, coin: int)

Bases: ArrayCBORSerializable

Represents a certificate combining stake registration, stake delegation, and vote delegation.

This certificate allows simultaneous registration of stake rights, delegation to a stake pool, and delegation of voting rights to a DRep.

stake_credential: StakeCredential
pool_keyhash: PoolKeyHash
drep: DRep
coin: int
classmethod from_primitive(values: Union[list, tuple]) StakeRegistrationAndDelegationAndVoteDelegation

Restore a primitive value to its original class type.

Parameters:
  • cls (ArrayBase) – The original class type.

  • values (List[Primitive]) – A list whose elements are CBOR primitives.

Returns:

Restored object.

Return type:

ArrayBase

Raises:

DeserializeException – When the object could not be restored from primitives.

class pycardano.certificate.DRep(kind: DRepKind, credential: Optional[Union[VerificationKeyHash, ScriptHash]] = None)

Bases: ArrayCBORSerializable

Represents a Delegate Representative (DRep) in the Cardano governance system.

DReps are entities that can represent stake holders in governance decisions.

kind: DRepKind
credential: Optional[Union[VerificationKeyHash, ScriptHash]] = None
classmethod from_primitive(values: Union[list, tuple]) DRep

Restore a primitive value to its original class type.

Parameters:
  • cls (ArrayBase) – The original class type.

  • values (List[Primitive]) – A list whose elements are CBOR primitives.

Returns:

Restored object.

Return type:

ArrayBase

Raises:

DeserializeException – When the object could not be restored from primitives.

to_primitive()

Convert the instance and its elements to CBOR primitives recursively.

Returns:

A CBOR primitive.

Return type:

Primitive

Raises:

SerializeException – When the object or its elements could not be converted to CBOR primitive types.

class pycardano.certificate.DRepKind(value)

Bases: Enum

Enumerates the different types of Delegate Representatives (DReps).

Defines the possible kinds of DReps in the Cardano governance system: - VERIFICATION_KEY_HASH: A DRep identified by a verification key hash - SCRIPT_HASH: A DRep identified by a script hash - ALWAYS_ABSTAIN: A special DRep that always abstains from voting - ALWAYS_NO_CONFIDENCE: A special DRep that always votes no confidence

VERIFICATION_KEY_HASH = 0
SCRIPT_HASH = 1
ALWAYS_ABSTAIN = 2
ALWAYS_NO_CONFIDENCE = 3
class pycardano.certificate.AuthCommitteeHotCertificate(committee_cold_credential: StakeCredential, committee_hot_credential: StakeCredential)

Bases: ArrayCBORSerializable

Represents an authorization certificate for a Constitutional Committee hot key.

This certificate authorizes a hot key for use by a Constitutional Committee member.

committee_cold_credential: StakeCredential
committee_hot_credential: StakeCredential
classmethod from_primitive(values: Union[list, tuple]) AuthCommitteeHotCertificate

Restore a primitive value to its original class type.

Parameters:
  • cls (ArrayBase) – The original class type.

  • values (List[Primitive]) – A list whose elements are CBOR primitives.

Returns:

Restored object.

Return type:

ArrayBase

Raises:

DeserializeException – When the object could not be restored from primitives.

class pycardano.certificate.ResignCommitteeColdCertificate(committee_cold_credential: StakeCredential, anchor: Optional[Anchor])

Bases: ArrayCBORSerializable

Represents a resignation certificate for a Constitutional Committee member.

This certificate is used when a committee member wishes to resign their position.

committee_cold_credential: StakeCredential
anchor: Optional[Anchor]
classmethod from_primitive(values: Union[list, tuple]) ResignCommitteeColdCertificate

Restore a primitive value to its original class type.

Parameters:
  • cls (ArrayBase) – The original class type.

  • values (List[Primitive]) – A list whose elements are CBOR primitives.

Returns:

Restored object.

Return type:

ArrayBase

Raises:

DeserializeException – When the object could not be restored from primitives.

class pycardano.certificate.Anchor(url: str, data_hash: AnchorDataHash)

Bases: ArrayCBORSerializable

Represents an anchor in the Cardano blockchain that contains a URL and associated data hash.

Anchors are used to provide additional metadata or reference external resources in certificates.

url: str
data_hash: AnchorDataHash
class pycardano.certificate.DRepCredential(credential: Union[VerificationKeyHash, ScriptHash])

Bases: StakeCredential

Represents a Delegate Representative (DRep) credential.

This credential type is specifically used for DReps in the governance system, inheriting from StakeCredential.

credential: Union[VerificationKeyHash, ScriptHash]
class pycardano.certificate.RegDRepCert(drep_credential: DRepCredential, coin: int, anchor: Optional[Anchor] = None)

Bases: ArrayCBORSerializable

Represents a certificate for registering a new Delegate Representative (DRep).

This certificate is used to register a new DRep in the governance system with an associated deposit amount and optional metadata.

drep_credential: DRepCredential
coin: int
anchor: Optional[Anchor] = None
classmethod from_primitive(values: Union[list, tuple]) RegDRepCert

Restore a primitive value to its original class type.

Parameters:
  • cls (ArrayBase) – The original class type.

  • values (List[Primitive]) – A list whose elements are CBOR primitives.

Returns:

Restored object.

Return type:

ArrayBase

Raises:

DeserializeException – When the object could not be restored from primitives.

class pycardano.certificate.UnregDRepCertificate(drep_credential: DRepCredential, coin: int)

Bases: ArrayCBORSerializable

Represents a certificate for unregistering a Delegate Representative (DRep).

This certificate is used to remove a DRep from the governance system.

drep_credential: DRepCredential
coin: int
classmethod from_primitive(values: Union[list, tuple]) UnregDRepCertificate

Restore a primitive value to its original class type.

Parameters:
  • cls (ArrayBase) – The original class type.

  • values (List[Primitive]) – A list whose elements are CBOR primitives.

Returns:

Restored object.

Return type:

ArrayBase

Raises:

DeserializeException – When the object could not be restored from primitives.

class pycardano.certificate.UpdateDRepCertificate(drep_credential: DRepCredential, anchor: Optional[Anchor])

Bases: ArrayCBORSerializable

Represents a certificate for updating a Delegate Representative (DRep)’s metadata.

This certificate is used to modify the metadata associated with a DRep.

drep_credential: DRepCredential
anchor: Optional[Anchor]
classmethod from_primitive(values: Union[list, tuple]) UpdateDRepCertificate

Restore a primitive value to its original class type.

Parameters:
  • cls (ArrayBase) – The original class type.

  • values (List[Primitive]) – A list whose elements are CBOR primitives.

Returns:

Restored object.

Return type:

ArrayBase

Raises:

DeserializeException – When the object could not be restored from primitives.