To set up staking on a Cardano ledger, you need to do the following:
- Register a staking address.
- 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.
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 |
| Enough funds in the account to cover the transaction fees and the amount | Check account balances |
The following new IDs, in a standard UUID format:
|
All new requests to change the system state follow the same process. To familiarize yourself with this process first, see Manage intents and approvals.
To perform staking tasks on Cardano, follow the steps in Manage intents and approvals, with a payload similar to one of the following examples.
The SDK examples assume a configured client. See Integrate via SDK. Each SDK method builds the operation, submits the intent, and returns a pending intent. To track the intent, call waitAccepted and waitExecuted (wait_accepted and wait_executed in Python). The Java examples pass null for ledgerId and customProperties, and reuse the feeStrategy from the first example.
{
"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"
}
}For a program that builds and submits these operations, see example 53 (advanced chain operations) in TypeScript or Python. To get the examples, see Examples.
Fields of the payload block to note are as follows:
| Field | Description |
|---|---|
accountId | Internal account ID of an existing Cardano account in Ripple Custody (Vault). |
parameters.operation.type | RegisterStaking |
parameters.feeStrategy | The fee strategy to use for the transaction. For more information, see Fee strategy and maximum fee. |
parameters.maximumFee | The maximum fee, in lovelace. For more information, see Fee strategy and maximum fee. |
parameters.type | Ledger type, in this case Cardano. |
type | v0_CreateTransactionOrder |
{
"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"
}
}{
"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 (Vault). |
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. |
parameters.maximumFee | The maximum fee, in lovelace. For more information, see Fee strategy and maximum fee. |
parameters.type | Ledger type, in this case Cardano. |
type | v0_CreateTransactionOrder |
{
"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 (Vault) 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.