# Reviewing QAP Rebase ###### tags: `filecoin-pl` `Protocol Review` :::info Up to date by December 2022 ::: *Date: 07 December 2022* *Speaker: Danilo Lessa Bernardineli (BlockScience)* ## What is Baseline Minting ### What is Block Reward Filecoin directs 55% of its Base issuance (2 Billion FIL) for "Storage Mining allocation" (1.1 Billion FIL), which is distributed periodically through the `RewardActor` based on the proportional compositions of the Network QAP. This is known as the "Block Reward" The total amount to be distributed on each epoch is controlled by the Minting Mechanism, of which there are two: the Simple Minting (30% of the SM Allocation or **16.5% of the Total** Issuance - 330M FIL) and the Baseline Minting (70% of the SM Allocation or **38.5% of the Total** Issuance - 770M FIL). [^mintingmodel] The actual distribution is described at this doc: [Block Reward Issuance Spec](https://spec.filecoin.io/#section-systems.filecoin_token.block_reward_minting.block-reward-issuance) ![Filecoin Token Allocation](https://hackmd.io/_uploads/ByAznaivj.png) *Filecoin Token Allocation as per the [spec](https://spec.filecoin.io/#section-systems.filecoin_token.token_allocation)* ### The Minting Form Both the Simple and the Baseline Minting functions take an similiar fundamental shape, they're described by $M(t) = M_\infty (1 - e^{-\lambda \tau})$, on which $M(t)$ is the minted supply on time $t$, $\lambda$ is the reward decay factor, $\tau$ is the measurement time and $M_\infty$ is how much tokens can be minted as $t \to \infty$. Another perspective is to refactor it so that the expected reward issuance is computed for the interval $[t-\Delta t, t]$: $m(t; \Delta t) = M(t) - M(t - \Delta t)$ $m(t; \Delta t) = M_\infty (e^{-\lambda(\tau - \Delta t)} - e^{-\lambda \tau})$ On Simple Minting, the measurement time is simply the current time ($\tau = t$). On Exponential Minting, the measurement time is the Effective Network Time ($\tau = \theta(t; S)$). ### Baseline Minting Properties An explainer for the Effective Network Time (ENT) specifics is contained on [Going Deep into Baseline Minting](/Psv3zSgATtCtxAzh1_pmEA), and a decent way of gaining intution is through the [Baseline Minting Educational Calculator](https://share.streamlit.io/blockscience/filecoin-baseline-incentives/main/app/main.py). From an Macro point of view, Baseline Minting has the effect of diminishing the Total Rewards being issued vs an Simple Exponential one when the RBP is below the Baseline. The rate of change of the Total Rewards however is lower than the rate of change of the Marginal Rewards. Effectively, this is creating an "network savings account" during sustained period down the baseline for when it crosses up again. A way to understand it is through affirming some properties: - P1: When the Network is above target and is on an "steady-state", then the ENT will progress on the same rate than the RT (Real Time). - P2: When the Network is below target and is on an "steady-state", then the ENT will progress slower than the RT. - P3: If the network did accumulate a lot of lag between the ENT and RT, then when it goes up again, the ENT will progress temporarely faster than the RT. More generally, it can be useful to decouple conceptually what is the `Effective Network Time`, and what is the `Target/Measurement Functions`. The `Effective Network Time` is defined as being the integral term $\theta(t)$ when summing over historical evolution of the `Measurement` function (the Capped Power $\bar{R}(t) = min(b(t), R(t))$) forcing it to be equal to the evolution of an `Target` function (which is the baseline function) $$\int_0^{\theta(t)} b(t)dt = \int_0^t \bar{R}(t) dt$$ Finding $\theta(t)$ requires solving the above analiticaly or numerically. A demonstration for how doing the later can be found at [Filecoin Baseline Minting Toy Model Spreadsheet](https://docs.google.com/spreadsheets/d/1foQghl2tTwjGZ2dWkTAJjBU6wvJi5Ot0HSZxK82Mdcc/edit?usp=sharing). It is possible to decouple the integral into $\int_0^{\theta_1} + \int_{\theta_1}^{\theta_2}$ terms, which gives us the following relationship for the partial evolution: $$\int_{\theta(t_1)}^{\theta(t_2)} b(t) dt = \int_{t_1}^{t_2} \bar{R}(t) dt$$ For an discrete time-series, the above can be shown to make the following expression true: $b(\theta_2)=\bar{R}(t_2)+\bar{R}(t_1) -b(\theta_1)$, which provides an more compact form of computing the new Effective Form **if the inverse function of $b(\theta)$ is known**. More generically, the above could be reframed as: $$\int_0^{\theta} T(t)dt = \int_0^t M(t) dt$$ Where $T(t)$ is the `Target` function, and $M(t)$ is the `Measurement` function. An important assumption when selecting the `Target` and `Measurement` function is that they should be non-negative, as not doing so would potentially generate multiple solutions for $\theta(t)$ rather than a single one. The development of the current form of the Baseline Minting form is an direct ramification of ZX's research work on KPI-driven minting forms, and they can be referentiated at: - [Zhang, Z., Zargham, M. & Preciado, V.M. On modeling blockchain-enabled economic networks as stochastic dynamical systems. Appl Netw Sci 5, 19 (2020). https://doi.org/10.1007/s41109-020-0254-9](https://appliednetsci.springeropen.com/articles/10.1007/s41109-020-0254-9) - [Engineering Token Economy with System Modeling, Zixuan Zhang](https://arxiv.org/pdf/1907.00899.pdf) ### Pitfalls Changing the "Baseline Function" as a way of issuing FIL rewards can be an multi-faceted question, as the following changes can be considered: - Changing the **Baseline Function Parameters** (eg. the Target Growth) - Changing the **Effective Network Time Form** (eg. use the capped-QAP rather than the capped-RBP as the `Measurement`, or change the `Target` function altogether) - Changing the **Issuance Form** (eg. use something else than the `Effective Network Time` to compute the rewards on a given epoch) The current Baseline Function has another role beyond controlling the Effective Network Time: it also controls the ceiling of the Miner Consensus Pledge as saw in [Reviewing the Target Locked Supply](/90MrWid8QHejWGAju9EaDw). Setting-up the Growth Parameter was always more of an subjective call based on feedbacks from storage miners and stakeholders rather than an optimization one, as doing the later would require an model for inferring Network Growth without having any data. It was expected that the parameter would need to be adjusted at some point (probably two years into the launch). One of the few framing points was the [study conducted by Seagate on the state of Cloud Storage](https://www.seagate.com/files/www-content/our-story/trends/files/idc-seagate-dataage-whitepaper.pdf). As saw in [Going Deep into Baseline Minting](/Psv3zSgATtCtxAzh1_pmEA), following the current Baseline trajectory would imply in Filecoin holding ~0.2% of the Public Cloud Storage by 2027, or ~2.5% of the Public Cloud Storage on the Edge. It is common to mistake what seems "good" for the network for what seems "good" to the individual. Any analysis on Token Issuance must take into the consideration that scarcity on supply can be seen as an opportunity OR an threat by different stakeholders. ## Historical Context The current Issuance Form and Baseline Function form were adopted in circa February 2020. Having an KPI-driven approach for issuing rewards was a old desirable when Filecoin was being designed, and several forms were tested before adopting the current one. For instance, as saw in [Target Driven Minting Functions, February 2020](https://github.com/filecoin-project/bsci-collab/blob/2020feb05/src/lab_notebook.ipynb), forms being tested included using an "Instant Target" for issuance, and the current Effective Network Time. | Network and Target Power | Daily Rewards | Marginal Daily Rewards | | -------- | -------- | -------- | | ![](https://hackmd.io/_uploads/rJUAnWavo.png) | ![](https://hackmd.io/_uploads/S1xCnb6wj.png) | ![](https://hackmd.io/_uploads/S1i9nWpvo.png) | ___ An even earlier proposed form was the Sigmoid Minting (or Exponential Decay wrt Power) one, on which the Minted Supply on the time $t$ would be expressed as being $S(t) =M_\infty (1 - \alpha^{\int_0^t P(t) dt})$, with $\alpha$ being restricted on the range $\alpha \in [0,1]$. [Sigmoid FIL Supply, as a function of network power, November 2019](https://github.com/filecoin-project/bsci-collab/blob/2019nov14/src/lab_notebook.ipynb). Logistic Growth forms were also considered, as saw in [Effects of Minting Functions on Capacity Commitment, January 2020](https://github.com/filecoin-project/bsci-collab/blob/2020jan16/src/lab_notebook.ipynb). ___ ![](https://hackmd.io/_uploads/SyoPgMpwj.png) *Some alternate issuance forms considered prior to the introduction of Baseline Minting.* ![](https://hackmd.io/_uploads/SkeZlzTPs.png) ___ Initially, we were working into the assumption that the Filecoin Reward Issuance would be done entirely by using the KPI-driven minting function. However it became obvious after some time that mixing minting functions could be beneficial to allow the network to "catch up" during shock events. Because of that, the combination of Simple Exponential and the Effective Network Time based minting functions were chosen. The first due to its simplicity and because of its incentives during shock events, and the second because it was the one that did express the long term incentives the best. All the other ones were made meaningless by having an combo of two. The rationale for choosing the Raw-Bytes Network Power as being part of the `Measurement` function was due to its predictability. **The explicit goal for Baseline Minting was to incentivize the network to have enough Storage Supply to met the expected demand for storage**, and that is **measured in raw-bytes rather than quality-adjusted** bytes. The introduction of quality-adjusted power was not perceived back then as being problematic on the calculus, as that was **related to an reward distribution question** rather than being related to estabilishing network-wide targets. - [Pathway to Parameter Recommendations, June 2020](https://docs.google.com/document/d/1CjGHCdZAIfz9MpsBc1qEWwpdAuSCqkdTkYRzXymz2xs/edit#heading=h.21ctbqb0m770) - [Cryptoecon Path to Mainnet Launch, July 2020](https://docs.google.com/document/d/1785jcbMex0omYaJFlJMYIcLVJJKzIOszsxNxNmuZi00/edit#) - [Filecoin Data Analytics, February 2021](https://docs.google.com/document/d/1RQtNjaIwgP3P4L1pR2rxO6eddBUuZYvX1w5K430ghVs/edit#) - [(Scope) Baseline Function Incentives Educational Calculator](/wl6QrhPDQciw0xtAr0QEQQ) ## Some Q&A Q: Background of why the baseline was established the way it was A: the current Baseline Function Form was established after multiple iterations and against multiple alternative forms. The design goals being expressed were: - Rewards should not be disproportionally issued during shock events so that long-term viability is compromised, but not smoothened too much to the point of not providing incentives to the network to recover - Rewards should incentivize the Network to achieve certain milestones in terms of capacity, but not so excessively to the point of generating excessive supply. - The form should be designed in a way that makes intuitive sense for future governance changes. It's important to note that the Baseline Function is responsible for 70% of the Rewards Issuance, and the Simple Exponential is responsible for 30%. Both are complementary, and in an sense, opposites. The role of Simple Exponential is to provide the usual deflationary issuance as seen in other currencies, and the role of Baseline Minting is to provide an "mid-way" between time-fixed rewards for mining and purely decaying rewards but using milestones as a guide. ___ Q: It’s not a foregone conclusion that it will be “bad” if we drop below the baseline…but what are the pros and cons of rebasing ourselves? A: The current baseline-based minting has a design goal of ensuring that the network has incentives to have **no more** than an specific amount of raw storage. Changing it to QAP means that network should aim to have **no more** than an specific amount of quality-adjusted storage. Seems trivial, but there's some subtle interpretations from it. For instance, let's suppose that the network RBP / QAP is 1000 PiB / 5000 QA-PiB, and the baseline is 2000 PiB, and we rebase it to 10000 QA-PiB. Before the rebase, the only way of the network to cross Baseline would be to onboard 1000 PiB immediatly, regardless of deals. After the rebase, the network could cross Baseline by upgrading 100% of its sectors to be saturated with Verified Deals. **By rebasing from RBP to QAP, we are increasing the pathways on which crossings can be achieved**, and this means that **the signal meaning becomes more fuzzy for the participants as for how to act**. A RBP below baseline could be an clear signal that onboarding new sectors is priority. A QAP below baseline is ambiguous: should we onboard or should we upgrade? This can be considered a Con. Additionally, **it's likely that RBP is an more time-stable measurement than QAP**, as onboarding sectors is costly and slow, while upgrading and making/droping deals can be comparatively fast In terms of Pros, **the main advantage is merging concepts: it allow participants to use the QAP concept more universally**. ___ Q: Would we rebase in terms of QAP? Something else? A: QAP is an obvious one, but it could be a interesting idea to think about the system goals and how the `Target` and `Measurement` functions could be tailored to achieve those. What if the Baseline Function depends on the recent and upcoming sector expirations instead? One interesting thing about using the `Effective Network Time` concept is that it allow us to decouple the Issuance Dynamics from the Time Dynamics. For instance, there's nothing that impede us of actually advancing future rewards now - we just need to make the Effective Network Time ahead of the current time. This could be used for providing extra incentives if the `ENT` is already close to the `Real Time`, and we foresee an shock event soon (like a wave of expiring sectors). ___ Q: questions around the shape/character/dynamics of ROI in relation to the baseline. A: An old issue with ROI is that it depends on multiple definitions: the FIL price, the actor portfolio strategy, and so on. It's very difficult to plot anything like "ROI vs Baseline". The best we can assume is that the intrisic value is on the Unit of Filecoin, and FIL on FIL is all that matters. An interesting question is to ask the following: Suppose two network trajectories: one which the RBP is always equal to the Baseline Function, and another one which crosses it down and then up. What is going to be the Miner Marginal Reward on both scenarios? And how would it be if Baseline Minting didn't exist? Eg. 100% of the Issuance is due to Simple Exponential. That's exactly what [A cadCAD Interactive Calculator to Explore Minting Scenarios in Filecoin](https://medium.com/block-science/a-cadcad-interactive-calculator-to-explore-minting-scenarios-in-filecoin-284009a2e941) seeks to answer. The metric "Mining Utility" computes what's the FIL Marginal Reward on the Baseline Crossing Scenario, divided by the FIL Marginal Reward on which the RBP is always equal to the RBP. What is clear is that introducing the Baseline Function as a Issuance mechanism does decreases the Marginal Rewards vs not having Baseline, but it doesn't do so in an absolute way: The Marginal Rewards will still go up as RBP decreases, it will only go up slower. | RBP Trajectories | Mining Utility | | -------- | -------- | | ![](https://hackmd.io/_uploads/Hyk3GQTPo.png) | ![](https://hackmd.io/_uploads/HJBnGQ6wj.png) | ## References - [Baseline Minting Educational Calculator](https://share.streamlit.io/blockscience/filecoin-baseline-incentives/main/app/main.py) - [“Baseline Crossing”, CEL](https://hackmd.io/Ny_e0UkXRGCTDA0oT3me2A?view) - [“Reviewing the Target Locked Supply”, BlockScience](https://hackmd.io/90MrWid8QHejWGAju9EaDw?view) - [“Sustainability Goal Achieved: Filecoin Network Crosses Baseline Target”, BlockScience](https://medium.com/block-science/sustainability-goal-achieved-filecoin-network-crosses-baseline-target-cec13a3ed8f) - [BlockScience blog about baseline crossing scenarios](https://medium.com/block-science/a-cadcad-interactive-calculator-to-explore-minting-scenarios-in-filecoin-284009a2e941) - [Going Deep into Baseline Minting](/Psv3zSgATtCtxAzh1_pmEA) [^mintingmodel]: [Minting Model - Token, Filecoin Specification. Section 2.5.1. accessed in 2022-12-05](https://spec.filecoin.io/#section-systems.filecoin_token.minting_model)