Why MVC chose UTXO Model

In the current blockchain world, there are mainly two recordkeeping methods: UTXO (Unspent Transaction Output) model and Account model. MVC adopts the UTXO model, and ETH adopts the Account model.

MVC uses a model called UTXO (Unspent Transaction Output) to represent balances. This model is very similar to the cash (bills and coins) we use every day, and can be regarded as an improved version of cash. The digital currency issued by the People's Bank of China is under a UTXO model.

MVC has a high-performance smart contract (MetaContract); the world's first smart contract that implements high performance on the UTXO model, enabling MVC to implement all smart applications with high performance and meet all business needs.

ACCOUNT MODEL

Well-known smart contract public chain platforms such as Ethereum, EOS, Solana, etc., can be called account models in terms of execution methods.

The account model is very easy to understand, and everyone's bank account and so on is a way of thinking that each person has one or more "accounts," and each account has a "balance".

The process of A->B transfer is to subtract X from the balance of account A, and then add X to the balance of account B (without considering the handling fee). If some logical conditions are added to the transfer process, and the transfer can only occur if certain conditions are met, then a smart contract is formed. There is a virtual machine inside Ethereum, called EVM, which is used to monitor specific conditions, and automatically execute transfers after the conditions are met. Because this virtual machine can execute programming code, it only needs to write logic in a high-level computer programming language, and deploy it on the chain to easily implement arbitrary logic.

Because this account model is very close to object-oriented programming, it only needs to define member variables (various balance data) and methods (contracts) to easily implement arbitrary logic. Because of this, the vast majority of smart contract platforms on the market run on the account model.

The account model also has a very significant disadvantage: how to ensure the consistency of the virtual machine under the condition of distributed nodes? Since all contracts on Ethereum are driven by sending Ethereum transactions, the order of receiving transactions will affect the results of transactions. In order to ensure that all nodes execute the same logic, it is necessary to ensure the order in which all nodes receive transactions is consistent; if not it will cause chaos. Obviously, in a distributed environment, it is difficult for all nodes to maintain the consistency of receiving transactions, especially in high-frequency trading scenarios. If A sends 10 sums of money to B in a row, it must wait until all nodes receive all transactions in order. After the transaction, the settlement can be completed. If a node receives the tenth transaction first, it needs to wait for the other nine transactions to be processed in place before processing the tenth. In addition, each Ethereum transaction can only be transferred one-to-one, which is very difficult in high-frequency scenarios, especially complex many-to-many situations.

EXAMPLE OF ACCOUNT MODEL PERFORMANCE ISSUES

In order to highlight the following performance problems of Ethereum, the following scenario can be assumed: account A wants to distribute money to 100 people. If ETH is used to send the money, they must be sent to #1, #2, #3, and so forth in order. 100 transactions need to be constructed and sent one by one, and the nodes must also be processed one by one in order. Because each sending has to wait for the last balance to be determined, the 100th can only receive the the money after all the people who became before the 100th have received the money.

Traditional internet applications that use the account model must cooperate with strong consistent locks in the database, or strong transactions to achieve account modification security. This problem is particularly prominent in distributed blockchains.

The core reason is that the modification of the account must be executed in a strict order, and the difference in the order may lead to wildly different execution results. This is why Ethereum's swap has not been able to solve the problem of miners rushing away wherein miners can insert transactions that benefit themselves in front of other users to change the execution results.

UTXO MODEL

The UTXO model is another model adopted by mainstream blockchains, such as Bitcoin, Litecoin, DOGE and others.

UTXO means "unspent transaction output." This model is very similar to the cash (bill and coins) used in daily life and can be regarded as an improved version of cash.

The blockchain does not record and maintain the balance of a certain address, but records which address each banknote belongs to. In the Bitcoin scenario, the balance of an address A cannot be directly queried, and it is necessary to count how many banknotes belong to A. For example, there is a wallet (a real wallet), and there is a $10, a $100, and a $1 coin in it, then it can be said that the balance of the wallet is $111 (and it is known that the balance is from a $100, A piece of $10 and a piece of $1), in other words, if you donโ€™t calculate each banknote and face value, you donโ€™t know how much balance you have just by the wallet itself, which is very different from account models such as Ethereum, PayPal, etc.

HIGH CONCURRENCY CHARACTERISTICS OF UTXO

The UTXO model transfer method is also very close (but not exactly the same) as paying with cash. If A wants to pay B $1, then A has 3 ways to pay B: [1] give him $1, [2] give him $10 and get $9 back, and [3] give him $100 and get back $99. Giving change money is not the same as cash, or it can be said to be an improvement. A gives B $10 to get back $9 is not that B finds $9 and gives it to A, but A burns $10 (destroys UTXO), and then the system reprints a sheet of $1 for B and gives A a piece of $9 (rebuild UTXO). After the transaction, A's wallet now has a banknote with a face value of $100, a banknote with a face value of $9, and a banknote with a face value of $1, and a total balance of $110 yuan.

According to the description above , we can know that the transfer and collection of the UTXO model is the process of the continuous elimination and generation of banknotes in the wallet. To know the balance of the Bitcoin address, you need to take out all the banknotes of this wallet address, calculate all the denominations, and sum them up.

At the same time, the UTXO model supports many-to-many transactions. For example, one transaction can allow A to transfer $1 to D, E, and F at the same time:

  1. Take out $100 and burn them, print out $99 and return it to A, and print out $1 and give it to D.

  2. Take out $10 and burn them, print out $9 and return them to A, and print out $1 for E.

  3. Take out $1 and burn it, don't give any change to A, and give printed $1 to F.

The magic of the UTXO model is that the above three steps can be sent in three unrelated (parallel transactions have nothing to do with the order) transactions, or can be sent directly using one transaction.

Compared with Ethereum, with the UTXO model, you can send money to 100 people 100 people at the same time in only one transaction and this will allow the 100 people to receive money at the same time. The performance gap can be obvious. UTXO script controls whether a UTXO (a bill with a certain face value) can be destroyed or not. The granularity of control is at the level of UTXO (single bill); there is no order requirement for transactions, so many-to-many transactions and parallel transaction verification can be performed which has extremely high performance in cash transfer scenarios.

Last updated