Dr Lars Brünjes, Director of Education at IOHK, was recently in Hamburg at a Blockchain Mania meetup where he gave a technical talk on incentives of Cardano. You will find a summary of this talk below.
Though he is involved in IOHK’s education efforts such as Haskell courses and internal/external training. He is also leading the ‘incentives’ workstream in Cardano, working alongside Professor Kiayias, Professor Koutsoupias and Aikaterini. Details on IOHK’s team members can be found here.
What is the Point of Incentives?
In blockchain, the goal is to incentivize participants to “do the right thing”. With Cardano, that means achieving a certain distribution of stake. This distribution is to be achieved with stake pools, in which we want no too many and not too few. Most of stake is to be concentrated in stake pools and these stake pools are to be online and actively participate in the protocol.
Incentives are to be set up in such a way that if everyone follows their own rational financial interest, then the outcome should be a nice distribution of stake.
What are Incentives?
Incentives in the context of a cryptocurrency are ways of encouraging people to participate in the protocol and to follow it faithfully.
In the case of Bitcoin, this means mining blocks and incorporating as many valid transactions in those blocks as much as possible
In Cardano, it means being online and creating a block when they have been elected as slot leader and to participate in the election process.
Participating in the Cardano protocol incurs far less computation costs than participating in Bitcoin. Nevertheless, having slot leaders online when it is their turn is important for both security and efficiency. And for these slot leaders, there is some investment (in the form of hardware, time, so forth) so its fair that they should be reimbursed for the trouble.
Incentives in our case is referring to monetary incentives in the form of ADA.
However, it should be noted that there are other types of incentives, such as:
- general desire to “do the right thing”
These should not be underestimated…For example, when the Bitcoin mining pool Ghash accumulated 42% of total mining power, people voluntarily started leaving the pool and brought it down to 38% in a matter of two days. This was done not for financial reasons, as the people who left Ghash did not receive any monetary incentives. But they did it because they believed in Bitcoin and decentralization and the desire to do the right thing. I found more information on this incident here.
In the ideal world, monetary and moral incentives should align.
In the Bitcoin example given above, it was not ideal as people had to choose between doing the right thing morally and pursuing financial gain.
The goal in Cardano is to align these two things: if you maximize your profit, you are automatically doing the right thing.
What do we want to incentivize?
- stakeholders to be online
- participation in the protocol: when stakeholders are elected slot leader for a certain slot, then they should be online at that slot to create the block
On the other hand, there may be people who are not interested or don’t have the technical know-how to set up software or the time to be online → but they can still participate by delegating their stake to a stake pool!
- 80% of all stake should be delegated to a number ( k ) of stake pools
- k should be around 100
- and those stake pools should be power users and be online when needed
- they should also provide additional network infrastructure (relay nodes)
- it is okay for the remaining 20% to participate in the protocol on their own or to simply do nothing
The team is configuring incentives in a way that they achieve this outcome.
Cardano is proof-of-stake system. Holding stake (owning Ada) means more than holding Bitcoin. Ada can be used to buy goods or services since it is a cryptocurrency, but in addition to the buying/payment power, it also means you have the right and obligation to participate in the protocol and create blocks.
These 2 uses can be separated by the delegation mechanism – meaning someone who owns Ada can keep the spending power, while delegating the power to participate in the protocol to someone else (stake pool)
It is important to note that funds can be spent normally at any time.
There are 3 distinct types of addresses or accounts. Each of which is associated with 2 keys (pair). One key is for payment, and one for staking.
3 Types of Addresses:
- Base Address: staking key is directly linked to the address
- Pointer Address: is more indirect. The address points to a point in the blockchain → at that point in the blockchain, there is some metadata that defines the staking key.
- Enterprise Address: cannot stake. This is used for exchanges. From the point of blockchain, exchanges are extremely rich. But the Ada in this address actually belongs to a number of separate individuals who deposited into the exchange. Don’t want the exchange to use clients’ money to participate in the protocol. This type of address can only transfer funds.
What is delegation certificate
It is a cryptographically signed piece of metadata in the blockchain that transfers staking rights from one staking key to another.
A delegation certificate can be published on the blockchain, in which case it is called heavyweight. This transaction will be on the blockchain and part of this metadata will be this delegation certification. Because of this there will be transaction fees (same as the normal fee).
There are also lightweight certificates. These are not published on the blockchain and not part of the metadata of transaction. They only become public as part of a block and is included in the block headers by the creator of block, to prove that he has the staking rights for the address that was elected as slot leader.
If there are conflicting certificates (ie. you delegate to someone and then somebody else) and there are 2 delegation certificates. There is a rule to break the tie, and this is whichever is later in the blockchain wins.
Stake Pool Registration
If one wants to create a stake pool, they must create formally register and be written into the blockchain ledger. The stake pool will create a registration certificate. This will also be embedded in a special transaction (therefore, there will be a fee to create a pool) in the system. The certificate contains the staking key of the pool leader. People wishing to delegate to this pool will then create delegation certificate where they transfer their staking rights to that staking key.
Note that stake pool registration is still open (until May 31). If you are interested, you can do so here.
Incentives Mechanism: Where does the money for Incentives come from?
There are two sources of funds for incentives.
1. Transaction fees
There are 2 main reasons for transaction fees:
- Prevention of DDos (Distributed Denial of Service) attacks
In a DDoS attack, an attacker tries to flood the network with dummy transactions to overload the system. If he has to pay a sufficiently high fee for each of those dummy transactions, this form of attack will become prohibitively expensive for him.
- to provide funds for incentives.
There will be an explanation on how the fees are calculated in the next section.
2. Monetary Expansion
The total supply fo Ada today is approximately 31 billion Ada. And the maximal supply is 45 billion. Therefore, there is a gap of 14 billion Ada available. These Ada can be used for incentives as well.
Though this is a very large amount, it is not finite.
The idea is to do something similar to Bitcoin, which is to have exponential decrease over time (% used for incentives will become less and less). The goal and hope is that of course Cardano will become largely successful. With that, more and more people will use it and the amount received through transaction fees will go up. This will create less need for this extra monetary expansion money.
How Fees Work
There is a rule that is hardcoded, for each transaction on what minimal fees are. Each transaction, must include at least minimal fees. So, the inputs for transactions have to be larger than outputs of transaction and the difference must be at least the minimal fee (or you can pay more if you want to).
Minimal fees formula
It is a linear function:
a + b x size
(‘size’ is that of transaction, in bytes, and not the amount of Ada)
a = constant, at this moment is 0.155381 Ada
Needed for prevention of DDoS → so that no matter how small the transaction is, it should cost enough to hurt an attack who tries to generate thousands of dummy transactions.
b = constant, at this moment is 0.000043946 Ada/byte
This is for fairness. The idea is that you should pay for the strain you put on the system. If you have a large transaction, the people who run the protocol will have to store your data on your computer and have computer memory. Therefore, it makes sense that the bigger the transaction, the more expensive it should be.
As an example: Take a transaction, with a fairly typical size of 200 bytes. Inputting the constants and the size, the transaction fee will look like:
0.155381 Ada + 0.000043946 Ada/byte x 200 bytes = 0.1641702 Ada
At some point, there is anticipation that values may be adjusted to better reflect actual costs. This is dependent on the course of Ada and on the use statistics of the system.
Dr. Brünjes also notes here that there may be additional terms in the future. There are ideas such as looking at the number of UTxO (which makes your wallet more complicated) and also affects the amount of data, or looking at the actual size of Ada (large amounts of Ada, not just in byte).
In Cardano, there is strict division of time (into epochs and slots).
Slots last 20 seconds. For each slot, one coin is randomly chosen and the owner of that coin has the right to create this block in that slot.
Epochs contains 21,600 slots, which is exactly 5 days. An epoch is where election/randomization process happens. Every 5 days, people ‘roll their dice’ and slot leaders for the next epoch are elected at that point.
In Bitcoin, distribution occurs block by block. But in Cardano, the plan is to distribute incentives in an epoch by epoch base. All transaction fees (from all blocks of an epoch) plus monetary expansion will be put into one reward pool, for the whole epoch. Then this whole pool will be distributed amongst the people that were active/important during this epoch.
Basic idea of distribution: Explained in Two Steps
1. How the whole reward pool is distributed amongst pools
The basic idea is to do it proportional to stake so you can look at stake, and do the calculation. Or you can look at number of slots in that epoch that that pool was elected as slot leaders (not the number of actual blocks it created).
These two approaches look different at first, but the probability of being elected slot leader is proportional to the controlled stake (due to how cardano protocol works). Then, these methods have the same expected rewards.
There are two refinements, as follows.
The maximal proportion of the rewards pool that a stake pool can receive will be limited by 1/k
(k being number of desired pools, probably around 100)
Without this, pools would want to get bigger and bigger because they still get same reward, with lower cost since the overhead cost will not be much more than a smaller pool’s.
if k = 100
A and B with 0.3% and 1.2% of stake respectively.
A will receive 0.3% of rewards pool but B will receive 1/100 = 1%
In this example, no matter how high your stake is, you can never get more than 1% of rewards pool. The hope is that this will have the effect that pools won’t grow too large.
So far, this was all only dependent on stakes that stake pool have, but not on the work they actually do. There is a need for a mechanism, which check that blocks are being created when elected. Thus, stake pools should be penalized for not following the protocol and not being online when it is their turn.
This predicate will decide whether the stake pool is eligible for its share of the reward pool, by looking at the slots a given stake pool was elected for as a leader and the number of blocks it actually created. This can not be as simple as “creating at least x% of the blocks it was supposed to”. → Say they say you must create at least “90%” of blocks you have been elected to create to receive your reward. In this case, if a stake pool is elected for 100 slots in epoch, and it already created 90 blocks, then they would most likely just switch off the computer and ignore the last 10. If everyone did that, then at end of epochs, everyone would switch off computer, which is not good.
That is why needs to be a bit more complicated whether it be randomization or other algorithms.
2. How one pool further splits rewards among members
After rewards pool has been split between stake pools, each stake pool leader has to distribute her share of the rewards amongst her pool members. Pool members are the people who delegated their stake to the pool.
The two general guidelines are:
- Pool leader herself should be compensated for her costs (hardware, registration, computing power, online time, etc.) and rewarded for her efforts
- Pool members should be rewarded proportional to the stake they delegated to the pool
To understand this, let’s take this example:
Consider pool leader Alice with 0.2% of stake who forms her pool with Bob (0.1% of stake) and Charlie (0.2% of stake).
Let us further assume that the reward pool for a fictional epoch, and it contains 5,000,000 Ada. Also assume that Alice’s pool fulfilled its predicate and dutifully created blocks during all slots it was elected slot leader.
Then Alice’s pool which holds (0.2% + 0.1% + 0.2%) 0.5% of stake, which is less than 1/k and has no cap: will receive (0.5% of 5,000,000) 25,000 Ada from the reward pool for this epoch.
Of the 25,000 Ada, Bob will get half of what Charlie gets.
But Charlie will get less than Alice herself, to reward Alice for the cost and trouble of running her pool.
Assume that this additional compensation for running a pool in this example is 5,000 Ada. This will go to the pool leader. So out of the remaining 20,000, you can do a 2:1:2 calculation based on % of stake.
Alice will receive 13,000 Ada (8,000 + 5,000)
Bob will get 4,000 Ada
Charlie will get 8,000 Ada
*Note! This example is purely fictional and meant to explain the idea of reward distribution. It by no means reflects future actual reward amounts!
There are 2 reasons that you could get less than your stake:
- if you have more than 1/k as explained above
- if you don’t do your work and participate in the protocol
In these cases, the whole reward pool is not distributed. It is important that this unspent reward does not get distributed amongst the rest of the people. This is not a bug, but rather a feature, because these funds will go to the treasury which promote sustainability in the system.
No Competition Between Pools
An important consequence that comes out this structure of undistributed funds is that is means there is no competition between pools. There is nothing one pool can do to increase its rewards by decreasing another pools reward. There is no incentive for any pool to sabotage another pool’s work.
Classic attacks in Bitcoin like selfish mining or block withholding cannot work because the pools are fenced off from each other. The actions of one pool only affect its own rewards.
Watch the video of the presentation here:
And his presentation slides can be found here.