Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the bitcoin UTXO model?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article focuses on "what is the bitcoin UTXO model". Interested friends may wish to take a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what the Bitcoin UTXO model is.

ETH and account Model

The account model used in Tai Fong is easier to understand, just as each of us has a bank account. In the world of Tai Fong, each address is like an account, and every deduction is recorded in the block chain after each transaction. Therefore, when authenticating the transaction, you only need to check whether the account has enough balance. This method is simple, intuitive and beneficial to the development of intelligent contracts. If you have ever been to Etherscan to observe your trading records, you will also find that everything is easy to understand. After entering your trading ID, you will see something like this:

Simple from A to B, as long as you can understand English, you should be able to understand.

Bitcoin and UTXO Model

UTXO, whose full name is Unspent Transaction Outputs, has no transaction output, which is less intuitive than the account model.

In the Bitcoin world, there is no account book that records all account balances. So how do you determine how much balance an address has now? To put it simply, you have to review all previous transactions, find all the bitcoins sent to you, and add them all up.

Input and output in a transaction

A "transaction" in Bitcoin is also more complex. Suppose today, Fred gave Alice two BTC,Ted to Alice three BTC, we send these two to Alice, the sum of 5 BTC is called Unspent Transaction Outputs, that is, no transaction output: that is, now Alice has two Unspent Transcation Outputs, which can be used as input for him to transfer money to others in the future.

If Alice wants to transfer 5 BTC to Bob now, he will use the first two UTXO with a sum of exactly 5 as input to the transaction. What the miners need to verify is that there are no other transactions in the previous block that have used the Unspent Output. If the same output has already been sent, it is not Unspent, which is how Bitcoin prevents Double Spending.

Another condition is that the total number of output and input should match. In fact, when trading, it is not always possible to find two output that add up to the amount you want to transfer, just like in the picture above, if Alice Alice only wants to transfer 4.5 BTC to Bob Bob, then he has to add an extra column of output and transfer the extra BTC to himself.

We can actually take a look at what bitcoin transactions look like, and now if we want to look at our own trading records on BlockExplorer, we will find that it looks like this:

A transaction contains a lot of input and output, which is likely to be a record of the amount transferred by the exchange, so it contains a lot of output. The input on the left may be a trading output that transfers a large number of money into the wallet of the exchange.

Interestingly, we can't actually "determine" the real transaction amount in a transaction. For example, in the following record, there are three output on the right, and we are not sure which of the 0.2 output 0.03 and 56.38 output is the real destination. Maybe Alice has only one Unspent Transaction Output unspent transaction to output 56.61 BTC, so although he only wants to transfer to 0.2BTC in this transaction, he has to use his only UTXO, and the remaining 56.38 is transferred back to himself.

Of course, today's bitcoin wallets take care of these things for us, so when we use them like bank accounts, as long as we output the destination address, the wallet will help us find the appropriate unspent output (UTXO) as input to complete the transaction. But if you are idle, or if you want to do something you don't want you to know, you can pack up strange inputs to increase anonymity.

Advantages and disadvantages of UTXO

UTXO allows multiple transactions in parallel because there is no account. If you have a lot of UTXOs, you can make multiple trades at the same time without being blocked. Then there is anonymity, as mentioned above, you can easily hide your trading purpose. In addition, UTXO is also considered to be relatively safe and efficient, and Simple Payment Verification (SPV) can be used to quickly verify and verify transactions.

But the biggest disadvantage of UTXO is that it is Stateless stateless, which is very disadvantageous to developing applications on it. Just like the famous Qtum, although it is based on UTXO's trading model, it still designs an Account Abstraction Layer account abstraction layer to make application development easier.

At this point, I believe you have a deeper understanding of "what the bitcoin UTXO model is". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report