UTXOracle: A Decentralized Approach To The Oracle Problem

21 September 2023

This is an opinion editorial by Daniel Hinton, the head of finance and operations for sFOX, a bitcoin prime broker and custodian, and Steve Jeffress, creator of Bitcoin UTXO set visualizer UTXO.live.

We now know how to infer the daily price of bitcoin within 1% by looking only at the unspent transaction output (UTXO) set.

With this, we can build decentralized applications that rely on the UTXO set — rather than on trusted third-party oracles — for the USD price used in discreet log contracts (DLCs) and smart contracts.

The possibilities for decentralized applications on Bitcoin using this “UTXOracle” are enormous.

Source: author

When You Want To Know ‘The’ Price Of Bitcoin, Where Do You Look?

There is no single price of bitcoin. Every second of the day, there are thousands of exchanges, brokers, OTC desks, payment companies and other market participants around the world quoting the price of bitcoin — and none of them is always correct.

In this article, we will explore a new way of interpreting the Bitcoin UTXO set that accurately reflects a bitcoin price at each block height and has the potential to serve as the foundation for a new era of trust-minimized, decentralized finance on Bitcoin.

What trust-minimized tools could you build if you could calculate an accurate price for bitcoin at each block height, using only your Bitcoin full node and an open-source model?

DLC derivatives (options, futures, perpetual futures)On-chain lending marketsPeer-to-peer marketplacesBitcoin-backed USD stablecoins on LightningStable-value USD accounts denominated in bitcoinAny use case that requires a USD component

Any one of these concepts, successfully implemented on the Bitcoin blockchain in a trust-minimized way, could deliver tremendous value to both Bitcoiners — utilizing bitcoin for its superior monetary properties — and participants in the Bitcoin ecosystem who need to remain partially tied to USD but want to utilize Bitcoin as their settlement network.

On-Chain Transactions Encapsulate The Global Signal Of Economic Weight

During the 2016 to 2017 “Blocksize Wars,” the merits of not only running a fully-validating Bitcoin node, but conducting economic activity using your node, were convincingly argued in helping the network avoid a meaningful fork that could have delayed Bitcoin’s success.

For purposes of our current discussion, it can be said that this tumultuous time in Bitcoin’s history emphasized that, in the same way that someone can run 1 million “full nodes” on a cloud server that signal for a particular “upgrade” but not influence the network of economic actors in any way if they are not actively settling transactions, centralized exchanges can produce volume and price statistics that, in reality, do not carry economic weight, and which are not reflected in the UTXOs that are settled onto the Bitcoin blockchain.

You can temporarily give the appearance of having more bitcoin than you do within a closed system like an exchange, but as long as there is a credible threat of withdrawal for settlement to the Bitcoin base layer, any mispricing within the closed system will eventually resolve itself back to equilibrium with the external market.

For example, when Mt. Gox was insolvent in 2013 to 2014, but before it officially collapsed, the reported price of bitcoin on the platform was markedly different from other exchanges due to the fact that Mt. Gox did not have nearly as much bitcoin as it claimed. As a result, it needed to entice new users to deposit to the exchange in order to fulfill withdrawals from existing customers. Within the Mt. Gox system, the price could be manipulated, but when users attempted to arbitrage the price back to the market, Mt. Gox collapsed.

In contrast, the Bitcoin blockchain is the hardest ledger in the world to corrupt. It represents the entire history of economic settlement activity to have occurred and is the final arbiter of truth with regard to the status of all bitcoin in existence.

Transactions that matter are settled on the Bitcoin blockchain, not in closed systems. Final settlement is what matters.

UTXOs Are Created And Destroyed Each Time You Move Bitcoin

People have a difficult time grasping Bitcoin, since it’s impossible for them to take a physical coin out of their pocket, point to it, and say, “This is a bitcoin.”

One analogy I’ve gravitated toward when describing a specific amount of bitcoin in a person’s possession is visualizing an individual bill in a physical wallet. These bills can represent any amount and are only good for one use. So, if you need to spend $3, and only have a $100 bill, you can’t rip off a corner of the bill. You would need to spend the entire $100 bill and get your change back. In Bitcoin parlance, each of these bills is a UTXO. Any time you send bitcoin, you are spending (and destroying) at least one UTXO while simultaneously creating at least one new one. If you run any version of the Bitcoin software, at any point in time you can count up all the bitcoin contained in existing UTXOs to determine exactly how much bitcoin currently exists.

In fact, when used together, the Bitcoin blockchain and UTXO set are perfectly accurate in determining the history and current state of the Bitcoin network. This never-before-seen capability in a decentralized system helped the 19 million bitcoin currently in existence grow to be worth several hundred billion dollars.

The Bitcoin software uses units of bitcoin (satoshis) for its internal accounting. While it may be obvious that 1 bitcoin equals 1 bitcoin, this also means that when someone wants to “send $100 of bitcoin,” the participants in this transaction need to agree on the price of bitcoin at the time of the transaction to know how much bitcoin this corresponds to.

On Average, 15% Of All Bitcoin Transactions Are In Round USD Values

Did you know that many people transact bitcoin in round USD amounts? Interestingly, because this is such a common occurrence, there are clearly-recognizable patterns that exist in the UTXO set that can be used to closely infer the price of bitcoin at any point in the past or present (see the chart below).

Imagine that you are buying bitcoin at an ATM (or buying a gift card online). Will you buy $100 worth or $39.27 worth?

Round USD values ranging from $1 up to several thousand dollars are very common denominations in the Bitcoin blockchain. In fact, since 2014, there has been a growing on-chain footprint of these round-USD-value bitcoin transactions which on some days can account for up to 25% of daily outputs created.

The United States has by far the largest installed base of Bitcoin ATMs globally. U.S. Bitcoin ATM operators have grown dramatically since 2019 and the Bitcoin UTXO set vividly displays this market’s growth as more people choose to hold or at least transact in bitcoin over USD.

Also, as seen with clients at sFOX, Bitcoin ATM flows are made of nearly all customer buys (putting cash into an ATM and receiving bitcoin), so the on-chain footprint of this activity consolidates signals at round USD values. Other large bitcoin markets, such as gift cards, peer-to-peer exchanges, and many other, less common use cases, also contribute to this pattern of USD-denominated bitcoin usage.

The Bitcoin UTXO Set As Of Block 772,298

There is only one bitcoin UTXO set at any given block height. This picture depicts the entire, approximately 70 million UTXOs that comprise all 19 million bitcoin in existence, as of block 772,298.

With Bitcoin being truly permissionless, anyone running a fully-validating Bitcoin node has this exact same data on their computer and can independently replicate this exact same dataset for this point in time. A live version of this visualization can be seen and interacted with at utxo.live.

Source

Zooming into the 2022 section of the chart highlights that there are consistent patterns in the UTXO set. We’ll focus on two such patterns: Horizontal lines and wavy lines.

Source

Horizontal lines (the flat lines) represent:

UTXOs denominated in round values of bitcoin (e.g., 0.001, 0.005, 0.01, 1, etc.)Flat at any USD price because sending 1 btc always equals 1 btc

Wavy lines:

Represent groupings of UTXOs denominated in round USD values ($1, $20, $50, $100, $200, $500, $1,000, etc.)Are very wavy, yet parallel to each other because people send in many USD denominations and these denominations all move in proportion to each other as the BTC/USD price changesMove inversely to price. BTC/USD price increases cause the wavy lines to slope down since it takes less BTC to equal a USD value as price moves up and vice versa.

Making Sense Of The Lines

The fact that horizontal lines exist isn’t all that impressive. People transacting in bitcoin often transact in round amounts of bitcoin.

But the fact that the wavy lines exist clearly and consistently is a big deal. It means that, given an open-source model, this could help bring about the ability to:

Independently calculate the price of bitcoin using only your full node at any block heightDevelop genuine DeFi applications without the need for (or without sole reliance upon) trusted third-party price oracles

The UTXOracle Price Model Has Native Logic Checks

How can you easily test the hypothesis that the wavy lines represent movement of bitcoin denominated in USD? Simply pick a date when you know the BTC/USD price crossed a round USD value and see if the horizontal and wavy lines cross.

One such case is July 27, 2020. Bitcoin was recovering from the March 2020 mayhem and crossed over $10,000 per BTC.

The image below shows the wavy line (USD) crossing down below the horizontal line (BTC) at the same time that the price rose above $10,000 per BTC. This particular image is the 10,000 sat (0.0001 BTC) line, but the same pattern exists at many other BTC denominations as you progress up the UTXO chart.

On July 27, 2020, the bitcoin price increased past $10,000. Source.

Still don’t see it? Zoom in and explore a high-resolution image at utxo.live.

Mr. Pitt from “Seinfeld,” “I don’t see it.” Source.

Clearly, the wavy lines on the chart show transactions denominated in USD.

This has enormous ramifications, since the wavy line pattern exists in varying degrees in every block, and is extremely consistent over rolling periods such as every 144 blocks (roughly 24 hours).

The UTXOracle USD Bitcoin Price Is Quite Accurate

Seeing the horizontal and variable lines cross at round USD values is nice, but a majority of the time, the lines are not very close to one another. We need a way to prime a pricing model from these crossing points that will infer an accurate, current price at any block height after the model is primed.

Enter the UTXOracle model.

In this preliminary model, an input date of July 27, 2020, a day when bitcoin rose above $10,000, is used to prime the model to a best fit for that day’s price. Using only this single day’s UTXOs, and an input of that single day’s volume-weighted average price (VWAP), we are able to create a model that, when used with a future date’s UTXO set changes, infers the daily price of bitcoin with remarkable accuracy from this day forward, utilizing only the Bitcoin UTXO set with no reference to any external price data after July 27, 2020.

The red line is the daily VWAP from sFOX, an aggregator whose price encompasses the filled trades from dozens of exchanges and OTC desks.

The blue line is the UTXOracle daily price calculation based on each day’s UTXO changes.

Source: author

For the measurement period of July 2020 to January 2023, the model performs exceptionally well, with daily median and daily average variances between the actual VWAP and the UTXOracle price of 0.65% and 1.04%, respectively, both of which are within the normal range of fees charged for bitcoin purchases at retail exchanges.

It’s been said that all models are wrong, but some models are useful. One key difference between the UTXOracle model and other models that output a bitcoin price is that the UTXOracle model does not seek to predict a future price. It merely attempts to infer an accurate current price based on recent blocks and corresponding changes in the UTXO set. Given that the current model has also not been fine tuned for a best fit and simply uses a single primer date for its input, the model is clearly wrong — hopefully it can be useful.

The UTXOracle Model Has Trade-Offs

If Bitcoin has taught me anything, it’s that trade-offs exist. The UTXOracle model is no different.

The Bitcoin UTXO set is a beautiful, living monument to the human spirit but try as we may, any model created from it will not fully encapsulate the entirety of the underlying activity which it represents. A map cannot be as accurate as the territory it represents.

The UTXOracle model relies on several concepts to function correctly:

Bitcoin UTXO data (free and widely-available data accessed by running a full node)Bitcoin price data to identify a time or series of times upon which to prime the model (based on free and widely-available data)A model to apply the primer date(s) generally to any date (there are many ways to optimize this)A way for users of the UTXOracle output price to utilize the price in DeFi applications (this needs significant effort to develop)

People may create UTXOs at amounts that would mimic the price being another level than reality.

On centralized venues, people have been known to “spoof” large buy or sell orders in an order book to make it seem as though there is a large buyer or seller in the market, only to later remove these buy/sell orders without actually having any trades filled. This can actually move markets on centralized venues, but you cannot spoof UTXOs. They either exist in a mined block or they do not.

It takes a long time to create a fake price signal and it’s obvious when someone tries to do so.

Currently, it looks as though using a daily UTXOracle signal, rather than a single block interval, achieves a price accurate enough to use in practice. This approach has the added benefit of greatly increasing the cost of attack in mimicking or censoring transactions which would be most useful in producing the UTXOracle price at any certain time.

Even if someone created many UTXOs at levels mimicking a different bitcoin price, there is no mechanism to remove the real transactions that reflect the accurate price. At best, an attacker would create an additional set of wavy lines.

UTXOs are expensive to fake. There is no such thing as “spam” in the Bitcoin blockchain. There are only transactions that pay a fee to be included in a block. This means that blockchain data is expensive to produce or censor and there is a real cost of capital in creating UTXOs to fake a price signal.

Current model accuracy diminishes after about two years, as is visible in the chart. In practice, it’s likely that a model will need to be recalibrated after some period of time. Changing the model to take into account different UTXO patterns carries much less risk than changing consensus rules in Bitcoin. Unless participants are transacting in multi-year options/futures contracts on chain, this is likely not a meaningful barrier to use.

The current model does not deal with extreme volatility well. Mempool variations and price volatility create situations where the UTXOracle price can temporarily vary from the centralized exchange price by more than 10%. While this can likely be improved upon with a more comprehensive model it does highlight a potential serious limitation of the practical use of the model. 

Then there is the AI echo chamber problem: If the model is very successful, it may become less effective. In a world where many people are settling economic activity using the price inferred by a UTXOracle model, there will be many additional UTXOs settled in round USD values. These UTXOs may diminish the model’s accuracy or distort it in other ways similar to how a large-language model (LLM) trained on LLM-generated content will not match the effectiveness of one trained on human-generated content.

Using A UTXOracle Model In Practice

Love it or hate it, you know the word “Ordinal.” Ordinals taught me that people can coalesce around a methodology of interpreting the UTXO set that is technically external to Bitcoin, but which can be solidified at the social layer as an additional protocol on top of Bitcoin.

It is my hope that a sufficiently-accurate UTXOracle model will be produced by someone which will allow people to use that version of the model as a schelling point in building decentralized applications on Bitcoin.

It is my further hope that Bitcoiners can develop a method of using these one or more competing models in a trust-minimized way to expand how Bitcoin is able to bring financial peace to the world.

A successful implementation would be one in which:

Model inputs are publicly known and outcomes are verifiableDLC participants can contest fraudulent outcomes by calculating their own price using the model inputs. (An elegant solution to this issue remains an unsolved challenge.)

And one in which any of these security models is possible:

Peer to peer: Two or more ordinary participants can utilize the UTXOracle model without third partiesVerifiable, centralized oracle attestations: A centralized oracle signs a message with a particular UTXOracle pricing model that the oracle will use and participants are able to verify outcomes and punish wrongdoingUTXOracle as a quorum member: Use the UTXOracle price as a logic check in a traditional, centralized oracle model or in a two-of-three or three-of-five multi-oracle setup

UTXOracle Use Cases

DLC Derivatives (Options, Futures, Perpetual Futures)

This would enable users to buy or sell contracts in an open marketplace where outcomes are administered by participants using a UTXOracle price.

For example: Alice deposits an amount of bitcoin to a DLC-governed address. Bob pays Alice an amount of bitcoin denominated in USD (as evidenced by the UTXOracle price). At the time of settlement, Alice or Bob may produce a signature from an oracle attesting to the price calculated under the UTXOracle model to determine the settlement flow of funds as expired or exercised.

On-Chain Lending Markets

Users can borrow or lend in an open marketplace where the loan life cycle is administered by participants using a UTXOracle price.

For example: I have 1 BTC (at a $100,000 value) and want to take a partial loan of $30,000 without selling my bitcoin. I can coordinate with a market-maker to deposit my 1 BTC and the market maker’s 0.3 BTC (at a value of $30,000) to an address governed by a DLC. Upon funding, I may spend the 0.3 BTC for my desired use case.

Normal Loan Repayment

In this use case, the borrower has the option to sign a transaction granting the market maker $30,000 in value of the original 1 BTC or to deposit $30,000 in value (as evidenced by the UTXOracle price) and withdraw the original 1 BTC.

Upon liquidation, if the value of the 1 BTC in the DLC-governed address falls to somewhere near $30,000 (as evidenced by the UTXOracle price), the market maker can sweep out the entire 1 BTC to liquidate the loan and recoup their principal.

StableSats

The UTXOracle model also offers an interesting use case around “stablesats,” referring to bitcoin-backed USD stablecoins or stable-value USD accounts denominated in bitcoin on Lightning.

For instance, imagine that you want to hold $1,000 worth of bitcoin for the next month. You do not want to or cannot hold the $1,000 in cash, at a bank, in Ethereum- or Tron-based stablecoins or on an exchange. You could enter into an agreement with a market maker on the Lightning Network to stream the daily net price change in value to you. You would be able to independently validate that the correct amounts are being paid by using the UTXOracle model you agreed to. At the end of the month you will have a different amount of bitcoin in your Lightning channel, but it will be worth $1,000.

Peer-To-Peer Marketplaces

As a seller in an online marketplace, it’s currently difficult to price items in bitcoin due to the volatility as well as the fact that your expenses are likely in USD. But accepting payments in USD means accepting chargeback risk, fraud and the fees and complexity inherent in modern payment systems. Pricing products in USD, but having the flexibility to accept a USD value in bitcoin via the UTXOracle model, could encourage more bitcoin-denominated commerce.

The Next Steps For UTXOracle

As outlined in this article, I believe the UTXOracle model could be a powerful tool in advancing Bitcoin use cases and extending financial freedom to more of the world. While it has trade-offs, I believe it represents an exciting frontier that can improve upon existing solutions that require more trust in third parties.

If you are excited about the prospect of UTXOracle, I encourage you to join the discussion on Telegram and Twitter.

This is a guest post by Daniel Hinton and Steve Jeffress. Opinions expressed are entirely their own and do not necessarily reflect those of BTC Inc or Bitcoin Magazine.

Need help?

Please use the contact form to get support.