Incidentally I was considering if we can use bitcoin historical hashrate change as a proxy for the demand of BTC, without relying on neither 1) Centralized Oracles nor 2) a specific fiat currency.
To that end I researched a Hashrate Demand Oracle as a base of a “stablized” coin backed by BTC; GitHub - Nuhvi/dbtc · GitHub
This Oracle can be available to all miners with no external information other than watching the Bitcoin chain’s headers, which is already available in Rootstock. So we can have that Oracle as a smart contract (just a messy example), or a precompiled contract, which then can be helpful for multiple purposes.
I am not 100% sure this price oracle would work great for a lending protocol and a stable coin etc.. but for adjusting fees, it feels like a solid “good enough” source of information, given that it only needs to react to the increase of BTC demand in a rough way that keeps the fees reasonable, not necessarily track the BTC/USD spot price minute by minute.
I thought difficulty would not be a good proxy for price, but seeing your repo maybe it is good enough for this. Could we tie min gas price directly to the Bitcoin difficulty observed in Rootstock’s headers?
Yeah I would assume that this Oracle would be a precompiled contract anyways, so having a parallel to it working on headers only wouldn’t be too difficult, at the end of the day, Bitcoin difficulty doesn’t change for 2016 blocks.
However, you need to be aware that this Oracle is a very lagging indicator, it shows persistent long term difficulty drop/increase, not only because we smooth over a year’s worth of data or so, but because bitcoin itself doesn’t adjust difficulty too often.
Maybe we can adjust gas price based on the difficulty in Rootstock, where adjustments happen more often, but I didn’t do any analysis, and also my bullish case for Rootstock is that miners don’t have much incentive to stop mining rootstock even if there is no revenue (as long as running RSKj is cheap), so difficulty in Rootstock might not be very good indicator of anything (except collapse if the federation screwed things up dramatically). So I hope Rootstock difficulty doesn’t drop much when miners revenue drops, in which case we can’t use this indicator.
So that leaves us with the Hashrate price Oracle based on Bitcoin difficulty adjustment, and it will work fine in the sense that it will roughly adjust reacting to the bitcoin’s 200 WMA price.
But isn’t that better than trusting miners to do the one thing that they have repeatedly proven they don’t want to? I don’t see much evidence that they have voted on any of the things that Rootstock Labs left for them to dynamically adjust with voting.
Maybe we should run some analysis to see how would Rootstock gas price react if we were using this oracle for the past few years.
A month later it is holding on very well, it is safe to say that Rootstock can easily price gas in DBTC instead of RBTC and never need miners engagement any more:
To be honest, it is impossible to guarantee that this phenomenon will last on the long term. Which is another reason why Rootstock needs a DAO… not to act as an oracle, but to intervene if/when this oracle starts to show cracks, and hopefully intervene only to update the correlation constants once a year or once every halving or something.
Unfortunately, the Oracle/Governance problem is unavoidable (think security councils, breaking changes, upgrades, enshrining and deprecating proof systems) .. so whoever solves it (Drivechains claim to be a solution, but miners seem too apathetic, we will see) will solve almost everything.