---
title: "cardano/address"
---

> Documentation Index
> Fetch the complete documentation index at: https://aiken-lang.com/llms.txt
> Use this file to discover all available pages before exploring further.

# cardano/address

## Types

### `Address` {#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](https://github.com/cardano-foundation/CIPs/tree/master/CIP-0019/#shelley-addresses).

#### Constructors

```aiken
Address {
  payment_credential: PaymentCredential,
  stake_credential: Option<StakeCredential>,
}
```

### `Credential` {#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

```aiken
VerificationKey(VerificationKeyHash)
```

```aiken
Script(ScriptHash)
```

### `PaymentCredential` {#PaymentCredential}

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

- a `VerificationKey` captures an output locked by a public/private key pair;
- and a `Script` captures an output locked by a native or Plutus script.

#### Alias

```aiken
PaymentCredential = Credential
```

### `Referenced<a>` {#Referenced}

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

```aiken
Inline(a)
```

```aiken
Pointer { slot_number: Int, transaction_index: Int, certificate_index: Int }
```

### `StakeCredential` {#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](https://github.com/cardano-foundation/CIPs/tree/master/CIP-0019/#pointers).

#### Alias

```aiken
StakeCredential = Referenced<Credential>
```

## Functions

### Constructing

### `from_script` {#from_script}

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

Smart-constructor for an [Address](#Address) from a [script](#Script) hash. The address has no delegation rights whatsoever.

### `from_verification_key` {#from_verification_key}

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

Smart-constructor for an [Address](#Address) from a [verification key](#VerificationKey) hash. The resulting address has no delegation rights whatsoever.

### `with_delegation_key` {#with_delegation_key}

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

Set (or reset) the delegation part of an [Address](#Address) using a [verification key](#VerificationKey) hash. This is useful when combined with [`from_verification_key`](#from_verification_key) and/or [`from_script`](#from_script).

### `with_delegation_script` {#with_delegation_script}

```aiken
with_delegation_script(
  self: Address,
  script: Hash<Blake2b_224, Script>,
) -> Address
```

Set (or reset) the delegation part of an [Address](#Address) using a [script](#Script) hash. This is useful when combined with [`from_verification_key`](#from_verification_key) and/or [`from_script`](#from_script).

Source: https://aiken-lang.com/stdlib/cardano/address/index.mdx
