reviving op_difficulty



Summary:

In a bitcoin-dev discussion, Tier Nolan proposed a new method for speculation contracts to consider the ratio between future and current difficulty instead of difficulty itself. Nolan suggested obtaining this ratio from packed representations already included in blocks. The formula for the ratio involves dividing current difficulty by last difficulty, which is the same as one divided by the ratio of current target to last target. Nolan provided an example using the current and last difficulties and targets. With this method, op_diff could take two packed targets (one known and one unknown at the time of the contract) and return the ratio. Then, the contract could work using the ratio for ticks instead of difficulty.


Updated on: 2023-06-14T15:11:24.345519+00:00