21:22Introduction to the calculation of commissions in Bitcoin Core
Introduction to the calculation of commissions in Bitcoin Core
commission for a transaction in Bitcoin Core
The space in the Bitcoin blockade is a limited resource, and given the rather low price, the demand for this space is much larger than the supply. If the space in the block is free, people will find all sorts of uses for it. Decentralized gambling, downloading the entire copy of the description of Bitcoin's original concept and timestamps of individual documents are just a few examples that we saw in the past.
Why there are commissions
is allocated to those who value it most and who is ready to pay for it the most, Bitkoyn has a market of commissions. In fact, the membrane acts as a decentralized clearing center - users place their price bids for a place in the block in the memPule (in the form of transactions with the attached commission), and the miners will conduct transactions and place them in the next block based on the attached board. The higher your payment, the more likely it is that your transaction will take precedence over competing transactions and that the miner selects your transaction for inclusion in the next block.
Why calculation of the commission is a difficult problem
How will the user know which commission size is appropriate? This question is difficult to answer for several reasons:
The offer of [place] is unpredictable. If we consider a long period of time, then we can say that the proposition [of the place] is predictable. This is approximately 2 MB of space every 10 minutes (or, to be more precise, a block weighing 4 MB every 10 minutes). But, due to Poisson distribution, for shorter time periods, the detection of blocks is uneven and unpredictable. One of the hundred blocks is detected within 7 seconds after the previous block, and to find another of a hundred it will take more than 45 minutes. This means that "successful" generation can occur when several blocks are detected within a few minutes, and all transactions with a high commission are withdrawn from the membrane. On the other hand, not a single block can be detected in half an hour or more, and in this case the membrane will be slowly filled with transactions with a higher commission.
Demand is also unpredictable. We definitely see a cycle in the transaction flow - on weekends it's usually quieter than on weekdays, so the mempool is empty, and the commission is lower. However, like the supply, demand is unpredictable in the short term. For example, even on weekends, demand is skyrocketing during rapid changes in bitcoin prices.
Different users have different requirements. As in any market, each participant has his own reasons for wanting to "buy" a block space. I can have a really urgent transaction that needs to be confirmed in the next half an hour, or maybe I need to close the expiring smart contract within the next 6 hours, or maybe I need to create a timestamp for something, and I I can wait a long time until it is confirmed next week. The model of a single size commission is not capable of taking into account all these different uses.
Therefore, it is difficult to calculate the correct fee under the circumstances, but this is a very important aspect when using the system. If your commission score is too high, you spend money every time you send a Bitcoin transaction. If it is too low, you will not be able to confirm your transaction as quickly as you would like, and using the system becomes a disappointment.
Our calculation of compensation can be based on various data. Let's look at them in turn. Note that these board evaluation methods will be used on the full node. We need our own mempul and a full lock-up to be able to make estimates based on observable events on the network.
Evaluation of the commission based on the current membrane
A simple algorithm for estimating the commission is to look at your mempul and establish a commission for the transaction at a level that will allow the transaction to get into the list of transactions that form the first 2 MB - with the maximum payment. This would allow expecting that such a strategy will result in your transaction being confirmed in the nearest block. Unfortunately, everything is not so simple for a number of reasons:
Most recent transactions may not be included in the next block. The miners are already working on the next block at the time the transaction was sent. Depending on how they update the block while working on it, they may not include your transaction;
Regardless of the time of sending the transaction to the membrane, the expected time that must pass to the next block is 10 minutes. This is a fundamental (and often misunderstood) property of the Poisson distribution, which follows the discovery of the block. If you put your transaction into memory in 8 minutes after the previous block, the expected time that you will need to wait is not 2 minutes - it's 10 more minutes. Therefore, you do not pros
|Total comments: 0|