This is a type of transaction which outputs can be processed only through fulfillment of some conditions. Usually, the output of a transaction leads to a specified address, but in case of conditional transactions, the address is not specified. Funds from the conditional transaction are transferred to a conditional **OUT**, not to a wallet.
Conditional transactions are used for client-service interaction, staking, exchange and many more.
> [!NOTE] Note
> Properties and purposes of every transaction depends on set of attached [[item|items]].
**Contents:**
- **[[3. Conditional Transactions#Conditional OUT|Conditional OUT]]**
- **[[3. Conditional Transactions#Conditional IN|Conditional IN]]**
- **[[3. Conditional Transactions#Transaction Examples|Examples of Transactions]]**
## Conditional OUT
There are five conditional out **items** in the Cellframe networks.
However, the presence of a **Subtype FEE** item in the transaction does not automatically make the transaction *conditional*; for this, there must be another conditional subtype.
### Subtype FEE
![[5. Transactions Structure#1. Fee]]
**[[3. Conditional Transactions#SUBTYPE_FEE|Transaction example]]**
### Subtype SRV_PAY
![[5. Transactions Structure#2. Service Payment]]
You can create and watch actual orders in the network with [[NET_SRV. Node Commands]].
To purchase an order, you have to create a conditional transaction using [[Node Command - TX_COND_CREATE]].
**[[3. Conditional Transactions#SUBTYPE_SRV_PAY|Transaction example]]**
### Subtype SRV_XCHANGE
![[5. Transactions Structure#3. Exchange Service]]
Orders can be created and purchased via the [[SRV_XCHANGE. Node Commands]].
**[[3. Conditional Transactions#SUBTYPE_SRV_XCHANGE|Transaction example]]**
### Subtype SRV_STAKE_LOCK
![[5. Transactions Structure#4. Staking Service]]
Funds can be staked and unlocked using [[SRV_STAKE. Node Commands]] or official [Cellframe stake site](https://stake.cellframe.net/).
**[[3. Conditional Transactions#SUBTYPE_SRV_STAKE_LOCK|Transaction example]]**
### Subtype SRV_STAKE_POS_DELEGATE
![[5. Transactions Structure#5. Delegated Staking Service]]
Commands for creating validator or staker orders - [[SRV_STAKE ORDER. Node Commands]].
Also there is a command which provides creation of order for collecting validator's fees.
**[[3. Conditional Transactions#SUBTYPE_SRV_STAKE_POS_DELEGATE|Transaction example]]**
### Subtype SRV_EMIT_DELEGATE
This subtype is need to create a [[3. Conditional Transactions|conditional transaction]] where funds can only be spent by specific users who were granted permission to do so when the transaction was created.
This subtype has its own article **[[Shared Funds]]** and corresponding [[WALLET SHARED. Node Commands]].
### Conditional IN
All previously described items are useless without conditional input. This item allows to transfer funds on it from the conditional **OUT**. For this conditional **IN** of the transaction being created must be tied to the conditional **OUT** from the previous transaction.
![[5. Transactions Structure#Conditional Input]]
**Example of interaction between conditional outputs and inputs:**
![[Pasted image 20250131170529.png]]
**CONDITIONAL TRANSACTION**:
This transaction takes two inputs, with the fee for the validator **`FEE`** being paid from the input **`#2`**. The validator fee is typically a small value, so some funds remaining on this input are then directed to a conditional output for service payment. Thus, the necessary funds for payment are collected on the conditional output **`SRV_PAY`** from inputs **`#1`** and **`#2`**.
**REWARD TRANSACTION #1:**
Next, the funds collected on the conditional output **`SRV_PAY`** of **`CONDITIONAL TRANSACTION`** are sent to the conditional input of **`REWARD TRANSACTION #1`** after certain conditions fulfillment. Then, through a classic output, they are transferred to the service provider's wallet.
**TRANSFER TRANSACTION:**
This is a typical funds transfer transaction. It has an input with a certain amount of funds that needs to be transferred, but it is important not to forget to pay the validator **`FEE`**. Thus, the funds, minus the fee, are transferred to a regular output of the transaction and from there are sent to the recipient's wallet.
**REWARD TRANSACTION #2:**
This transaction illustrates the process of collecting validator fees from both **`CONDITIONAL`** and **`TRANSFER`** transactions. Such transactions combine several conditional outputs with **`FEE`** from other transactions and transfer them to the validator's wallet.
> [!IMPORTANT] Important
> For better understanding refer to a [[2. Transactions Functions]] page, where functional roles of transactions are described.
## Transactions Examples
### SUBTYPE_FEE
```actionscript
item type: OUT COND
Header:
ts_expires: never
coins: 0.05
value: 50000000000000000
subtype: DAP_CHAIN_TX_OUT_COND_SUBTYPE_FEE
uid: 0x0000000000000000
```
### SUBTYPE_SRV_PAY
```actionscript
item type: OUT COND
ts_expires: never
coins: 0.06
value: 60000000000000000
subtype: DAP_CHAIN_TX_OUT_COND_SUBTYPE_SRV_PAY
uid: 0x0000000000000001
tsd_size: 0
unit: 0x00000002
pkey: 0x3E6079BA2AC5F73836BB15A64D8BAF597A0EB0931054BDEEE760E5B0673EFD6A
max price(coins): 0.0
max price(value): 0
```
### SUBTYPE_SRV_XCHANGE
```actionscript
item type: OUT COND
ts_expires: never
coins: 1.0
value: 1000000000000000000
subtype: DAP_CHAIN_TX_OUT_COND_SUBTYPE_SRV_XCHANGE
uid: 0x0000000000000002
tsd_size: 0
net id: 0x000000000000dddd
buy_token: mtKEL
rate: 1.0
```
### SUBTYPE_SRV_STAKE_LOCK
```actionscript
item type: OUT COND
Header:
ts_expires: never
coins: 81.0
value: 81000000000000000000
subtype: DAP_CHAIN_TX_OUT_COND_SUBTYPE_SRV_STAKE_LOCK
uid: 0x0000000000000012
time_unlock: Fri, 06 Mar 2026 04:00:01 +0700
```
### SUBTYPE_SRV_STAKE_POS_DELEGATE
```actionscript
item type: OUT COND
ts_expires: never
coins: 10.1
value: 10100000000000000000
subtype: DAP_CHAIN_TX_OUT_COND_SUBTYPE_SRV_STAKE_POS_DELEGATE
uid: 0x0000000000000013
tsd_size: 0
signing_addr: o9z3wUTSTicckJuozhPr6oMEAtya7JnStmo8UvkBJ9TcHc9ooUPksbmAEWSrgt9tzNRbop3XGniUJuXRWGQUbNujR4ugg1WZ3L8s9K7F
with pkey hash: 0xC51165F05F83FDF16D682658927B65F90F930E147D31AE15662842F174538F25
signer_node_addr: 4A34::01E2::FE8C::C0B4
```