The user model is more important than the original chain in the initial need to determine the data structure, the team's choice or focus on two typical model systems, the account model and the UTXO model, as with most other blockchain design, choose the model to determine the protocol layer of important implementation, both models have pros and cons, Different blockchain has its own judgment for the scene that wants to focus.
The origins of UTXO (from the Nakamoto of Gaoming)
Satoshi's design of bitcoin has allowed the world to enter the digital currency era. Bitcoin originated in Nakamoto, Utxo from Bitcoin. Naturally, Utxo from gaoming. Advantages of Utxo:
- In terms of versioning, SVN is a centralized database to keep a ledger, which is naturally contrary to the design of blockchain, GIT is a decentralized database, but it will save too much redundant data, for distributed performance must be greatly compromised. The Utxo database is a git that discards historical baggage and stores only the last version. Simple and practical.
- UTXO has a natural, anonymous effect, an account of the amount of non-spent transactions is difficult to find, such as the money is the currency of the currency to achieve privacy.
- In terms of performance, because Utxo is a separate data record, there is great parallelism to improve the speed of blockchain transaction verification.
Easy implementation of the design-Utxo account model for Ethereum abandonment
Ethereum Yellow Book designers Gavin Wood to utxo understanding, very deep, since Utxo has so many advantages, why he abandoned Utxo? At this point you should ask a question, what is the biggest highlight of Ethereum? You will certainly answer: smart contracts. It is because of the smart contract that it is difficult for Gavin Wood to implement a Turing-complete smart contract (a functional diversity supercomputer) based on Utxo. And the account model is a natural object-oriented, for each transaction, will be recorded on the relative account (nonce++). In order to manage accounts easily, and to introduce the world State, each transaction will change the state of the world. This is in contrast to the real world, and every tiny change will change the world.
Pursuit of higher performance
Ethereum's account model makes it easy to implement a supercomputer model. However, performance has been an insurmountable hurdle. In terms of performance, Utxo Natural can run in parallel, and Ethereum based on world state is difficult to expand. Gavin Wood is certainly aware of this, but it is difficult to change. It would be better to rewrite ethereum with a functional programming feature of rust, or a compromise.
Thinking over the original chain
Marx's philosophy of negation of the law, the development and change of things is spiraling upward. In the Blockchain field is also suitable, before further, also need to back half step. Based on the UTXO model to implement the stack-type virtual machine, that will still lose flexibility, with Utxo to combine Ethereum evm, difficult, is not too practical, this is like with Haskell language, to achieve CPP-style object-oriented programming, see no practical significance. There is no silver bullet in the world, the part must be discarded than the original chain, the compromise part can better adapt to the scene.
We used the Bitcoin utxo Easy parallel operation of the model premise, but also made a targeted improvement, add an asset number field, so that different assets can be processed in the same transaction conversion, as long as the total input equals the total output can be.
But for the data to be easy to manage, easy to program, we introduce the concept of the world state of Ethereum, each asset maintains a global state of the world, the global state of the world is fast to find, non-change, easy to provide proof of the characteristics. Its implementation will refer to the Pat Tree of the Ethereum (an extended cardinality tree), the Merkle tree of Bitcoin, and the Cosmos's Iavl tree (a non-changing, balanced binary tree). All outputs for each asset will have an index count in a global Utxo database (each output count cannot exceed 1, and when parallel computing is maintained, an output can be used by a BVM instance to ensure data consistency). BVM is the Intelligent contract virtual machine model which is realized by the original chain, and the execution of each transaction will instantiate a BVM instance, only in the BVM instance, the world state of each asset can be updated in the condition of maintaining validity and consistency. BVM can create multiple "contract sandbox" instances in parallel, and the operation of the contract in the sandbox is not affected by the outside world.
than the original chain to create a solution to the problem of digital asset registration, for the public chain projects, keep concise, maintain high efficiency, maintain focus, is to ensure security, the new extended Utxo model is based on this scenario implementation of the fusion and improvement.