How does Bitcoin dose find and check UTXO?
By Bitcoin, I think you have to say "bitcoin core" – the Bitcoin wallet software derived from the original reference implementation by Satoshi Nakamoto. The word Bitcoin also encompasses all of the specific concepts described in the Bitcoin White Paper, Network Protocol Definitions, Bitcoin Improvement Proposals (BIPS), the global network of Bitcoin nodes and users. Bitcoin, etc.
The best way to manage Bitcoin UTXO is to better analyze the source code. However, I can deduce that even if an error occurs, it will show that the problem that concerns you is not a problem.
Bitcoin core maintains multiple sets of data files. The wallet.dat file is one of them. Another set consists of the data of the actual blockchain, represented in a series of files. There may be other sets of data.
I know that blockchain is never changed by a previous block
Yes, but that does not mean that some Bitcoin software must have a persistent storage format that exactly follows the layout of the blocks on the network. The software can store the data in a standardized SQL database and rebuild the blocks only when it is necessary to recheck the hashes, signatures, and so on. – which should normally be checked only once when the block is first received. Such a data storage arrangement would allow many additional fields and associated tables to store additional information, such as an indicator indicating whether an TXO object had been subsequently used. UTXO). Alternatively, Blockchain data could be stored in exactly as received files and auxiliary files used to store additional indexes of block numbers and transaction IDs associated with addresses of interest or a table of UTXO added and deleted at the arrival and closure of blocks. checked and processed.
he must check all the blocks to see if TXO (reference to UTXO) exists or not.
No, just check each block once. After that, he can consult an effective index in a separate small separate table current UTXO that it manages independently of the real data of the blockchain.
I have a good idea. it's that we should score something in the UTXO
Actually it's already done. Except that, most likely, the mark does not appear in a copy of the block structure of the blockchain, but in separate data structures that Bitcoin Core retains for this purpose.
It is not necessary to modify the agreed data structure of the block chain used to transmit blocks between nodes.
There is no need for a node software (wallet or not) to store blockchain blocks, especially SPV portfolios. They are all free to choose the implementation of internal storage and the formats that their designers consider to be in line with their objectives.
Nodes may need to be able to pass to other nodes the requested blocks that they have already received. But this could be achieved by rebuilding blocks from other completely different and more complete storage formats.
I would like to discuss my point.
Please note that it is a question-and-answer website and not a discussion forum. Try our chat room or another website (for example, reddit, facebook, twitter, etc.)