深度 |《Wisdom Chain文档知识库》之账户模型
English
In the current block chain world, there are mainly two ways of record preservation, UTXO mode and Account mode. Bitcoin adopts UTXO model, Ethereum/EOS adopts Account model, and WisdomChian also adopts Account model. Today we will explain in detail why WisdomChian also adopted the account model.
Before introducing the UTXO model and the Account balance model, we have to first introduce the most important concepts and data structures in their two or even all block chain applications, that is, Block. The block chain is actually made up of a list of growing chains, which contains many records, that is, blocks.
UTXO model
In the UTXO model, transactions only represent changes in the UTXO collection. The concept of accounts and balances is a higher abstraction on the UTXO collection. The concept of accounts and balances only exists in wallets. Let's look at some examples to understand the difference.
First, Bitcoin UTXO can not be partially expended. If a user wants to spend 0.5 Bitcoins, but he has 1 Bitcoins in his UTXO collection.He has to send half a Bitcoin to himself to get change at the same time as he sends half a Bitcoin to someone else. If he doesn't send it to himself, he will pay 0.5 Bitcoin to the miner.
Second, Bitcoin itself does not store account balances. Users only need to sign these UTXO with the private key to spend Bitcoins. The digital wallet makes the Bitcoin blockchain look like it has the function of user account balance. This is not the case.
How visual wallets work in Bitcoin
a) Processing UTXO
b) Storage key
c) Set transaction costs
d) Provide change address
e) Aggregated UTXO (display available, pending and total balance)
Trading in the UTXO model is similar to paper currency. Each account shows how much money it has by calculating the sum of all the paper money (UTXO) in the wallet (corresponding to the wallet address). When we want to spend money, we need to use one or more UTXO with enough cost and we may get a new UTXO. Each UTXO can only be used once, because once UTXO is expended, it will be deleted from the UTXO pool.
All in all, we know that:
Bitcoin blockchain does not store account balance
Bitcoin Wallet Holds secret key
If it is included in the transaction, it will cost the entire UTXO (in some cases, the change is in the form of a new UTXO).
WisdomChain
WisdomChain adopts the same Account transaction structure as ETH. Unlike Ethernet, there are two very different data in Ethernet: permanent data and temporary data. An example of permanent data is a transaction, which, when fully confirmed, will be recorded in the transactiontrie and will never change. An example of temporary data is the balance on a specific Ethereum account address. The balance of the account address is stored in statetrie and will be changed whenever the transaction of the particular account changes. In Ethereum, permanent data (such as mined transactions) and temporary data (such as account balances) are stored separately. Ethereum uses trie data structure to manage data.
And about WisdomChain, when the transaction is initiated, the node will calculate the status information after transaction based on the current state information and transaction content in the virtual machine, and store the relevant hash value of the state information along with the transaction. When the transaction is packaged by a miner, the remaining nodes store data on the Merkletrees to ensure that the state information of their nodes and other nodes in the network is consistent.
So WisdomChain's records are kept like banks. Similar to using ATM / debit cards, banks track the amount of each debit card. When we need to spend money, the bank checks its records to make sure we have enough balance before confirming the transaction.
Of course, WisdomChain uses the Account transaction structure, which inevitably leads to the problems of the Account transaction structure itself. First, there is no dependency between Account model transactions, so the problem of replay attacks needs to be solved. Second, for the realization of lightning network, Plasma and so on, users need more complex Proof mechanism to produce evidence. The state transfer of sub chains to the main chain requires more complicated protocols.
简体中文
URL:
https://twitter.com/Wisdom_Chain/status/1296335835500085248?s=20
在当前区块链世界中,主要有两种记录保存方式,UTXO模式UnspentTransactionOutput和Account模式。Bitcoin采用的是UTXO模型,Ethereum/EOS采用的是Account模型,同样Wisdom Chian也采用了Account模型。今天我么将详细讲述为什么Wisdom Chian也采用了Account模型。
在具体介绍UTXO模型和账户余额模型之前,我们不得不首先介绍它们两者、甚至所有区块链应用中最重要的概念和数据结构,也就是区块(Block)。区块链其实就是由一个长度不断增长的链表组成的,其中包含了很多记录,也就是区块。
关注Wisdom Chain动态
-
Twitter:@Wisdom_Chain -
微博:WisdomChain -
知乎:智慧链技术社区 -
Facebook:WisdomChain -
Telegram:@WisdomPublicChain
相关资源
https://github.com/WisedomChainGroup
-
WIsdom Chain公链文档知识库: -
Wisdom Chain官网: -
Wisdom Chain技术论坛: -
Wisdom Chain开源代码库: -
Wisdom Chain区块浏览器:
- 免责声明
- 世链财经作为开放的信息发布平台,所有资讯仅代表作者个人观点,与世链财经无关。如文章、图片、音频或视频出现侵权、违规及其他不当言论,请提供相关材料,发送到:2785592653@qq.com。
- 风险提示:本站所提供的资讯不代表任何投资暗示。投资有风险,入市须谨慎。
- 世链粉丝群:提供最新热点新闻,空投糖果、红包等福利,微信:juu3644。