Balance check

in balance •  4 years ago 

The concept of balance should be said to be deeply ingrained. The balance is generated by what is called the debit and credit bookkeeping method. It is also a method commonly used by banks. A person’s transaction records are counted and a balance is calculated, but there is no balance in Bitcoin. This concept is because it uses the accounting method of the UXTO model. For example, A->B10 bitcoins, B->C5 bitcoins. For the second transaction, B must indicate the information of the first transaction when initiating the transaction, so that you can know that B has been from A 10 Bitcoins were received there, indicating that the conditions for initiating the second transaction were met. Therefore, the balance check in Bitcoin is done retrospectively.

The figure above depicts two transactions. In transaction 10001, B transferred 10 bitcoins to C. The process of verifying this transaction is: first decrypt B’s signature with B’s public key, and then combine it with the specific content of the transaction ( The left side of B's ​​signature). If they are the same, it means that the message was sent by B, and then check whether the transaction of 10000 really exists and the authenticity of its content. If these two points are met, it means that transaction 10001 is acceptable, otherwise it is rejected.

In fact, the real transaction is more complicated than this, because it is possible that multiple transactions constitute the input. For example, B->C20 bitcoins are composed of multiple transactions A->B10, D->B10, then The previous transaction ID is just two IDs, or even more. For the sake of brief description, only one transaction is listed here.
————————————————
Copyright statement: This article is the original article of the CSDN blogger "Dongda Data Group Zzzcg". It follows the CC 4.0 BY-SA copyright agreement. Please attach the original source link and this statement for reprinting.

image.png

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!