Delegating Addresses in Qtum: FAQs

Jack Winter
Qtum
Published in
13 min readOct 4, 2020

--

After a month of the testnet Stake-A-Thon and a month of the mainnet Stake-A-Thon we got a lot of community questions about the details of delegating addresses for offline staking, picking a super staker, splitting UTXOs, etc.

Here are your answers.

Introduction

Please view the address delegation manuals for the Qtum Core wallet and Qtum Web Wallet in the References ¹ ² below and a list of available super stakers at https://stake-a-thon.qtum.org/en/super-staker/list .

Q1. Why delegate an address to a super staker?

A1. Qtum offline staking by delegating an address to a super staker allows participation in staking and earning block rewards by wallets that do not have to stay online. Qtum Proof of Stake requires running the full node Qtum Core wallet which syncs the entire blockchain and secures the network by validating and relaying every transaction and block in real-time. These Qtum Core wallets that also hold QTUM coins can also participate in Proof of Stake, publish blocks, and win block rewards. With the addition of offline staking protocol, the Qtum Core wallet may now be operated as a “super staker” and accept address delegations for Proof of Stake from users with wallets that don’t want to run a full node or remain online 24/7.

UTXOs and Splitting UTXOs

When it comes to staking it’s all about the UTXOs.

Q2. What is a UTXO?

A2. A UTXO is an Unspent Transaction Output. A UTXO is a small piece of transaction data stored in a block on the blockchain and gives a number for the value of the transaction, which address owns it, and the steps to send that value. The wallet for UTXO blockchains (like bitcoin and Qtum) simply sums all these little bits of data value where they are stored on various blocks of the blockchain and presents a convenient balance. But all transactions such as sending and staking are managed at a granular level with individual UTXOs.

Q3. Is splitting my UTXOs necessary?

A3. Yes. Suppose we want to delegate an address that has built up its size over time with new coins and has received one block reward (as a staker). This could give an address holding UTXOs with these sizes: 4 (the block reward), 90, 50, 400, 75, and 30. But since most super stakers will only stake UTXOs with a default minimum size of 100 we end up only staking 400 QTUM of the total. This is where splitting the larger UTXOs and recombining the smaller ones will help.

Note the split transaction will pay a small transaction fee, the Core wallet would show as “Payment to yourself” because the coins were sent to the wallet address, and splitting resets the maturity of the UTXOs because they are sent to the wallet. After the split/recombine the super staker can stake the full total.

Delegating large UTXOs will reduce your returns. You can see how this works by considering an address with an “expected time” of 500 blocks (the same as the stake period). If the delegated address held a single UTXO, and that UTXO won a block reward, it would be staked and ineligible to win another block reward for 500 blocks, at which point it would “mature” and begin staking again, effectively reducing the return by 50%.

Considering a network weight of 20 million, we can see the following revenue reductions for a delegated address staking with a single large UTXO vs. split into many small UTXOs:

How to read this table? Taking the 3rd line from the bottom, for 20 million network weight, the expected time for staking 10,000 QTUM would be 2,000 blocks. Staking with a single UTXO of size 10,000 means that after winning a block reward that UTXO is out of action for 500 blocks, or 20% of the block sequence for that wallet, which can only realize 80% of the potential revenue.

Splitting UTXOs is more important with delegated addresses since the delegated UTXOs can’t be split by the staking process as they are for super staker UTXOs (when winning block rewards for their UTXOs), or solo stakers. In this case, any UTXO staked over 200.0 QTUM will automatically be split in two by the protocol so the staked UTXOs will naturally end up in the 100s range. But delegated address UTXOs can’t be staked or split by the super staker. A too-large UTXO for a delegated address will stay too large forever.

Smaller wallets may want to use the split operation after delegating the address to manage any UTXO changes after paying gas and fees for that transaction. See question 5 for more about this.

Q4. How can I check the size of my UTXOs?

A4. Since the size of UTXOs is very important in delegating addresses (and even more important for super stakers, but that is another FAQ list) you can use the explorer API to check your UTXO sizes. To see your UTXO sizes you can call the API through any browser with a URL request like this:

https://qtum.info/api/address/Q_your_address_goes_here/utxo

Of course, replace the “Q_your_address_goes_here” with your actual Qtum address.

The response will list the current UTXOs and their value in Satoshis (100,000,000 Satoshis = 1.0 QTUM). Continuing the above example, if we looked at the UTXOs before splitting we would see:

API output, cleaned up for clarity

There are 6 UTXOs sized from 400 to 4 QTUM. To convert Satoshis to QTUM move the decimal point 8 places to the left, for example, the top row shows a UTXO for 400.0 QTUM:

Notice the bottom UTXO for 4.0 QTUM is listed as “isStake”:true which means it was a staked UTXO which are handled differently by the wallet.

Looking at the actual API response (on testnet) after the split transaction we see:

API output, cleaned up for clarity

We see 6 UTXOs as expected, 5 of 100.0 QTUM sizes, and one at 148.99 which is the remainder after splitting and paying a transaction fee of 0.004384 QTUM.

Q5. Does it make more sense to split your UTXOs into 102-sized UTXOs as one of them will end up paying a little over 1 QTUM when delegating, especially for smaller holders that might have 200 or 300 QTUM?

A5. Yes, this approach would work. Keep in mind that the delegating wallet will need to pay the gas and fees with a UTXO and that UTXO will be reduced in size as well as getting a small gas refund. If a 100.0 UTXO is used it would return (assuming change address is disabled for those wallets that have this option) as 98.89 QTUM and not be staked.

Another approach is to leave a small UTXO of 3.0, 5.0, etc., which the wallet will usually pick for the fee and gas, but always check the UTXO sizes after delegating to be sure they are appropriately sized.

Q6. I’m not using the Qtum Core wallet (which has the “split UTXOs” command built-in). How can I split my UTXOs?

A6. Qtum Electrum can use the “Tools — Pay to many” page. For other wallets, users could use a new address with multiple sends of 100 coins to this address. Large addresses could send their total to an Electrum wallet address and use “Tools — Pay to many”.

Electrum using Tools — Pay to many

Delegation Operations

Q10. How can I select a good super staker?

A10. Chose a super staker that is big enough and has an acceptable fee. The explorer will show the Staking Balance vs. the QTUM Balance for that staker. Look to see the Staking Balance is no more than 50% of the QTUM Balance (total). Because of block reward variation, if the staker’s total QTUM Balance is staked it cannot stake new blocks for delegates. Choose a staker that is getting regular block rewards so you know it is online and active.

Super staker address page on qtum.info

This Photoshopped example shows a super staker that is staking plenty of blocks with about 38% of its balance committed to stakes. The average amount committed to stakes will change over time as delegations change and network weight changes.

Q11. When block reward?

A11. This is the quintessential question for any decentralized blockchain. Delegating an address does not change the probability math for when a block reward will be received. The stake calculator shows the “expected time” to a block reward, which is a probability result for a random process. 63% of the time the wallet will receive a block reward by the expected time, but the block reward could come much sooner or much later than the “expected time” which can be seen as a long-term average. Read more about “when block reward” in this blog.

Q12. How much is the fee to delegate and undelegate?

A12. Delegation transactions are executed in a smart contract that charges gas fees. You can see gas amounts charged by the delegations smart contract which are in the 2,183,000 range for a delegation (about 0.87 QTUM) and in the 30,000 gas range for undelegation (about 0.012 QTUM). Wallets will typically default to send 2,500,000 gas amount which at a gas price of 0.00000040 is a 1.0 QTUM gas payment for the delegation assignment. Any extra gas is refunded to the wallet, so you could see small “mined” payments of 0.12 QTUM, etc., as gas refunds. The delegation fee also pays the regular transaction fee which could be 0.01 QTUM or less.

Q13. How do I know if my delegation has been accepted?

A13. The delegating wallet will show the status, as will the explorer, where you can see the delegation status (after the next block is published) on the page for the delegator address or super staker address.

Q14. Is there a way I can check if my delegated address is being staked by the super staker?

A14. The explorer will show if your address has been delegated to a super staker, which means assigned through the smart contract. But you can delegate an address to any Qtum address, whether or not there is a super staker running at that address.

The only real way to check if a super staker is staking your UTXOs is to receive a block reward from that super staker. Short of that, you can get some confidence by verifying the assignment with the explorer and seeing if the super staker is winning block rewards for other delegates with the same fee you used.

Q15. What happens if a delegation is made with a higher or lower fee than the super staker requires?

A15. If a delegation is made with a higher fee than the super staker requires, any block rewards for that delegate will pay the higher fee.

If a delegation is made with a lower fee than the super staker requires, the super staker will not stake those UTXOs, which should be undelegated and then delegated with the proper fee.

Q16. Should I turn on the Staking button in my wallet after delegating? What happens if I do?

.

A16. The Stake page — Staking button is used if you are staking from your Qtum-Qt wallet. Turning on the Staking button will make no difference for the delegated address (the UTXOs won’t be staked twice) since that address has been assigned to a super staker, but it will allow staking from other undelegated addresses of your wallet if any.

Q17. Are my rewards automatically added to my offline staking or do I need to redelegate periodically?

A17. There is no need to redelegate. The super staker will stake any added UTXOs larger than its minimum staking UTXO size (usually the default 100.0 QTUM) once they mature. Delegated addresses should combine the block rewards when they can make a UTXO of 100 QTUM or more, using the split command for the Qtum Core wallets or coin control on others. A smaller wallet could use coin control to add smaller amounts of block rewards to another UTXO, for example combining 10 of 3.6 QTUM block rewards with an existing 100 QTUM UTXO, but that is probably not worth the effort.

Q18. If a super staker wallet also makes an address delegation assignment from their super staker address what happens?

A18. In this case, the super staker address “A” would be delegated to a new super staker “B”, the super staker “A” would have no mature UTXOs to stake (because they were delegated) and would discontinue staking for its delegated addresses or itself. Super staker “A” should remove that delegation to restore staking for their delegates.

Q19. What is the minimum amount that can be delegated and why?

A19. Most super stakers will be configured to stake the default minimum UTXO size of 100.0 QTUM, so even though any amount can be delegated, the minimum size that will be staked is a UTXO of 100.0 QTUM, and the delegating wallet should have another 1.1 QTUM for the address delegation fee and gas.

Qtum Electrum & Mobile Wallet

Q25. How can I use the Qtum Electrum wallet for address delegation?

A25. On Qtum Electrum go to View, select to Show Addresses, and note the address to delegate. Then go to View, select to Show Delegations, go to the Delegations page and right-click to fill in the Stake Delegation (address delegation) form. Pick the address you want to delegate from the Address drop-down list. Make sure you are using a “legacy” wallet with “Q” addresses (which are required for address delegation).

Q26. When will Ledger support offline staking?

A26. Qtum has submitted a pull request to Ledger to update the Ledger Qtum app for address delegation, and it is up to Ledger to test and release according to their schedule.

Q27. Is it possible to delegate from the mobile wallet, and if not, will it be possible in the future?

A27. Currently, it is not possible to delegate an address with the Qtum Android mobile wallet and I don’t know if this will be possible in the future. What you can do now is restore the mobile wallet address on the Qtum Web Wallet, and delegate the address with the Web Wallet. Save the Web Wallet key file in a safe place — this is a good backup for your mobile wallet. You can see any block rewards received with the Web Wallet, mobile wallet, or the explorer.

Advanced

Q30. I want to delegate to my super staker. How should I set this up?

A30. Set the super staker with a 0 percent fee, 4.0 QTUM minimum UTXO staking size, and set the delegation address in the Allow list (Settings — Configuration: custom — Delegation list type — Allow list). This will accumulate block rewards in the offline address for best safety, stake all the block rewards as they mature, and prevent other delegators from freeloading on your super staker. For the halving in December 2021, reset the minimum UTXO staking size to 2.0 QTUM.

Q31. I tried to undelegate on Qtum-Qt and see a red dot with “Remove transaction error” and the delegation doesn’t cancel. What can I do?

A31. Perhaps the wallet.dat file has some problems. Make sure you have a good backup of the wallet (a copy of that wallet.dat file) then try the “rescan” command on startup, or if still having problems then try the “salvagewallet” command.

Q32. I have coins on several different addresses in my wallet. How can I consolidate them into one address for splitting?

A32. Go to Settings — Options — Wallet and tick the box for “Enable Coin Control Features”, and untick “Use change address” This lets you select UTXOs by address to send and not get a new address for change.

Pick the address you want to consolidate to, and copy that address. Go to Send, and then select “Inputs”. Look at that list and select the address UTXOs you want to send (and add up the amount of each) to your consolidated address that you paste the address for sending.

Send the coins to one address then do the split operation.

If this is too much work, you can also open up the Qtum Web wallet with a new address, send the balance from the Qtum Core wallet, then send it back to your preferred address. Then do the split.

Thanks for all the great questions and if you have one, please leave it in the comments below so we can add more answers.

References

1. Qtum Core manualdelegating address to super staker

2. Qtum Web Wallet manualaddress delegation for offline staking

3. YouTube video Qtum Offline Staking — How to Delegate

--

--