aiken/transaction/credential

Types

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>,
    }

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

  • VerificationKeyCredential(Hash<Blake2b_224, VerificationKey>)
  • ScriptCredential(Hash<Blake2b_224, Script>)

A ‘PaymentCredential’ represents the spending conditions associated with some output. Hence,

  • a VerificationKeyCredential captures an output locked by a public/private key pair;
  • and a ScriptCredential captures an output locked by a native or Plutus script.

Alias

PaymentCredential = Credential

A unique stake pool identifier, as a hash of its owner verification key.

Alias

PoolId = Hash<Blake2b_224, VerificationKey>

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 }

Alias

Script = ByteArray

Alias

Signature = ByteArray

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>

Alias

VerificationKey = ByteArray

Functions

from_script(script: Hash<Blake2b_224, Script>) -> Address

Smart-constructor for an Address from a script hash. The address has no delegation rights whatsoever.

from_verification_key(vk: Hash<Blake2b_224, VerificationKey>) -> Address

Smart-constructor for an Address from a verification key hash. The resulting address has no delegation rights whatsoever.

verify_signature(key: VerificationKey, msg: ByteArray, sig: Signature) -> Bool

Verify an Ed25519 signature using the given verification key. Returns True when the signature is valid.

with_delegation_key(
  self: Address,
  vk: Hash<Blake2b_224, VerificationKey>,
) -> Address

Set (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(
  self: Address,
  script: Hash<Blake2b_224, Script>,
) -> Address

Set (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.

Search Document