search
Homeweb3.0If you want to understand BRC-20 in depth, learn UTXO first

If you want to understand BRC-20 in depth, learn UTXO first

Mar 06, 2024 pm 01:34 PM
BlockchainBitcoinEthereumPopular scienceBitcoinblockchain

The recently popular BRC-20 Token is based on Bitcoin, but the Bitcoin blockchain cannot impose rules on it. The cost of making a BRC-20 Token lies in adding the file to the blockchain and the future movement of the UTXO associated with the Token.

Since UTXO is so important, today we will briefly introduce UTXO.

01. What is UTXO

In the current blockchain project, there are two main ways to save records, One is the account /Balance model, one is UTXO model. Bitcoin adopts the UTXO model, while Ethereum and others adopt the account/balance model.

If you want to understand BRC-20 in depth, learn UTXO first
##UTXO is the abbreviation of Unspent Transaction Output, which means

unspent output, can be simply understood as return There are no spent receipts. For example, Han Meimei received a Bitcoin, but she did not use it. This Bitcoin is a UTXO to her.

02. Account/balance model and UTXO model

Account/balance model is very common in life, such as our bank account and WeChat account, all based on account/ Balance model.

The balance in the account exists as a whole. How much money is in Li Lei's account? You can tell by looking at the balance. When a transaction occurs, it is the balance that changes. For example, on Valentine's Day, Li Lei transfers 520 yuan to Han Meimei via WeChat. Li Lei's WeChat account balance will decrease by 520 yuan, while Han Meimei's account balance will increase by 520 yuan.

The UTXO model is different from the account model.

How many Bitcoins Li Lei has can only be known by summing up all the UTXOs of his Bitcoin address. To put it simply, the UTXO model is like the wallet we use, and each banknote or coin in the wallet is a separate UTXO. Therefore, it is not clear at a glance how much money is in the wallet. All banknotes and coin denominations need to be compared. It can be found by adding.

Every payment or receipt is consumed or received in UTXO units. For example, when we use 10 yuan to buy 5 yuan breakfast, the 10 yuan will be paid to the seller as a UTXO, and the seller will give you change.

Let’s illustrate with an example.

On Valentine's Day, Li Lei bought flowers for Han Meimei, the price was 520 yuan. To pay in cash, he took out 6 hundred-yuan bills (equivalent to 6 100-yuan UTXOs) and gave them to the seller. The seller needed to give Li Lei 80 yuan in change (one each of 50-yuan, 20-yuan and 10-yuan bills). It is obvious in this process that Li Lei spent 600 yuan to buy flowers and received 80 yuan in change, and the seller sold the flowers and received 520 yuan.

From the perspective of UTXO, Li Lei spent 6 UTXO (6 pieces worth 100 yuan) and got 3 UTXO (3 pieces in change); the seller got 6 UTXO and spent 3 UTXO in change.

If this transaction is completed with Bitcoin, the process will be slightly different. Suppose Li Lei uses 6 UTXOs of 1 BTC to pay the seller 5.2 BTC. In the end, the seller gets

a value of 5.2 BTC. UTXO, The change given to Li Lei is a UTXO worth 0.8 BTC. In other words, 6 UTXOs were "destroyed" and turned into two new UTXO. (The reason for the difference between the two is that the types of banknote denominations are limited, while Bitcoin is not subject to this restriction). If the show of affection between Li Lei and Han Meimei takes place on the Bitcoin network, what is the transfer process?

Li Lei mined and received 12.5 Bitcoins as a reward from the system, so there was a UTXO of 12.5 BTC on Li Lei’s Bitcoin address.

Li Lei wants to transfer 5.2BTC to Han Meimei, and the 12.5BTC UTXO will be spent as a whole, of which 5.2BTC will be transferred to Han Meimei, and the remaining 7.3BTC will be given to himself in change (for the convenience of discussion, I will ignore it here Mining fees). In other words, 12.5 BTC previously existed in the form of a UTXO. During the transfer, this UTXO was "destroyed" and no longer existed. It became two new UTXOs: one belonged to Han Meimei, and the value of this UTXO 5.2BTC, the other one belongs to Li Lei, this UTXO is worth 7.3BTC, this is the change given to Li Lei.

If you want to understand BRC-20 in depth, learn UTXO first
Comparison of the two models when transferring money

03. Summary

The core design idea of ​​UTXO is: it records transaction events but not the final status. To calculate how many Bitcoins a user has, it is necessary to sum up all the UTXOs in his wallet, and the result is the number of coins he holds. The UTXO model uses UTXO as the unit when transferring transactions, which means that when making a payment, an integer multiple of UTXO is called, such as 1 UTXO, 3 UTXO, and there is no such thing as 0.5 UTXO.

Bitcoin’s General transactions: call one UTXO to pay other people, and Collection transactions: call multiple UTXOs to pay other people.

Can you name other types of transactions?

The above is the detailed content of If you want to understand BRC-20 in depth, learn UTXO first. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:知乎. If there is any infringement, please contact admin@php.cn delete
Gitcoin Labs, the primary software development unit of Ethereum public goods funding protocol Gitcoin is shutting downGitcoin Labs, the primary software development unit of Ethereum public goods funding protocol Gitcoin is shutting downApr 26, 2025 am 11:22 AM

The decision was made in part because a “path to profitability” was unrealistic, Gitcoin co-founder Kevin Owocki said in a statement.

RCO Finance (RCOF) Emerges as a Contender for the Next Top Crypto PickRCO Finance (RCOF) Emerges as a Contender for the Next Top Crypto PickApr 26, 2025 am 11:20 AM

The XRP price has stabilized at $2.13, with a 24-hour trading volume of $2.33 billion. However, its momentum has slowed, leaving investors seeking the next top crypto pick.

Bitcoin (BTC) Could Reach $1.5 Million per Coin by 2030, ARK Invest ProjectsBitcoin (BTC) Could Reach $1.5 Million per Coin by 2030, ARK Invest ProjectsApr 26, 2025 am 11:18 AM

Investor and CEO Cathie Wood's ARK Invest firm projects that Bitcoin could reach $1.5 million per coin by 2030

The Swiss National Bank has rejected holding bitcoin reserves, citing concerns over cryptocurrency market liquidity and volatility.The Swiss National Bank has rejected holding bitcoin reserves, citing concerns over cryptocurrency market liquidity and volatility.Apr 26, 2025 am 11:16 AM

"For cryptocurrencies, market liquidity, even if it may seem ok at times, is especially during crises naturally called into question"

As Trump Announces a 90-Day Delay for Tariffs on Cryptocurrency Imports, Speculators and Investors Begin to Outline Potential RisksAs Trump Announces a 90-Day Delay for Tariffs on Cryptocurrency Imports, Speculators and Investors Begin to Outline Potential RisksApr 26, 2025 am 11:14 AM

As the US President Donald Trump announced a 90-day delay for the tariffs on cryptocurrency imports, speculators and investors began to outline potential risks to the broader cryptocurrency market.

Spotting 'one small detail' on 50p coin from 2011 could earn you £2,000Spotting 'one small detail' on 50p coin from 2011 could earn you £2,000Apr 26, 2025 am 11:12 AM

This Olympics-themed coin is highly sought after by collectors if it features a specific design.

Brits are being urged to be on the lookout for a highly sought-after 50p coin that has the potential to be worth a staggering £2,000Brits are being urged to be on the lookout for a highly sought-after 50p coin that has the potential to be worth a staggering £2,000Apr 26, 2025 am 11:10 AM

This coin is highly prized by collectors if it features a specific design.

Spotting 'one small detail' on 50p coin from 2011 could earn you £2000Spotting 'one small detail' on 50p coin from 2011 could earn you £2000Apr 26, 2025 am 11:08 AM

This Olympics-themed coin is highly sought after by collectors if it features a specific design.

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.