EUTXO
The Extended UTXO (EUTXO) model is a variation of the Unspent Transaction Output (UTXO) model originally used in Bitcoin and widely adopted by many blockchain systems. The model is well-suited to the needs of the Cardano blockchain and lets the creation of more expressive and flexible smart contracts while providing improved transaction efficiency and security.
Overview
One of the key strengths of the EUTXO model is its ability to support more complex and expressive smart contracts. In a standard UTXO model, each transaction creates new outputs and consumes previous outputs as inputs. This model is simple and easy to understand, but it has limitations when it comes to creating more complex transactions.
EUTXO model addresses this limitation by introducing the concept of "extended" outputs. These extended outputs can contain more information than a standard UTXO, allowing them to be used as inputs for more complex transactions. This additional information can include smart contract codes, data structures, and other types of information that can be used to create more expressive and flexible smart contracts.
Another strength of the EUTXO model is its ability to support more efficient transaction validation. In a standard UTXO model, all inputs must be fully spent in a transaction, which can lead to inefficiencies when it comes to validating transactions. The EUTXO model allows for partial spending of inputs, which can significantly reduce the amount of work required to validate a transaction.
EUTXO model is more resistant to certain types of attacks, such as double spending attacks. In a standard UTXO model, it is possible for an attacker to create multiple transactions that spend the same output, potentially leading to a double spend. However, the EUTXO model makes it more difficult for an attacker to create these types of transactions, providing an additional layer of security.
The EUTXO model offers unique advantages over other accounting models. The success or failure of transaction validation depends only on the transaction itself and its inputs, and not on anything else on the blockchain. As a consequence, the validity of a transaction can be checked off-chain, before the transaction is sent to the blockchain. A transaction can still fail if some other transaction concurrently consumes an input that the transaction is expecting, but if all inputs are still present, the transaction is guaranteed to succeed.
In the UTXO model, a transaction has *inputs* and *outputs*, where the inputs are unspent outputs from previous transactions. Assets are stored on the ledger in unspent outputs, rather than in accounts.
As soon as the output is used as input in a transaction, it becomes spent and can never be used again. The output is specified by an address (a public key or public key hash) and a value (consisting of an ADA amount and any optional additional native token amounts). An output’s address determines which transactions are allowed to ‘unlock’ the output and use it as an input. A transaction must be signed by the owner of the private key corresponding to the address. Think of an address as a ‘lock’ that can only be ‘unlocked’ by the right ‘key’ ‒ the correct signature.
EUTXO vs Bitcoin UTXO
The UTXO model used in Bitcoin is more limited in its capabilities. Transactions in the Bitcoin blockchain are based on a simple set of rules that do not allow for the inclusion of complex smart contract logic. As a result, the UTXO model is not well-suited to the needs of more advanced and expressive smart contracts.
Another difference between the EUTXO model used in Cardano and the UTXO model used in Bitcoin is the level of efficiency and security provided by each model, EUTXO model allows for partial spending of inputs, which can lead to more efficient transaction validation. Secondly, the EUTXO model is more resistant to certain types of attacks, such as double spending attacks.