Types
Address
A Cardano Address typically holding one or two credential references.
Note that legacy bootstrap addresses (a.k.a. ‘Byron addresses’) are completely excluded from Plutus contexts. Thus, from an on-chain perspective only exists addresses of type 00, 01, …, 07 as detailed in CIP-0019 :: Shelley Addresses.
Constructors
Address {
payment_credential: PaymentCredential,
stake_credential: Option<StakeCredential>,
}Credential
A general structure for representing an on-chain Credential.
Credentials are always one of two kinds: a direct public/private key pair, or a script (native or Plutus).
Constructors
VerificationKey(VerificationKeyHash)Script(ScriptHash)PaymentCredential
A ‘PaymentCredential’ represents the spending conditions associated with some output. Hence,
- a
VerificationKeycaptures an output locked by a public/private key pair; - and a
Scriptcaptures an output locked by a native or Plutus script.
Alias
PaymentCredential = CredentialReferenced<a>
Represent a type of object that can be represented either inline (by hash) or via a reference (i.e. a pointer to an on-chain location).
This is mainly use for capturing pointers to a stake credential registration certificate in the case of so-called pointer addresses.
Constructors
Inline(a)Pointer { slot_number: Int, transaction_index: Int, certificate_index: Int }StakeCredential
A StakeCredential represents the delegation and rewards withdrawal conditions
associated with some stake address / account.
A StakeCredential is either provided inline, or, by reference using an
on-chain pointer.
Read more about pointers in CIP-0019 :: Pointers.
Alias
StakeCredential = Referenced<Credential>Functions
Constructing
from_script
from_script(script: Hash<Blake2b_224, Script>) -> AddressSmart-constructor for an Address from a script hash. The address has no delegation rights whatsoever.
from_verification_key
from_verification_key(vk: Hash<Blake2b_224, VerificationKey>) -> AddressSmart-constructor for an Address from a verification key hash. The resulting address has no delegation rights whatsoever.
with_delegation_key
with_delegation_key(
self: Address,
vk: Hash<Blake2b_224, VerificationKey>,
) -> AddressSet (or reset) the delegation part of an Address using a verification key hash. This is useful when combined with from_verification_key and/or from_script.
with_delegation_script
with_delegation_script(
self: Address,
script: Hash<Blake2b_224, Script>,
) -> AddressSet (or reset) the delegation part of an Address using a script hash. This is useful when combined with from_verification_key and/or from_script.