Home > Blockchain >  Depth | Wisdom Chain document repository "account model
Depth | Wisdom Chain document repository "account model

Time:09-16

English

Wisdom Chian: AccountState

This article comes from the official Twitter of Wisdom Chain
URL:
https://twitter.com/Wisdom_Chain/status/1296335835500085248? S=20

In the current block chain world, there are mainly two ways of record preservation, UTXO mode and the Account mode. Bitcoins adopts UTXO model, Ethereum/EOS adopts the Account model, and WisdomChian also adopts the Account model. Today we will explain In detail according to 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 later made up of a list of the growing chains, which contains many records, that is, blocks.


UTXO model
In the UTXO model, the transactions only represent changes In the UTXO collections. The concept of accounts and balances is a who abstraction on the UTXO collections. The concept of accounts and balances only exists In wallets. Let 's look at some examples to understand the difference.

First, Bitcoins UTXO can not be partially expended. If a user wants to spend 0.5 Bitcoins, but he has 1 Bitcoins in ihs UTXO collection. He has to send half a Bitcoins to himself to get change at the same time as he sends half a Bitcoins to someone else. If he doesn 't send it to himself, he will pay 0.5 Bitcoins to the miner.



Second, Bitcoins itself does not store the account balances. The Users only need to sign these UTXO have the private key to spend Bitcoins. The digital wallet top service the Bitcoins blockchain look like it has the function of user account balance. This is not the case.

How visual wallets work in bitcoins
Bitcoins' s UTXO system works well, partly because digital wallets can help to accomplish differ most of the work related to the transactions. O but not limited to:

A) Processing UTXO
B) Storage key
C) the Set transaction costs
D) dojo.provide change address
E) Aggregated UTXO (display the available, pending and the 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 in the wallet (UTXO) (corresponding to the wallet address). When we want to spend money, we need to use one or more UTXO with the enough cost and we may get a new UTXO. Each UTXO can only be 2 once, because once UTXO is expended, it will be does the from the UTXO pool.

All in All, we know that:
Bitcoins blockchain does not store the account balance
Bitcoins Wallet doesn secret key
If it is included in the transaction, it will cost the - 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 the about WisdomChain, when the transaction is initiated, the node will calculate the status information after the 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 said 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 the using ATM/debit CARDS, Banks track the amount of each debit card. The When we need to spend money, the bank checks its records to make sure we have the 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. The First, there is no dependency between the Account model the transactions, so the problem Of replay attacks needs to be solved. Second, for the realization Of from the network, Plasma and so on, the users need more complex Proof mechanism to produce evidence. The state transfer Of sub chains to the main chain requires more complicated separate protocols.

Simplified Chinese
This article from Wisdom Chain official Twitter
URL:
https://twitter.com/Wisdom_Chain/status/1296335835500085248? S=20

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related