The original post: /r/cryptocurrency by /u/AD1AD on 2024-10-11 19:54:58.
In addition to enabling the token use-cases you’re most likely familiar with (like NFT art and Initial Coin Offerings), protocol level tokens can enable decentralized applications rivaling the capabilities of blockchains like Ethereum, but on the more scalable UTXO architecture.
(UTXO chains only have to keep track of which coins haven’t been spent yet, while EVM chains need to keep track of an entire virtual computer, with various programs running simultaneously and potentially interacting with one another.)
While UTXO chains like Bitcoin may not be the first ones you think of when you hear terms like “smart contract” and “decentralized finance”, it’s important to remember that the Bitcoin network launched with its own “scripting language”. Using a predefined set of functions (called opcodes), users could make customized rules for what will make a transaction valid or invalid.
(That’s actually how every normal Bitcoin address works: it’s just a set of rules requiring a signature from the same private key that was used to generate the address.)
With that foundation to build on, only several upgrades are necessary to bring UTXO chains up to speed with EVM.
The first is to enable “Oracles”. Oracles allow smart contracts to use trusted sources of information from outside the blockchain. That data could include current exchange rates for futures contracts, or the status of a delivery for escrow contracts. This can be done with just a few new opcodes.
The second necessary upgrade is “transaction introspection”. Introspection opcodes allow smart contracts to restrict not just whether coins can be sent, but also how those coins can be sent. For example, you might keep your savings in a smart-contract that doesn’t let you withdraw more than 5% of the balance per day, unless your financial advisor co-signs the transaction.
These two upgrades enable a surprising number of financial products and features on their own, but there are still applications that would be impractical or impossible to implement without the third and final upgrade: protocol level tokens.
With the addition of miner-validated tokens, a UTXO chain can host much more complex financial products like decentralized exchanges (or DEXs), decentralized autonomous organizations (or DAOs), and even side-chain prediction markets, all without sacrificing its excellent scaling characteristics.
The details are a little technical, but I’ll try to give you a general idea of how it works.
Transactions on UTXO chains are executed “atomically”, that is, independently from all other transactions, past and present. This is in contrast with EVM chains, which have access to the chain’s “global state”. (Transactions can look at each other, and the history of the chain.) Global state makes it easy to build complex applications, but it doesn’t scale very well.
Without access to global state, we need another way to represent and keep track of the various data structures used by complex smart contract applications. That’s where tokens come in.
While you might usually think of tokens as representing “assets”, you can generalize the concept and think of them instead as little messages that can be passed around between smart contracts. Each token just needs a small commitment of data, and a category. The category allows the token to prove independently that it was issued by a given contract, and the data defines how the token interacts with the contract.
By cleverly arranging and interconnecting multiple contracts that can issue and redeem tokens, we can create DEXs and DAOs whose current “state” is represented entirely by the balances of those contracts, the locations of their issued tokens, and those tokens’ properties.
But in this case, interacting with a Defi application doesn’t require knowing about all the other tokens it issued. Your tokens carry the unforge-able data on how you can interact with the application, and that’s all you need. Instead of tracking state “globally”, token-based DeFi tracks state “locally”.
As a final note, it’s important to understand that you will NOT be able to copy and paste smart contracts from Ethereum to UTXO chains, like you could from Ethereum to other EVM chains. While you may be able to build similar applications, the design process is completely different.
Think of it like how both a carpenter and 3D printer can make a birdhouse, but giving a carpenter a list of coordinates, extrusion rates, and some plastic filament will get you about as far as leaving a 3D printer alone in a woodshop overnight.
While designing smart contracts from this token-centric perspective may be less intuitive than working with EVM, the scaling bewnefits can not be overstated.