Mechanism Design for Blockchain Order Books against Selfish Miners
Abstract
In blockchain-based order book systems, buyers and sellers trade assets, while it is miners to match them and include their transactions in the blockchain. It is found that many miners behave selfishly and myopically, prioritizing transactions with high fees and ignoring many desirable matches that could enhance social welfare. Existing blockchain mechanisms fail to address this issue by overlooking miners’ selfish behaviors. To our best knowledge, this work presents the first analytical study to quantify and understand buyer and seller transaction fee choices and selfish miners’ transaction matching strategies, proving an infinitely large price of anarchy (PoA) for social welfare loss. To mitigate this, we propose an adjustable block size mechanism that is easy to implement without altering the existing decentralized protocols and still allows buyers and sellers to freely decide transaction fees and miners to selfishly match. The analysis is challenging, as pure strategy Nash equilibria do not always exist, requiring the analysis of many buyers’ or sellers’ interactive mixed-strategy distributions. Moreover, the system designer may even lack information about each buyer’s or seller’s bid/ask prices and trading quantities. Nevertheless, our mechanism achieves a well-bounded PoA, and under the homogeneous-quantity trading for non-fungible tokens (NFT), it attains a PoA of 1 with no social welfare loss. We implement our mechanism on a local instance of Ethereum to demonstrate the feasibility of our approach. Experiments based on the realistic dataset demonstrate that our mechanism achieves social optimum for homogeneous-quantity trading like NFT. It can enhance social welfare up to 3.7 times compared to the existing order book benchmarks for heterogeneous-quantity trading of Bitcoin tokens. It exhibits robustness against random variations in buyers and sellers.
I Introduction
I-A Motivations
Blockchain-based order books (BBOB) have garnered significant attention due to their ability to facilitate secure, decentralized transactions in various markets, including decentralized exchanges (DEXs) and non-fungible tokens (NFTs) [1]. The market value of BBOBs continues to rise, with a current market cap of $864 million in 2024 [2]. Within these systems, buyers aim to purchase assets at the lowest possible price, while sellers seek to sell at the highest price. Both parties set transaction fees to incentivize miners, who then decide which transactions to match and confirm on the blockchain.
Despite fast development, current BBOBs face significant challenges. Many existing protocols suffer from poor performance, where the executed trade price deviates from the expected price, leading to inefficient trades [3][4]. One of the key reasons for the current BBOB design’s poor performance is miners’ self-interested or myopic behavior. Miners may prioritize those transactions with higher fees, even if these result in lower social welfare, thereby misaligning individual incentives with the collective benefits of the system [5].
Addressing this issue requires research efforts in two areas. First, buyers and sellers continuously experience benefit loss and complain about the system’s poor performance caused by miners [6][7], yet our assessment of the potential loss is limited. It is crucial to assess the extent to which miners’ self-interested actions degrade system performance, which motivates the following key question:
Key Question 1
How much do miners’ self-interested actions worsen the BBOB system’s trading performance?
Answering Key Question 1 requires characterizing and understanding the strategic interactions between self-interested buyers, sellers, and miners. Our rigorous game-theoretical analysis reveals that miners’ self-interested or myopic actions can lead to arbitrarily large social welfare losses. With the understanding of this huge damage and its condition to happen, there is a strong need to design a mechanism mitigating the adverse effects of self-interested miner behavior. The mechanism should be practical and operate within existing blockchain protocols, e.g., Bitcoin Cash [8]. This leads us to ask the next key question:
Key Question 2
How to design an easy-to-implement mechanism to maximize the social welfare of the BBOB system?
The challenge for addressing Key Question 2 lies in not forcing buyers, sellers, and miners to adopt a completely new protocol or even mechanism. Therefore, we will turn to key BBOB parameters that can be controlled easily and adjusted flexibly by the system, focusing on block size design. By optimizing this parameter, we aim to create a practical and effective mechanism in enhancing social welfare.
Our work addresses the incentive issues in BBOB systems. Several existing studies focus on various user-related aspects within this area (e.g., [9, 10, 11, 12, 13, 14]). Daian et al. [9] analyzed the frontrunning issue among buyers and sellers in BBOB systems. Schnaubelt et al. [10] proposed a reinforcement learning method to optimize users’ order placements in BBOB systems. Hautsch et al. [11] examined arbitrage opportunities for users. Heimbach et al. [12] designed a mechanism to mitigate the frontrunning issue. Victor et al. [13] detected and quantified wash trading behavior in the system. Raheman et al. [14] designed an automated agent to collect revenue from the BBOB system. However, the existing literature on mechanism design in BBOB systems has not adequately considered miners’ incentives. Our work fills in this gap by analyzing the impact of miners’ incentives and proposing an incentive mechanism to mitigate these effects.
I-B Contributions
In this paper, we consider the strategic interaction among buyers, sellers, and miners within the system designer’s mechanism design framework. Specifically, the system designer first determines the block size to maximize social welfare. Subsequently, buyers and sellers decide their transaction fees. Finally, miners select transactions to match and include in the blockchain based on these fees.
As such, we need to tackle several intricate technical challenges in the BBOB system. We model the complex and coupled dynamic game-theoretical interactions among self-interested buyers, sellers, and miners. The analysis is further complicated by the non-existence of pure strategy Nash equilibria under certain conditions, requiring the analysis of many buyers’ or sellers’ interactive mixed-strategy distributions. What is worse, the mechanism design may lack buyers’ and sellers’ detailed trading information, making the problem quite challenging. Our mechanism must be practical, easy to implement, and compatible with existing blockchain protocols. These challenges highlight our research’s novelty and significant technical contributions to the field.
Our key results and contributions are summarized as follows:
-
•
First analytical work to curb selfish miners in BBOB system: Prior literature’s mechanisms (e.g., [9, 10, 11, 12, 13, 14]) do not adequately address this selfish miners’ created problem. To the best of our knowledge, this work presents the first analytical study to quantify the selfish behavior of miners and proactively design the simplest possible mechanism to mitigate the issue.
-
•
Infinitely large efficiency damage by selfish miners: Our dynamic game-theoretical analysis addresses the complex and coupled interactions among buyers, sellers, and miners. Our findings reveal that miners’ self-interested actions can cause the price of anarchy (PoA) to equal infinity, meaning arbitrarily low social welfare. This is because miners make poor transaction matches to maximize their fee collection.
-
•
Simple and effective mechanism via limiting block size: We propose an adjustable block size (ABS) mechanism that balances the need to reduce miners’ tendency to ignore desirable matches while maintaining high throughput. The mechanism design is challenging due to the non-existence of pure strategy Nash equilibrium, which results in buyers’ and sellers’ strategies being interactive mixed-strategy distributions. Moreover, the system designer may even lack information about each buyer’s or seller’s bid/ask prices and trading quantities. Nevertheless, our mechanism achieves asymptotically social optimum under homogeneous-quantity matching for NFT and provides a bounded approximation ratio under heterogeneous-quantity matching.
-
•
Performance evaluation and implementation: We implement the ABS mechanism on an Ethereum blockchain testbed, validating its practical applicability. Based on the testbed, we conduct extensive experiments based on the actual BBOB dataset. For homogeneous-quantity trading of NFT, our mechanism achieves social optimum. For heterogeneous-quantity trading of Bitcoin tokens, our mechanism enhances social welfare up to 3.7 times compared to the existing benchmark and achieves at least 60% of the social optimum. Moreover, we find that miners’ non-selfish behavior may help to enhance social welfare. Our mechanism also demonstrates robustness in scenarios with random variations in the numbers of buyers and sellers.
II System Model and Problem Formulation
In this section, we describe the system model of the BBOB system to match buyers and sellers by miners. We first introduce the buyers, sellers, and miners’ decision models in Section II-A. We then formulate their dynamic game interaction in Section II-B.
II-A Decision models of Buyers, Sellers, and Miners in BBOB
We consider the BBOB system as illustrated in Fig. 1. Specifically, the system designer first determines the mechanism under the blockchain protocols for participants. Then, buyers and sellers decide on their transaction fees. Finally, miners select transactions to match and include in the blockchain.
Next, we will present the detailed model. Table I summarizes the key notations of this paper.
Notations | Physical meaning |
---|---|
Buyer ’s transaction fee decision | |
Seller ’s transaction fee decision | |
Miner ’s transaction selection in round | |
if miner matches buyer with seller | |
when mining block | |
Block size | |
Set (number) of buyers | |
Buyer ’s asset purchase proposal | |
Upper (lower) bound of asset purchase | |
and selling | |
Buyer ’s utility of unit asset purchase | |
Set (number) of sellers | |
Seller ’s asset selling proposal | |
Seller ’s cost of unit asset selling | |
Set (number) of miners | |
Mining power of miner | |
Set (number) of blocks | |
Smallest unit of transaction fee | |
Transaction pool when mining block | |
Delay cost per block | |
Buyer ’s payoff | |
Seller ’s payoff | |
Miner ’s payoff when mining block | |
Social welfare | |
Indicator function |
II-A1 System Designer’s Mechanism Design
The system designer proposes a mechanism to maximize social welfare, aiming for the most beneficial trading outcome for the group. Typical mechanism design strategies include block size design [15], transaction fee design [16], and consensus protocol design [17]. The ideal mechanism design should be easy to implement and compatible with the current system protocol, possibly the simplest as in [15]. Our mechanism design focuses on adjusting the block size, as detailed later in Section IV.
II-A2 Buyers’ and Sellers’ Fee Decision
We consider there are buyers and sellers, denoted by the sets and , respectively. Each buyer generates a transaction aiming to purchase units of asset (such as cryptocurrency and non-fungible tokens (NFTs)) on the blockchain, while each seller proposes a transaction to sell units of asset, where are continuous. If buyer is matched with seller , the buyer receives a normalized utility of per unit of asset, characterizing his valuation or satisfaction level in obtaining the asset, and seller incurs a normalized cost of per unit of asset for selling the asset.
To facilitate these transactions, each buyer and seller decides on his fee payments and , respectively. The smallest fee unit is (e.g., one satoshi in Bitcoin). The generated transactions enter the transaction pool as in mid of Fig. 1, which is pending for miners to match and include in the blockchain. Due to the limited number of transactions each block can contain, some transactions remain in the pending transaction pool, leading to a delay until they can be processed in subsequent blocks. Each buyer and seller must balance fee payment and transaction delay.222In the blockchain system, transactions typically experience some delay ranging from several minutes to hours [18]. As miners prioritize high-fee transactions [19], a buyer/seller generally uses the fee recommendation software to set the transaction fee, where he enters his delay requirement, and the software recommends the corresponding transaction fee [20]. Such a decision process is how a buyer/seller tradeoffs between transaction fee and delay.
II-A3 Miners’ Transaction Selection
We analyze a total of blocks, denoted as the set . There are miners in the system, represented by the set . When mining block , each miner selects a set of buyer’s and seller’s transactions to match and include in the blockchain, to maximize his fee revenue. The selection satisfies , where is the transaction set pending inclusion in the blockchain with initial .
The block size allows each block to hold up to pairs of buyer’s and seller’s transactions. The block size constraint is formulated as follows:
(1) |
We assume the block size constraint is an even number without loss of generality. If the constraint is , where is odd, it is effectively , as the remaining unpaired transaction would violate the matching constraints in (3)-(4).
Matching constraint: We respectively denote and as miner ’s selected buyer and seller sets, where . We use the index to denote whether miner matches buyer with seller or not when mining block :
(2) |
Within miner ’s selection, each buyer’s transaction must be matched with one seller’s in a typical setting (e.g., [21][22]), ensuring the completion of the matching process. The matching conditions are formulated as:
(3) | |||
(4) |
Moreover, the buyer’s utility must be higher than the seller’s cost for matching profitable transactions. This constraint is formulated as:
(5) |
As in [23][24], we denote the probability of miner mining a block as . For example, in proof-of-work systems, this probability is proportional to the miner’s computational power relative to the total. In proof-of-stake systems, it reflects the amount of cryptocurrency the miner has staked. Therefore, each miner’s probability of mining a block varies due to their computational or staking power differences.
Miners’ strategies follow the following principles based on existing blockchain systems in practice.
-
•
Myopic selection: According to [25] and [26], miners myopically select transactions to maximize their payoff for each block, prioritizing immediate transaction fee rewards. The rationale behind the myopic strategy is as follows: To benefit from a non-myopic strategy, a miner needs to mine at least two consecutive blocks. However, in typical blockchain systems like Bitcoin, each miner’s mining power generally satisfies [27]. Consequently, the probability of a miner successfully mining two consecutive blocks, , is very small. Thus, they tend to be myopic in matching seller and buyer pairs.
-
•
Tie breaking: When each miner faces two matching choices with the same total fee, he randomly selects one option. Moreover, miner rejects zero-fee transactions, as confirmed by blockchain protocols [16].
Pending transaction set update: After the miners’ selection, one miner successfully generates a block (e.g., by solving a puzzle in a proof-of-work system or by being selected based on their stake in a proof-of-stake system). The selected transactions are then appended to the blockchain and removed from the pending transaction set . This update process to the next block is formulated as follows:
(6) |
where is a function of all miners’ strategies over time.
Next, we formulate the dynamic game-theoretical interactions among buyers, sellers, and miners.
II-B Dynamic Game Formulation among Buyers, Sellers and Miners
This subsection models the dynamic interactions among miners, buyers, and sellers as a two-stage game. The buyers and sellers decide the transaction fees in Stage I, and miners select and match buyers’ and sellers’ transactions in Stage II. We will first introduce the payoffs for miners, buyers, and sellers. Then we introduce the dynamic game formulation.
II-B1 Each Miner ’s Payoff
When miner mines block , he receives transaction fees from his selected transactions as the payoff. Otherwise, he receives nothing. We denote and as miner ’s selected buying and sell transaction sets, where . Miner ’s expected payoff during the mining of block is formulated as:
(7) |
where denotes all buyers’ and sellers’ fee decisions. Note that the fee does not vary based on the quantity of the matched order (e.g., in Ethereum, the fee for a transaction is determined by its gas consumption, which is a measure of the computational resources required to process the transaction, and the gas price, which is set by the user).
II-B2 Each Buyer ’s Payoff
Each buyer ’s payoff function comprises matching surplus and delay cost.
When buyer is matched with seller , the trading quantity is the minimum of purchasing quantity and selling quantity , denoted as , which follows the typical setting for reduce-only orders [28]. Buyer receives a utility of and seller incurs a cost of per unit of the asset. Such a linear utility/cost model is widely used in cryptocurrency trading settings [29], as each unit of cryptocurrency has a uniform value. To be fair, the buyer pays the widely-used mid price (e.g., [30, 31, 32]) to the seller, which is . Thus, buyer ’s surplus from matching with seller is:
(8) |
When miner matches buyer with seller in mining round (i.e., ) and successfully mines a block (w.p., ), buyer receives the surplus . Additionally, buyer pays a fee to miner . Therefore, the total matching surplus for buyer is:
(9) |
When buyer ’s transaction is included in block , he bears the delay cost of , where is the delay cost per block. Buyer ’s delay cost is
(10) |
where is a function of all miners’ strategies over time .
To sum up, each buyer ’s payoff function is formulated as follows:
(11) |
II-B3 Each Seller ’s Payoff
Each seller ’s payoff function also comprises matching surplus and delay cost.
When buyer is matched with seller , seller collects the price payment from buyer . Seller ’s surplus from matching with buyer is:
(12) |
The total matching surplus for seller is:
(13) |
When seller ’s transaction is recorded in block , he bears the delay cost of:
(14) |
To sum up, each seller ’s payoff function is formulated as follows:
(15) |
Based on the payoffs, we model the strategic interactions among the buyers, sellers, and miners as a two-stage game.
II-B4 Stage II: Miner’s Transaction Selection
During the mining of block ,333We assume a typical scenario that , ensuring that all transactions can be recorded on the blockchain if miners choose to do so as in [24][33][34]. each miner selects the transaction set to maximize his payoff as follows:
(16) | ||||
s.t. | ||||
var. |
In problem (16), each miner myopically selects transactions from the pending transaction pool to maximize the fees he can earn. Note that this objective differs from centralized matching, which generally aims to maximize social welfare. This divergence is a key reason BBOB may result in lower social welfare, which will be further analyzed in the next section.
II-B5 Stage I: Buyers’ and Sellers’ Fee Setting
We formulate buyers’ and sellers’ fee setting as a non-cooperative game by foreseeing the miners’ myopic behavior , where all buyers and seller set their transaction fees simultaneously to maximize their individual payoffs.
Game 1 (Stage I: Transaction Fee Decisions Game)
In Stage I, the Fee Setting Game is a tuple defined by:
-
•
Players: The set of buyers and sellers .
-
•
Strategies: Each buyer and seller decides on his fee payment and , respectively. The set of feasible strategy profiles is .
- •
In Game 1, each buyer or seller balances the fee payment with matching surplus and delay. By paying a higher fee, he is more likely to be matched with other higher-fee transactions and experience a lower delay. The analysis of Game 1 is challenging because a pure strategy Nash equilibrium does not always exist, while buyers and sellers interact to decide their mixed-strategy distributions.
For modeling simplicity, we first assume that buying utilities and quantities, as well as selling costs and quantities, are static and publicly available information. Market participants can estimate these values for each participant by analyzing public historical transaction data. In Section IV-B, we will relax this assumption by considering these values as unknown and following general distributions.
II-B6 PoA Definition
We use the PoA to evaluate the performance of the BBOB system, defined as the ratio between the social optimum and the worst social welfare under the equilibrium of the BBOB system. This measure quantifies the maximal efficiency loss due to the self-interested behaviors of all participants, providing a quantitative answer to Key Questions 1 and 2 without and with our mechanism, respectively.
Formally, the social welfare is defined as the sum of all buyers’, sellers’, and miners’ payoffs:
(17) |
The social optimum represents the maximum achievable social welfare when the system designer has full control over the decisions of buyers, sellers, and miners, and is expressed as:
(18) | ||||
var. |
where represents the set of positive integers. PoA is defined as:
(19) |
where and denotes the equilibrium strategies of buyers, sellers, and miners, which will be derived in the next section. As the BBOB system cannot control the decisions of buyers, sellers, and miners, the social welfare at equilibrium is lower than the social optimum, and the PoA is always greater than 1.
III Game Theoretic Analysis for Poor PoA
In this section, we analyze how miners’ self-interested actions negatively affect the BBOB system. We will use the backward induction to derive the equilibrium of Stages II and I in Sections III-A and Section III-B, and then analyze the system PoA in Section III-C.
III-A Stage II: Miners’ Selfish Transaction Selection
In this subsection, we solve problem (16) to derive miners’ optimal strategies.
When mining block , we denote that there are buying transactions and selling transactions within the pending transaction set . Without loss of generality, we arrange the transactions in decreasing order of fees: and . We define the set of top fee buying and selling transactions as :
(20) | |||
(21) | |||
(22) |
Theorem 1 summarizes the optimal strategy for miners.
Theorem 1 (Miner’s Optimal Strategy in Stage II)
During mining block , miner ’s optimal strategy is to choose the top fee buying and selling transactions in set:
(23) |
where
(24) |
The proof of propositions and theorems is in Section VII.
Despite having different probabilities of mining a block, each miner selects all the highest-fee transactions that can be matched to maximize his fee revenue. The BOBB protocol operates in the way that there is no direct competition among miners to lower the fee choice threshold, as the mining probability is a linear factor of fee revenue in (7).
III-B Stage I: Buyers’ and Sellers’ Fee Decision Game
In this subsection, we solve the buyers’ and sellers’ equilibrium strategies in Game 1 by taking the miners’ payoff-maximizing strategy in (23) into account.
We first define the pure strategy Nash equilibrium (PSNE). At the PSNE, no buyer or seller can increase his payoff by unilaterally changing his deterministic strategy.
Definition 1 (PSNE)
A strategy profile constitutes a pure strategy Nash equilibrium of Game 1 in Stage I if
(25) | |||
(26) |
where and denote the equilibrium strategies of all buyers and sellers other than buyer or seller , respectively.
Without loss of generality, we arrange the buying utilities in decreasing order and the selling costs in increasing order . We assume to avoid the trivial situation where no transactions are matched. We then define the threshold to help establish condition of PSNE:
(27) |
Proposition 1 summarizes the PSNE in Stage I.
Proposition 1 (Buyers’ and Sellers’ PSNE in Stage I)
Here we elaborate the insights of Proposition 1:
-
1.
If : The block size is small, requiring multiple blocks to record all matched transactions. We illustrate the absence of a PSNE with a two-buyer-two-seller example and a block size of 1. When one buyer (or seller) pays a fixed fee, the other can take advantage by either paying an higher fee to reduce delay costs or paying the minimum fee of to minimize the payment. Consequently, the first buyer (or seller) will also respond by paying an higher fee or paying . This back-and-forth strategy implies no PSNE.
-
2.
If : The block size is large enough that any leftover transactions cannot be matched after the first block. At PSNE, low-utility buyers in (28b) (or high-cost sellers in (29b)) pay the maximum fee they can afford to get matched, resulting in zero transaction benefit, but their transactions remain unmatched as others pay higher fees. Meanwhile, high-utility buyers in (28a) (or low-cost sellers in (29a)) pay a fee higher than the low-utility buyers (or high-cost sellers), ensuring their transactions get matched.
To analyze buyers’ and sellers’ equilibrium strategies when , we must refer to the mixed strategy Nash equilibrium (MSNE), where each buyer’s or seller’s fees follow a randomized distribution function. This makes the analysis challenging, as they interact to decide their mixed-strategy strategy functions against each other. Nevertheless, we are able to derive MSNE utilizing its property: within the support of the fee distribution, each buyer or seller receives the same expected payoff regardless of his specific fee choice within that range.
Definition 2 (MSNE)
A vector of probability measure constitutes a mixed strategy Nash equilibrium if the following inequalities hold for any , and .
(32) |
(33) |
We then define the intermediate function to help establish the equilibrium strategy:
(34) |
Equations (35) and (36) characterize the buyers’ and sellers’ equilibrium strategies in terms of cumulative distribution function (CDF).
Proposition 2 summarizes the buyers’ and sellers’ MSNE.
Proposition 2 (Buyers’ and Sellers’ MSNE in Stage I)
When , the buyers’ and sellers’ MSNE is as follows:
Here we elaborate on the insights of Proposition 2. If , buyers and sellers adopt the mixed strategy. Low-utility buyers in (37b) pay the maximum fee they can afford in an attempt to get matched but fail. High-utility buyers in (37a) pay fees that follow a distribution due to the nonexistence of a PSNE stated in Proposition 1. Their fee distribution’s lower bound in (35a) is higher than those with low utilities to ensure to get matched. The same insights apply to the sellers.
III-C PoA to Compare NE With Social Optimum
In this subsection, we derive the PoA of the state-of-the-art BBOB equilibrium in Theorem 2.
Theorem 2 (PoA of current system)
The PoA is unbounded, i.e., , which means NE’s arbitrarily large social welfare loss compared to the social optimum.
We explain the insights of Theorem 2 by a two-buyer-two-seller example in Figs. 11-3, highlighting that setting the block size too high or too low can lead to arbitrarily large social welfare loss. Each buyer and seller has a unit of buying and selling quantity, respectively.
-
•
Figure 2: Buying utility and selling cost for high block size. High block size with example: As shown in Fig. 11, with , the social optimum is to only match with to maximize the difference between buying utility and selling cost. However, if block size and each buyer and seller set an fee according to Proposition 1, miners will match with and with to maximize their fee revenue. Note that must be matched with since a valid match requires the buying utility to be higher than the selling cost. Consequently, miners’ matching can collect fees from four transactions instead of the two under the social optimum. Therefore, the ratio between social optimum and actual social welfare is:
As can be made arbitrarily large while keeping and constant, the PoA as the maximum ratio becomes unbounded.
-
•
Figure 3: Buying utility and selling cost for low block size. Low block size with example: As shown in Fig. 3, with , the social optimum is to set block size as and include all transactions in one block to maximize the difference between buying utility and selling cost without delay cost. However, if block size and each buyer and seller sets fees according to the mixed strategy in Proposition 2, miners need two blocks to include all transactions, resulting in two transactions bearing delay cost . Therefore, the performance ratio with optimum is:
As can be made arbitrarily large or buyers and sellers are impatient to trade in practice while keeping and constant, the PoA as the maximum ratio becomes unbounded.
Theorem 2 answers Key Question 1: Setting the block size too high or too low can lead to arbitrarily low social welfare. When the block size is too high, miners’ self-interested behavior can cause them to ignore desirable matches, resulting in significant social welfare loss. Conversely, when the block size is too low, the system incurs substantial delay costs. These observations underscore the motivation for our mechanism design.
IV Our Adjustable Block Size Mechanism
In this section, we present the adjustable block size mechanism. First, we analyze the scenario where bid and ask prices and quantities are public information in Section IV-A. Then, we extend our mechanism and analysis to the case where these parameters follow random distributions in Section IV-B.
IV-A Adjustable Block Size Mechanism for Complete Information
Motivated by the Bitcoin protocol that optimizes block size [15], the system designer decides the block size in Stage 0 in Fig. 1, before buyers and sellers decide the transaction fees in Stage I. The system may impose a hard block size limit due the limited network bandwidth, which will be analyzed in Section V-B. Our Adjustable Block Size (ABS) mechanism design problem is formulated as follows:
(39) | ||||
var. |
Problem (39) is challenging as it needs to consider the mixed-strategy distribution interactions among all buyers and sellers under any block size design, which may involve trading over multiple rounds due to the limited block size. Note that our mechanism design incorporates the tradeoff between block size and delay, as delay is part of buyers’ and sellers’ payoff function in the social welfare.
We address this challenge and the following algorithm outline the procedure for determining the optimal block size in the complete information setting:
The computational complexity of Algorithm 1 is by the merge sort algorithm,444https://www.javatpoint.com/merge-sort as the primary task is to sort the buying utilities and selling costs. This level of complexity is manageable even in systems with a large number of buyers and sellers.
Theorem 3 (PoA under ABZ)
The PoA under our ABS mechanism with is upper bounded as follows:
(40) |
When considering homogeneous-quantity trading (e.g., NFT trading) in BBOB with , setting the block size as achieves social optimum and PoA = 1.
Here we explain the insights of Theorem 3. Note that and according to (27). Therefore, including transactions with and for top pairs enhances social welfare, while including and for bottom reduces social welfare. Hence, we set the block size as . The ABS in Theorem 3 achieves the social optimum under homogeneous-quantity trading. This is particularly useful and efficient in BBOB for NFT trading, where the trading quantity for buyers and sellers is generally one.
The PoA is larger than 1 when for heterogeneous-quantity trading, because miners may randomly match transactions as long as such a random match does not affect their total fee revenue. This can result in transactions with large buying quantities matched with transactions with small selling quantities, causing small trading quantities and social welfare loss.555To mitigate this issue, we could enforce a rule requiring transactions with large buying quantities to be matched with transactions with high selling quantities. However, this approach may fundamentally alter the core principles of blockchain and compel agents to adopt an entirely new protocol.
IV-B ABS Mechanism for Incomplete Information
In practice, the system designer may not know the exact values of buying utilities and quantities from buyers, as well as selling costs and quantities from sellers [35, 36]. Here, these parameters’ values are drawn from random distributions.
As a typical setting, we suppose the buying utilities and selling costs follow i.i.d. random distributions in the normalized range , with general CDFs of and . The buying and selling quantities follow i.i.d. distributions between with general CDFs of and .
The ABS mechanism design problem under such incomplete information is formulated as follows:
(41) | ||||
s.t. | ||||
var. |
Problem (41) is analytically challenging to solve due to the adoption of mixed strategies by buyers and sellers, which are randomized and interactive distributions of others’ strategies. Additionally, the general distributions of trading information for buyers and sellers further complicates the analysis. Despite these difficulties, we are able to derive the PoA bounds.
The following algorithm outlines the procedure for determining the optimal block size in the incomplete information setting:
(42) |
(43) |
Note that the computational complexity of Algorithm 2 is independent the number of buyers and sellers , indicating that the mechanism is scalable.
Theorem 4
When , the PoA under the ABS mechanism with block size of in (43) satisfies:
(44) |
When considering homogeneous-quantity trading (e.g., NFT trading) in BBOB with , setting the block size as achieves asymptotically social optimum and the PoA satisfies
(45) |
Here we explain the insights of Theorem 4. Note that and
as . Therefore, we set the block size as in (43), where the parameter provides block size redundancy to ensure that the mechanism includes all transaction pairs with actual for all to maximize social welfare. Moreover, the block size in Theorem 4 achieves the asymptotically social optimum under homogeneous-quantity trading, relying only on the knowledge of the distributions for setting the block size of ABS.
V Performance Evaluations with Real Dataset
We conduct experiments to evaluate the mechanism in terms of social welfare, the performance ratio between the mechanism’s social welfare and social optimum, and the robustness of the system under time-varying numbers of buyers and sellers and different block size limits.
V-A Experiment Setting
Our experiment considers homogeneous-quantity and heterogeneous-quantity trading, with parameters set based on practical datasets. The homogeneous-quantity trading experiment is based on NFT trading data, including bid and ask prices [37]. The heterogeneous-quantity trading experiment utilizes the Bitcoin trading dataset [38], which includes bid prices, ask prices, bid quantities, ask quantities, and trading times.


Fig. 4(a) illustrates the bid price and ask price of NFT trading, where the trading quantities are constantly 1. Fig. 4(b) illustrates the bid price, ask price, bid quantity, and ask quantity for Bitcoin trading.666For Bitcoin trading, the smallest unit of bid and ask quantities is not one but Bitcoin tokens. These trading quantities are relatively small because of the high price of each Bitcoin token. We fit each attribute of the data to a distribution. For homogeneous-quantity trading, we only need to generate random bid and ask prices based on fitted distributions from the NFT trading dataset [37]. For heterogeneous-quantity trading, we generate bid prices, ask prices, bid quantities, and ask quantities based on the Bitcoin trading dataset [38].
In reality, a buyer’s utility (or a seller’s selling cost) can differ from their bid (or ask) price. In the experiment, we follow [39] to set the ratio of 1.05 between buyers’ bid prices and their utilities, as well as between sellers’ ask prices and their costs. The remaining parameters’ values are summarized as follows: the number of miners is 250k,777https://www.statista.com/statistics/1334722/ethereum-held-by-miners/ the average ratio of buyers to sellers is , the delay cost is per block, and the block size factor .
In the experiment, we compare our mechanism with the following benchmarks:
-
1.
Benchmark with BBOB matching algorithm [40]: The benchmark mechanism is the state-of-the-art BBOB matching algorithm, which sets the block size to be maximal. This mechanism further recommends transaction matching for miners, but miners are rational and do not necessarily follow the recommendation. This issue is prevalent in other matching algorithms for BBOB.888https://dydx.exchange/
-
2.
Our ABS facing 20% non-selfish miners: In practice, some miners follow the protocol recommendations.999https://thenextweb.com/news/a-brief-history-of-bitcoin-mining-hardware Therefore, we evaluate our ABS mechanism assuming 20% of miners are cooperative and follow the recommendations of matching algorithm [40].
V-B Implementation of ABS Mechanism
We implement the ABS mechanism on a local instance of the Ethereum blockchain by modifying the “gas limit,” which refers to a system parameter that restricts the number of computational steps (or “gas”) a block can contain. This Ethereum-based testbed demonstrates that block size adjustments can be effectively realized within a real-world blockchain environment.

We use Geth version 1.11.2 [41] as the Ethereum client. We modified the Geth source code’s “block_validator.go” file, setting the gas limit to adjust the block size. After modifying the client, we ran a local Ethereum instance with the updated gas limit. Fig. 5 illustrates the modification as setting the gas limit to 2,100,000 to accommodate approximately 100 transactions per block (each transaction typically consumes 21,000 gas).
By leveraging this implementation, we are able to conduct our experiments and evaluate the performance of our ABS mechanism. Section VIII provides a detailed explanation of the implementation steps.
V-C Experiment Results
We compare our ABS mechanism with the two benchmarks and evaluate the impacts of the randomness of buyer/seller number and the block size limit.
V-C1 Mechanism Comparison



We establish the homogeneous-quantity trading and heterogeneous-quantity trading settings by using the fitted PDFs from the NFT trading dataset [37] and the Bitcoin trading dataset [38], respectively.
For homogeneous-quantity trading, Fig. 6 compares different mechanisms in terms of social welfare. The social welfare of all mechanisms increases with the number of sellers due to more matching opportunities. Notably, our ABS mechanism, ABS with 20% non-selfish miners, and the social optimum overlap in the figure. This confirms the result in Theorem 4 for our ABS mechanism’s asymptotic optimum and demonstrates the close-to-optimal performance even with non-large seller number cases. Moreover, the benchmark mechanism only achieves about 40% of our mechanism’s social welfare.
For heterogeneous-quantity trading, Fig. 7(a) shows that our mechanism achieves 3.7 times higher social welfare than the benchmark mechanism by strategically adjusting the block size to prevent social welfare loss. Additionally, the presence of non-selfish miners who follow the recommendation further enhances the social welfare of our mechanism. This highlights that our mechanism performs well even when the system deviates from our rational-miner assumption.
In Fig. 7(b), the performance ratio of our mechanism converges to 0.6, indicating that it achieves approximately 60% of the social optimum. With 20% non-selfish miners, the performance ratio can be improved to 78%.
Overall, our ABS mechanism’s performance is close to optimum for practical homogeneous-quantity trading like NFT trading. Moreover, it dominates the benchmark mechanism in heterogeneous-quantity trading settings.
V-C2 Impact of Buyer/Seller Number Randomness


In practice, the number of buyers and sellers can vary randomly over time. Here we analyze cases where the number of sellers follows the number of buyers/sellers in the Bitcoin trading dataset [38]. Our mechanism sets the block size based on (43), using the average value of . Fig. 8 illustrates how the performance ratio changes over time.
Fig. 8(a) illustrates the homogeneous-quantity trading. The performance ratio fluctuates with time as the number of sellers changes. Our ABS mechanism achieves an average performance ratio of 96%, while the benchmark mechanism achieves an average of 40%.
Fig. 8(b) illustrates heterogeneous-quantity trading. Our ABS and benchmark mechanisms achieve lower performance ratios than homogeneous-quantity trading, as miners can match high-buying-quantity transactions with low-selling-quantity transactions, causing social welfare loss. Nevertheless, our mechanism achieves an average performance ratio of 58%, which is 3.3 times higher than the benchmark mechanism.
To sum up, Fig. 8 shows that our ABS mechanism still outperforms the benchmark even when the number of buyers and sellers is random, showcasing the practicality of our mechanism in real-world implementations. Additionally, our benchmark mechanism highlights the shortcomings of existing matching algorithms in blockchain that neglect miners’ incentives, indicating that our mechanism achieves universal dominance over existing matching algorithms.
V-C3 Impact of Block Size Limit on ABS




The blockchain system generally has a block size limit due to the limited network bandwidth [42][43]. Here, we examine the impact of block size limits on the performance of our mechanism.
We consider block size limits of and and use a brute-force search to optimally solve problem (41) with the additional block size limit constraint.
Fig. 9 illustrates the optimal block size for our ABS mechanism and the corresponding social welfare for homogeneous-quantity trading. In Fig. 9(a), when the number of sellers is small, the optimal block size of our ABS mechanism increases with . However, as increases, our ABS mechanism sometimes strategically reduces the block size. This is because larger block sizes can lead to a higher tendency to ignore desirable matches, as explained in Theorem 2, which decreases social welfare. Consequently, our ABS mechanism may decrease the block size and bear a higher delay cost to mitigate this issue. This finding underscores the importance of our ABS mechanism even under block size limits.
Fig. 9(b) compares the social welfare of our ABS mechanism with the benchmark. Even with the block size limit, our mechanism achieves higher social welfare than the benchmark, highlighting its practical necessity. The improvement is more significant when the block size limit is large (i.e., ) and the number of sellers is small (i.e., ). Such an improvement is even more pronounced for heterogeneous-quantity trading in Fig. 10(b), with an average improvement of 65%.
Fig. 10 illustrates the optimal block size and the corresponding social welfare for heterogeneous-quantity trading. The insights are consistent with those observed in the homogeneous-quantity trading setting.
Hence, our ABS mechanism can still improve social welfare under the block size limit constraint. The improvement is particularly significant when the number of buyers and sellers is small.
VI Conclusion
In this paper, we proposed a block size optimization mechanism to address the inefficiencies in blockchain-based order book (BBOB) systems caused by miners’ self-interested actions. Our dynamic game-theoretical model highlighted how these self-interested actions lead to suboptimal transaction matches, significantly reducing social welfare. To mitigate this issue, we designed a mechanism where the system designer optimizes the block size to balance the tendency to ignore desirable matches with maintaining high throughput. Our analysis revealed that the optimized block size mechanism could achieve the social optimum under homogeneous-quantity matching and provide a bounded approximation ratio under heterogeneous-quantity matching. We implemented our proposed mechanism on an Ethereum blockchain testbed, validating its practical applicability. Through extensive experiments using actual BBOB data, we demonstrated that our mechanism achieved social optimum for homogeneous-quantity matching like NFT. For heterogeneous-quantity matching, our mechanism enhances social welfare by up to 3.7 times compared to the existing benchmark and achieves at least 60% of the social optimum. Furthermore, our mechanism demonstrated robustness in scenarios with random variations in the number of buyers and sellers.
In future work, we will consider the impact of different miner incentive structures that can adapt to varying levels of miner rationality. Furthermore, we will consider participants making strategic decisions on bid and ask prices.
VII Model Analysis
VII-A Stage II of Miners’ Transaction Selection Analysis
Proof of Theorem 1.
Theorem 1 follows naturally from the objective of miners to maximize their payoff. Miners will always select the highest-fee transaction set that can be matched. Propositions 1 and 2 later show that buyers (or sellers) who cannot be matched will pay lower transaction fees than those who can be matched. Therefore, the strategy of selecting only the top-fee transactions ensures that each miner maximizes their payoff.
This completes the proof of Theorem 1.
VII-B Stage I Analysis
Proof of Proposition 1.
We will first prove the case of , and then prove the case of .
VII-B1 Proof of Case
We use the contradiction method to prove the non-existence of pure strategy Nash equilibrium. We assume there exists a pure strategy Nash equilibrium . Then we arrange the buyers’ and sellers’ fees in a decreasing order: and . Then based on the assumption that there exists a pure strategy Nash equilibrium, we will prove that and by contradiction.
As we arrange the fee in a decreasing order, we assume that buyer ’s fee satisfies , where . Then buyer can deviate to set the transaction fee as , where he pay strictly less fee and do not change the miners’ matching result and delay cost. This contradicts the pure strategy Nash equilibrium. Hence, we have proved that . Following the same proof logic, we can also prove that .
Next, we prove that . If buyer sets the fee as , then buyer has probability that transaction is included in the second block and bear the delay cost. He can deviate to pay fee to bear no delay cost, strictly increasing his payoff. This contradicts the pure strategy Nash equilibrium. Hence, we must have .
Then, we prove that . If buyer sets the fee as , then buyer can deviate to set the transaction fee as , where he pay strictly less fee and do not change the miners’ matching result and delay cost, strictly increasing his payoff. This contradicts the pure strategy Nash equilibrium. Hence, we must have .
However, when , then buyer can deviate to set the fee as , where his transaction is included in blockchain in the first block. He strictly decreases his delay cost by while paying slightly higher fee. Hence, this contradicts the pure strategy Nash equilibrium.
To sum up, we have proved the non-existence of pure strategy Nash equilibrium for Case .
VII-B2 Proof of Case
For this case, we just need to verify that no buyer or seller can increase his payoff by deviating from the pure strategy Nash equilibrium.
We first analyze buyers with . Under the equilibrium strategies characterized by (10) and (11), miners will select buyers with and sellers with to included in the blockchain. For buyers with and sellers with , their transactions will not be matched and get zero payoff. For a buyer with , if he deviates to set lower transaction fee, his transaction is still not included in the blockchain, and his payoff is unchanged. If buyer deviates to increase transaction fee to , the matching surplus of his transaction is:
(46) |
The delay cost is:
(47) |
Hence, the payoff of setting transaction fee as is
(48) |
Note that for buyer , the above (48) achieves the highest payoff of:
(49) | ||||
To sum up, for buyers with , increasing or decreasing the transaction fee cannot increase his payoff. Following the same analysis process, we can also prove that for sellers with , he cannot increase his payoff by deviating from the pure strategy Nash equilibrium.
We then analyze buyers with . We derive his payoff and then compare it with he deviating to set higher or lower transaction fee. For buyer setting the transaction fee as , his matching surplus is
(50) |
The delay cost is:
(51) |
Hence, the payoff of setting transaction fee as is
(52) |
Note that for buyer , the above (52) achieves the lowest payoff of:
(53) | ||||
When buyer deviates to pay a higher transaction fee, he cannot change the matching results and his delay cost. Hence, he has no incentive to increase his transaction fee. When buyer deviates to decrease transaction fee to , then he cannot get matched and getting the payoff of zero.
To sum up, for buyers with , increasing or decreasing the transaction fee cannot increase his payoff. Following the same analysis process, we can also prove that for sellers with , he cannot increase his payoff by deviating from the pure strategy Nash equilibrium.
This completes the proof of Proposition 1.
Proof of Proposition 2
In this proof, we only present the analysis of buyers, as the proof sketch is exactly the same as for sellers. Here we first show that buyers who adopt pure strategy in (37b) cannot increase his payoff by setting different transaction fee. Next we prove the mixed strategy in (37a).
Buyers with : For any buyer , his transaction cannot get matched and he gets zero payoff. If he deviates to set lower transaction fee, his transaction still cannot get matched, which cannot increase his payoff. If buyer deviates to set higher transaction fee, there are two situations:
-
1.
If , then the matching surplus of his transaction is:
(54) The delay cost is:
(55) Hence, the payoff of setting transaction fee as is
(56) Hence, for buyer , setting the transaction fee as cannot increase his payoff.
-
2.
Setting transaction fee as satisfying , then the matching utility of his transaction is:
(57) The sum of fee payment and delay cost is:
(58) Hence, the payoff of setting transaction fee as is
(59) Hence, for buyer , setting the transaction fee as cannot increase his payoff.
To sum up, for any buyer , setting different transaction fee cannot increase his payoff.
Next we prove the mixed strategy for buyers with . Here we first present Lemma 2.1-2.4 to analyze the property of mixed-strategy distribution, then we derive the mixed strategy Nash equilibrium.
For all buyer (or seller) who adopt mixed strategy, we consider their strategies follows the same probability distribution. Note that the distributions of buyers and sellers are different. Moreover, as some transactions are not matched, (e.g., if , then some buyers’ transactions cannot be matched), the strategies of matched and unmatched ones are different. For buyer who adopt the mixed strategy, we define his strategy is , which is a probability measure over . We define the corresponding CDF as .
We use and to represent the strategy of transaction fee’s lower support and upper support, respectively, which are defined as follows:
(60) | ||||
Lemma 2.1. We define and as the lower and upper support of transaction fee-per-byte at mixed strategy Nash equilibrium, respectively. Then .
Proof of Lemma 2.1.
We will prove the range of and by contradiction. Notice that as we will focus on a particular buyer ’s payoff, we will denote his payoff function as to simplify the notation.
Assume : then at equilibrium. When buyer sets fee , the matching surplus of his transaction is:
(61) |
The delay cost is:
(62) |
Hence, the payoff of setting transaction fee as is
(63) |
Note that . Hence, buyer can increase his payoff by setting the transaction fee as , the corresponding payoff is
(64) | ||||
This contradicts the Nash equilibrium, where no buyer or seller can increase his payoff by deviating. Such a contradiction shows that the upper bound satisfies .
Assume : then at equilibrium. When buyer sets fee , his transaction cannot get matched and buyer gets zero payoff. Then buyer can increase his payoff by setting the transaction fee as , where his payoff is
(65) | ||||
This contradicts the Nash equilibrium, where no buyer or seller can increase his payoff by deviating. Such a contradiction shows that the lower bound satisfies .
Thus, all possible cases leads to contradiction, we have . This completes the proof of Lemma 2.1.
We define an atom as a point where the probability of a random variable equals to the value of this point is strictly positive. For example, is an atom if .
Lemma 2.2. For buyer’s strategy at mixed-strategy Nash equilibrium , it doesn’t have any atom over , i.e., .
Proof of Lemma 2.2.
We prove the result by contradiction method. Assuming there exists an atom in (i.e., ), we will construct a strategy that achieves higher payoff than equilibrium strategy. Notice that as we will focus on a particular buyer ’s payoff, we will denote his payoff function as to simplify the notation.
Assume has an atom within , i.e., . Then we define following probabilities:
(66) |
At mixed strategy Nash equilibrium, any strategy support yields same expected payoff. Thus, buyer ’s expected payoff can be calculated at transaction fee equaling . The matching utility of his transaction is:
(67) |
The sum of fee payment and delay cost is:
(68) | ||||
Hence, the payoff of setting transaction fee as satisfies
(69) | ||||
Define
(70) | ||||
We set a sufficiently small , such that there is no atom between and satisfies following condition:
(there must exist satisfy the above condition, as can be arbitrarily close to and atom cannot continuously exists). We consider buyer sets the trasnaction fee as , the sum of buyer ’ fee payment and delay cost is
(71) | ||||
Note that the matching utilities are the same when buyer set the transaction fee as and , which is in equation (67). Thus buyer can increase his payoff by setting the transaction fee as , which is a contradiction to Nash equilibrium. Thus, we have proved doesn’t have any atom. This completes the proof of Lemma 2.2.
Lemma 2.3. We use to represent buyer ’s strategy at mixed strategy Nash equilibrium, and to represent the strategy of transaction fee-per-byte’s lower and upper support, and to represent the CDF of the strategy of transaction fee-per-byte. Then is strictly increasing over .
Proof of Lemma 2.3.
We will prove that the CDF is strictly increasing over by contradiction. Assuming the CDF is not strictly increasing, we will construct a strategy that achieves higher payoff than equilibrium strategy. Notice that as we will focus on a particular buyer ’s payoff, we will denote his payoff function as to simplify the notation.
Assume ’s CDF is constant over (i.e, ), , and , such that is not strictly increasing over . Then, there is a positive probability of buyer ’s transaction fee-per-byte is between , i.e., . (Otherwise the upper support should be , which is defined as strictly smaller than .) Then there are two possible cases:
-
1.
Strategy support includes point . Notice that there is no atom at based on Lemma 2.2. At mixed strategy Nash equilibrium, any strategy support yields same expected payoff. Thus, buyer ’s expected payoff can be calculated at fee-per-byte equaling . The matching utility is
(72) The sum of fee and delay cost is
(73) We consider buyer sets the transaction fee as . His matching utility is the same as in (72). However, the sum of fee and delay cost is
(74) We compare the payoff of setting the transaction fee as and the mixed strategy at equilibrium, we have
Note that the matching utilities are the same when buyer set the transaction fee as and , which is in equation (72). Thus buyer can increase his payoff by setting the transaction fee as , which is a contradiction to Nash equilibrium.
-
2.
Users’ strategy support does not include point . There must exist a sufficiently small , such that belongs to the support of users’ strategy and satisfies following condition:
(there must exist satisfy the above condition, as can be arbitrarily close to , otherwise we can always consider a larger where the CDF is constant over ) At mixed strategy Nash equilibrium, any strategy support yields same expected payoff. Thus, buyer ’s expected payoff can be calculated at fee-per-byte equaling . The matching utility is
(75) The sum of fee and delay cost is
We consider buyer sets the transaction fee as . The matching surplus is the same as in (75). However, the sum of fee and delay cost is
We compare the payoff of setting the transaction fee as and the mixed strategy , we have
Note that the matching utilities are the same when buyer set the transaction fee as and , which is in equation (75). Thus buyer can increase his payoff by setting the transaction fee as , which is a contradiction to Nash equilibrium.
Thus, we have proved that the CDF is strictly increasing over . This completes the proof of Lemma 2.3.
Lemma 2.4. We use to represent buyer ’s strategy at mixed strategy Nash equilibrium, and to represent the strategy of transaction fee’s lower and upper support, and to represent the CDF of the strategy of transaction fee-per-byte. Then and .
Proof of Lemma 2.4.
We prove by contradiction. Note that Lemma 2.1 has proved that . Hence, we assume , we will construct a strategy that achieves higher payoff than equilibrium strategy. Notice that as we will focus on a particular buyer ’s payoff, we will denote his payoff function as to simplify the notation.
When . There are two cases:
-
•
User ’s transaction fee strategy support at mixed strategy Nash equilibrium includes point . At mixed strategy Nash equilibrium, any strategy support yields same expected payoff. Thus, buyer ’s expected payoff can be calculated at fee-per-byte equaling . The matching utility is
(76) The sum of fee and delay cost is
We consider buyer sets the transaction fee as . The matching surplus is the same as in (76). However, the sum of fee and delay cost is
Note that the matching utilities are the same when buyer set the transaction fee as and , which is in equation (76). Thus buyer can increase his payoff by setting the transaction fee as , which is a contradiction to Nash equilibrium.
-
•
Users’ strategy support does not include point . Note that there exist a sufficiently small , such that belongs to the support of users’ strategy at mixed strategy Nash equilibrium and satisfies following condition:
(there must exist satisfy the above condition, as can be arbitrarily close to , otherwise is not the lower bound.) At mixed strategy Nash equilibrium, any strategy support yields same expected payoff. Thus, buyer ’s expected payoff can be calculated at fee-per-byte equaling . The matching utility is
(77) The sum of fee and delay cost is
We consider buyer sets the transaction fee as . The matching surplus is the same as in (77). However, the sum of fee and delay cost is
We compare the payoff of adopting pure strategy and the mixed strategy , we have
Thus buyer can increase his payoff by setting the transaction fee as , which is a contradiction to Nash equilibrium.
This completes the proof of .
Next we prove by contradiction.
Note that Lemma 2.1 has proved that . Then we assume . Notice that any strategy within the strategy support yields same expected payoff and strategy support of fee-per-byte must include . Then we consider buyer sets transaction fee as . The matching utility is
(78) |
The sum of fee and delay cost is . However, for buyer sets the transaction fee as , the sum of fee and delay cost is
(79) |
Thus, different strategies within the strategy support yield different expected payoffs, which is a contradiction to mixed strategy Nash equilibrium. Thus, we have proved that .
This completes the proof of Lemma 2.4.
Finally we prove the CDF of transaction fee satisfies Equation (35). Notice that any strategy within the strategy support yields same expected payoff and strategy support of fee must include , thus for any strategy , the expected payoff of strategy and strategy should be the same, which is:
(80) | ||||
When , then no longer belongs to the strategy support and we have
(81) |
VII-C Existing BBOB System PoA Analysis
Proof of Theorem 2.
We prove this result by constructing two cases where price of anarchy (PoA) is infinity.
We first construct an example where setting the block size too high leads to infinity PoA. We consider a 2-buyer-2-seller example illustrated in Fig. 11, which satisfies . Hence, it means and . We consider the buying quantities and selling quantities are all 1. Under such setting, we consider the case .

At Nash equilibrium of Stage I, users will set the transaction fee as in Table II.
1 | 2 | |
---|---|---|
Buyer | ||
Seller |
For this example, the social welfare is
(82) |
The social optimum is to match with , which is
(83) |
The ratio between social optimum and social welfare is
(84) |
As long as we choose to be sufficiently large, PoA, which is largest possible ratio is unbounded.
This completes the construction of the example where setting the block size too high leads to infinity PoA.
We then construct an example where setting the block size too low leads to infinity PoA.
We consider a 2-buyer-2-seller example illustrated in Fig. 12, which satisfies . We consider the buying quantities and selling quantities are all 1. Hence, under such setting, we consider the case .

Based on users’ fee equilibrium characterized by Propositions 1 and 2, miners must record all transactions in blockchain: 2 transactions in the first block and 2 transactions in the second block. Hence, the social welfare is
(85) |
The social optimum is to record all transactions in the first block, which is
(86) |
The ratio between social optimum and social welfare is
(87) |
Then we have
(88) |
As long as we choose delay cost to be sufficiently close to , PoA, which is largest possible ratio is unbounded.
This completes the construction of the example where setting the block size too low leads to infinity PoA.
This completes the proof of Theorem 2.
VII-D Stage 0 Analysis
VII-D1 Adjustable Block Size Mechanism for Complete Information
Proof of Theorem 3.
We first prove the result for homogeneous trading quantity , by showing can achieve the social optimum under the three cases.
To simplify the notation, we consider . For , we can just multiply the social welfare and social optimum by a linear factor of .
-
1.
Case 1: As illustrated in Fig. 13, buying utility and selling cost satisfy .
Figure 13: Buyer’s utility and seller’s cost when Under this case, there is no possible match. Hence, the social optimum is zero. Any block size also yields no match and corresponding social welfare is zero. Hence, any achieves social optimum.
-
2.
Case 2: As illustrated in Fig. 14, buying utility and selling cost satisfy .
Figure 14: Buyer’s utility and seller’s cost when Hence, the social optimum is as follows:
(89) We consider three subcases to show that achieves social optimum.
-
(a)
If , then under , the following strategies constitute a Nash equilibrium:
(90) Under such an equilibrium, miners randomly match buying and selling transactions. Even though a buyer or a seller deviates to higher fee, he is still randomly matched. For this subcase, the social welfare is:
(91) Hence, achieves social optimum.
-
(b)
If , then under , the following strategies constitute a Nash equilibrium:
(92) (93) Under such an equilibrium, for buyer with index , they pay the maximal fee they can afford; while for buyer with index , they pay the maximal fee higher than the buyer with index . For this subcase, the social welfare is:
(94) Hence, achieves social optimum.
-
(c)
If , then under , then the following strategies constitute a Nash equilibrium:
(95) (96) Under such an equilibrium, for seller with index , they pay the maximal fee they can afford; while for seller with index , they pay the maximal fee higher than the buyer with index . For this subcase, the social welfare and social optimum are the same:
(97) Hence, achieves social optimum.
-
(a)
-
3.
Case 3: As illustrated in Fig. 15, there exists such that and .
Figure 15: Buyer’s utility and seller’s cost when and Hence, the social optimum is as follows:
(98) Under , the following strategy constitutes a NE:
(99) (100) For this case, the social welfare is:
(101) Hence, achieves social optimum.
To sum up, for homogeneous trading quantity and setting the block size as , the social welfare always equals social optimum. Hence, the PoA of homogeneous trading quantity is PoA = 1.
This completes the proof of for homogeneous trading quantity .
Next, we prove the case of heterogeneous trading quantities by analyzing the PoA under the three cases.
-
1.
Case 1: As illustrated in Fig. 16, buying utility and selling cost satisfy . Under this case, there is no possible match. Hence, the social optimum is zero. Any block size also yields no match and corresponding social welfare is zero. Hence, any block size achieves social optimum. We have PoA .
Figure 16: Buyer’s utility and seller’s cost when -
2.
Case 2: As illustrated in Fig. 17, buying utility and selling cost satisfy .
Figure 17: Buyer’s utility and seller’s cost when Hence, the social optimum is as follows:
(102) We consider three subcases to show the social welfare of setting block size as .
-
(a)
If , then under , the following strategies constitute a Nash equilibrium:
(103) Under such an equilibrium, miners randomly match buying and selling transactions. Even though a buyer or a seller deviates to higher fee, he is still randomly matched. For this subcase, the social welfare satisfies:
(104) Moreover, the social optimum satisfies:
(105) Hence, the ratio between social optimum and social welfare satisfies
(106) -
(b)
If , then under , the following strategies constitute a Nash equilibrium:
(107) (108) Under such an equilibrium, for buyer with index , they pay the maximal fee they can afford; while for buyer with index , they pay the maximal fee higher than the buyer with index . For this subcase, the social welfare satisfies:
(109) Moreover, the social optimum satisfies:
(110) Hence, the ratio between social optimum and social welfare satisfies
(111) -
(c)
If , then under , then the following strategies constitute a Nash equilibrium:
(112) (113) Under such an equilibrium, for seller with index , they pay the maximal fee they can afford; while for seller with index , they pay the maximal fee higher than the buyer with index . For this subcase, the social welfare satisfies:
(114) Moreover, the social optimum satisfies:
(115) Hence, the ratio between social optimum and social welfare satisfies
(116)
-
(a)
-
3.
Case 3: As illustrated in Fig. 18, there exists such that and .
Figure 18: Buyer’s utility and seller’s cost when and Hence, the social optimum is as follows:
(117) Under , the following strategy constitutes a NE:
(118) (119) For this case, the social welfare satisfies:
(120) Moreover, the social optimum satisfies:
(121) Hence, the ratio between social optimum and social welfare satisfies
(122)
To sum up, for heterogeneous trading quantity and setting the block size as , the ratio between social optimum and social welfare always satisfies
(123) |
Hence, the PoA of heterogeneous trading quantity satisfies
(124) |
This completes the proof of for heterogeneous trading quantity .
This completes the proof of Theorem 3.
VII-D2 Adjustable Block Size Mechanism for Incomplete Information
Proof of Theorem 4.
To facilitate the proof, we define
(125) |
where characterizes the ratio between number of buyers and sellers. Moreover, we first set the general block size as with , and then we evaluate a special case where . Note that when , the block size is exactly the block size set in Theorem 4.

We illustrate how we set block size in Fig. 19. We explain why we set block size as : We set block size as . So on average, block 1 includes buying transactions with utility higher than and selling transactions with cost lower than . For , we have . So for the unrecorded transactions, they are unlikely to be matched (probability they can be matched exponentially decreases with ). Hence, for large , we do not need block 2 to record the rest transactions. This avoids the delay cost , achieving a constant approximation ratio.
We will first prove the homogeneous trading quantity of . In the proof, we will first estimates the social optimum. Next we estimate the social welfare loss when setting .
To simplify the notation, we consider for homogeneous trading quantity. For , we can just multiply the social welfare and social optimum by a linear factor of .
Social optimum estimation: We denote the buying utilities in a decreasing order as and denote selling costs in an increasing order as . Then when , the social optimum case should include it in blockchain. Hence, the social optimum can be derived as follows:
(126) |
Note that is the -th order statistics of iid random variables (i.e., buying utilities). Moreover, is -th order statistics of iid random variables (i.e., selling costs).

As illustrated in Fig. 20, we estimate in equation (126) by three parts. Our estimation is to prove that when is large, part 1 are matched with probability 1, part 2’s match can be approximated, and part 3 are matched with probability of 0.
The detailed estimation is as follows:
(127) | ||||
Here we estimate three parts of equation (127) as follows:
-
1.
Estimation of . For , the expectation satisfies:
(128) (129) The variance satisfies:
(130) (131) Then and can be approximated by normal distribution when .101010Based on asymptotic distribution of a central order statistics theorem. http://www.math.ntu.edu.tw/~hchen/teaching/LargeSample/notes/noteorder.pdfhttps://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9936687 Then to estimate the probability of , we can use the standard method to estimate the probability of one normal-distributed random variable larger than another normal-distributed random variable as follows:
(132) (133) Given , we have:
(134) Then for any , we have
(135) where is a standard normal variable. Moreover, we note that:
(136) and we define
(137) where is a constant given . We use to denote the CDF of standard normal distribution. For large and for any , equation (135) becomes:
(138) Hence, we have:
(139) -
2.
Estimation of . For this part, we have and . Hence, we have
(140) -
3.
Estimation of . For , the expectation satisfies:
(141) (142) The variance satisfies:
(143) (144) Then and can be approximated by normal distribution when .111111Based on asymptotic distribution of a central order statistics theorem. http://www.math.ntu.edu.tw/~hchen/teaching/LargeSample/notes/noteorder.pdfhttps://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9936687 Then to estimate the probability of , we can use the standard method to estimate the probability of one normal-distributed random variable larger than another normal-distributed random variable as follows:
(145) (146) Given , we have:
(147) Then for any , we have
(148) where is a standard normal variable. Moreover, we note that:
(149) and we define
(150) where is a constant given . We use to denote the CDF of standard normal distribution. For large and for any , equation (148) becomes:
(151) Hence, we have:
(152)
To sum up, we estimate as
(153) | ||||
Next we estimate the social welfare when setting . The social welfare when setting comprising of the following:
(154) |
The social welfare loss comes from two blocks and . We will compute them one by one.
-
•
The social welfare loss in block 1: The social welfare loss in block 1 comes from the situation that miners include some transactions to get fees, but these transactions reduces the social welfare.
Figure 21: Social welfare loss due to and . Fig. 21 illustrates the social welfare loss due to and . The social optimum under such case is . However, at Nash equilibrium, miners will match with and with , such that they can collect all transactions’ fees. This yields the social welfare of . Hence, the social welfare loss compared with social optimum for such a situation is .
Under , the expected social welfare loss due to and is
(155) Figure 22: Social welfare loss due to and . Fig. 22 illustrates the social welfare loss due to and . The social optimum under such case is . However, miners will match with , with , and with . Such that they can collect all transactions’ fees. This yields the social welfare of . Hence, the social welfare loss compared with the social optimum for such a situation is .
Under , the expected social welfare loss due to and is
(156) We can use such method to calculate all the social welfare loss due to and , where to . Hence the total expected social welfare loss from block 1 is
(157) We estimate two parts one by one:
- 1.
-
2.
For , we have
(160)
This completes the computation of .
-
•
The social welfare loss in block 2: Note that based on equation (151), for any , we have
(161) In other words, when , the probability of there are transaction left for block 2 is zero. Hence, the social welfare loss due to block 2 is zero:
(162)
Based on all these discussions, we can estimate the ratio between social optimum and social welfare, under block size when :
(163) | ||||
Then, we will use the Squeeze Theorem to prove that PoA is 1 when setting . Based on (163), the ratio between social optimum and social welfare satisfies:
(164) |
First, for , we have
(165) |
Then, we analyze
(166) |
Note that the term in above equation must be higher than a strictly positive constant. The reason is as follows: based on equation (139), we have:
(167) | ||||
Note that . Moreover, when and , must be smaller than . Hence, equation (167) becomes:
(168) | ||||
Based on equations (167) and (168), we have shown the term must be strictly positive. Hence, for equation (166), we have
(169) |
This means that setting the block size as always achieves the social optimum. Hence, the PoA of homogeneous trading quantity is PoA = 1.
This completes the proof of for homogeneous trading quantity .
Proof for heterogeneous trading quantities: We will first estimate the social optimum. Next we estimate the social welfare loss when setting .
Social optimum estimation: We denote the buying utilities in a decreasing order as and denote selling costs in an increasing order as . We also range to buying quantities and asking quantities in a decreasing order as and .
Note that for , its buying quantities are not necessarily the -th highest. Hence, based on Rearrangement Inequality, the social optimum satisfy:
(171) |
Note that is the -th order statistics of iid random variables (i.e., buying utilities), is the -th order statistics of iid random variables (i.e., buying quantities), is -th order statistics of iid random variables (i.e., selling costs), and is the -th order statistics of iid random variables (i.e., selling quantities).

As illustrated in Fig. 23, we estimate in equation (171) by three parts. Our estimation is to prove that when is large, part 1 are matched with probability 1, part 2’s match can be approximated, and part 3 are matched with probability of 0.
The detailed estimation is as follows:
(172) | ||||
Here we estimate three parts of equation (172) as follows:
-
1.
Estimation of . We first estimate then we estimate .
For , the expectations of and satisfy:
(173) (174) Moreover, since is a concave function, Jensen’s inequality tells us:
(175) For , the expectations of and satisfy:
(176) (177) The variance satisfies:
(178) (179) Then and can be approximated by normal distribution when .121212Based on asymptotic distribution of a central order statistics theorem. http://www.math.ntu.edu.tw/~hchen/teaching/LargeSample/notes/noteorder.pdfhttps://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9936687 Then to estimate the probability of , we can use the standard method to estimate the probability of one normal-distributed random variable larger than another normal-distributed random variable as follows:
(180) (181) Given , we have:
(182) Then for any , we have
(183) where is a standard normal variable. Moreover, we note that:
(184) and we define
(185) where is a constant given . We use to denote the CDF of standard normal distribution. For large and for any , equation (183) becomes:
(186) To sum up, we have:
(187) -
2.
Estimation of . For this part, we have , and . Hence, we have
(188) -
3.
Estimation of . For , the expectations of and satisfy:
(189) (190) The variances satisfy:
(191) (192) Then and can be approximated by normal distribution when .131313Based on asymptotic distribution of a central order statistics theorem. http://www.math.ntu.edu.tw/~hchen/teaching/LargeSample/notes/noteorder.pdfhttps://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9936687 Then to estimate the probability of , we can use the standard method to estimate the probability of one normal-distributed random variable larger than another normal-distributed random variable as follows:
(193) (194) Given , we have:
(195) Then for any , we have
(196) where is a standard normal variable. Moreover, we note that:
(197) and we define
(198) where is a constant given . We use to denote the CDF of standard normal distribution. For large and for any , equation (196) becomes:
(199) Hence, we have:
(200)
To sum up, we estimate as
(201) | ||||
Next we estimate the social welfare when setting . Since miners will randomly match transactions, the expected quantity of trading is the minimal of buying quantity and selling quantity. The CDF of the minimal is
(202) |
The expectation of trading quantity is denoted as
(203) | ||||
We denote The social welfare when setting comprising of the following:
(204) | ||||
We will compute the terms in (204) one by one.
-
•
: based on the proof of Theorem 3, we have
(205) -
•
: This term must be strictly positive, we neglect this term and treat it as zero, since we derive a lower bound of the approximation ratio.
-
•
: denotes the social welfare loss in block 1, which comes from the situation that miners include some transactions to get fees, but these transactions reduces the social welfare.
Figure 24: Social welfare loss due to and . Fig. 24 illustrates the social welfare loss due to and . The social optimum under such case is . However, at Nash equilibrium, miners will match with and with , such that they can collect all transactions’ fees. This yields the social welfare of . Hence, the social welfare loss compared with social optimum for such a situation is .
Under , the expected social welfare loss due to and is
(206) Figure 25: Social welfare loss due to and . Fig. 25 illustrates the social welfare loss due to and . The social optimum under such case is . However, miners will match with , with , and with . Such that they can collect all transactions’ fees. This yields the social welfare of . Hence, the social welfare loss compared with the social optimum for such a situation is .
Under , the expected social welfare loss due to and is
(207) We can use such method to calculate all the social welfare loss due to and , where to . Hence the total expected social welfare loss from block 1 is
(208) We estimate two parts one by one:
- 1.
-
2.
For , we have
(211)
-
•
: denotes the social welfare loss in block 2: Note that based on equation (199), for any , we have
(212) In other words, when , the probability of there are transaction left for block 2 is zero. Hence, the social welfare loss due to block 2 is zero:
(213)
Based on all these discussions, we can estimate the ratio between the social optimum and social welfare under block size when :
(214) | ||||
where
(215) |
As the buying and selling quantities are within , we have and . Hence, (214) becomes
(216) | ||||
Hence, the ratio between the social optimum and social welfare for heterogeneous trading quantity is upper bounded by . The PoA, as the maximum ratio, is upper bounded by .
This completes the proof of heterogeneous-quantity trading.
This completes the proof of Theorem 4.
VIII Experiment
This section provides a comprehensive introduction to the implementation of our Adjustable Block Size (ABS) mechanism in the Ethereum blockchain and the experiment. The ABS mechanism aims to dynamically adjust the block size, which in Ethereum is represented by the gas limit of each block.
VIII-A Experiment Overview
In Ethereum, the block size is determined by the gas limit. To implement our ABS mechanism, we adjust the gas limit of each block to control the block size. We utilize Geth version 1.11.2 [41] as the Ethereum client and modify its source code to implement the gas limit adjustment. After the implementation, we run the blockchain protocol and generate the buying and selling transactions to match.
VIII-B Experiment Details
The experiment includes four steps:
VIII-B1 Modifying Geth Source Code
To adjust the gas limit of each block, we modify the “block_validator.go” file in the Geth source code. Specifically, we update the function responsible for calculating the gas limit “CalcGasLimit”. In order to set the block size to accommodate approximately 100 transactions, we configure the gas limit to 2,100,000 since each typical transaction consumes approximately 21,000 gas. The code modification is shown in Figure 26, where we add comments to the original code of “CalcGasLimit” and include our modifications. Additionally, we update the gas limit in the “genesis.json” file to the following value:
Ψ"gasLimit": "0x200b20",
This change is made because the gas limit is specified in hexadecimal format.

VIII-B2 Running the Modified Ethereum Client
After modifying the gas limit, we run a local instance of the Ethereum blockchain using the modified Geth client in a Cygwin64 terminal. The steps to achieve this are outlined below:
-
1.
Navigate to the Geth client directory and compile the file. The commands are as follows:
ΨΨcd /cygdrive/d/Program\ Files/go-ethereum-1.11.2.2 ΨΨ ΨΨmake geth Ψ
-
2.
Remove blockchain data from any previous experiments (if it exists). The command is:
ΨΨgeth removedb Ψ
-
3.
Initialize the genesis file and run the modified client. The commands are:
ΨΨ./build/bin/geth init "D:\Program Files\go-ethereum-1.11.2.2 ΨΨ\cmd\devp2p\internal\ethtest\testdata\genesis.json" ΨΨ ΨΨ./build/bin/geth --networkid 12345 --nodiscover --mine -- ΨΨminer.etherbase 0xF90FDcB13069361f27e3aC5a2A1aca66E37437f2 ΨΨ--miner.threads 1 --http --http.port 8545 --http.api web3, ΨΨeth,net,personal Ψ
Figure 27 shows the operation result of blockchain execution after running our modified client. It shows the mining history of blocks, and the red rectangle in the figure shows that we have modified the fixed gas limit to 2,100,000.

VIII-B3 Verification of Gas Limit:
We open a new Cygwin64 terminal to verify the implementation by inspecting the gas limit of the mined blocks. After navigating to the appropriate directory, we retrieved the block information. The code executed is as follows:
Ψcd /cygdrive/d/Program\ Files/go-ethereum-1.11.2.2 Ψ Ψcurl -X POST --data "{\"jsonrpc\":\"2.0\",\"method\":\"eth_ ΨΨgetBlockByNumber\",\"params\":[\"latest\",true],\"id\":1}" Ψ-H "Content-Type: application/json" http://localhost:8545
Figure 28 displays the results of executing the code. The red rectangle in the figure highlights that the block’s gas limit is indeed set to 0x200b20 in hexadecimal, which is equivalent to 2,100,000 and matches the value we configured. This confirms that the ABS mechanism has been successfully implemented.

VIII-B4 Transaction Generation:
We open a new cmd to generate the buying and selling transactions. First, we navigate to the folder and install Web3.js with specific version:
Ψcd /d D:\Program Files\go-ethereum-1.11.2.2\ Ψethereum-transaction Ψ Ψnpm install web3@1.6.1
Next is to run the code
Ψnode sendTransaction3.js
The code of “sendTransaction3.js” is as follows:
Ψconst Web3 = require(’web3’); Ψconst web3 = new Web3(’http://localhost:8545’); // Initialize Web3 with HTTP provider Ψ Ψ// Your account and private key Ψconst account = ’0xF90FDcB13069361f27e3aC5a2A1aca66E37437f2’; Ψconst privateKey = ’0xec65482032b5cf235cffc47aacd4d9f2e1fc71d670e82c9110d17a4776ea6dde’; Ψ Ψconst recipientAccounts = [ Ψ’0xeA8EC02a56D1a334C61036032Bb9ad349FB6C160’, Ψ’0xc4cc8Fe4B613C7774157FEd7d7F898C52b415eF2’, Ψ’0x303bDCeD279e89bb3B0f10A9c2f4738Bdc8496e3’, Ψ’0xcb1E67065D274DD8A2bb03fa77C798fC902ec670’, Ψ’0x18F3F58D9F408723f2E2EFAaAC756dDf0Fc05869’, Ψ’0x65B2E2E97B2076B27aE15713D2a0916694E9220F’, Ψ’0xAd3F680F5d594A49c4b39926A40c3Af832Ecfacb’, Ψ’0xEF9835504AD5A42CdAABeE58c7f8299534Ff14DA’, Ψ’0xaBeCed76e700790cC03EFD2691fAc9D82706e97e’, Ψ’0x49591Eaaa296180ba24ad7568Ccb30946Fd6d7c0’, Ψ’0xf36137dEA116d4296485534CE90c3D88A56d13E2’, Ψ’0xF241E66491f58F0C0FAf82a7F7eB0EF857742550’, Ψ’0x61f244C8D7B354B09fa657b2DA6C36571fcac821’, Ψ’0x7b369bFC4b3BFAc833c84521424C4f41c037B3a8’, Ψ’0xdc332E90Ed666eed9330Cf72740f14B17A9ae36c’, Ψ’0x84796451696BdBA236E9b82B19B06Be831F41Ca8’, Ψ’0x259648887B2A2322007C06B8C33382B460d1017F’, Ψ’0xa9F6ac59Eb8ECF113D2e05FBDa8a567fe66774c9’, Ψ’0x43f01580C9E2f38548b9687930db349cfD8c6B89’, Ψ’0x006498deE48fd6dd4b300fb25438b0C741C61613’ Ψ]; Ψ Ψ// Ensure the address is checksummed Ψconst checksumAddress = web3.utils.toChecksumAddress(account); Ψ Ψ// Add the private key to Web3’s wallet Ψweb3.eth.accounts.wallet.add(privateKey); // Add private key to Web3 wallet Ψ Ψ// Function to generate a random number within a range Ψconst getRandomInRange = (min, max) => { ΨΨreturn Math.floor(Math.random() * (max - min + 1)) + min; Ψ}; Ψ Ψ// Function to send a single transaction Ψconst sendSingleTransaction = async (index, nonce) => { ΨΨ// Generate a random gas price between 10 gwei and 100 gwei (for example) ΨΨconst gasPrice = web3.utils.toWei(getRandomInRange(10, 100).toString(), ’gwei’); ΨΨ ΨΨ// Select a random recipient from the list ΨΨconst recipient = recipientAccounts[index % recipientAccounts.length]; // Ensure we don’t go out of bounds ΨΨ ΨΨ// Prepare the transaction details ΨΨconst tx = { ΨΨΨfrom: checksumAddress, ΨΨΨto: recipient, // Randomized recipient address ΨΨΨvalue: web3.utils.toWei(’0.1’, ’ether’), // Transaction value in Ether (0.1 ETH for each transaction) ΨΨΨgas: 21000, // Gas limit ΨΨΨgasPrice: gasPrice, // Randomized gas price ΨΨΨnonce: nonce // Unique nonce for each transaction ΨΨ}; ΨΨ ΨΨ// Sign and send the transaction ΨΨtry { ΨΨΨconst signedTx = await web3.eth.accounts.signTransaction(tx, privateKey); ΨΨΨconst receipt = await web3.eth.sendSignedTransaction(signedTx.rawTransaction); ΨΨΨconsole.log(‘Transaction ${index + 1} successful:‘, receipt); ΨΨ} catch (err) { ΨΨΨconsole.error(‘Error sending transaction ${index + 1}:‘, err); ΨΨ} Ψ}; Ψ Ψ// Function to send 10 transactions concurrently with unique nonces Ψconst sendTransactionsConcurrently = async () => { ΨΨ// Get the current nonce for the sender’s account ΨΨconst currentNonce = await web3.eth.getTransactionCount(checksumAddress); ΨΨ ΨΨconst transactionPromises = []; ΨΨ ΨΨfor (let i = 0; i < 10; i++) { ΨΨΨ// Add each transaction promise to the array with unique nonce ΨΨΨtransactionPromises.push(sendSingleTransaction(i, currentNonce + i)); // Increment nonce for each transaction ΨΨ} ΨΨ ΨΨ// Wait for all transactions to complete concurrently ΨΨawait Promise.all(transactionPromises); Ψ}; Ψ Ψ// Execute the function to send 10 transactions concurrently ΨsendTransactionsConcurrently().then(() => { ΨΨconsole.log(’All transactions have been sent.’); Ψ}).catch(err => { ΨΨconsole.error(’Error in sending transactions:’, err); Ψ});
Figure 29 displays the results that miners successfully record the transactions in the blockchain. This completes the experiment.

Through the experiment, we successfully adjusted the block size in the Ethereum blockchain by modifying the gas limit of each block and complete matching. This implementation demonstrates the feasibility and practicality of ABS mechanism.
References
- [1] D. Ghelani, “What is non-fungible token (nft)? a short discussion about nft terms used in nft,” Authorea Preprints, 2022.
- [2] “Market value,” https://www.binance.com/en/price/dydx-chain, 2024.
- [3] “Issue of decentralized order book,” https://pintu.co.id/en/academy/post/what-is-decentralized-order-book#pros-and-cons-of-decentralized-order-book, 2023.
- [4] K. Li, S. Guan, and D. Lee, “Towards understanding and characterizing the arbitrage bot scam in the wild,” in Abstracts of the 2024 ACM SIGMETRICS/IFIP PERFORMANCE Joint International Conference on Measurement and Modeling of Computer Systems, ser. SIGMETRICS/PERFORMANCE ’24. New York, NY, USA: Association for Computing Machinery, 2024, p. 89–90. [Online]. Available: https://doi.org/10.1145/3652963.3655088
- [5] B. G. Gebraselase, B. E. Helvik, and Y. Jiang, “Effect of miner incentive on the confirmation time of bitcoin transactions,” in 2021 IEEE International Conference on Blockchain (Blockchain). IEEE, 2021, pp. 521–529.
- [6] “Price slippage in matching,” https://www.coingecko.com/learn/slippage-crypto, 2023.
- [7] “Dex matching issue,” https://101blockchains.com/defi-slippage-explained/, 2024.
- [8] “Bitcoin cash,” https://crypto.marketswiki.com/index.php?title=Bitcoin_cash, 2020.
- [9] P. Daian, S. Goldfeder, T. Kell, Y. Li, X. Zhao, I. Bentov, L. Breidenbach, and A. Juels, “Flash boys 2.0: Frontrunning in decentralized exchanges, miner extractable value, and consensus instability,” in 2020 IEEE symposium on security and privacy (SP). IEEE, 2020, pp. 910–927.
- [10] M. Schnaubelt, “Deep reinforcement learning for the optimal placement of cryptocurrency limit orders,” European Journal of Operational Research, vol. 296, no. 3, pp. 993–1006, 2022.
- [11] N. Hautsch, C. Scheuch, and S. Voigt, “Building trust takes time: limits to arbitrage for blockchain-based assets,” Review of Finance, p. rfae004, 2024.
- [12] L. Heimbach and R. Wattenhofer, “Sok: Preventing transaction reordering manipulations in decentralized finance,” in Proceedings of the 4th ACM Conference on Advances in Financial Technologies, 2022, pp. 47–60.
- [13] F. Victor and A. M. Weintraud, “Detecting and quantifying wash trading on decentralized cryptocurrency exchanges,” in Proceedings of the Web Conference 2021, 2021, pp. 23–32.
- [14] A. Raheman, A. Kolonin, B. Goertzel, G. Hegyközi, and I. Ansari, “Architecture of automated crypto-finance agent,” in 2021 International Symposium on Knowledge, Ontology, and Theory (KNOTH). IEEE, 2021, pp. 10–14.
- [15] “Bitcoin xt,” https://en.bitcoin.it/wiki/Bitcoin_XT, 2015.
- [16] “Ethereum fee,” https://www.blocknative.com/blog/eip-1559-fees, 2021.
- [17] W. Li, S. Andreina, J.-M. Bohli, and G. Karame, “Securing proof-of-stake blockchain protocols,” in Data Privacy Management, Cryptocurrencies and Blockchain Technology: ESORICS 2017 International Workshops, DPM 2017 and CBT 2017, Oslo, Norway, September 14-15, 2017, Proceedings. Springer, 2017, pp. 297–315.
- [18] “Transaction delay,” https://www.blockchain.com/explorer/charts/n-transactions, 2025.
- [19] C. Wang, X. Chu, and Y. Qin, “Measurement and analysis of the bitcoin networks: A view from mining pools,” in 2020 6th International Conference on Big Data Computing and Communications (BIGCOM). IEEE, 2020, pp. 180–188.
- [20] “Fee calculator,” https://www.cashbackforex.com/tools/exchange-fees-calculator?s=blockchain-com-exchange, Jan 2025.
- [21] “Chainlink introduction,” https://www.globalxetfs.com/chainlink-the-basics/, 2023.
- [22] “Serum introduction,” https://medium.com/perpdex/serum-order-book-implementation-2fca9301f76e, 2022.
- [23] D. Easley, M. O’Hara, and S. Basu, “From mining to markets: The evolution of bitcoin transaction fees,” Journal of Financial Economics, vol. 134, no. 1, pp. 91–109, 2019.
- [24] Y. Liu, S. Ke, Z. Fang, M. H. Cheung, W. Cai, and J. Huang, “A storage sustainability mechanism with heterogeneous miners in blockchain,” IEEE Journal on Selected Areas in Communications, vol. 40, no. 12, pp. 3645–3659, 2022.
- [25] “Bitcoin protocol,” https://github.com/Maguines/Bitcoin-v0.1, 2016.
- [26] J. Messias, M. Alzayat, B. Chandrasekaran, K. P. Gummadi, P. Loiseau, and A. Mislove, “Selfish & opaque transaction ordering in the bitcoin blockchain: the case for chain neutrality,” in Proceedings of the 21st ACM Internet Measurement Conference, 2021, pp. 320–335.
- [27] “Ethereum staking distribution,” https://dune.com/hildobby/eth2-staking, 2024.
- [28] “dydx order type,” https://docs.dydx.exchange/api_integration-trading/order_types, 2024.
- [29] A. A. Alchian, “The meaning of utility measurement,” The American Economic Review, vol. 43, no. 1, pp. 26–50, 1953.
- [30] A. Ntakaris, M. Magris, J. Kanniainen, M. Gabbouj, and A. Iosifidis, “Benchmark dataset for mid-price forecasting of limit order book data with machine learning methods,” Journal of Forecasting, vol. 37, no. 8, pp. 852–866, 2018.
- [31] E. Akyildirim, O. Cepni, S. Corbet, and G. S. Uddin, “Forecasting mid-price movement of bitcoin futures using machine learning,” Annals of Operations Research, vol. 330, no. 1, pp. 553–584, 2023.
- [32] A. Ntakaris, J. Kanniainen, M. Gabbouj, and A. Iosifidis, “Mid-price prediction based on machine learning methods with technical and quantitative indicators,” Plos one, vol. 15, no. 6, p. e0234107, 2020.
- [33] T. Roughgarden, “Transaction fee mechanism design for the ethereum blockchain: An economic analysis of eip-1559,” arXiv preprint arXiv:2012.00854, 2020.
- [34] J. Li, G. Sun, L. Duan, and Q. Wu, “Multi-objective optimization for uav swarm-assisted iot with virtual antenna arrays,” IEEE Transactions on Mobile Computing, 2023.
- [35] S. Gao, C. A. Courcoubetis, and L. Duan, “Average-case analysis of greedy matching for large-scale d2d resource sharing,” IEEE Transactions on Mobile Computing, vol. 23, no. 5, pp. 3707–3721, 2023.
- [36] S. Gao, C. Courcoubetis, and L. Duan, “Dynamic matching for ride-sharing with deadlines,” in 2024 22nd International Symposium on Modeling and Optimization in Mobile, Ad Hoc, and Wireless Networks (WiOpt). IEEE, 2024, pp. 241–248.
- [37] “Nft trading dataset,” https://www.kaggle.com/datasets/mathurinache/nft-history-sales?resource=download, 2022.
- [38] “Bitcoin order book dataset,” https://www.kaggle.com/datasets/maxreis/df-order-book, 2020.
- [39] W.-d. Yu and K.-W. Wang, “Best value or lowest bid? a quantitative perspective,” Journal of Construction Engineering and Management, vol. 138, no. 1, pp. 128–134, 2012.
- [40] “Blockchain order book protocol,” https://b2broker.com/news/what-is-cryptocurrency-matching-engine/, 2023.
- [41] “Ethereum clients,” https://chainstack.com/ethereum-clients-geth-and-erigon/, 2022.
- [42] Q. Zhou, H. Huang, Z. Zheng, and J. Bian, “Solutions to scalability of blockchain: A survey,” Ieee Access, vol. 8, pp. 16 440–16 455, 2020.
- [43] G. Sun, J. Li, Y. Liu, S. Liang, and H. Kang, “Time and energy minimization communications based on collaborative beamforming for uav networks: A multi-objective optimization method,” IEEE Journal on Selected Areas in Communications, vol. 39, no. 11, pp. 3555–3572, 2021.