Stablecoins as Chia Coloured Coins

Ioannis Tsiokos
6 min readJul 19, 2021

This post will introduce you to a new kind of Stable coin that I came up with while using a couple of recent blockchain innovations introduced by the Chia network.

If you end up implementing this in Chialisp and making a lot of money, please drop a credit back to this article :)

Types of Stable-coins and their issues

Stable coins are supposed to keep a stable value relative to a fiat currency. So, ideally, one USDC is always sold/bought for 1 USD. Stable coins achieve their stability in one of two ways:

1) By convincing the market that they are backed by assets (crypto or real) of equal value. If the market believes that, then the price of the coin will stay close to its target price. Examples of such collateralized stable-coins are USDT and USDC.

2) By self-adjusting their total coin supply based on price movements. In other words, when the coin price falls below the pegged amount, the smart contract will try to buy back coins from the market to raise the price and vice versa. Examples of algorithmic stable-coins are ESD and AMPL.

Each approach comes with its own set of risks. Collateralized coins expose owners to collateral and counterparty risk. Algorithmic coins are prone to self-feedback loops, market volatility, complicated economic forces, and oracle centralization.

How to force a hard fiat peg to a Chia-coloured coin

I would like to propose a third type of stable-coin that we will call Proxy-coin. As we shall see, this type of coin can be used as a value proxy for any tradeable asset.

Proxy-coins are Chia-coloured coins that can only be spent by creating a proxy-type offer to exchange them for Chia coins. An “offer” in the Chia context is a cryptographically secured file that is issued by the proxy-coin owner (the person who holds the key for spending the proxy-coin). The owner can then publish the file on their blog, send it by email, or post it on an exchange. Whoever else has the file can give Y chia coins and receive X proxy-coins for as long as the file is valid. An offer can only be matched once.

To re-iterate, proxy-coins can only be spent through proxy-type offers that “convert” them to chia coins. So, for example, one cannot send a proxy-coin to another Chia address. Conversely, the only way to buy a proxy-coin is to find a proxy-type offer and match it with the required chia coins.

Now that we have a coin that can only be transacted through a specific proxy-type offer, we also have the means to control that coin’s price. We can do this by imposing a second limitation, this time on the offer itself, and require that the proxy-coin/chia-coin ratio equals a certain value.

Say for example that one Chia coin is currently valued at $1000. If we want one proxy-coin (say USDP) to be valued at $1.00, then, only offers that have a 1/1000 peg ratio will be valid. If somebody creates an offer to sell their proxy coin for less or more than the defined value, their offer will not be accepted by the coin’s smart contract.

Does that mean that one USDP has the value of one US dollar? It depends on how you look at it. What we can say for sure is that 1.00 USDP can only be exchanged for $1.00 and vice versa or not exchanged at all.

This hard-peg mechanism is only possible through the decentralized exchange created by Chia offers that is effectively “capturing” the price (an external property, as far as any other blockchain is concerned).

How to use Chia offers to track the price and update the peg ratio

Our proxy-coin as described above will not work of course, or will only work for a few seconds. After some time, the price of Chia coin will change and the 1/1000 ratio will not be valid anymore. So, we need an oracle to feed the current ratio to the proxy-type offer.

It turns out, that we can use Chia’s offers to create a fully automated oracle that is driven by arbitrage. This is perfect because we want to avoid having to rely on any type of centralized and/or external information provider.

All we have to do is create a second coin that we will call proxy-twin-coin or USDPT. This coin’s smart contact will have to be a bit more involved than its brother proxy-coin.

The proxy-twin-coin can only be transacted through proxy-twin-type offers, i.e. you cannot send USDPT to another Chia address but you can only buy/sell it through these offers. This is similar to how the proxy-coin works. However, this is where similarities end.

Proxy-type offers can be from anyone to anyone, whereas, proxy-twin-type offers can only be made by the proxy-twin-coin vault. The vault is an account that stores some (enough) Chia coins and its secret key is only known by the proxy-twin-coin’s smart contract. The key can be generated by the smart contract during the coloured coin’s genesis to guarantee that no one knows it.

At any time, there will exist at least two offers, one BUY offer (give twin-proxy-coin and get Chia) and one SELL offer (give Chia and get twin-proxy-coin). The price of the BUY offer should be slightly lower than the last price, and the price of the SELL offer should be slightly higher than the last price.

If somebody claims one of the two offers, they have effectively communicated to the smart contract what the latest Chia price is. We can then use this price to update the oracle stored peg ratio. Problem solved!

The contract will also post a set of new BUY/SELL orders with a median price that equals the price of the last offer transaction.

What happens if low market liquidity or high volatility cause neither of the two BUY/SELL offers to be claimed. To guard against this, every time a transaction takes place, the smart contract should publish a larger set (10 or more pairs) of offers with an increasingly larger spread (lower SELL, higher BUY). These offers should only be valid in future times and the contract should have the means to cancel them in case a lower-spread offer is claimed.

What if some malicious party decides to “chase” the price in the opposite direction (at their cost). In that case, the oracle’s price will not be accurate for as long as the malicious party wants to keep wasting their money. However, nothing is forcing proxy-coin owners to transact at the wrong price, so they can simply wait until the malicious actor gets tired and the price peg is restored.

Note that the proxy-twin-coin needs to publish new offers every time an old offer is claimed (no sooner and no later). The amount of its transaction should be enough to incentivize arbitrage trades but not higher.

In the end, our twin-proxy-coin is nothing but a small collateralized stable-coin; so, why bother? The difference is that our twin-proxy-coin is not really creating a market (it’s too small and can only be traded to/from the vault), but rather it is following a market. Its whole purpose is to discover the current USD price of Chia so we can update the proxy-coin/chia-coin ratio and ensure our dollar proxy-coin remains pegged to USD.

You might notice that our proxy-twin-coin Vault will need some Chia and will most likely incur slippage and transaction fee costs. I’ll leave this as food for thought.

One stable coin to rule them all?

So, there you have it, a USD-Proxy coin that can be exchanged for Chia (and vice versa) and has a constant price in USD terms. The coin requires little collateral for its twin coin (enough to run the price discovery), and forces an algorithmic hard peg to USD.

Economically speaking, the utility of the coin depends on its stability, i.e. on the effectiveness of its mechanism to keep the price constantly pegged. If we assume that arbitrage opportunities will be devoured quickly, then the proxy coin should be much more efficient at maintaining its peg than traditional algorithmic coins.

It goes without saying that no price-tracking witchcraft can substitute owning the underlying. That said, you don’t actually own the physical embodiment (paper, ink) of the dollar you hold in your hand as it is the Government’s property.

Proxy-coins can obviously be used for any kind of asset, crypto, fiat, or other, as long as a twin-proxy-coin can exist that owns enough of that asset to track its price.

Kudos to the Chia-blockchain team for making this, and a ton of other weird stuff, possible.

--

--

Ioannis Tsiokos

I have nothing to say that’s nearly as cool as I am, except maybe… wow, I am dad!