---
# System prepended metadata

title: Update Difficulty Bomb with a Freezing Mechanism

---

---
eip: 2515
title: Update Difficulty Bomb with a Freezing Mechanism
author: James Hancock (@madeoftin)
discussions-to: https://ethereum-magicians.org/t/eip-2515-replace-the-difficulty-bomb-with-a-difficulty-freeze/3995
status: Draft
type: Standards Track
category: Core
created: 2020/02/10
---

# Update Difficulty Bomb with a Freezing Mechanism

**Discussion Note*

*This is an active document to see the most recent version please make comments on https://hackmd.io/pL5JAgN2STSzqV7_ZSoT_Q*

*Long form discussion is also avaible on the forum: https://ethereum-magicians.org/t/eip-2515-replace-the-difficulty-bomb-with-a-difficulty-freeze/3995*

## Simple Summary
<!--"If you can't explain it simply, you don't understand it well enough." Provide a simplified and layman-accessible explanation of the EIP.-->
The Difficulty Freeze is an update to the Difficulty Bomb implemented within the Ethereum protocol's difficulty adjustment algorithm. The difficulty would freeze at a specific block height, determined in advance, and increases through a predictable mechanism. This does not stop the chain, but it keeps the functionality of the original difficulty bomb, while making it simple to predict when it occurs. 

## Abstract
<!--A short (~200 word) description of the technical issue being addressed.-->
The difficulty freeze mechanism is easy to predict and model. The client maintainers are also positioned to respond to an incoming Difficulty Freeze because they are the arbiters of client release code. This, combined with the predictability, will lead to more timely diffusion of the bomb.


## Motivation
<!--The motivation is critical for EIPs that want to change the Ethereum protocol. It should clearly explain why the existing protocol specification is inadequate to address the problem that the EIP solves. EIP submissions without sufficient motivation may be rejected outright.-->
The current difficulty bombs' effect on the Block Time Targeting mechanism is rather complex to model, and it has both appeared when it was not expected (Muir Glacier) and negatively affected users and miners when they are not the target (in the case of delaying forks due to technical difficulties). 
- Users are affected as a function of the usability of the chain is affected by increased block times. 
- Miners are affected by an unplanned reduction in block rewards due to the increase in block time.

Both of these groups are unable on their own to address the difficulty bomb. In the case of the Difficulty Freeze it is more predictiable and so knowing when to make the change is readily apparent at all times to all stakeholders.

## Specification

Add variable `DIFFICULTY_FREEZE_HEIGHT`


The logic of the Difficulty Freeze is defined as follows:

```
### If before the Freeze adjust the difficulty as normal
if (BLOCK_HEIGHT <= DIFFICULTY_FREEZE_HEIGHT):
   block_diff = parent_diff + parent_diff // 2048 * max(
                1 - (block_timestamp - parent_timestamp) // 10, -99)

### After the difficulty freeze increase the difficulty every block by .01%
else:
 block_diff = parent_diff + parent_diff * 0.0001
```

**Optional Implementation**

Add the variable `DIFFICULTY_FREEZE_DIFFERENCE` and use the `LAST_FORK_HEIGHT` to calculate when the Difficulty Freeze would occur.

For example we can set the `DFD = 1,800,000 blocks` or approximately 9 months. The Difficulty Calculation would then be.

```
if (BLOCK_HEIGHT  <= LAST_FORK_HEIGHT + DIFFICUTLY_FREEZE_DIFFERENCE) :
   block_diff = parent_diff + parent_diff // 2048 * max(
                1 - (block_timestamp - parent_timestamp) // 10, -99)

else:
 block_diff = parent_diff + parent_diff * 0.0001
```

This approach would have the added benefit that updating the Difficulty Freeze happens automatically at the time of every upgrade. The trade-off is that the logic for checking is more complex and would require further analysis and test cases to ensure no consensus bugs arise. 

## Rationale
<!--The rationale fleshes out the specification by describing what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work, e.g. how the feature is supported in other languages. The rationale may also provide evidence of consensus within the community, and should discuss important objections or concerns raised during discussion.-->

### Why use Block Height?

Block height is very easy to predict and evaluate within the system. This removes the unpredictable part of the block time targeting mechanism and *when* the bomb takes effect will be well known in advance by all parties.

Once a block height is reached there are two approaches that can achieve the goal of "eventual assured obsolescence". I will document each as we have not yet determined, which is the preferred method.

 - Freeze Difficulty Than increase Difficulty at each block.
 - At a certain block height start to increase the target block time.


### Freeze Difficulty Than increase Difficulty at each block.

[Todo @madeoftin]

### Rational behind the 0.001% Increase
The algorithm is not purely linear, but slowly increases exponentially every block by .01% of the previous. It still needs to be determined if a pure linear function is preferred, or which value of the scalar if it is exponential.

[Insert Graphs]

### At a certain block height start to increase the target block time.

[Todo @madeoftin]

## Backwards Compatibility
<!--All EIPs that introduce backwards incompatibilities must include a section describing these incompatibilities and their severity. The EIP must explain how the author proposes to deal with these incompatibilities. EIP submissions without a sufficient backwards compatibility treatise may be rejected outright.-->
No backward incompatibilities

## Test Cases
<!--Test cases for an implementation are mandatory for EIPs that are affecting consensus changes. Other EIPs can choose to include links to test cases if applicable.-->
TBD

## Implementation
<!--The implementations must be completed before any EIP is given status "Final", but it need not be completed before the EIP is accepted. While there is merit to the approach of reaching consensus on the specification and rationale before writing code, the principle of "rough consensus and running code" is still useful when it comes to resolving many discussions of API details.-->
TBD

## Security Considerations
<!--All EIPs must contain a section that discusses the security implications/considerations relevant to the proposed change. Include information that might be important for security discussions, surfaces risks and can be used throughout the life cycle of the proposal. E.g. include security-relevant design decisions, concerns, important discussions, implementation-specific guidance and pitfalls, an outline of threats and risks and how they are being addressed. EIP submissions missing the "Security Considerations" section will be rejected. An EIP cannot proceed to status "Final" without a Security Considerations discussion deemed sufficient by the reviewers.-->
The effect of missing the Difficulty Freeze has a different impact than missing the Difficulty Bomb. At the point of a Difficulty freeze, the protocol is no longer able to adapt to changes in hash power on the network. This can lead to one of three scenarios.

 - The Hash rate Increases:
   Block Times would increase on the network for short time until the steady increase in difficulty is too high for the network to add any more miners.
 - The Hash rate decreases:
   Block times would increase. 
 - The Hash rate stays the same:
   A consistent increase in blocktimes.

Clients are motivated to have their client sync fully to the network and so are very motivated to keep this situation from occurring. Simultaneously delaying the Difficulty Freeze is most easily implemented by client teams. Therefore the group that is most negatively affected is also the group that can most efficiently address it.

## Economic Considerations

Under the current Difficult, Bomb issuance of ETH is reduced as the Ice Age takes affect. Under the Difficulty Freeze, it is more likely that issuance would increase for a short time; however, clients are motivated to prevent this and keep clients syncing effectively. This means it is much less likely to occur. However, The steady increase of difficulty after the freeze will shortly reduce blocktimes and also issuance.

It is also easy when the freeze occurs, and stakeholders who are affected (Eth Holders) can keep client developers accountable by observing when the Difficulty Freeze is approaching and yell at them on twitter.

## Update History
This chronicles the significant updates to the proposal, and answers "How did the proposal get to where it is today" in an effort to bring readers of the EIP along for the journey.

- **Update from a Freeze to Freeze and Blow up** 
  - The addition of increasing difficulty after the freeze was added after feedback that the game theory of the mechanism did not reliably result in planned obsolescence of the chain. It was still theoretically possible that a chain could continue in a zombie state with miners self-regulating hashrate to keep the chain at a semi-functional state. While the game theory tended towards miners reaching blocktimes too fast for the network to propagate, the addition of a steady increase in difficulty removes this possibility and is therefore more secure. https://twitter.com/quentinc137/status/1227110578235330562
- **Evaluate whether increasing the difficulty, or increasing the target block time is preferred.**
  - The possibility of increasing the target block time was introduced on the AllCoreDevs call. They both need to be evaluated side by side to make the best decision regarding the network.

## Copyright
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
