Skip to content

Commit

Permalink
Merge pull request ipld#165 from filecoin-project/feat/block-reward-l…
Browse files Browse the repository at this point in the history
…ogic

write out block reward logic
  • Loading branch information
whyrusleeping authored Mar 8, 2019
2 parents b3c42a9 + 008b3d3 commit e8f43d8
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions mining.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,32 @@ An eligible miner broadcasts the completed block to the network (via [block prop

### Block Rewards

Currently the block reward is a fixed 1000 FIL. This will change soon.
Over the entire lifetime of the protocol, 1,400,000,000 FIL (`TotalIssuance`) will be given out to miners. The rate at which the funds are given out is set to halve every six years, smoothly (not a fixed jump like in Bitcoin). These funds are initially held by the network account actor, and are transferred to miners in blocks that they mine. The reward amount remains fixed for a period of 1 week (given our 30 second block time, this is 20,160 blocks, the `AdjustmentPeriod`) and is then adjusted. Over time, the reward will eventually become zero as the fractional amount given out at each step shrinks the network accounts balance to 0.

The equation for the current block reward is of the form:

```
Reward = IV * (Decay ^ (BlockHeight / 20160))
```

`IV` is the initial value, and is computed by taking:

```
IV = TotalIssuance * (1 - Decay)
```

`Decay` is computed by:

```
Decay = e^(ln(0.5) / (HalvingPeriodBlocks / AdjustmentPeriod))
```

```
// Given one block every 30 seconds, this is how many blocks are in six years
HalvingPeriodBlocks = 6 * 365 * 24 * 60 * 2
```

Note: Due to jitter in EC, and the gregorian calendar, there may be some error in the issuance schedule over time. This is expected to be small enough that it's not worth correcting for. Additionally, since the payout mechanism is transferring from the network account to the miner, there is no risk of minting *too much* FIL.

### Open Questions

Expand All @@ -281,4 +306,4 @@ Currently the block reward is a fixed 1000 FIL. This will change soon.
There are many ideas for improving upon the storage miner, here are ideas that may be potentially implemented in the future.

- **Sector Resealing**: Miners should be able to 're-seal' sectors, to allow them to take a set of sectors with mostly expired pieces, and combine the not-yet-expired pieces into a single (or multiple) sectors.
- **Sector Transfer**: Miners should be able to re-delegate the responsibility of storing data to another miner. This is tricky for many reasons, and will not be implemented in the initial release of Filecoin, but could provide interesting capabilities down the road.
- **Sector Transfer**: Miners should be able to re-delegate the responsibility of storing data to another miner. This is tricky for many reasons, and will not be implemented in the initial release of Filecoin, but could provide interesting capabilities down the road.

0 comments on commit e8f43d8

Please sign in to comment.