Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a method and a system for continuously digging a block chain.
The invention is realized in such a way that a block chain sustainable mining method comprises the following steps:
all transaction system users pay certain transaction fees according to the tax rate in the transaction process; the transaction fee is not paid to miners directly, but collected into a tax-specific account; when a new block is successfully generated, a miner who obtains the accounting right of the new block draws a fixed tax mechanism for returning the mining from a tax special account; the original systematic ore excavation return is compensated or replaced, so that the ore excavation process is stable;
setting a special tax account by using a data structure on a chain, and realizing tax management by carrying out consensus verification on tax collection and mining return payment;
and calculating the transaction tax rate by adopting a sliding window average algorithm based on double threshold control, and controlling the stability and reliability of the tax balance.
Further, the tax mechanism specifically includes:
setting of tax special account: setting a tax special account by adopting a mode of a data structure on a chain; adding two data fields in the block head, and respectively recording the data fields as balance and tax rate;
the setting of tax and excavation return protocol includes:
payment of transaction tax:
when a user creates a transaction, paying transaction fee according to the transaction amount and the tax rate, and specifically calculating according to the following steps: transaction amount x tax rate; wherein the UTXO (unused transaction output, referring to the virtual digital currency held by the transaction creator declared at a block) referenced by the user is represented by an input, and the portion of the change representing UXTO higher than the sum of the transaction amount and the transaction tax is returned to the user; the transaction creation needs to satisfy: inputting transaction amount x (1+ tax rate) into change;
and (3) transaction tax whole network verification:
after the transaction is established, the transaction needs to pass through whole network propagation and tax verification, and a relational expression which needs to be met during the transaction establishment in the transaction tax payment step is verified;
tax collection and mine digging return payment:
the miners in the transaction system collect the transactions transmitted on the network and verify the transactions;
the miners collect the taxes for all successfully verified transactions;
miners who successfully obtain the accounting right deposit the specified amount of money into their own purses as the return of ore digging, and update the balance information in the tax special account; meanwhile, the miners also calculate the tax rate of the next period according to a transaction tax rate calculation method given by the system and update the tax rate information;
and (3) verifying tax special account data in the whole network:
after a miner generates a new block, broadcasting the new block to the whole network for verification; the network node receiving the new block verifies the balance information and the tax rate information in the tax special account;
the tax special account data is written into the account book:
after the new block is verified by most nodes of the network, the block is successfully added into the main chain, and the data information of the tax special account is approved all over the network.
Further, the transaction tax rate calculation adopts a sliding window average method to estimate the transaction amount, and calculates the transaction tax rate according to the estimation of the transaction amount and other system parameters, specifically as follows:
x (k) represents the tax-specific account balance for the k block count; s (k) represents the total amount of transactions that occurred in the k block; mu represents the return of ore excavation and is a constant; λ (k) represents the transaction tax rate of the kth block generation period; l represents the sliding window length; the correlation is calculated as follows:
further, the fine tuning of the tax rate by the double-threshold method specifically includes:
adjusting the tax rate according to the balance of the special account of the tax;
the first step is as follows: if the current account balance is lower than the balance lower limit XLThen, the tax rate is adjusted up as follows:
λ(k+1)←λ(k+1)(1+δ);
if not, entering the second step;
the second step is that: if the current account balance is higher than the balance upper limit XHThen, the tax rate is adjusted downward as follows:
λ(k+1)←λ(k+1)(1+δ);
if not, entering a third step;
the third step: maintaining the calculated tax rate before the first step, namely:
λ(k+1)←λ(k+1);
the fourth step: and outputting the obtained tax rate lambda (k + 1).
Further, the method for continuously excavating the ore by the block chains further comprises the following steps:
establishing an evaluation system from the analysis of ore excavation return, tax balance and tax rate stability; the method specifically comprises the following steps:
first, mu is used to represent the fixed return from mining, mu (k) is used to represent the return from mining obtained by generating the kth block, and Δ μ is defined
max=max
1≤k≤KThe | mu (k) -mu | is the maximum deviation of the mine excavation return distance target return; definition of
An average deviation from a target return for a mine excavation return, wherein K is a statistical duration;
secondly, the balance of the tax special account represents the activity degree of system transaction on one hand and also reflects the capability of paying mine digging return on the other hand; are defined separately
And
the mean and standard deviation of the account balance;
then, tax rate stability analysis is carried out, and two indexes of average tax rate and tax rate fairness are defined as follows respectively
Wherein in the fairness index
When all λ: (k) When K is equal to 1, 2.., K }, the fairness index reaches a maximum value of 1.
Another object of the present invention is to provide a block chain system for continuous excavation. The system comprises a special account module for tax fee on the chain, a transaction amount counting module, a tax rate calculating and self-adaptive adjusting module and a protocol mechanism module for executing tax fee management and mining reporting payment;
the special account module for tax is arranged in the block head and is additionally provided with two data fields for recording account balance and declaring the tax rate of the next block period; the management of the tax special account is responsible for miners who obtain the accounting right, and the data reliability of the tax special account is verified by a full network consensus mechanism;
the transaction amount counting module is used for realizing average counting of transaction amounts contained in the current block and a plurality of previous blocks and determining a parameter L of a statistical block number adjusting algorithm; the statistical result is used for estimating the transaction amount in the next block period;
the tax rate calculating and self-adaptive adjusting module is used for calculating the transaction tax rate in the next block period according to the estimation of the transaction amount in the transaction amount counting module and the arrangement of ore excavation return; in addition, according to the state of the balance of the special account for the tax, a double-threshold control method is used for finely adjusting the tax rate, so that the balance of the special account for the tax is stabilized in an expected range;
the system comprises a protocol mechanism module for executing tax management and mining report payment, wherein the protocol mechanism module appoints the tax to be paid by a system user for initiating a transaction and verifies whether the transaction tax payment is effective or not through a block chain consensus mechanism; the miners who agree to obtain the accounting right execute the information of the special tax account, calculate and update management and the payment returned by mining the miners, and verify the effectiveness of the information of the special tax account and the effectiveness of the payment returned by mining through a block chain consensus mechanism.
The invention has the advantages and positive effects that:
the invention realizes the collection and management of the tax by setting a tax mechanism and setting a special account for the tax. And the public and safety of tax management are realized by using the on-chain data structure and the block chain consensus process. A series of system performance indexes are verified through computer simulation, and results show that the provided new scheme can effectively solve the sustainability problem of block chain excavation.
Aiming at the problem that the mine excavation return of a transaction system based on a block chain is gradually reduced and unstable, a tax and return payment scheme supporting sustainable mine excavation is provided. The invention can compensate or replace the original systematic mining return under the condition of reducing or interrupting the systematic return, so that the mining process, namely the block generation process is stable, and the trading system can be continued. Through computer simulation, under the condition that the systematic mine digging reward is interrupted, the invention can provide stable mine digging reward for a trading system, and compared with the probability of 50% of the voluntary tip-rate mode, the mine digging reward is lower than the set expected value, and the probability of only 0.01% of the mine digging reward is lower than the expected value.
The invention adopts the sliding window average algorithm calculation based on double threshold control to calculate the tax rate, thereby improving the stability and reliability of tax balance control; through double threshold control, the balance of the tax special account is controllable, so that the stability of mine excavation return is improved, and the stability of a transaction system is promoted; through computer simulation verification, when the average block transaction amount is 10000 and the expected mine digging return is 12.5, if a simple fixed tax rate mode is adopted, the account balance is often insufficient, and the standard deviation of the balance is large and reaches 14.2; the sliding window average algorithm based on double-threshold control designed by the invention can keep the account balance within an expected range, and meanwhile, the standard deviation of the balance is smaller and is 5.34. In addition, the method is used for adopting a sliding window average algorithm, so that the system tax rate is kept relatively stable; the computer simulation result shows that the tax rate fairness index is 0.99, which is close to the fairness index of 1 under the condition of fixed tax rate. The higher the fairness, the more stable the tax rate.
The invention adopts a data structure on a chain to set a special account for the tax, and the collection of the tax and the mine digging return payment are identified and verified together, so that the account has the same safety and reliability with the block chain technology.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail with reference to the following embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the prior art, in a block chain-based transaction system, stability and sustainability of a mining process are difficult to maintain under the condition that systematic mining return is reduced or interrupted.
The invention is described in detail below with reference to the figures and the embodiments.
As shown in fig. 1, in the block chain sustainable mining method provided by the embodiment of the present invention, a user of all transaction systems pays a certain transaction fee according to a tax rate during a transaction process; the transaction fee is not paid to miners directly, but collected into a tax-specific account; when a new block is successfully generated, a miner who obtains the accounting right of the new block draws a fixed tax mechanism for returning the mining from a tax special account; the original systematic ore excavation return is compensated or replaced, so that the ore excavation process is stable;
setting a special tax account by using a data structure on a chain, and realizing tax management by carrying out consensus verification on tax collection and mining return payment;
and calculating the transaction tax rate by adopting a sliding window average algorithm based on double threshold control, and controlling the stability and reliability of the tax balance.
The application of the principles of the present invention will now be described in further detail with reference to specific embodiments.
Sustainable mining reward design method
The block chain sustainable mining method provided by the embodiment of the invention designs a tax mechanism: all transaction system users pay certain transaction fees according to the tax rate in the transaction process; but the fee is not paid directly to the miners but is collected into a tax-specific account set; every time a new block is successfully generated, the miners who obtain the accounting right of the block draw the fixed mining return from the tax special account. As in fig. 1.
1. Tax-specific account design
The invention realizes the setting of the tax special account by adopting a mode of a data structure on a chain. Specifically, two data fields are added in the block header and are respectively recorded as balance and tax rate. The modified block header data format is shown in table 1.
Table 1 Block header data Structure including balance and tax data fields
In the data structure of the special tax account, the balance item is used for recording the balance of the special tax account to the current block (including all transaction fees of the current block, and removing the mining return of the current block); the tax rate represents the transaction tax rate in the next block forming period. It should be noted here that the tax-dedicated account is different from the general user account, and it only records tax information, and does not store currency, and it pays the process of mining return, and does not need any digital signature of any person. The circulation of the tax-dedicated account data and the digital currency under the control of the account ensures the safety and credibility of the account through the consensus process of the block chain.
2. Tax and mining return protocol design
Based on the demand of block chain sustainable mining, the introduction of tax special account and the design of user transaction and payment of mining return, the invention provides a new protocol which is marked as tax and mining return protocol.
The protocol introduces a series of workflows synchronized with the block generation process, as shown in detail in fig. 2. For the sake of comparison, in each step text description in fig. 2, the lower part is the block generation step, and the upper part is the protocol step of the present invention.
The tax and mine excavation reporting protocol and the process thereof are described below with reference to FIG. 2.
1) Transaction tax payment
This step is synchronized with the user creating the transaction. When a user creates a transaction, the user must pay transaction fees according to transaction amount and tax rate, and the specific calculation is according to: transaction amount x tax rate. The "input" is used herein to indicate that the UTXO referenced by the user and the "change" indicates that a portion of UXTO above the sum of the transaction amount and the transaction tax is returned to the user. Then, the transaction is created with the following requirements: input-transaction amount x (1+ tax rate) ═ change.
2) Transaction tax verification over network
This step is synchronized with transaction-wide web-propagation verification. After the transaction is created, the transaction needs to be propagated through the whole network and verified by tax, mainly by verifying the relation needed to be satisfied in the previous item.
3) Tax collection and mine excavation return payment
This step is synchronized with the process that the mineworker has collected the transaction to have mined. Miners in the transaction system can collect the transactions propagated on the network and verify the transactions. The mineworker collects the taxes for all successfully verified transactions. Miners who successfully obtain the accounting right can deposit the specified amount of money into the wallets of the miners as the return of mining, and meanwhile, the balance information in the tax special account is updated. In addition, the miners can calculate the tax rate of the next period according to the tax rate calculation method given by the system and update the tax rate information.
4) Tax-specific account data full-network verification
This step is synchronized with the net-wide propagation verification of the newly generated blocks. After the miners generate a new block, the block is broadcast to the whole network for verification. And the network node receiving the new block verifies the balance information and the tax rate information in the tax special account.
5) Tax special account data writing account book
This step is synchronized with the block addition backbone. After the new block is verified by most nodes of the network, the block is successfully added into the main chain, and the data information of the tax special account is approved all over the network.
It can be seen that the sustainable mining method and the protocol thereof rely on the consensus process of the block chain, and have the same safety performance as the block chain.
3. Transaction tax rate calculation algorithm, fig. 3.
The invention adopts a sliding window average method to estimate the transaction amount, and calculates the transaction tax rate according to the estimation of the transaction amount and other system parameters, which is as follows:
x (k) represents the tax-specific account balance for the k block count; s (k) represents the total amount of transactions that occurred in the k block; mu represents the return of ore excavation and is a constant; λ (k) represents the transaction tax rate of the kth block generation period; l represents the sliding window length; the correlation is calculated as follows:
further, the fine tuning of the tax rate by the double-threshold method specifically includes:
adjusting the tax rate according to the balance of the special account of the tax;
the first step is as follows: if the current account balance is lower than the balance lower limit XLThen, the tax rate is adjusted up as follows:
λ(k+1)←λ(k+1)(1+δ);
if not, entering the second step;
the second step is that: if the current account balance is higher than the balance upper limit XHThen, the tax rate is adjusted downward as follows:
λ(k+1)←λ(k+1)(1+δ);
if not, entering a third step;
the third step: maintaining the calculated tax rate before the first step, namely:
λ(k+1)←λ(k+1);
the fourth step: and outputting the obtained tax rate lambda (k + 1).
Aiming at the problem that the mine excavation return of a transaction system based on a block chain is gradually reduced and unstable, a tax and return payment scheme supporting sustainable mine excavation is provided. The invention can compensate or replace the original systematic mining return under the condition of reducing or interrupting the systematic return, so that the mining process, namely the block generation process is stable, and the trading system can be continued.
The invention adopts a data structure on a chain to set a special account for the tax, and the collection of the tax and the mine digging return payment are identified and verified together, so that the account has the same safety and reliability with the block chain technology.
The invention adopts the sliding window average algorithm calculation based on double threshold control to calculate the tax rate, thereby improving the stability and reliability of tax balance control and further improving the stability of a trading system.
The present invention is further described below with reference to a block chain sustainable mining evaluation system.
In order to scientifically evaluate the sustainable design of block chain mining, the invention establishes an evaluation system from mining return statistics, tax balance statistics and tax rate stability analysis.
First, the mine excavation reward is the system performance that the present scheme is directly concerned with. As mentioned above, where mu is used to represent the fixed return from mining, and mu (k) is used to represent the return from mining obtained by generating the kth block, then the definition of
Δμmax=max1≤k≤K|μ(k)-μ|;
Reporting a maximum deviation from the target return for the mine excavation return; definition of
An average deviation from the target return is reported for the mine excavation, where K is the duration of the statistic.
And secondly, the balance of the tax special account represents the transaction activity degree of the system on one hand and also represents the payment mining return capability of the scheme on the other hand. Are herein defined separately
And
the mean and standard deviation of the account balance.
Then, considering the stability of the balance of the tax account, the invention adopts a dynamic tax rate adjustment strategy. However, a reasonable tax rate setting should not have too large a floating adjustment that would affect the unfairness of the tax in a short time. Therefore, two indicators of average tax rate and tax rate fairness are defined herein as follows
Wherein in the fairness index
The fairness index reaches a maximum value of 1 when all λ (K), K ═ 1, 2, …, K } are equal.
Third, simulation analysis of protocol performance
The part takes the bitcoin system as an example, and assuming that the systematic mining return is already interrupted, the scheme provided by the method is used for realizing the mining return. The verification of the invention and the analysis of the influence of the protocol parameters on the performance are carried out through computer simulation. The trading system simulation setup is shown in table 1.
TABLE 1 computer simulation test parameter set-up
The network nodes are networked in a P2P mode, and each node is a trading user and is also used for mining. For comparative analysis, simulation analysis is performed on the following ore excavation return payment mechanisms:
1. the traditional voluntary tip payment mode is abbreviated as the voluntary mode;
2. paying a tip mode according to a fixed rate, and abbreviating the tip mode as a fixed tax mode;
3. the tax rate is averagely adjusted according to the sliding window without a double-threshold control mode, which is abbreviated as the sliding window mode;
4. the tax rate is averagely adjusted according to the sliding window and a double-threshold control mode is provided, which is abbreviated as the sliding window double-threshold mode.
Through the simulation, performance analysis and evaluation are performed on the modes according to the proposed sustainable excavation evaluation system, and the results are as follows.
The result is as follows: ore mining return analysis
First, analysis is performed for the excavation return parameters of primary interest to the present invention. Fig. 4 shows the reports obtained by each block miner generated in four mining reporting modes (for clarity, the time axis is shown sampled in units of 10 block periods). The result shows that the tax in the transaction system is effectively managed by adopting the tax special account mode, and the miners can still keep stable mine digging return even after the interruption of the systematic reward. For the traditional voluntary tip mode, the mining return changes along with the random change of consumption, and cannot be stably guaranteed.
And further analyzing the comparison difference of mining return in the tax fixing mode, the sliding window mode and the sliding window double-threshold mode. From the results, the stability support of the sliding window double-threshold mode on the mine digging return is best, the sliding window double-threshold mode is hardly influenced by the transaction dynamics, and the mine digging return is always kept at 12.5 bits of coins. On the contrary, the fixed tax mode is influenced by the system transaction dynamics, so that the mine excavation and return market is reduced; the sliding window mode without thresholds is also affected by the system transaction dynamics.
Table 3 gives the results of statistical analysis of the performance parameters. It can be seen that the sliding window dual-threshold mode returns the maximum offset Deltau u in mining
maxAverage deviation amount
And the probability of the return of mining is lower than 12.5 bit coins, and the three parameters have great advantages in performance. Moreover, it should be noted that the maximum deviation occurs in the initial stage of the simulation, when the balance of the tax-specific account is still insufficient, the block mining returns are all kept at 12.5 bit coins in the following process, which meets the set target. In contrast, the other modes are different, but the stability of the sliding window double-threshold mode is not achieved.
TABLE 3 mine excavation reporting analysis
And a second result: tax balance analysis
This section analyzes the course of the tax account balance changes under different policy models. Since the conventional voluntary mode does not set an account, the mode is not in the statistics. Fig. 5 shows the change process of the balance with the block. The results show that the sliding window dual threshold mode can stabilize the account balance at a desired level due to the dual gate first control, thereby improving the stability of the mine excavation reward payment. In the sliding window mode, as the average periodic transaction amount statistics is taken as the reference for setting the tax rate, a relatively stable account balance level is obtained, but the balance is kept at a lower level, which is not beneficial to stable mining return expenditure. The account balance in the tax-fixing mode is affected by the dynamic change of the transaction amount.
Table 4 shows the results of a statistical analysis of the balance of the tax-specific account. The results show that in the sliding window double threshold mode, the average value of the account balance is 485.19 bit coins, and the standard deviation reaches 84.42. This result is achieved because the initial phase of the account balance is set to 0, and there is a process of balance increase. The data in parentheses in the table is statistics again after the account balance reaches 500 bit coins for the first time, and it can be seen that the balance is 506.42 bit coins on average, and the standard deviation is reduced to 5.34, which indicates that the account balance has good stability and provides important support for the sustainability of ore excavation. Compared with the prior art, in the fixed tax mode, the balance standard deviation is large, the balance is often grounded to 0, and the stability is insufficient; the sliding window mode without threshold, again maintains a very low balance level.
TABLE 4 tax specific Account balance analysis
And a third result: tax rate stability analysis
And finally, analyzing the change condition of the system tax rate from the perspective of the tax payment fairness of the transaction system user. From the results shown in FIG. 6, it can be seen that in the sliding window mode and the sliding window dual threshold mode, the tax rate setting is based on the statistical mean of the system transaction amount, and thus, the tax rate is a dynamic process with time; in addition, due to the sliding window double threshold moduleThe formula can also adjust the tax rate according to the balance condition of the tax special account, and the middle adjusting process can be seen from the figure. Due to dynamic adjustment, the mode has good stability in account balance and mine excavation return payment. In the fixed tax mode, the tax rate is fixed and is set under the condition that the average transaction amount of the system is known in the simulation process; in a real system, if the tax rate is not properly set, the block chain mining process may also be affected. Table 5 further shows the statistics of the average tax rate and the tax rate fairness index. The results show that the tax rate was maintained at a level of 0.125% on average. Furthermore, although FIG. 6 shows that the tax rate is a dynamic process in the sliding window mode and the sliding window dual threshold mode, the adjustment range is very small, substantially 10-4Magnitude; from a fairness parameter λfairIt can be seen that the fairness index is close to the fixed tax rate level.
TABLE 5 tax specific Account balance analysis
Thirdly, the invention is further described below with reference to the simulation results.
The invention carries out comparative analysis and verification on the proposed block chain sustainable mining system. The result shows that the tax collection and management are carried out after the compulsory transaction tax is set and the tax special account is set, so that reliable and stable return can be provided for the block chain mine digging process, and the block chain-based transaction system can realize sustainability even after the system mine digging return is stopped. In addition, the current transaction amount is reasonably predicted by using the historical transaction amount through a sliding window average method, so that the stability of the balance of the special account for the tax is improved; furthermore, through double-threshold control, the tax balance can be stabilized at a level expected by the system, and the stability and sustainability of the return of ore excavation provided by the account are greatly improved.
The invention provides a method for continuously digging ores and provides a complete scheme design aiming at the problem that the ore digging process is difficult to keep stable under the condition that the systematic ore digging return is reduced or interrupted in a block chain-based transaction system. Specifically, the collection and management of the tax are realized by setting a tax mechanism and setting a special account for the tax. And the public and safety of tax management are realized by using the on-chain data structure and the block chain consensus process. A series of system performance indexes are verified through computer simulation, and results show that the provided new scheme can effectively solve the sustainability problem of block chain excavation.
The present invention is further described below in connection with a blockchain sustainable mining system.
As shown in fig. 7, the block chain continuous mining system according to the embodiment of the present invention is provided. The system comprises a special account module 1 for tax fee on a chain, a transaction amount counting module 2, a tax rate calculating and self-adaptive adjusting module 3 and a protocol mechanism module 4 for executing tax fee management and mining reporting payment;
the special account module for tax 1 is arranged in the block head and is additionally provided with two data fields for recording account balance and declaring the tax rate of the next block period; the management of the tax special account is responsible for miners who obtain the accounting right, and the data reliability of the tax special account is verified by a full network consensus mechanism;
a transaction amount statistic module 2 for realizing average statistics of transaction amounts contained in the current block and a plurality of previous blocks, and determining a statistic block number adjustment algorithm parameter L; the statistical result is used for estimating the transaction amount in the next block period;
the tax rate calculating and self-adaptive adjusting module 3 is used for calculating the transaction tax rate in the next block period according to the estimation of the transaction amount in the transaction amount counting module and the arrangement of ore excavation return; in addition, according to the state of the balance of the special account for the tax, a double-threshold control method is used for finely adjusting the tax rate, so that the balance of the special account for the tax is stabilized in an expected range;
the agreement mechanism module 4 for executing tax management and mining reporting payment, which appoints the tax to be paid by the system user for initiating the transaction, and verifies whether the transaction tax payment is valid through a block chain consensus mechanism; miners who agree to obtain the accounting right perform information calculation and updating management of the special tax account and payment of mine excavation return of the miners, and the validity of the special tax account information and the validity of the payment of mine excavation return are verified through a block chain consensus mechanism.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.