# Transaction Type Reference

{% hint style="info" %}
For more information on how to send transactions, see the network [API docs](/network-apis/concepts/architecture.md).&#x20;
{% endhint %}

The following global transaction types are supported across the network.&#x20;

***

## **Transaction Types**

### **DAG Transaction**

A **standard currency transaction** that transfers **DAG tokens** between two addresses.

| Property            | Value         |
| ------------------- | ------------- |
| **Receiving Layer** | DAG L1        |
| **Signed By**       | Source wallet |
| **Fee**             | Paid in DAG   |

#### **Transaction Fields**

| Field           | Description                                                                                                                                         |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| **source**      | The wallet address initiating the transaction.                                                                                                      |
| **destination** | The wallet address receiving DAG.                                                                                                                   |
| **amount**      | The number of DAG tokens being transferred.                                                                                                         |
| **fee**         | The transaction fee in DAG.                                                                                                                         |
| **salt**        | A random value to guarantee uniqueness on the network.                                                                                              |
| **parent**      | A reference to the previous transaction hash and network accepted ordinal. Creates a transaction chain for each address, preventing replay attacks. |

#### **Example**

```json
{
  "value": {
    "source": "DAG1xyz...",
    "destination": "DAG1abc...",
    "amount": 10050000000,
    "fee": 0.01,
    "salt": 465498,
    "parent": {
      "ordinal": 12345,
      "hash": "fbff1127273..."
    }
  }
  "proofs": [{
    "id": "f27242529710fd8...",
    "signature": "f0sdfa32f2f2..."
  }
}
```

***

### **L0 Token Transaction**

A **standard transaction** for transferring **L0 tokens** within a **metagraph’s currency layer**.

| Property            | Value                 |
| ------------------- | --------------------- |
| **Receiving Layer** | Metagraph Currency L1 |
| **Signed By**       | Source wallet         |
| **Fee**             | Paid in L0 Token      |

#### **Transaction Fields**

Same as **DAG Transaction**, but **amount and fee are denominated in L0 tokens**.

***

### **AllowSpend**

A **delegation transaction** that **pre-approves spending** on behalf of the sender.

| Property            | Value                                              |
| ------------------- | -------------------------------------------------- |
| **Receiving Layer** | DAG L1 or Metagraph Currency L1                    |
| **Signed By**       | Source wallet                                      |
| **Fee**             | Paid in DAG or L0 Token (based on receiving layer) |
| **Expiration**      | Maximum **1 hour (83 epochs)**                     |

#### **Transaction Fields**

| Field                      | Description                                                                                                                                                 |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **source**                 | The address granting permission to spend up to the amount.                                                                                                  |
| **destination**            | The wallet address receiving the funds.                                                                                                                     |
| **currency**               | The metagraph ID for an L0 token or null for DAG.                                                                                                           |
| **amount**                 | Maximum amount that can be spent with an associated `SpendTransaction` in datum.                                                                            |
| **fee**                    | Optional fee for the transaction.                                                                                                                           |
| **lastValidEpochProgress** | The expiration of the `AllowSpend` in terms of network epochProgress value.                                                                                 |
| **approvers**              | A list of addresses that must approve the transaction in order to issue an `AllowSpend` against it. Currently limited to a single approver per transaction. |
| **parent**                 | A reference to the previous `AllowSpend` hash and network accepted ordinal for the source address. Prevents replay attacks.                                 |

#### **Example**

```json
{
  "value": {
    "source": "DAG1xyz...",
    "destination": "DAG1abc...",
    "currency": "DAGzzz123...",
    "amount": 5000000000,
    "fee": 0,
    "lastValidEpochProgress": 999,
    "approvers": ["DAG1abc..."]
    "parent": {
      "ordinal": 123,
      "hash": "fbff112..."
    }
  },
  "proofs": [{
    "id": "f27242529710fd8...",
    "signature": "f0sdfa32f2f2..."
  }]
}
```

***

### **SpendTransaction**

A **metagraph-generated transaction** that either:

1. Uses an **AllowSpend** to execute a transfer, or
2. Moves funds from a **metagraph-owned wallet**.

If an AllowSpend is referenced, the SpendTransaction can spend up to the `amount` of the AllowSpend, or less. Once an AllowSpend is referenced in an accepted SpendTransaction, the AllowSpend lock is released and the transaction cannot be used again for a future SpendTransaction.&#x20;

| Property            | Value                                         |
| ------------------- | --------------------------------------------- |
| **Receiving Layer** | Submitted by metagraph to Global L0           |
| **Signed By**       | Included in **metagraph's currency snapshot** |
| **Fee**             | None                                          |

#### **Transaction Fields**

| Field             | Description                                                        |
| ----------------- | ------------------------------------------------------------------ |
| **allowSpendRef** | (Optional) The hash of the `AllowSpend` being used.                |
| **source**        | The executing wallet matching `AllowSpend` source or metagraph ID. |
| **destination**   | The destination wallet for the funds.                              |
| **currency**      | The metagraph ID for an L0 token or null for DAG.                  |
| **amount**        | The amount being transferred.                                      |

#### **Example**

```json
{
  "value": {
    "allowSpendRef": "f2n2390l232...",  // or null for metagraph wallet txns
    "source": "DAG1xyz...", 
    "destination": "DAG1abc..."
    "currency": "DAGzzz123...",
    "amount": 3000000000
  },
  "proofs": [{
    "id": "f27242529710fd8...",
    "signature": "f0sdfa32f2f2..."
  }]
}
```

***

### **FeeTransaction**

A **transaction associated with submitting data** to a metagraph’s Data L1.

| Property            | Value                                                                 |
| ------------------- | --------------------------------------------------------------------- |
| **Receiving Layer** | Metagraph Data L1                                                     |
| **Signed By**       | Source wallet                                                         |
| **Fee**             | There is no fee for the transaction since it represents a fee itself. |

#### **Transaction Fields**

| Field             | Description                                                                        |
| ----------------- | ---------------------------------------------------------------------------------- |
| **source**        | The wallet address initiating the transaction.                                     |
| **destination**   | The wallet address receiving the transaction.                                      |
| **amount**        | The amount of the transaction, denoted in the L0 token of the receiving metagraph. |
| **dataUpdateRef** | The hash of the associated data update.                                            |

#### **Example**

```json
{
  "data": {
    // metagraph-defined custom data type
  },
  "fee":{
    "value": {
      "source": "DAG1xyz...", 
      "destination": "DAG1abc..."
      "amount": 10,
      "dataUpdateRef": "0227488ede0..."
    },
    "proofs": [{
      "id": "f27242529710fd8...",
      "signature": "f0sdfa32f2f2..."
    }]
  }
}
```

***

### **TokenLock**

Locks funds for a specified duration or indefinitely. Locked funds are deducted from a wallet's balance for the duration of the lock but are never transferred from the wallet.&#x20;

| Property      | Value                           |
| ------------- | ------------------------------- |
| **Layer**     | DAG L1 or Metagraph Currency L1 |
| **Signed By** | Source wallet                   |
| **Fee**       | Paid in DAG or L0 Token         |

#### **Transaction Fields**

| Field           | Description                                                                                                                |
| --------------- | -------------------------------------------------------------------------------------------------------------------------- |
| **source**      | The wallet address initiating the transaction                                                                              |
| **amount**      | The balance to lock                                                                                                        |
| **fee**         | Optional fee for the transaction.                                                                                          |
| **currencyId**  | The metagraph ID for an L0 token or null for DAG.                                                                          |
| **unlockEpoch** | The global epochProgress value that this lock will be released by the network. This field is null for indefinite locks.    |
| **parent**      | A reference to the previous `TokenLock` hash and network accepted ordinal for the source address. Prevents replay attacks. |

#### **Example**

```json
{
  "value": {
    "source": "DAG1xyz...", 
    "amount": 10,
    "fee": 0:,
    "currencyId": "DAGzzz123..."
    "unlockEpoch": 999232,
    "parent": {
      "ordinal": 123,
      "hash": "fbff112..."
    }
  },
  "proofs": [{
    "id": "f27242529710fd8...",
    "signature": "f0sdfa32f2f2..."
  }]
}
```

***

### **TokenUnlock**

A **system-generated transaction** that **unlocks previously locked tokens**. **TokenUnlock** transactions can be created by metagraphs (L0 tokens) and the global L0 (DAG) to unlock a **TokenLock** before its `unlockEpoch`, or to unlock a **TokenLock** with no `unlockEpoch`. This transaction type is also emitted when a TokenLock has reached its `unlockEpoch`.&#x20;

| Property            | Value                                                                         |
| ------------------- | ----------------------------------------------------------------------------- |
| **Receiving Layer** | Global L0 or Metagraph L0                                                     |
| **Signed By**       | Included in a signed metagraph snapshot (L0 tokens) or global snapshot (DAG). |
| **Fee**             | None                                                                          |

#### **Transaction Fields**

| Field          | Description                                       |
| -------------- | ------------------------------------------------- |
| **source**     | The wallet address initiating the transaction     |
| **amount**     | The balance to lock                               |
| **currencyId** | The metagraph ID for an L0 token or null for DAG. |

#### **Example**

```json
{
  "value": {
    "source": "fbff112...", 
    "amount": 10,
    "currencyId": "DAGzzz123..."
  },
  "proofs": [{
    "id": "f27242529710fd8...",
    "signature": "f0sdfa32f2f2..."
  }]
}
```

***

### **AllowSpendExpiration**

A **system-generated transaction** that marks an **expired AllowSpend**.

| Property            | Value                                                                  |
| ------------------- | ---------------------------------------------------------------------- |
| **Receiving Layer** | Global L0 or Metagraph L0                                              |
| **Signed By**       | Included in a metagraph snapshot (L0 tokens) or global snapshot (DAG). |
| **Fee**             | None                                                                   |

#### **Transaction Fields**

| Field             | Description                           |
| ----------------- | ------------------------------------- |
| **allowSpendRef** | The hash of the associated AllowSpend |

#### **Example**

```json
{
  "value": {
    "allowSpendRef": "fbff112..."
  },
  "proofs": [{
    "id": "f27242529710fd8...",
    "signature": "f0sdfa32f2f2..."
  }]
}
```

***

### UpdateDelegatedStake

A user-generated transaction to create or update a delegated stake position. A delegated staking position is comprised of two parts:

* A TokenLock with an indefinite expiration
* An UpdateDelegatedStake transaction referencing the TokenLock

This transaction can be used to update an existing delegated stake position without requiring a withdrawal first. The updated delegated stake transaction will have all the same details as the original, except with a different nodeId referenced.&#x20;

| Property      | Value         |
| ------------- | ------------- |
| **Layer**     | Global L0     |
| **Signed By** | Source wallet |
| **Fee**       | Paid in DAG   |

#### Transaction Fields

| Field            | Description                                                                                                                           |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| **nodeID**       | The node ID (pub key) of the node to delegate to.                                                                                     |
| **amount**       | The amount to delegate. This must match the `TokenLock` amount.                                                                       |
| **fee**          | An optional fee for the transaction.                                                                                                  |
| **tokenLockRef** | The hash of the `TokenLock` transaction that is being delegated.                                                                      |
| **parent**       | A reference to the previous `UpdateDelegatedStake` hash and network accepted ordinal for the source address. Prevents replay attacks. |

#### **Example**

```json
{
  "value": {
    "nodeId": "e7d04c888...",
    "amount": 90000,
    "fee": 0,
    "tokenLockRef": "0fzz0f23...",
    "parent": {
      "ordinal": 123,
      "hash": "fbff112..."
    }
  },
  "proofs": [{
    "id": "f27242529710fd8...",
    "signature": "f0sdfa32f2f2..."
  }]
}
```

***

### WithdrawDelegatedStake

A user-generated transaction to unwind a delegated staking position. After the WithdrawDelegatedStake transaction is accepted, the associated TokenLock will be unlocked by the network after 21 days (measured by epochProgress).&#x20;

| Property      | Value         |
| ------------- | ------------- |
| **Layer**     | Global L0     |
| **Signed By** | Source wallet |
| **Fee**       | None          |

#### Transaction Fields

| Field        | Description                                                   |
| ------------ | ------------------------------------------------------------- |
| **stakeRef** | The hash of the `UpdateDelegatedStake` transaction to unlock. |

#### **Example**

```json
{
  "value": {
    "stakeRef": "0fzz0f23..."
  },
  "proofs": [{
    "id": "f27242529710fd8...",
    "signature": "f0sdfa32f2f2..."
  }]
}
```

***

### UpdateNodeCollateral

A user-generated transaction to create a node collateral position. A node collateral position is comprised of two parts:

* A TokenLock with an indefinite expiration
* An UpdateNodeCollateral transaction referencing the TokenLock

This transaction can be used to update an existing delegated stake position without requiring a withdrawal first. The updated delegated stake transaction will have all the same details as the original, except with a different nodeId referenced.&#x20;

| Property      | Value         |
| ------------- | ------------- |
| **Layer**     | Global L0     |
| **Signed By** | Source wallet |
| **Fee**       | Paid in DAG   |

#### Transaction Fields

| Field            | Description                                                                                                           |
| ---------------- | --------------------------------------------------------------------------------------------------------------------- |
| **nodeID**       | The node ID (pub key) of the node to delegate to.                                                                     |
| **amount**       | The amount to delegate. This must match the `TokenLock` amount.                                                       |
| **fee**          | An optional fee for the transaction.                                                                                  |
| **tokenLockRef** | The hash of the `TokenLock` transaction that is being delegated.                                                      |
| **parent**       | A reference to the previous Update hash and network accepted ordinal for the source address. Prevents replay attacks. |

#### **Example**

```json
{
  "value": {
    "nodeId": "e7d04c888...",
    "amount": 90000,
    "fee": 0,
    "tokenLockRef": "0fzz0f23...",
    "parent": {
      "ordinal": 123,
      "hash": "fbff112..."
    }
  },
  "proofs": [{
    "id": "f27242529710fd8...",
    "signature": "f0sdfa32f2f2..."
  }]
}
```

***

### WithdrawNodeCollateral

A user-generated transaction to unwind a node collateral position. After the WithdrawNodeCollateral transaction is accepted, the associated TokenLock will be unlocked by the network after 21 days (measured by epochProgress).&#x20;

| Property      | Value         |
| ------------- | ------------- |
| **Layer**     | Global L0     |
| **Signed By** | Source wallet |
| **Fee**       | None          |

#### Transaction Fields

| Field             | Description                                                   |
| ----------------- | ------------------------------------------------------------- |
| **collateralRef** | The hash of the `UpdateNodeCollateral` transaction to unlock. |

#### **Example**

```json
{
  "value": {
    "collateralRef": "0fzz0f23..."
  },
  "proofs": [{
    "id": "f27242529710fd8...",
    "signature": "f0sdfa32f2f2..."
  }]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.constellationnetwork.io/network-fundamentals/transaction-type-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
