# Set up staking on Cardano

To set up staking on a Cardano ledger, you need to do the following:

1. Register a staking address.
2. Delegate staking to a stake pool.


You can also do the following:

- Unregister a staking address.
- Withdraw staking rewards: The accumulated rewards are automatically delegated. You can withdraw the rewards without affecting your staking amount, which still stays in the stake pool. However, you cannot withdraw rewards if the address does not have a minimum amount of non-rewarded currency.


## Prerequisites

To perform staking tasks on Cardano, you need the following:

| Prerequisite | Additional information |
|  --- | --- |
| An account on a Cardano ledger from which to initiate the transactions | [View account details](/products/custody/v1.34/api/accounting-entities/account/view) |
| Enough funds in the account to cover the transaction fees and the amount | [Check account balances](/products/custody/v1.34/api/accounting-entities/account/balances#check-account-balances) |
| The following new IDs, in a standard UUID format:A transaction order IDAn intent ID |  |


## Perform staking tasks

System change process
All new requests to change the system state follow the same process. To familiarize yourself with this process first, follow the [Request a change with an intent](/products/custody/v1.34/resources/tutorials/intent) tutorial.

To perform staking tasks on Cardano, follow the steps in [Request a change with an intent](/products/custody/v1.34/resources/tutorials/intent), with a payload similar to one of the following examples.

### Payload examples

#### Register a staking address


```json
{
    "payload": {
        "id": "f49a4914-a590-4977-b340-205f07f5bc6a",
        "accountId": "416dcc47-b60c-49fb-be8e-ca7b8a8144ba",
        "parameters": {
            "operation": {
                "type": "RegisterStaking"
            },
            "feeStrategy": {
                "priority": "Medium",
                "type": "Priority"
            },
            "maximumFee": "10000",
            "type": "Cardano"
        },
        "description": "Cardano register staking",
        "customProperties": {},
        "type": "v0_CreateTransactionOrder"
    }
}
```

Fields of the `payload` block to note are as follows:

| Field | Description |
|  --- | --- |
| `accountId` | Internal account ID of an existing Cardano account in Ripple Custody. |
| `parameters.operation.type` | `RegisterStaking` |
| `parameters.feeStrategy` | The fee strategy to use for the transaction. For more information, see [Fee strategy and maximum fee](/products/custody/v1.34/concepts/transactions-reference#fee-strategy-and-maximum-fee). |
| `parameters.maximumFee` | The maximum fee, in lovelace. For more information, see [Fee strategy and maximum fee](/products/custody/v1.34/concepts/transactions-reference#fee-strategy-and-maximum-fee). |
| `parameters.type` | Ledger type, in this case `Cardano`. |
| `type` | `v0_CreateTransactionOrder` |


#### Unregister a staking address


```json
{
    "payload": {
        "id": "f49a4914-a590-4977-b340-205f07f5bc6a",
        "accountId": "416dcc47-b60c-49fb-be8e-ca7b8a8144ba",
        "parameters": {
            "operation": {
                "type": "UnregisterStaking"
            },
            "feeStrategy": {
                "priority": "Medium",
                "type": "Priority"
            },
            "maximumFee": "10000",
            "type": "Cardano"
        },
        "description": "Cardano unregister staking",
        "customProperties": {},
        "type": "v0_CreateTransactionOrder"
    }
}
```

#### Delegate staking to a staking pool


```json
{
"payload": {
	"id": "f49a4914-a590-4977-b340-205f07f5bc6a",
	"accountId": "416dcc47-b60c-49fb-be8e-ca7b8a8144ba",
	"parameters": {
		"operation": {
			"poolId":"pool1vf8ukuvdn7kv0hxgm23utjkkw5ugdhwfdrxy56l2t6wvxezspyu",
            "type": "DelegateStaking"
		},
		"feeStrategy": {
			"priority": "Medium",
			"type": "Priority"
		},
		"maximumFee": "10000",
		"type": "Cardano"
	},
	"description": "Cardano delegate staking",
	"customProperties": {},
	"type": "v0_CreateTransactionOrder"
}
```

Fields of the `payload` block to note are as follows:

| Field | Description |
|  --- | --- |
| `accountId` | Internal account ID of an existing Cardano account in Ripple Custody. |
| `operation.poolId` | ID of the pool to which to delegate staking. Must be in Bech32 format. |
| `operation.type` | `DelegateStaking` |
| `parameters.feeStrategy` | The fee strategy to use for the transaction. For more information, see [Fee strategy and maximum fee](/products/custody/v1.34/concepts/transactions-reference#fee-strategy-and-maximum-fee). |
| `parameters.maximumFee` | The maximum fee, in lovelace. For more information, see [Fee strategy and maximum fee](/products/custody/v1.34/concepts/transactions-reference#fee-strategy-and-maximum-fee). |
| `type` | `v0_CreateTransactionOrder` |


#### Withdraw staking rewards


```json
{
"payload": {
	"id": "f49a4914-a590-4977-b340-205f07f5bc6a",
	"accountId": "416dcc47-b60c-49fb-be8e-ca7b8a8144ba",
	"parameters": {
		"operation": {
			"amount":"100000",
            "type": "WithdrawRewards"
		},
		"feeStrategy": {
			"priority": "Medium",
			"type": "Priority"
		},
		"maximumFee": "10000",
		"type": "Cardano"
	},
	"description": "Cardano withdraw rewards",
	"customProperties": {},
	"type": "v0_CreateTransactionOrder"
}
```

When the transaction order is successfully approved, Ripple Custody does the following:

- Creates a transaction, to broadcast the details on the blockchain.
- Creates one or more transfers, to represent the separate amounts associated with the transaction, such as the cryptocurrency amount and the fees.