Bitcoin Must-Read Guide Ⅱ: The Past and Present of the UTXO Model

UTXO can not only assist the consensus mechanism, but also solveBlockchainThe double-spending problem givesBlockchainTraceability feature.

Author: Echo, BiHelix; Satoshi Labs

Instructor: Hong Shuning

introduce

“UTXO区块链奠定了当今区块链行业的基础和无可争议的根基。UTXO技术反映了中本聪对金融终极自由的核心愿景。” UTXO 模型保证了金融活动核心的Safety, data privacy and scalability are a moreSafetyalternatives.

区块链原理:UTXO 模型的基础

Blockchain is a digital, decentralized, distributed ledger. Blockchain uses a P2P (peer-to-peer) network, where participants are called nodes. The ledger stores data about transactions. The most important feature of blockchain is that blocks are linked together by encryption.

Blockchain: Cryptographically linked together

• Except for the first block (called the genesis block), each block in the blockchain contains a field called the “previous hash.” It is the hash value of the previous block in the blockchain and is also theSafetybasis.

比特币必读指南Ⅱ :UTXO 模型的前世今生

• Factors that determine the hash of a block. If any of these 4 factors changes, even by 1 bit, the hash will completely change, this is due to the avalanche effect. Transactions are stored inside blocks and are also one of the 4 factors that change the hash of a block. This means that if a miner chooses a different transaction and keeps the other 4 factors the same, the hash will be different.

1. Timestamp

2. Block number:The sequence number of the current block in the chain.

3. data:Transactions stored in blocks.

4. Random Numbers

• If an attacker tries to change the data of a block, the hash of that block will change. As mentioned before, the next block will hold the hash of the current block, and if the hash changes, then the chain will be broken. Alternatively, the attacker must mine all blocks again from that point on. This is one possibility in the 51% attack.

比特币必读指南Ⅱ :UTXO 模型的前世今生

what isBlock"?

Blocks in the blockchain store transactions. In the case of Bitcoin, blocks are added to the blockchain every 10 minutes, and depending on the complexity of the target hash, the time to mine a new block can vary.

• When a miner successfully mines the block, it is added to the blockchain. When a block is added to the chain, the status of all transactions within the block changes from unconfirmed to confirmed.

• In the case of Bitcoin, the number of transactions that can be stored in a block is not fixed, but the average size of a block is 1 MB.

• Empty blocks are valid, which means empty blocks can be mined and added to the chain.

Blockchain transactionsstructure

Peeling back a single transaction reveals several different structures with different semantics. Here are the different structures present in a transaction:

比特币必读指南Ⅱ :UTXO 模型的前世今生

1. Transaction version number: It is the version number that specifies the transaction type to the network. Through the transaction number, the node can determine the set of rules used to verify this specific transaction.

2. Output: The transaction output consists of a password lock and time.

3. Input: A transaction input consists of a pointer and an unlocking key. The pointer points to the previous transaction output. The unlocking key is used to unlock the previous output pointed to by the input. Every time an output is unlocked by an input, it is marked as spent in the blockchain database.

4. Lock Time: Specifies whether a transaction can be included in the blockchain immediately or after a specified time.

UTXOs are all outputs that have not been unlocked by inputs.

Once outputs are unlocked, they are removed from the circulating supply. New outputs replace them. Therefore, the sum of unlocked outputs will always be equal to the sum of newly created output values.

What is the UTXO model?

UTXO is notcryptocurrencyDenominations, such as satoshi for Bitcoin (BTC) or gwei for Ethereum (ETH); however, UTXO can be measured in these denominations. UTXO stands for Unspent Transaction Output. In Bitcoin, a transaction exists until it is executed and until another transaction is completed from that UTXO. When a transaction is completed, the unspent output is stored back in the database as an input and can be used later in another transaction.

比特币必读指南Ⅱ :UTXO 模型的前世今生

When the user passeswallet发起交易时,包含交易信息的UTXO 会被定位、解锁,并且新所有者的信息会与转移给他们的 UTXO 相关联。并且该用户可以通过相同的过程在交易中使用它们。随着交易的继续,数据库中将填充所有权变更的记录。输出是用户发送给某人但未花费的加密货币的一部分。它们作为加密货币分数的输入记录到数据库中。

How are UTXOs created?

UTXO 是通过消耗现有 UTXO 创建的。每一笔比特币交易都由输入和输出组成。输入消耗现有的 UTXO,而输出创建新的 UTXO。当决定花费比特币时,我们只能看到已扣除的金额以及钱包中剩余的金额。对于用户来说,这类似于用 1 美元的钞票购买 0.50 美元的商品 — 得到零钱,将其放入口袋中。

UTXO ModelAdvantages

The UTXO model does not include wallets at the protocol level. It is based on individual transactions grouped in blocks. The UTXO model is a design common to many cryptocurrencies, especially Bitcoin.

• Cryptocurrencies that use the UTXO model do not use accounts or balances. Instead, UTXOs are transferred between users, just like physical cash.

• Every transaction in the UTXO model can transition the system to a new state, but it is not feasible for every transaction to transition to a new state.

• Network participants must stay in sync with the current state.

比特币必读指南Ⅱ :UTXO 模型的前世今生

The total UTXOs present in the blockchain represent a set and are constantly maintained by every Bitcoin node.

• Each transaction consumes elements from this set and creates new elements that are added to this set. Every time a new block is accepted in the blockchain, the UTXO set is updated and every Bitcoin node in the network will have an exact copy of the UTXO set in its local storage.

• The complete UTXO set can be added up to calculate the total supply of a cryptocurrency at a given point in time, and in the case of valid blockchain transactions, only unspent outputs can be used to fund further transactions. The condition that only unspent outputs can be used for further transactions is necessary to prevent double spending and fraud.

The difference between the UTXO model and the Ethereum account model

比特币必读指南Ⅱ :UTXO 模型的前世今生

Unspent transaction outputs are part of the distributed database technology behind Bitcoin and other cryptocurrencies. Bitcoin uses UTXO, but it is not UTXO. In addition, Ethereum uses an account-based approach and account balances, so there are no UTXOs in the Ethereum Virtual Machine.

UTXO The importance of technology

Language-independent intelligencecontract:基于UTXO 的智能合约独立于语言,允许 UTXO 开发独特的共识机制。

Support decentralizationexchangeAnd atomic swaps:The UTXO model can support atomic swaps, thereby enabling peer-to-peer encrypted transactions without the involvement of a third party. The atomic swap function of UTXO is aXiaobai NavigationDirect cryptocurrency trading offers better convenience.

Scalability advantages:The facility or parallel transaction processing reduces the computational load on the blockchain network.

Privacy and Security:Each UTXO transaction uses a new address, so transactions cannot be tracked.

Preventing double spending:UTXO can only be used once, which is the basis for the operation of blockchain technology and ensures that the currency will not be used multiple times.

More flexibility:It offers greater flexibility than fiat currencies.

Simple parallelization:它允许智能合约中交易的更简单并行化。

The UTXO model is used in many cryptocurrencies because it allows users to track ownership of all parts of that cryptocurrency. Because cryptocurrencies are created with anonymity in mind, UTXOs are associated with public addresses that are visible to the entire network.

Users cannot be identified by their ownership unless they publish their addresses, but the model allows for transparency through addresses.

UTXO Use Case ApplicationsRGB Off-chain transfer solution

The core idea of the RGB protocol is to call the Bitcoin blockchain only when necessary, that is, to use proof of work and the decentralization of the network to achieve double-spending protection and censorship resistance.TokenThe verification of transfers is removed from the global consensus layer and placed off-chain, where they are only verified by the client receiving the payment.

Working principle:

In a contract of RGB, GenesisToken都归属于一个比特币的UTXO(无论是已经存在的,还是临时创建的),而为了转移代币,你需要花费此UTXO。在花费这个UTXO 的时候,比特币交易必须额外添加一个输出,该输出包含对一条消息的承诺,这条消息的内容就是RGB 的支付信息,它定义了输入,这些代币将被发送到哪个UTXO,资产的id,数量,花费的交易以及它需要附加的数据。

Summarize

The essence of UTXO is actually a kind of running account: the UTXO model is used to check whether the transaction funds exist, and then the source of the transaction is traced. After confirmation, it is broadcast to the entire network through the consensus mechanism and recorded on the chain. During the whole process, UTXO will record all the information involved, such as account funds, transaction addresses, transfer funds, and sources of funds, so that the original source of each transaction can be traced. It is based on this feature that UTXO can solve the double-spending problem together with the consensus mechanism. The security and integrity of the transaction information of the RGB protocol are guaranteed by UTXO.

In general, UTXO can not only assist the consensus mechanism and solve the double-spending problem of blockchain, but also give blockchain the characteristic of traceability. Blockchain can also use this as a basis to ensure the authenticity and reliability of each transaction.

The article comes from the Internet:Bitcoin Must-Read Guide Ⅱ: The Past and Present of the UTXO Model

Related recommendation: Behind the Bitcoin crash

The reason may be that investors sold their bitcoins at a profit after the bitcoin rebound in December. Written by Tanaya Macheel Compiled by Qin Jin According to CNBC, bitcoin plummeted on Monday. The reason is that investors sold their bitcoins at a profit after the bitcoin rebound in December. According to Coinbas data, bitcoin prices recently plunged by more than 7%, reporting…

share to
© 版权声明

相关文章