All field notes

DeFi · Retrospective

DeFi summer, watched from a UTXO chain

A shared white basin fed by many blue lines, beside three tokens each in its own glass cup.
Concept illustration · AI-generated

Since Compound began distributing its COMP token to lenders and borrowers in mid-June, "yield farming" has taken over most of the crypto conversations I follow. July brought YFI. This month YAM launched and broke within days.

I watch all of this from Trivechain, where I am the lead developer. Trivechain comes from the Bitcoin family: coins live in unspent transaction outputs, and there are no general-purpose smart contracts. None of these farms could run on it as written. Working out exactly why has been a useful exercise.

What our asset layer can say

TriveAsset, our token layer, is inspired by coloured coins. In brief, its instructions come in three families, issue, transfer and burn, and each is encoded in an OP_RETURN output of up to 80 bytes, with richer metadata referenced by an IPFS hash. The metadata can carry rules: a fee paid on every transfer, an expiry, who may mint more, and which addresses may hold the asset.

That covers a lot. Certificates, tickets, a fixed-supply token, an asset that only approved addresses can receive. Our TriveCredential certificates are built on it.

Two limits matter for DeFi. First, the meaning of a TriveAsset transaction is worked out by software that follows the chain, not by Trivechain's nodes. The nodes see an ordinary transaction; the rules hold only as far as the software reading the metadata applies them. Second, every output belongs to whoever can satisfy its script. There is no shared object on the chain that many people update in turn.

What a farm needs

A liquidity pool is exactly such an object: two reserves and a record of who supplied what, updated by thousands of strangers, with each trade changing the price for the next one. A farm is another contract that reads your share of that pool and pays out a reward token over time. Other contracts then accept the pool share or the reward token as an input, and so on. People call this composability. It depends on all of those contracts reading and writing the same state, under rules the network itself enforces, often within a single transaction.

On a UTXO chain, two parties can swap with each other, because both can sign one transaction. What they cannot do is trade against a pool that nobody owns. On TriveAsset, a "pool" would be a convention that indexers agree to follow, and if two indexers disagree, the chain does not referee.

Changing the rules quickly, and the cost

Trivechain does have rules about who receives new coins. Block rewards are split by the protocol between miners, masternodes and the TriveGovernance treasury. Changing that split means a new release of the node software that miners and masternode operators must choose to run. That is slow by design.

A farm changes its emissions by deploying a contract. That speed is a large part of the appeal, and YAM showed the other side of it. It launched in the second week of August, and within about two days a bug in the code that adjusts its supply had left its own governance unable to fix it in time. Deposits had arrived within hours, far faster than anyone could review the contracts.

When contracts compose, a bug in one carries into everything stacked on top of it. On our chain, a bad release reaches the network only when operators install it. That is slower and less exciting, and I do not think it makes us right. It does mean the failure modes are different, and I find it useful to be precise about which ones I am exposed to.

What I am taking from it

Three things keep coming back to me.

First, an asset layer that the chain itself does not understand cannot hold shared state that strangers trust. Whatever TriveAsset is good for, and it is good for several things, a pool is not one of them.

Second, the interesting part of DeFi is not the reward rate. It is that one contract can build on another without asking anyone's permission. That is an architectural property, and a chain either has it or does not.

Third, speed of deployment and depth of review pull against each other. Every farm sits somewhere on that line, and this summer many have sat close to the fast end. When I read about a new one now, the first thing I look for is not the token or the rate but whether anyone outside the team has read the code.