status

Cardano has a multi-delegation feature

Published 18.9.2023

The Lace wallet allows users to delegate ADA to multiple pools from a single account. The same functionality can be achieved by creating multiple accounts, which is currently a widespread method. In this article, we will explain how multi-delegation is technically feasible.

Wallets are just Generators and Keepers of Keys

When users create a non-custodial wallet, new random seeds (passphrases) are generated and they are prompted to keep it carefully and securely. From the seed, wallets derive all other keys that are necessary for receiving and sending funds, but also for staking. Everything happens in the background, so users only work with transactions and blockchain addresses. It is good to know how Cardano wallets derive keys from the seed.

In the image below you can see the key derivation structure that starts with the seed. Red keys represent private/signing keys and green keys are public/verification keys.

A seed is a random sequence of words from which the master key is derived. It is used for generating other cryptographic keys. Seed can be used for restoring wallets. If you know the seed, you can derive the same set of keys from it again if you follow the same procedure (this is ensured through standardization). A master key is the top level of the hierarchical deterministic (HD) wallet structure.

A master key can be used to derive multiple accounts, each with its own set of addresses and keys. An account is also a key pair that represents your stake in the network and allows you to delegate it to a pool.

An account can have multiple addresses and staking keys, which are also key pairs that are derived from the account key with different roles.

Addresses are used for receiving and sending funds. The public key is used to generate the address, while the private key is used to sign transactions and thus prove ownership of the funds.

The staking key is used by both stakers and pool operators. In the case of stakers, the staking address is derived from the staking key. The private key is used to exercise delegation rights.

The pool operator also uses the staking key to generate a stake address and pool ID. The pool ID is a hash of the public staking key.

The user staking address is inserted into the delegation certificate as the source of the ADA coins to be delegated to the pool that is identified by the pool ID. The delegation certificate links the staking address to the pool's stake key.

The staking address is used by both stakers and operators to store and withdraw staking rewards (via the private keys).

Let's focus mainly on users' wallets.

Within a single account, wallets usually create only one staking key and use the hash of the public staking key to insert it into the references of all payment addresses. In other words, all payment addresses contain the same reference to the staking key.

In the picture below you can see an account with three payment addresses (Shelley payment addresses) whose stake address references refer to the same hash which is derived from a single staking key. Note that the stake address contains the reward account.

This way, the user can delegate their stake to a pool with a single certificate, and all their payment addresses will follow the same delegation choice. This also simplifies the management of keys and addresses, as the user only needs to keep track of one staking key and one delegation certificate for their wallet. The user can create multiple new payment addresses and all ADAs on these addresses will be automatically used for staking (as soon as the next snapshot is taken).

The stake is the amount of ADA that is associated with the staking key and delegated to a stake pool. The stake is calculated by summing up all the UTxOs on the payment addresses that are associated with the same staking key. Wallets automatically insert the same staking key into newly created payment addresses.

However, this also means that the user cannot delegate different portions of their stake to different pools from the same wallet, as they would need to create multiple staking keys and certificates for that purpose. We will talk more about this in the next part of the article.

ADA Delegation to Multiple Pools

The Lace wallet enables multiple delegations through a single account. Lace generates multiple stake keys from the same account key, and also multiple payment addresses. Multiple staking keys (their hashes) are associated with different payment addresses.

One payment address can only be associated with one staking key. Multiple payment addresses can be associated with the same staking key.

In the picture below you can see how 2 staking keys and 2 payment keys are derived from one account key. Notice the links between the keys. Each payment address is associated with a unique staking key.

If a new staking key and payment key are created (index 1 in our picture) in an existing wallet, there will be no ADA coin on the payment address. The wallet must create a transaction that transfers part of the ADA coins (UTxOs) from the address that is already delegated (old payment address with index 0 in our picture) to the new address and create a new delegation certificate for the new staking key.

Now the user can choose two pools (two pool IDs) to which he wants to delegate. The wallet will perform all the necessary steps and create all the necessary transactions.

Thanks to the fact that a single account was used for multi-delegation, voting power is not disrupted.

The same can be achieved by creating multiple accounts. Each account has a separate staking key for multiple payment addresses.

In the picture below, you can see how 2 account keys are derived from one master key (essentially two independent user accounts). Each account has its own staking key for the payment address (of which there can be more).

A delegation certificate must be created and submitted to the network for each account.

Pitfalls

If you are going to delegate to multiple pools, there are some pitfalls to be aware of. Let's consider that you balance your stake in such a way that you divide 1000 ADA into 5 pools, 200 ADA will be delegated to each.

You can receive ADA coins at one address at a time. If someone sends you 200 ADA, you will delegate 400 ADA to one pool and still only 200 ADA to all others. If you want to rebalance the staking portfolio, you will have to do it manually. Maybe your wallet will help you with that.

If you send someone 100 ADA, the wallet can take ADA from a single address, so you will only delegate 100 ADA to one of the 5 pools. The wallet can theoretically take UTxOs from 5 addresses to reduce the stake per pool by 20 ADA. But the transaction will be larger and the fee will be higher. Each wallet may offer different options regarding the selection of addresses.

Some DApps rely on users having only one staking key (they verify the wallet through a staking key and may require a signature by the staking key) and may not support multiple staking keys. The Dapp may not see your entire portfolio.

Conclusion

Multi-delegation is beneficial for those users who want to support multiple pools, but do not want to create multiple seeds for wallets (and transfer ADA between them). Many wallets support the creation of multiple accounts. The Lace wallet allows the derivation of multiple staking keys within a single account. This is a relatively new feature in the ecosystem.

If you start with multiple delegations, be loyal to the wallet you started using. If you want to use another wallet, make sure it supports the same type of multiple delegation that you started using. For example, if you use Lace and delegate to 5 pools, you may not be able to re-delegate in other wallets. However, we believe that most wallets will start supporting multiple staking keys within a single account.

Featured:

Related articles

Did you enjoy this article? Other great articles by the same author