Transaction settlement method based on Pos block chain
By building the transaction settlement method of PoS blockchain, adjusting the block size and time, and combining the successful settlement factor (SSF), the attacker's insufficient consideration of benefits and costs in the existing PoS blockchain model is solved, and more efficient transaction settlement judgment and performance improvement are achieved.
Patent Information
- Application Number
- CN202411852297.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-07-29
AI Technical Summary
The existing transaction settlement model based on PoS blockchain has shortcomings in taking into account the benefits and costs of attackers, resulting in weak universality of the model and lack of portrayal of the pledge effectiveness of key role validators, making it impossible to effectively judge whether the transaction settlement is successful.
Build a transaction settlement method based on PoS blockchain, set up a trading environment, build a single-period transaction model, and design the optimal PoS blockchain settlement mechanism. By adjusting the block size and block time, maximize the total expected transaction utility, and introduce a successful settlement factor (SSF) to determine whether the settlement is successful, taking into account the attacker's benefits and costs.
It provides a theoretically optimal PoS blockchain transaction settlement model, which can effectively judge whether the settlement is successful or not, improves the application performance of PoS blockchain in the field of transaction settlement, and performs better than PoW blockchain under certain conditions.
Smart Images

Figure CN120387816A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of blockchain, and particularly to a transaction settlement method based on the Pos blockchain. Background Art
[0002] Chiu and Koeppl (2019) constructed a blockchain operating based on the PoW algorithm. When the forking profit of the attacker is lower than the sum of the variable cost of forking (computing power cost) and the fixed cost of forking (cost of purchasing computing power equipment), the system can be successfully settled. Saleh (2021) introduced the transaction settlement based on the PoS blockchain. Assuming that the attacker needs to borrow coins and then return them, the interest on borrowing coins and the loss of the token value after the attack are regarded as the cost of forking. When the forking cost is higher than the forking profit, the attacker will not choose to fork, and the PoS blockchain can be successfully settled.
[0003] Saleh (2021) assumed that the attacker needs to borrow PoS tokens and then return them, and regarded the interest on borrowing coins and the loss of the token value after the attack as the cost of forking. It considered the financing cost and financing constraint, but ignored the block reward and the attacker's staking income. Therefore, the model has weak universality. Summary of the Invention
[0004] The present invention provides a transaction settlement method based on the Pos blockchain, aiming to fill the gap in the field of the transaction settlement model based on the PoS blockchain, study how to design and construct the optimal model mechanism of transaction settlement based on the PoS blockchain from a theoretical level, characterize the staking utility of the key role of validator, comprehensively consider the profit and cost of the attacker, propose the idea and method for judging whether the transaction settlement is successful, and comprehensively compare the settlement performance of the PoS blockchain and the PoW blockchain, so as to provide theoretical guidance for the application of the PoS blockchain in the field of transaction settlement.
[0005] The present invention adopts the following technical solutions to solve the technical problems:
[0006] A transaction settlement method based on the Pos blockchain includes the following steps:
[0007] Step S1, set the transaction environment and construct model assumptions, including the single-period transaction model of the buyer and the seller;
[0008] Step S2, construct the staking model in the PoS blockchain. According to the total number of transactions and the block size, obtain the number of blocks required to settle all transactions. The validator will verify the authenticity of all new transactions in the block, and add the verified block to the blockchain. The validator who proposes the new block will obtain the corresponding reward;
[0009] Step S3: Design the optimal PoS blockchain settlement mechanism, adjust the block size and block time to maximize the total expected transaction utility, and set two requirements that the optimal block size and block time need to meet: the first requirement is the no-fork inequality to ensure that the settlement will not fail, and the second requirement is the optimization goal to ensure the maximum total expected transaction utility.
[0010] Furthermore, in Step S1, after the transaction is confirmed, the investor's valuation of the asset will be reversely impacted, and this impact follows an exponential distribution with an arrival rate of λ; as λ increases, more investors tend to settle as soon as possible to prevent the counterparty from defaulting; at the same time, the asset dividend will also be impacted and follows an exponential distribution with an arrival rate of ν; the dividend after the impact is and δ = E(δ) - ε δ ; if the impact is large enough, the trader will have the incentive to default on the previously agreed-upon transaction; assume the transaction is settled at time T, the buyer and seller evenly share the transaction fee τ, and the transaction price of the asset is p; set the investor's utility function as the CARA negative exponential utility function, then the expected utility is Since the exponential function is monotonically increasing, this formula is simplified to Assume the transaction settlement is successful, and obtain the buyer's expected transaction utility
[0011]
[0012] The seller's expected transaction utility is
[0013]
[0014] The expected transaction utility of a single transaction can be given by the following formula
[0015] U t = U b + U s = (2e -λT - 1)V0 - τ (3)
[0016] where V0 = (u h - u l )E(δ), δ is the dividend provided by each asset, follows a normal distribution, and its variance is σ δ 2 ; A is a constant greater than 0; u l is the seller's marginal valuation, u h is the buyer's marginal valuation; E(δ) is the expectation of the dividend of the traded asset.
[0017] Furthermore, from the total number of transactions M and the block size B, obtain the number of blocks N required to settle all transactions, as shown in the following formula:
[0018]
[0019] where ceiling[x] is the smallest integer greater than or equal to x.
[0020] Furthermore, in the staking model, there are a total of M nodes. For the sub - cycle of transactions, the number of tokens staked by a validator is s, and only one block is generated in one transaction sub - cycle.
[0021] According to the staking ability of validator j, the probability of proposing a new block is
[0022]
[0023] where s j is the number of tokens staked by validator j.
[0024] The reward for proposing a new block is R, and the reward that any validator j may obtain is φ j R; the staking income of validator j is
[0025] βs j = [(P ch - P c )x+(P cl - P c )(1 - x)]s j (6)
[0026] where P c is the token price at the start of staking; after the block is generated, the staked token price rises or falls; at the end of staking, the probability that the token price rises is x, and the corresponding price is P ch ; the probability that the coin price falls is (1 - x), and the corresponding price is P cl ;
[0027] Assume that validator j first borrows some USDT coins and then converts them into the target tokens for staking; after staking the tokens for a period of time, the validator converts the tokens back into USDT tokens and repays them at the corresponding interest rate r as the borrowing cost. The cost of the validator staking the tokens is rP c s j ;
[0028] The maximization problem faced by the validator is
[0029]
[0030] The first - order condition is
[0031]
[0032] where β is the income per unit of staked tokens.
[0033] Assume that the amount of tokens staked by M validators is the same, i.e., s j = S, and the amount of tokens staked by each validator is obtained
[0034]
[0035] Assume that the validators participating in staking are in perfect competition and the number of validators tends to infinity, which is consistent with the decentralized feature of the PoS algorithm. Then it is deduced that
[0036]
[0037] Furthermore, after multiple transactions are completed, the buyer and the seller report the transaction fees to the validator, and the transactions are settled in descending order of transaction fees. Each block is connected end to end to form a chain; it is set that each block records B transactions, and the corresponding single transaction fee is τ(n), satisfying τ(1) ≥ τ(2) ≥... ≥ τ(N); the time interval between adjacent blocks is Δ; therefore, block B n The interval from block B1 is (n - 1)Δ;
[0038] Assume that the expected transaction utility of each transaction is the same, then
[0039] U(n - 1) = U(n) = 2(e -λΔ(n-1) - 1)V0 - τ(n - 1) = 2(e -λΔn - 1)V0 - τ(n) (11)
[0040] where V0 is the transaction surplus, n = 2, 3,..., N - 1, then
[0041] τ(n - 1) - τ(n) = 2(e -λΔ(n-1) - e -λΔn )V0 (12)
[0042] Since there is no settlement competition among traders in the last block, i.e., τ(N) = 0, then
[0043] U(n) = U(N) = 2(e -λΔn - 1)V0 - τ(n) = 2(e -λΔN - 1)V0 - τ(N) (13)
[0044] where N is the total number of blocks;
[0045] The single transaction fee in this block is
[0046] τ(n) = 2V0(e -λΔn - e -λΔN ) (14)
[0047] Since it is assumed that transaction fees act as the entire block reward, the total block reward is
[0048]
[0049] Substituting formula (14) into (15), we get
[0050]
[0051] So the individual block reward is given by the following formula
[0052]
[0053] where is the number of transaction sub-periods.
[0054] Furthermore, the attacker obtains the maximum default return V through forking and needs to pay the fixed and variable costs of forking; the attacker will also obtain the block reward R and the income β of the staked tokens; the fixed cost Γ of forking mainly includes the cost of validator registration, and Γ < V; due to the design features of the PoS blockchain itself and the limitations of the transaction mechanism, the variable cost of forking is higher than the cost of normal block generation; according to Chiu and Koeppl, α ≥ 1 is used to represent that the variable cost of forking is higher than the cost of normal block production, and α is called the variable forking cost coefficient; the number of tokens staked by the attacker for forking is denoted as s f ;
[0055] Assume the attacker is rational and needs to consider the following maximization problem at the start of a certain settlement sub-period
[0056]
[0057] The optimal number of tokens it stakes is
[0058]
[0059] The condition for successful settlement is:
[0060] When M → ∞, there is no settlement failure in the PoS blockchain if and only if
[0061]
[0062] Furthermore, calculate the transaction fee τ(n) and the block reward R when each transaction has the same transaction utility and when the market staking power reaches the supply-demand balance;
[0063] Considering the reward R for generating each block
[0064]
[0065] Obtain the non-forking inequality
[0066]
[0067] The left side of inequality (22) is the maximum return of default, which represents the motivation for forking; the right side of inequality (22) represents the forking resistance, including the cost of forking, the reward for generating blocks, and the successful settlement factor.
[0068] Furthermore, the blockchain operator adjusts the block size and block time to maximize the total expected transaction utility; assume that there are N blocks in the PoS blockchain, and the single transaction fee corresponding to the Nth block is τ(n); based on formula (3), the total expected transaction utility is obtained, which is equal to the sum of the expected transaction utilities of individual transactions, that is
[0069]
[0070] where U t is the expected utility of a single transaction;
[0071] Substitute equation (14), that is, τ(n) = 2V0(e -λΔn -e -λΔN ), into formula (23) to obtain
[0072]
[0073] This function consists of the block time Δ and the number of blocks N related to the block size B; maximizing the total expected transaction utility U(B) is equivalent to minimizing the total settlement delay ΔN, that is, minimizing This is called the optimization objective, as shown in the following formula:
[0074]
[0075] Advantages of the present invention:
[0076] The present invention provides a transaction settlement method based on the Pos blockchain, aiming to fill the gap in the field of transaction settlement models based on the PoS blockchain, study how to design and construct an optimal model mechanism for transaction settlement based on the PoS blockchain from a theoretical level, characterize the pledge utility of key role verifiers, comprehensively consider the benefits and costs of attackers, propose ideas and methods for judging the success of transaction settlement, and comprehensively compare the settlement performance of the PoS blockchain and the PoW blockchain, providing theoretical guidance for the application of the PoS blockchain in the field of transaction settlement. Brief description of the drawings
[0077] Figure 1 It is the flowchart of the method of the present invention.
[0078] Figure 2 This is a schematic diagram of the transaction fees and block rewards of the present invention.
[0079] Figure 3 This is a schematic diagram of the asset transaction settlement based on the blockchain of the present invention. Detailed implementation manners
[0080] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0081] Refer to the attached Figure 1 , the present invention provides a transaction settlement method based on the Pos blockchain, including the following steps:
[0082] Step S1, set the transaction environment and construct model assumptions, including a single-period transaction model for the buyer and the seller;
[0083] Step S2, construct a pledge model in the PoS blockchain. According to the total number of transactions and the block size, obtain the number of blocks required to settle all transactions. The validator will verify the authenticity of all new transactions in the block, and the block that passes the verification will be added to the blockchain. The validator who proposes the new block will receive corresponding rewards;
[0084] Step S3, design an optimal PoS blockchain settlement mechanism, adjust the block size and block time to maximize the total expected transaction utility, and set two requirements that the optimal block size and block time need to meet: the first requirement is the no-fork inequality to ensure that the settlement will not fail, and the second requirement is the optimization objective to ensure the maximum total expected transaction utility.
[0085] The present invention aims to fill the gap in the field of transaction settlement models based on the PoS blockchain, study how to design and construct an optimal model mechanism for transaction settlement based on the PoS blockchain from a theoretical level, characterize the pledge utility of the key role of the validator, comprehensively consider the benefits and costs of the attacker, propose ideas and methods for judging whether the transaction settlement is successful, and comprehensively compare the settlement performance of the PoS blockchain and the PoW blockchain, providing theoretical guidance for the application of the PoS blockchain in the field of transaction settlement.
[0086] To further optimize the technical solution, in step S1, to make the setting of the trading environment as general and clear as possible, a relatively classic model assumption constructed by Chiu and Koeppl is selected. This model is a single-period trading model including a buyer and a seller. To facilitate model comparison, similar assumptions are made as much as possible, and the same variable symbols are used. Assume that both the buyer and the seller are risk-averse investors, and they trade a certain underlying asset. The dividend provided by each asset is denoted as δ and follows a normal distribution with a variance of σ δ 2 . At t = 0, the seller owns an asset, and his marginal valuation of it is u l , and the buyer has a higher marginal valuation of it, which is u h ≥u l . The difference in the asset valuations between the buyer and the seller provides a prerequisite for the occurrence of the transaction. The buyer and the seller reach a trading consensus at t = 0. Assume that there are a total of M pairs of such buyers and sellers in the market. The transaction should be completed within the trading period T∈[0,1].
[0087] After the transaction is confirmed, the investors' valuations of the asset will be subject to a reversal shock, and this shock follows an exponential distribution with an arrival rate of λ; as λ increases, more investors tend to settle as soon as possible to prevent the counterparty from defaulting; at the same time, the asset dividend will also be subject to a shock and follows an exponential distribution with an arrival rate of ν; the dividend after the shock is and δ = E(δ)-ε δ ; if the shock is large enough, the trader will have the incentive to default on the previously agreed transaction; assume that the transaction is settled at time T, the buyer and the seller share the transaction cost τ equally, and the trading price of this asset is p; to more simply and accurately describe the utility of risk-averse investors, the utility function of the investor is set as the CARA negative exponential utility function, and the expected utility is Since the exponential function is monotonically increasing, this formula is simplified to Assume that the transaction settlement is successful, and the expected trading utility of the buyer is obtained
[0088]
[0089] The expected trading utility of the seller is
[0090]
[0091] And the expected trading utility of a single transaction can be given by the following formula
[0092] U t = U b + U s = (2e -λT -1)V0 - τ (3)
[0093] where V0 = (u h - u l )E(δ), where δ is the dividend provided by each asset, following a normal distribution with variance σ δ 2 ; A is a constant greater than 0; u l is the seller's marginal valuation, and u h is the buyer's marginal valuation; E(δ) is the expectation of the dividend of the asset being traded.
[0094] Further optimizing the technical solution, the design of blockchain transaction settlement depends on two factors - the block time Δ and the block size B. The block time Δ is the time interval between each block generated by the blockchain, and the block size B is the total number of transactions contained in a block. The trading cycle consists of consecutive discrete trading sub - cycles, and the length of each trading sub - cycle is the block time. We can see that when the block size remains unchanged, the update process of the blockchain will accelerate as the block time shortens, so that the system can settle more transactions at the same time. Similarly, if the block time remains unchanged, a larger block size can accommodate more transactions at the same time.
[0095] From the total number of transactions M and the block size B, the number of blocks N required to settle all transactions is obtained as shown in the following formula:
[0096]
[0097] where ceiling[x] is the smallest integer greater than or equal to x.
[0098] Further optimizing the technical solution, in a PoS blockchain, potential block producers are called validators, and a certain number of tokens need to be staked before generating a block. After the block is "forged", other validators will verify the authenticity of all new transactions in the block, and the verified block will be added to the blockchain. The validator who proposes the new block will receive corresponding rewards. Different from the PoW algorithm that generates blocks based on computing power, the PoS algorithm focuses on the staking ability of validators, and the probability of forging the next block is proportional to the number of tokens they stake, because the staked amount represents the staking ability of the validator. The more tokens a validator stakes, the greater the likelihood that the validator will propose a new block. A validator can also be called a node.
[0099] In the staking model, there are a total of M nodes, sub - cycles of transactions, the number of tokens staked by a validator is s, and only one block is generated in one trading sub - cycle;
[0100] According to the staking ability of validator j, the probability of proposing a new block is
[0101]
[0102] Among them, s j is the number of tokens pledged by verifier j;
[0103] The reward for proposing a new block is R, and the reward that any verifier j may obtain is φ j R; The pledge income of verifier j is
[0104] βs j = [(P ch - P c )x + (P cl - P c )(1 - x)]s j (6)
[0105] Among them, P c is the token price at the start of the pledge; after the block is generated, the price of the pledged tokens rises or falls; at the end of the pledge, the probability that the token price rises is x, and the corresponding price is P ch ; the probability that the coin price falls is (1 - x), and the corresponding price is P cl ; In the PoS blockchain, verifiers usually face a certain degree of token inflation. Considering that token inflation will ultimately be reflected in the price, then the pledge income can effectively reflect this loss of token value.
[0106] Suppose verifier j first borrows some USDT coins and then converts them into the target tokens for pledge; after pledging the tokens for a period of time, the verifier converts the tokens back into USDT tokens and returns them at the corresponding interest rate r as the borrowing cost. The cost of the verifier's pledged tokens is rP c s j ;
[0107] The maximization problem faced by the verifier is
[0108]
[0109] The first-order condition is
[0110]
[0111] Among them, β is the income of pledging a unit of tokens;
[0112] Suppose the number of tokens pledged by M verifiers is the same, i.e., s j = S, and the number of tokens pledged by each verifier is obtained
[0113]
[0114] Assume that the validators participating in the pledge are in perfect competition and the number of validators tends to infinity, which is consistent with the decentralized feature of the PoS algorithm. Then it is deduced that
[0115]
[0116] Compared with Chiu and Koeppl, the present invention takes into account the key features of the PoS blockchain, that is, validators need to pledge tokens to generate new blocks and may profit or lose from the price fluctuations of the currency. In addition, validators need to pay a certain amount of interest for the borrowed tokens.
[0117] Further optimizing the technical solution, after multiple transactions are completed, the buyer and the seller report the transaction fees to the validator, and the transactions are settled in the order from high to low transaction fees. Each block is connected end to end to form a chain, as Figure 2 shown; it is set that each block records B transactions, and the single transaction fee corresponding to it is τ(n), satisfying τ(1)≥τ(2)≥L≥τ(N); the time interval between adjacent blocks is Δ; therefore, the interval between generating block B n and block B1 is (n - 1)Δ;
[0118] Assume that the expected transaction utility of each transaction is the same, then
[0119] U(n - 1) = U(n) = 2(e -λΔ(n-1) - 1)V0 - τ(n - 1) = 2(e -λΔn - 1)V0 - τ(n) (11)
[0120] where V0 is the transaction surplus, n = 2, 3,..., N - 1, then
[0121] τ(n - 1) - τ(n) = 2(e -λΔ(n-1) - e -λΔn )V0 (12)
[0122] Since there is no settlement competition among traders in the last block, that is, τ(N) = 0, then
[0123] U(n) = U(N) = 2(e -λΔn - 1)V0 - τ(n) = 2(e -λΔN - 1)V0 - τ(N) (13)
[0124] where N is the total number of blocks;
[0125] The single transaction fee in this block is
[0126] τ(n) = 2V0(e -λΔn - e -λΔN ) (14)
[0127] Since it is assumed that the transaction fee serves as the entire block reward, the total block reward is
[0128]
[0129] Substituting formula (14) into (15), we get
[0130]
[0131] So the single block reward is given by the following formula
[0132]
[0133] where is the number of transaction sub - periods.
[0134] Further optimizing the technical solution, successful settlement without forks:
[0135] Since the blockchain is a system based on a peer - to - peer network, there will be a delay in the propagation of blocks to the entire network. Coupled with the phenomenon that nodes independently generate blocks, blocks generated by different nodes may be generated simultaneously. At this time, there may be two chains in the system. That is to say, a fork is the divergence between nodes when a new block is generated, and an attacker can use this point to replace the original transaction.
[0136] The key to successful transaction settlement based on the blockchain is to prevent malicious forks. Specifically, after a transaction is agreed upon by the buyer and seller and sent to the verifier, the buyer or seller may attempt to default by creating a fork, transferring the money or asset ownership to themselves, which leads to an inconsistency between the new transaction and the public ledger and may result in the problem of double - spending. Dishonest investors are also called forkers or attackers. Different from Nakamoto's idea, to avoid this major loophole and eliminate all settlement failures to achieve the optimal system settlement efficiency, the solution given by the present invention is to avoid forks. If an attacker with the greatest motivation to fork also considers forking unattractive, then it can be considered that other potential attackers will not attack either. Therefore, it is necessary to find the forking situation with the greatest motivation.
[0137] It is not difficult to see that the necessary condition for an attacker to have the greatest motivation to default is that the investor's valuation and asset dividend are both impacted. The maximum return the attacker obtains from default is the larger one of the buyer's or seller's default. That is to say, the attacker's maximum return is V = max{p - u l [E(δ)-ε δ , u h [E(δ)+ε δ -p}.
[0138] In addition, the present invention also considers Figure 3 two situations in []. The first situation is that the transaction has been recorded in the block. At this time, the original blockchain has been updated to any block after B3. If a dishonest investor wants to invalidate the original transaction, he needs to follow the longest chain rule (LCR), that is, replace all the blocks after B3, similar to what Nakamoto described. That is to say, the attacker needs to generate blocks such as B 3’ , B 4’ , etc. The cost of this method is relatively high. The second situation is that the transaction has not been recorded in block B3. The attacker can start working secretly on a parallel chain with another version containing his transaction and simply generate a block B 3’ to invalidate the original transaction. We can see that compared with the first situation, the cost of the second situation is significantly much lower.
[0139] Then, consider the benefits and costs of potential attacker forks. The attacker obtains the maximum default return V through forking and needs to pay the fixed cost and variable cost of forking; the attacker will also obtain the block reward R and the income β of the staked tokens; the fixed cost Γ of forking mainly includes the cost of validator registration, and Γ < V; due to the design characteristics of the PoS blockchain itself and the limitations of the transaction mechanism, the variable cost of forking is higher than the cost of normal block generation; according to Chiu and Koeppl, α ≥ 1 is used to represent that the variable cost of forking is higher than the cost of normal block production, and α is called the variable forking cost coefficient; the number of tokens staked by the attacker for forking is represented as s f ;
[0140] If we want to rule out all settlement failures, we need to prevent the trader with the greatest forking motivation from forking. The forker must be an investor who can obtain the maximum return through forking and whose transaction has not been settled, because at this time he only needs to generate one block instead of a series of blocks. Assuming the attacker is rational, he needs to consider the following maximization problem at the beginning of a certain settlement sub-cycle
[0141]
[0142] The optimal number of tokens he stakes is
[0143]
[0144] The condition for successful settlement is:
[0145] When M → ∞, there is no settlement failure in the PoS blockchain if and only if
[0146]
[0147] In this case, different from the solution in Nakamoto, in this settlement mechanism, investors do not need to wait for z blocks to be generated to confirm the security of transactions. Instead, the present invention introduces a Success Settlement Factor (SSF) to characterize whether the transaction settlement on the PoS blockchain is successful. The Success Settlement Factor (SSF) is
[0148]
[0149] Since α≥1, the SSF is greater than or equal to 1. Inequality (26) can be rewritten as
[0150]
[0151] It can be concluded that too high a default benefit or too low a forking cost may both lead to blockchain forking and settlement failure. It should be noted that the block reward R and the SSF can act as adjustment factors. If the blockchain is close to forking, increasing these two variables can suppress forking. The increase in the staking reward makes honest nodes more willing to stake tokens, which makes it more difficult to create a fork.
[0152] The present invention assumes that the transaction fee serves as the entire block reward R, and the reward for each block is the same. Note that the transaction fee is usually determined by the scarcity of settlement resources, that is, the transaction fee increases as the settlement congestion deepens. The blockchain system usually has its own transaction fee determination mechanism. For example, on the Tezos blockchain, the validator sets the transaction fee according to the supply and demand of the staking power on the network. If the block size decreases or the block time increases, the transaction urgency of investors becomes higher, and the transaction fee will increase.
[0153] Further optimizing the technical solution, calculate the transaction fee τ(n) and the block reward R when each transaction has the same transaction utility and when the market staking power reaches the supply and demand balance;
[0154] Considering the reward R for generating each block
[0155]
[0156] Obtain the non-forking inequality
[0157]
[0158] The left side of inequality (22) is the maximum return of default, which represents the motivation for forking; the right side of inequality (22) represents the forking resistance, including the cost of forking, the reward for generating blocks, and the successful settlement factor. If the motivation for forking > the forking resistance, that is, the left side of the inequality is greater than the right side, forking may occur. If the motivation for forking < the forking resistance, that is, the right side of the inequality is greater than the left side, the transaction will be successfully settled. SSF is on the right side of the inequality and is related to the income and cost of staked tokens and the variable forking cost coefficient. It should be noted that the block reward R is a key variable affecting successful settlement, which is positively correlated with the settlement congestion degree, and the settlement congestion is related to the block size B and the block time.
[0159] Further optimize the technical solution, the optimal block size and block time:
[0160] The present invention not only needs to avoid the occurrence of forking as much as possible, but also needs to strive to complete the settlement as soon as possible. Intuitively, increasing the block size and shortening the block time can both speed up the settlement speed and relieve the settlement congestion. However, this will reduce the transaction fee that traders are willing to pay for early settlement, that is, the block reward, thereby reducing the forking resistance and possibly leading to forking. Therefore, there is a trade-off when setting the optimal block size and block time respectively.
[0161] A well-designed blockchain settlement system should maximize the total transaction utility. The blockchain operator adjusts the block size and block time to maximize the total expected transaction utility; assuming that there are N blocks in the PoS blockchain, the single transaction fee corresponding to the Nth block is τ(n); based on formula (3), the total expected transaction utility is obtained, which is equal to the sum of the expected transaction utilities of individual transactions, that is
[0162]
[0163] where U t is the expected utility of a single transaction;
[0164] Substitute equation (14), that is, τ(n) = 2V0(e -λΔn -e -λΔN ), into formula (23), and get
[0165]
[0166] This function consists of the block time Δ and the number of blocks N related to the block size B; maximizing the total expected transaction utility U(B) is equivalent to minimizing the total settlement delay ΔN, that is, minimizing This is called the optimization goal, as shown in the following formula:
[0167]
[0168] The present invention obtains two requirements that need to be satisfied for setting the optimal block size and block time. The first requirement is the no-fork inequality (22), which ensures that the settlement will not fail. The second requirement is the optimization objective, which ensures the maximum total expected transaction utility. Based on the optimization objective, it is desired to settle more transactions in a shorter time. However, as the block size B increases or the block time Δ decreases, the settlement congestion will be alleviated. Therefore, the transaction fees that traders are willing to pay for early settlement will decrease (early settlement to control the default risk). As a result, the block reward R will decrease, thereby reducing the fork resistance and leading to an increase in the fork probability. Therefore, the block size B and the block time Δ cannot be increased indefinitely. In other words, the optimal settlement scenario is the moment when the fork resistance is just higher than the fork driving force. That is, when the block time is constant, the maximum block size that just satisfies the no-fork inequality (22) should be found, or when the block size is constant, the shortest block time that just satisfies the no-fork inequality (22) should be found. By optimizing the block time and the block size simultaneously, the optimal blockchain settlement system design is demonstrated.
[0169] Due to the discreteness of the block size, the joint analytical solution of the optimal block size and block time cannot be obtained. This problem will be solved through numerical analysis.
[0170] The block size and block time are optimal if and only if the settlement is successful and the total settlement delay is the shortest.
[0171] Keeping the block size B (block time) constant, the optimal block time (block size) decreases (increases) with the increase in the number of transactions M, transaction urgency λ, transaction surplus V0, fork cost (α, Γ), successful settlement factor (SSF), staking income β, and staking cost rP when the staking income is negative c but the optimal block time (block size) increases (decreases) with the increase in the maximum default benefit V and staking cost rP when the staking income is positive c of.
[0172] First, a larger trading volume M increases the rewards that can be distributed to the verifiers. Second, the higher the transaction urgency λ, the more inclined the investors are to settle early. Third, when the transaction surplus V0 increases, the investors are willing to pay higher transaction fees because they are more willing to settle early to control the transaction risk. Fourth, a higher staking income β also increases the income of the verifiers. These four factors above will all increase the income of the verifiers. Secondly, when the income is negative, the SSF will increase with the increase in the staking income and staking cost. Finally, the increase in the income of the verifiers, fork cost, and SSF will all lead to an increase in the fork resistance. Therefore, in order to reduce the fork resistance, the block size should be increased and the block time should be reduced. On the contrary, the maximum default benefit V (associated with the maximum default risk exposure ε δPositive correlation) increases the motivation for forking. Therefore, the forking resistance must be strengthened to reduce the optimal block size and increase the optimal block time.
[0173] It can be concluded that when other parameters have the same trend of change, there is an opposite trend between the block size and the block time. The reason is that the same-direction change of the block size and the block time will generate two opposite settlement congestion trends, which in turn will have opposite effects on the block reward and the forking resistance. The impacts of changes in trading volume, trading urgency, and maximum default risk exposure on the settlement performance of the PoS blockchain will be analyzed empirically.
[0174] Under the same other conditions, when the SSF is greater than α, the settlement performance of the PoS blockchain is better than that of the PoW blockchain.
[0175] When the SSF is greater than α, the performance of the PoS blockchain is better than that of the PoW blockchain. Otherwise, the performance of the PoW blockchain is better than that of the PoS blockchain. Therefore, the designers and operators of the PoS blockchain can improve the SSF by perfecting the design of the reward mechanism, so as to make the settlement performance of the PoS blockchain better.
[0176] Currently, there are many problems in the traditional transaction settlement infrastructure, such as long settlement cycles, high settlement costs, and outdated settlement facilities. The new technological revolution has put forward a series of new requirements for the new settlement infrastructure, such as short settlement cycles, low settlement costs, and decentralization. Therefore, the blockchain-based transaction settlement system, especially the PoS blockchain-based transaction settlement system, is one of the mainstream solutions that the academic and industrial circles are currently vigorously exploring and pinning high hopes on.
[0177] The present invention designs and constructs an optimal model mechanism for transaction settlement based on the PoS blockchain from a theoretical level, provides theoretical guidance for the application of the PoS blockchain in the field of asset transaction settlement, and provides theoretical support for its further promotion and development. First, the present invention takes the classic single-period trading environment including buyers and sellers in the literature as the research background; second, based on the settlement needs of both buyers and sellers for the traded assets, the present invention introduces the basic design framework of the PoS blockchain, and details the staking behavior of the key role verifiers in the system, constructs the corresponding staking income model, and at the same time assumes that the transaction fee acts as the block reward and introduces the relevant models of transaction fees and block rewards; finally, the present invention points out that the key to the successful settlement of the PoS blockchain system lies in avoiding the double-spending behavior of attackers, that is, the generation of blockchain forking, and then proposes the successful settlement factor (SSF) to judge whether the settlement is successful. The optimal PoS blockchain settlement system needs to achieve the shortest total settlement delay on the premise of meeting the successful settlement, and thus the optimal block size and block time can be obtained.
[0178] The research of this invention shows that the staking behavior of verifiers is the core link of the PoS blockchain transaction settlement system. The key to the successful settlement of the PoS blockchain settlement system lies in avoiding the double-spending behavior caused by attackers through forking, which requires the forking resistance to be greater than the forking power. The change of forking resistance can be achieved by adjusting the block reward, and the block reward is positively correlated with the settlement congestion degree. Therefore, an appropriate block size and block time can be set to control the settlement congestion degree. When the SSF is significantly small, the forking resistance is significantly less than the forking power at this time, and the probability of the system being attacked increases significantly. It is necessary to reduce the block size or increase the block time to increase the settlement congestion, thereby increasing the block reward and increasing the forking resistance. When the SSF is significantly large, the forking resistance is significantly greater than the forking power at this time. The system security is worry-free but the settlement performance is a concern. It is necessary to increase the block size or reduce the block time to reduce the settlement congestion, thereby reducing the block reward and reducing the forking resistance. When the forking resistance is exactly greater than the forking power, the system reaches the optimal settlement performance, and the block size and block time at this time are the optimal block size and block time. Finally, this chapter compares the settlement performance of the PoS blockchain and the PoW blockchain, and points out that when the successful settlement factor (SSF) is greater than the variable forking cost coefficient α, the settlement performance of the PoS blockchain will be better than that of the PoW blockchain.
[0179] This invention expands the relevant theory of verifier staked tokens in the PoS blockchain, designs and constructs the transaction settlement mechanism based on the PoS blockchain theoretically for the first time, innovatively proposes the key indicator for judging whether the PoS blockchain is successfully settled - the successful settlement factor (SSF), and compares the transaction settlement performance of the PoS blockchain and the PoW blockchain on this basis, and finally verifies it with actual data.
[0180] Although there has been some theoretical research on staked tokens and corresponding rewards in the academic community, the existing research still has extremely limited understanding of the impact of the validator staking mechanism on the settlement of PoS blockchains. The present invention fills this gap by introducing two variables, staking income and staking cost, into the settlement model. Saleh considered the financing cost and financing constraint, but ignored the block reward and the staking income of the attacker, which are incorporated into the model of this paper. Different from this model, the change in the market value of the tokens used before and after the attack is taken as the staking income, which includes not only the possible depreciation of the tokens due to hard forks but also the possible appreciation of the tokens due to other factors. The dual assumptions, positive and negative, make the consideration of this paper more comprehensive. The present invention makes some theoretical and empirical contributions to the relevant literature on blockchain transaction settlement. The present invention is the first theoretical and empirical research on transaction settlement based on PoS blockchains. The present invention constructs a transaction settlement model based on PoS blockchains, comprehensively and deeply elaborates on the settlement mechanism of PoS blockchains, and focuses on studying how to perform optimal system design based on PoS blockchains, filling the gap in existing research. The empirical results further verify the impact of staking income and staking cost on the optimal block size, average settlement time per transaction, average settlement fee per transaction, and total settlement delay.
[0181] Based on the two key variables of staking income and staking cost, the present invention theoretically proposes a successful settlement factor (SSF) to judge whether a PoS blockchain can be successfully settled. When the block size and block time are given, the success of settlement can be judged by the size of the SSF, because successful settlement requires the fork resistance (containing the SSF) to be greater than the fork momentum; when the SSF is given, the block size and block time can be adjusted to make the settlement optimal, because optimal settlement requires the fork resistance to be exactly greater than the fork momentum. Analysis shows that when and only when the SSF is greater than the variable fork cost coefficient, the settlement performance based on PoS blockchains is better than that of PoW blockchains.
[0182] This provides a relatively simple method for comparing the settlement performance between PoS and PoW blockchains. The reason is that a larger SSF means that the fork resistance of PoS blockchains is greater than that of PoW blockchains, so the block size can be increased and the block time can be shortened to accelerate settlement. The empirical results further verify the impact of the SSF on the optimal block size, average settlement time per transaction, average settlement fee per transaction, and total settlement delay, and compare the settlement performance between PoS and PoW blockchains.
[0183] When the successful settlement factor (SSF) is greater than the variable fork cost coefficient (i.e., when the SSF is high), the transaction settlement performance of the PoS blockchain is superior to that of the PoW blockchain. Under the benchmark parameters of the present invention, the optimal block size of the PoS blockchain settlement system with a high SSF (PoS-HSSF) is 0.14% smaller than that of the PoW blockchain settlement system, and the optimal block time, average settlement time, average settlement fee, and total settlement delay of the former are reduced by 23.41%, 23.29%, 23.47%, and 23.31% respectively compared to the latter, showing the superior settlement performance of the PoS blockchain.
[0184] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A transaction settlement method based on the Pos blockchain, characterized in that, It includes the following steps: Step S1, set the trading environment and construct model assumptions, including a single-period trading model for the buyer and the seller; Step S2, construct a staking model in the PoS blockchain. According to the total number of transactions and the block size, obtain the number of blocks required to settle all transactions. The validator will verify the authenticity of all new transactions in the block, and the block that passes the verification will be added to the blockchain. The validator who proposes the new block will receive corresponding rewards; Step S3, design an optimal PoS blockchain settlement mechanism, adjust the block size and block time to maximize the total expected transaction utility, and set two requirements that the optimal block size and block time need to meet: the first requirement is the no-fork inequality to ensure that the settlement will not fail, and the second requirement is the optimization objective to ensure the maximum total expected transaction utility.
2. The transaction settlement method based on the Pos blockchain according to claim 1, wherein, In step S1, after the transaction is confirmed, the valuation of the asset by the investor will be reversely impacted, and this impact follows an exponential distribution with an arrival rate of λ; as λ increases, more investors tend to settle as soon as possible to prevent the counterparty from defaulting; at the same time, the asset dividend will also be impacted and follows an exponential distribution with an arrival rate of ν; the dividend after the impact is and δ = E(δ) - ε δ ; if the impact is large enough, the trader will have the incentive to default on the previously agreed transaction; assume the transaction settles at time T, the buyer and the seller share the transaction cost τ equally, and the transaction price of the asset is p; setting the investor's utility function as the CARA negative exponential utility function, the expected utility is Since the exponential function is monotonically increasing, this formula is simplified to Assume the transaction settles successfully, and obtain the expected transaction utility of the buyer The expected transaction utility of the seller is The expected transaction utility of a single transaction can be given by the following formula U t = U b + U s = (2e -λT - 1)V0 - τ (3) where V0 = (u h - u l )E(δ), δ is the dividend provided by each asset, following a normal distribution with variance σ δ 2 ; A is a constant greater than 0; u l is the marginal valuation of the seller, and u h is the marginal valuation of the buyer; E(δ) is the expectation of the dividend of the asset being traded.
3. A transaction settlement method based on the Pos blockchain according to claim 2, wherein From the total number of transactions M and the block size B, obtain the number of blocks N required to settle all transactions, as shown in the following formula: where ceiling[x] is the smallest integer greater than or equal to x.
4. The transaction settlement method based on the Pos blockchain according to claim 3, wherein, In the staking model, there are a total of M nodes, sub - cycles of transactions. The amount of tokens staked by a validator is s, and only one block is generated in one transaction sub - cycle; According to the staking ability of validator j, the probability of proposing a new block is where s j is the number of tokens pledged by verifier j; The reward for proposing a new block is R, and the reward that any validator j may obtain is φ j R; The staking income of validator j is βs j = [(P ch - P c )x + (P cl - P c )(1 - x)]s j (6) Among them, P c is the token price at the start of the pledge; after the block is generated, the price of the pledged token rises or falls; at the end of the pledge, the probability of the token price rising is x, and the corresponding price is P ch ; the probability of the coin price falling is (1 - x), and the corresponding price is P cl ; Suppose validator j first borrows some USDT coins and then converts them into the target tokens for staking; after staking the tokens for a period of time, the validator converts the tokens back into USDT coins and returns them with the corresponding interest rate r as the borrowing cost. The cost for the validator to stake the tokens is rP c s j ; The maximization problem faced by the validator is The first-order condition is where β is the income of staking a unit of tokens; Assume that the amounts of tokens staked by M verifiers are the same, i.e., s j = S, and obtain the amount of tokens staked by each verifier Assume that the validators participating in staking are in perfect competition and the number of validators tends to infinity, which is consistent with the decentralized characteristics of the PoS algorithm, then it is deduced that When M → ∞, 5. A transaction settlement method based on the Pos blockchain according to claim 4, characterized in that, After multiple transactions are completed, the buyer and the seller report the transaction fees to the verifier. The transactions are settled in the order of decreasing transaction fees, and each block is connected end to end to form a chain. It is set that each block records B transactions, and the corresponding single transaction fee is τ(n), satisfying τ(1) ≥ τ(2) ≥... ≥ τ(N); the time interval between adjacent blocks is Δ; therefore, block B is generated. n The interval between block B and block B1 is (n - 1)Δ; Assume that the expected transaction utility of each transaction is the same, then it is obtained that U(n - 1) = U(n) = 2(e -λΔ(n-1) - 1)V0 - τ(n - 1) = 2(e -λΔn - 1)V0 - τ(n) (11) where V0 is the transaction surplus, n = 2, 3,..., N - 1, then τ(n - 1) - τ(n) = 2(e -λΔ(n-1) -e -λΔn )V0(12) Since there is no settlement competition among traders in the last block, that is, τ(N)=0, it is obtained that U(n) = U(N) = 2(e -λΔn - 1)V0 - τ(n) = 2(e -λΔN - 1)V0 - τ(N) (13) where N is the total number of blocks; The single transaction fee in this block is τ(n) = 2V0(e -λΔn -e -λΔN ) (14) Since it is assumed that the transaction fee serves as all the block rewards, the total block reward is Substitute formula (14) into (15), and it is obtained that So the single block reward is given by the following formula Among them is the number of trading sub-periods.
6. The transaction settlement method based on the Pos blockchain according to claim 5, wherein An attacker obtains the maximum default return V through forking and needs to pay the fixed and variable costs of forking; the attacker will also obtain the block reward R and the income β of staked tokens; the fixed cost Γ of forking mainly includes the cost of validator registration, and Γ < V; due to the design characteristics of the PoS blockchain itself and the limitations of the transaction mechanism, the variable cost of forking is higher than the cost of normal block generation; according to Chiu and Koeppl, α ≥ 1 is used to represent that the variable cost of forking is higher than the cost of normal block production, and α is called the variable forking cost coefficient; the number of tokens staked by the attacker for forking is represented as s f ; Assume that the attacker is rational and needs to consider the following maximization problem at the beginning of a certain settlement sub-cycle The optimal number of tokens it stakes is The condition for successful settlement is: When M→∞, there is no settlement failure in the PoS blockchain if and only if 7. A transaction settlement method based on the Pos blockchain according to claim 6, characterized in that, Calculate the transaction fee τ(n) and block reward R when each transaction has the same transaction utility and when the market staking power reaches the supply-demand balance; Considering the reward R for generating each block Obtain the no-fork inequality The left side of inequality (22) is the maximum return of default, which represents the motivation for forking; the right side of inequality (22) represents the forking resistance, including the cost of forking, the reward for generating blocks, and the successful settlement factor.
8. A transaction settlement method based on the Pos blockchain according to claim 7, characterized in that The blockchain operator adjusts the block size and block time to maximize the total expected transaction utility; Assume that the PoS blockchain has N blocks, and the single transaction fee corresponding to the Nth block is τ(n); based on formula (3), obtain the total expected transaction utility, which is equal to the sum of the expected transaction utilities of individual transactions, that is where U t is the expected utility of a single transaction; Substitute Equation (14), i.e., τ(n) = 2V0(e -λΔn -e -λΔN ), into Formula (23), and we get This function consists of the block time Δ and the number of blocks N related to the block size B; maximizing the total expected transaction utility U(B) is equivalent to minimizing the total settlement delay ΔN, that is, minimizing which is called the optimization objective and is shown as follows: