UTXO vs Account Based

All coins and tokens exist on their blockchains as either unspent transaction output (UTXO) or account-based assets. The 2 protocols handle digital assets differently, and therefore have different integration requirements. The most common examples of the two are bitcoin, which is UTXO, and ethereum, which is account based.

UTXO

The UTXO model is stateless. On the blockchain, UTXO are uniquely identifiable chunks of data. The UTXO in your crypto wallet functions similar to the bills and coins in your physical wallet, in that each has a clearly defined amount that you can use to transact with.

When transacting with cash, the exact bills and coins you use depends on what's in your wallet. If you don't have the exact amount required for a transaction, then you must hand over a greater amount and get the difference back in change. The same applies to UTXO transactions.

When developing an app, you must decide how you handle UTXO management and allocation. For example, when displaying a wallet balance, most end users likely don't care to see their individual UTXO - they probably just want to know what their total balance is. In addition, the more UTXO a transaction has, the more complex it is, so you must account for UTXO allocations within transactions. Conceptually, this isn't too different than deciding which bills and coins to use when transacting with cash.

Account Based

The account-based model is stateful. On the blockchain, transactions don't uniquely reference individual coins or tokens. This model simply assigns a total balance to a wallet, similar to how the balance of your bank account doesn't reference unique bills or coins. The stateful nature of account-based assets enable them to better engage with smart contracts used in DeFi.

Account-based assets have integration considerations that differ from UTXO assets. For example, transactions require an incrementing nonce to prevent unintended duplicate transactions. Since transactions don't explicitly reference specific inputs, you must take precautions when engaging in parallel transactions or simply execute transactions sequentially. Further more, if using multiple receive addresses in a single wallet, you must make regular consolidations to the root address in order to withdraw the maximum spendable amount.