MeerToken Series — UTXO Model VS Account Model
Open the beta version of the KAHF wallet [1] and switch to Meer (Testnet). You can see that in addition to Meer, there are two assets QITID and METID. These two are the primary MeerToken asset issuance system of Qitmeer, issuing primary Meer secondary assets which seem to be ordinary, but have great content.
Since its foundation, Qitmeer has positioned the project as an infrastructure for inclusive value circulation, so the requirements for the underlying public chain are stability, security, and efficiency. Therefore, the ledger of the MeerToken asset distribution system did not follow the popular scheme of the time to adopt the account model but the more stable and classic UTXO [2] model.
The seemingly simple choice of the ledger model is a difficult one because it is not only the choice of a value circulation model but more importantly, the choice of a smart contract model. The account model comes along with the Ether smart contract because UTXO is good enough for value circulation and there is no need to reinvent a new account model. As the so-called “blockchain 2.0” era represented by Ether which is “smart contract is justice”, many new public chain projects will give priority to quickly support smart contracts, so they will expand directly based on Ether’s code. As for the underlying ledger model, it is not a priority whether it meets the positioning of the project or not.
While prioritizing the engineering implementation of smart contracts is a rational choice for most projects seeking community acceptance, there exist projects with a similar philosophy to Qitmeer. As far as I understand, the ledger model Cell of NervOS [3] is an enhanced UTXO model and its smart contracts are generated and computed off-chain (off-chain) by a contract generator (Generator) but verified on-chain (on-chain). The advantage of this is that the on-chain calculation becomes very simple, the stability is greatly enhanced and the programming interface of smart contracts also becomes very flexible and efficient, the current is based on Rust, a safe and efficient high-level language development framework Capsule than the Ethernet smart contract language which is Solidity that has a stronger language expression and development environment. In the future, if necessary, we can also support other language development frameworks.
First of all, it must be stated that the support of smart contracts is not necessarily related to whether it is an account model or UTXO, but only to whether the transaction supports Total Order [4]. This is well understood since two concurrent transactions may contain operations against the same smart contract account. There are two levels of questions here: first, whether the smart contract is an on-chain or off-chain smart contract; and second, if it is on-chain, whether it supports smart contracts.
For the first problem, NervOS is the most representative case. As mentioned above, the essence of NervOS’s ledger is the UTXO model, which generally does not support the full sorting of transactions without a special need for consensus expansion. For example, in the figure below, the two transactions Tx3 and Tx4 are concurrent (note that concurrency is used here instead of parallelism, as concurrency only requires logical simultaneous occurrences, while parallelism requires temporal simultaneous occurrences). UTXO does not require the order of the two transactions to be determined, the advantage is that the transaction confirmation can be as fast as possible. If I do not care about the order of the two transactions, the node can verify and confirm any transaction once it receives it (note that this is simply a confirmation, not a security confirmation, which needs to wait until it is theoretically difficult to overturn the transaction), while if we consider the order, the order of arrival is unstable because of network factors, so after receiving and verifying It may be necessary to wait for some time for enough transactions to be received before confirmation, which requires a consensus protocol to guarantee.
Since NervOS’s Cell model does not support transactions, how does NervOS support smart contracts? This goes back to the first level I mentioned at the beginning, whether it is an on-chain contract or an off-chain contract. NervOS only does not support the on-chain model, but the off-chain is fully supported.
One thing to add here is that the concept of NervOS is very close to Qitmeer, but there are still differences. Although both are UTXO models, both are off-chain smart contracts (Qitmeer’s cross-chain smart contract is also an off-chain smart contract solution), and both start from the stability of the underlying public chain. However, Qitmeer’s underlying chain uses the MeerDAG protocol based on the UTXO model enhancement, which supports the full sorting of transactions, so it can support on-chain smart contracts. NervOS can enhance the consensus protocol to achieve the same effect if needed. MeerDAG’s support for full transaction sorting is more of overall architectural consideration, such as supporting fairer reward rules, and MeerDAG initially explored the SPECTRE protocol [5], which is based on relatively weak scalability but faster confirmation, before finally moving to the GhostDAG protocol [6], which is based on stronger scalability and faster confirmation. . The development history of the Qitmeer consensus protocol will be shared more fully in the future discussion of MeerDAG.
So here is the second level of question, whether it supports on-chain smart contracts. Like NervOS, Qitmeer does not support it at the moment, but as mentioned earlier, the MeerDAG consensus protocol can be fully expanded to support on-chain smart contracts. The reason for not supporting it is more of a trade-off between engineering implementation and project positioning because the EVM is based on the account model, so many projects will be developed based on the Ether code to make it more convenient for smart contract engineering implementation. As for the account model or the UTXO model, which is more suitable for project positioning is not a priority, and if the Ether smart contract implementation is based on the UTXO model, they may also choose the UTXO model. Qitmeer feels that UTXO makes more sense from a project orientation, so they choose a unique off-chain smart contract solution like cross-chain.
The above is kind of a more detailed sharing of MeerToken’s journey based on the UTXO model for the community. The ledger model determines the design of the asset issuance mechanism, like Ether’s asset issuance mechanism, is a simplified version of a smart contract, and we will continue to share the principle of Qitmeer’s asset issuance mechanism based on UTXO, as well as the advantages and disadvantages of the asset issuance mechanism compared to Ether’s. Stay tuned.