# Greedy Networking in Cryptocurrency Blockchain

Simeon Wuthier, Pranav Chandramouli, Xiaobo Zhou, Sang-Yoon Chang

► To cite this version:

Simeon Wuthier, Pranav Chandramouli, Xiaobo Zhou, Sang-Yoon Chang. Greedy Networking in Cryptocurrency Blockchain. 37th IFIP International Conference on ICT Systems Security and Privacy Protection (SEC), Jun 2022, Copenhagen, Denmark. pp.343-359, 10.1007/978-3-031-06975-8_20. http://dx.doi.org/10.1007/978-3-031-06975-8_20

HAL Id: hal-05319901

https://inria.hal.science/hal-05319901v1

Submitted on 17 Oct 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_2.png" /></figure>

ifip

International Federation for Information Processing

This document is the original author manuscript of a paper submitted to an IFIP
conference proceedings or other IFIP publication by Springer Nature. As such, there
may be some differences in the official published version of the paper. Such
differences, if any, are usually due to reformatting during preparation for publication or
minor corrections made by the author(s) during final proofreading of the publication
manuscript.
# Greedy Networking in Cryptocurrency Blockchain

Simeon Wuthier(✉), Pranav Chandramouli, Xiaobo Zhou, and Sang-Yoon Chang

Department of Computer Science, University of Colorado,
Colorado, Colorado Springs, USA
{swuthier,pchandra,xzhou,schang2}@uccs.edu

**Abstract.** Proof of work (PoW) is a widely adopted distributed consensus protocol which enables cryptocurrency transaction processing without a trusted third party. The miners are financially incentivized to participate in the PoW consensus protocol, and PoW relies on the underlying peer-to-peer (P2P) networking for receiving and transmitting the transactions and the up-to-date blocks (which are the inputs for the PoW consensus protocol). We study the rational miner strategy but control an orthogonal parameter from those in the previous blockchain research, which has studied the control of the mining power or the timing of the block submissions (e.g., selfish mining or block withholding). More specifically, we study greedy networking, in which a miner node increases its connectivity beyond the default protocol to expedite the deliveries of blocks and transactions for an unfair mining advantage. While greedy networking has been actively studied in the general P2P networking, it has not been systematically studied in cryptocurrency and blockchain despite the alleged real-world instances by the Bitcoin community. We build an analytical framework for greedy networking and study how the networking control impacts the cryptocurrency application to quantify the benefits and costs of the networking control. To demonstrate the use of our framework, we implement a greedy networking prototype based on an active Bitcoin node connected to the Mainnet while simulating different miner capabilities by varying the computing backend of the miner. In contrast to the previous belief in blockchain and cryptocurrency, we discover that the optimal number of connections is bounded (limiting the greedy behavior) and depends on the hash computing capability of the miner.

**Keywords:** Blockchain · Bitcoin · Peer-to-peer networking · Proof of Work (pow) · Mining · Rational strategy · Greedy networking

## 1 Introduction

The rise of cryptocurrencies has sparked a new era where currency generation and financial transactions no longer depend on a centralized source but instead

© IFIP International Federation for Information Processing 2022

Published by Springer Nature Switzerland AG 2022

W. Meng et al. (Eds.): SEC 2022, IFIP AICT 648, pp. 343–359, 2022.

https://doi.org/10.1007/978-3-031-06975-8_20
rely on the cryptographic primitives that back the digital ownership of monetary quantities. Additionally, cryptocurrencies build on distributed computing and networking for further decentralization, including distributed storage (having the participating nodes locally store the ledger), distributed consensus protocol (deciding how financial transactions get processed), and distributed networking (to transmit and receive relevant information for cryptocurrency operations). In a decentralized peer-to-peer (P2P) system, having a healthy number of connections is important for the robustness of information delivery and synchronization in the network. The underlying principles that help to maintain the networking layer's operation include the reliability of information transmission, the latency/throughput per node, and the influence of peers in the selection process that is responsible for ensuring a strongly connected and efficient network topology.

Rational and incentive-driven optimization strategies are an active research field. In this study, we explore a new dimension of blockchain-based optimizations in which a miner node varies its connectivity (the number of P2P connections) for financial gain, unfair to the rest of the miners and potentially destructive to the network. We call this greedy networking. While greedy behaviors have been extensively studied in various P2P contexts (discussed in Sect. 7), we are the first work to study greedy networking in cryptocurrency. Greedy networking is rational (incentive compatible for the node's financial interest). Because the miners are incentivized to participate in the cryptocurrency network due to such financial interests, we systematically analyze the greedy networking incentives associated with the peer selection process and its impact on cryptocurrency mining applications. More specifically, we measure the benefits vs. costs of greedy networking based on our active cryptocurrency blockchain prototype in Bitcoin. We find that a self-interest-driven node/miner has a threshold at which the incentive to continue increasing peer connections eventually transforms into a disincentive. Thus, there exists an optimal number of peer connections dependent on a node's resource capabilities.

The rest of the paper is organized as follows. Section 2 builds the preliminary representation of PoW-based cryptocurrencies to serve as our baseline in Sect. 3 where we formulate the problem and build the motivations for our work. Our model and framework are introduced in Sect. 4. While we apply the framework to a limited number of variables, our general framework can support a greater number of parameters. Section 5 identifies and focuses on those parameters by formalizing their behavior and introducing our real-world experimental setup in Bitcoin. We quantify the framework into a utility function that is analyzed and optimized in Sect. 6. We then discuss related literature including the greedy strategies in blockchain and cryptocurrency in Sect. 7 followed by our discussions and future work in Sect. 8. Finally, we conclude our study in Sect. 9.

## 2 Background

**Blockchain Networking.** The distributed P2P networking is critical to blockchain as it provides the information for blockchain operations, e.g., the
<figure><img src="image_3.png" /><figcaption>**Fig. 1.** Our empirical distribution of *x*, where *x* is the control variable in the number of peer connections while running a public Bitcoin node without artificial control (we later manually control *x* to study greedy networking). The dotted vertical line indicates the average number of peer connections, $\bar{x}$.</figcaption></figure>

transaction propagation and up-to-date blocks for the distributed consensus protocol depend on the underlying network.

**Bitcoin.** Bitcoin was initially proposed by Satoshi Nakamoto in 2008 [19] and has achieved its first $1 trillion market capitalization in February of 2021 [5]. Similarly, Bitcoin has served as the foundation for later cryptocurrency developments and blockchain-based consensus mechanisms. While our work can generalize across different cryptocurrencies, we focus on the most popular cryptocurrency, Bitcoin, to experimentally validate our work.

A Bitcoin Core (version 0.21.0) public node maintains 10 outbound peer connections that are initiated by the subject node, and between 0 to 118 inbound connections (initiated by other nodes). Thus, the default number of node connections varies between 10 and 128 with the average case being dependent on the subject node's resource capabilities. By default, nodes do not accept incoming connections and are therefore limited to $x = 10$. However, as shown in Fig. 1, using our active Bitcoin prototype and enabling incoming connections yields an empirical distribution of node connections that have an average of $\bar{x} = 32$. The networking/socket layer uses a distributed P2P system for information delivery that identifies nodes in one of three forms: IPv4, IPv6, or Tor, each of which holding different resource capabilities.

**Mining Incentives.** Cryptocurrencies and blockchain in general rely on the node processing the distributed consensus protocol to agree on the transactions that get recorded to the ledger. In PoW-based blockchains, nodes are called *miners* and they participate in the *mining process* involving finding the probabilistic proof-of-works (PoW) based on the hash computations that result in the creation of new blocks. The latest block is broadcasted to the other miners through networking and yields a financial reward (in newly-minted coins) to the miner who finds the block, and those paid by the cryptocurrency users/beneficiaries. Such financial rewards provide the incentive for the mining operations, e.g., mining is a popular investment to gain financial income. Because the miners are driven by their financial income, we study the rational strategy that increases this reward.
# 3 Our Motivations and Contributions

Bitcoin nodes are driven by their self-interests and financial gains. Thus, as discussed in the Bitcoin paper [20], the miner protocol is designed to be incentive-compatible. We however study the uncooperative and self-interest-driven behaviors in blockchain P2P networking.

In greedy networking, nodes deviate from the Bitcoin implementation specification/policy to increase the number of peer connections with the intention to expedite receiving blocks and transactions. By targeting the smallest block propagation time, miners can begin mining a block sooner for an increased chance of mining the next block. Likewise, miners that do not receive an expedited block delivery risk decreased probabilities in finding the next block, and, due to this probabilistic nature and race condition of PoW mining to mining cost estimation, the risk can be directly modeled into a loss of monetary value if the block propagation is delayed. Thus, the rational mining strategy holds the incentive to deviate from traditional blockchain networking protocols set by the cryptocurrency specification, e.g., Bitcoin Core. Consequently, increasing the peer connections scales the networking traffic of the node which impacts the processor/memory utilization, power consumption, and bandwidth (among other parameters). The trade-offs associated with mining rewards yield an optimal number of peer connections which the rational mining strategy can use to optimize its mining income.

The motivation for our work is in regards to [27] where a Bitcoin Core developer noted that increasing the number of connections can be detrimental to the health of the network, stating that “connectable peers on the network are a scarce resource, and essential to the decentralization. If people go try connect to all of them like some sites do, we’ll very quickly run out”. The intention to increase peer connections for increased responsiveness is also mentioned in [9] stating that “many of these services attempt to connect to a large portion of the listening network and gain insight into the chance of a transaction confirming”. Our work largely corroborates with [27] and [9] but we make the following research contributions: i) we provide a general framework for greedy networking which can apply to PoW blockchains; ii) we systematically investigate the greedy networking on an active Bitcoin prototype, including the potential costs in an increased load on the broadcasting network and physical machine resources, which is in contrast to the previous research focusing only on the benefits that discourage greedy networking. Our results show that the optimal greedy networking strategy is not to keep increasing the peer connections but rather maintain an optimal number of connections, in contrast to the previous belief. We shed light on this greedy networking optimization problem in cryptocurrency to facilitate further research in aligning the incentives of the protocol to its design integrity and fairness.
<figure><img src="image_4.png" /><figcaption>**Fig. 2.** Our greedy networking analytical framework. $x$ is the control variable in the number of peer connections while $	ilde{f}(x)$ are the sensing measurements dependent on $x$. The feedback $	ilde{g}$ takes $	ilde{f}(x)$ to normalize the sensing measurements.</figcaption></figure>

# 4 Model and Framework

We describe our model and framework in this section for the general greedy net-working framework, while Sect. 5 applies the framework to our Bitcoin prototype for a concrete instance including the sensing parameters (defined in Sect. 4.3) and the control processing (defined in Sect. 4.4).

## 4.1 Introduction to Our Model

Any node participating in the network for distributed consensus protocol and P2P communications can launch greedy networking. A greedy node controlling the number of peer connections impacts the financial outcomes in the consensus protocol, as it affects the delivery time of the consensus-relevant information and the mining operational costs. Because of its financial impact, any standard miner driven by its financial income would be incentivized to launch greedy networking.

## 4.2 Our General Framework

We begin by defining a general framework to enable the formal modeling of our novel greedy networking optimization problem. We later give a use case for this general framework (in Sect. 5) to show its instantiated function at the implementation level where we acquire a concrete value for $x$.

We build a protocol-independent utility function framework to measure the incentives and quantify the costs and benefits when using our framework. Figure 2 describes our framework for greedy networking. The number of connec-tions, denoted by $x$, is the control parameter that affects the PoW consensus protocol and its resulting sensor measurements, denoted by $\tilde{f}$. We define $\tilde{f}$ to be comprised of elements that are dependent variables of $x$ and involve those from not only ledger data but also the network sensing. This is used in the feedback processing to yield $\tilde{g}(\tilde{f}(x))$ which informs the control and selection of $x$. For val-idation, we implement concrete instances of our framework on an active Bitcoin node.
## 4.3 Sensing Measurements in $\vec{f}$

We define $\vec{f}$ for our sensing parameter measurements which are dependent on $x$, i.e., $\vec{f} = (\{f_i\}_i) = (f_1, f_2, ..., f_i)$ where $f_i$ is the observed value for the $i$-th parameter. Because $x$ affects not only the networking but also the cryptocurrency application, $f_i$ are from those in networking (e.g., transmitted bytes/bandwidth and computing resources for networking), cryptocurrency application (e.g., block delay and computational power for mining), and hardware (e.g., processing and power consumption for mining execution). The relevant sensing parameters which are either increasing or decreasing with $x$ affect the optimal selection of $x$, which we denote by $\hat{x}$.

## 4.4 Feedback Processing in $\vec{g}$

$\vec{g} = (\{g_i\}_i)$ transforms the sensor measurement values ($f_i$) to monetary values ($g_i$). Thus, $g_i$ has a fixed monetary output in *coins earned per hour* for each parameter where coin is some unit of cryptocurrency, while its input, $f_i$, has a distinct measurement unit for each $i$. Thus, $g_i(f_i(x)) < 0$ yields that the $i$-th parameter is a *cost* parameter reducing the incentive for increasing $x$, and $g_i(f_i(x)) > 0$ yields a *benefit/incentive* for increasing $x$. To control $x$, the control algorithm processes $\vec{g} = (\{g_i\}_i)$, for example, our algorithm in Sect. 5 aggregates them with varying weights for a score.

# 5 Our Framework Implementation in Bitcoin

In this section, we build implementations for our framework in Sect. 4 by providing concrete values to the variables and functions. While this does introduce a concept of “design choice” in which there may exist many interpretations of the formal definition, we do so to show the existence of one instance that maps the formal definition to a proof-of-concept. Doing so allows us the ability to quantitatively optimize the greedy networking problem.

## 5.1 System-Dependent Control and Dynamic Environment

Our framework depends on the mining system and the underlying resources that the dynamic environment uses. For example, a miner's competitiveness (targeting their expected financial income) varies in its own capabilities while the others in the network aggregate their computing power to support the dynamic entries and exits of the participating miners. For example, in Bitcoin, a node in 2019 received 85.16% fewer transaction bytes and 66.44% fewer transactions when compared to 2021 [1]. While our framework in Sect. 4 sufficiently captures the dynamic and system-dependent nature of our modeling (using variables), this section provides a concrete implementation instance by constructing functions and assigning variable values based on our active Bitcoin implementations using multiple distinct mining hardwares.
## 5.2 Parameters for $\vec{f}$

Our Bitcoin prototype senses and monitors parameters as we will describe in Sect. 6.3, including those we set a weight of zero to in $\vec{g}$ (i.e. zero effect on controlling the number of connections). In this section, we identify the sensing parameters we use for our greedy networking prototype in Bitcoin, where the sensing parameters, $\vec{f}$, are still in their native unit of measurement.

Blockchain networking includes the delivery of new blocks and transactions that are critical for mining. To decrease the **block propagation time**, denoted with $\tau$, and receive the block earlier motivates increasing $x$. The reason for this is quite intuitive in that the more peer connections a network has, the more connectivity there will be (which is expected to expedite information delivery). In this regard, we consider $\tau$ to quantify how expedited the block deliveries are (in the native unit of seconds since the block was mined), thus, we will be referring to $\tau$ as a function dependent on $x$ (being input parameter, i.e. $\tau(x)$). The inclusion $\tau$ into the framework is possible since blocks contain timestamp information, and subtracting this from the time that a block is received enables the estimation of block propagation time; something that cannot be directly computed by any other message in the protocol.

For transaction delivery, we denote the size of incoming transactions as $\beta$ bytes per second. We split this into two parts, 1) **number of redundant bytes**, $\beta^R$ (i.e. transactions that are received more than once in our subject node due to our connections being oblivious to what transactions we have already seen), and 2) **unique transaction bytes**, $\beta^U$ (i.e. never-before-seen transactions that are new and immediately added to the transaction memory pool upon being received by our subject node). Therefore, $\beta = \beta^R + \beta^U$, and $\beta^R$ increases as $x$ increases due to duplicate transmissions. At the time of writing, nodes from $x$ are unable to distinguish between seen/unseen transactions.

For mining, we denote a node's **hashrate** (i.e. number of hash computations per second) as $\alpha$, which determines the expected probability of finding a block and thus the expected financial reward amount given some mining time interval. The mining process incurs **power consumption**, which we denote as $\rho$ kilowatt-hours. We additionally sense and measure processing-based metrics such as CPU and memory utilization; however, power consumption, $\rho$, is dependent on both CPU, $\phi$, and memory utilization, $\mu$ (in addition to every other hardware component on the power supply) as $\rho$ monotonically increases with respect to $x$. For $\rho$, we use PowerTOP v2.14 [3] to derive the power output estimation of the machine. Varying $x$, we observe that $\phi(x)$, $\mu(x)$, $\beta^R(x)$, and $\beta^U(x)$ monotonically increase with $\tau(x)$ and $\beta^U(x)$ converging to values as $x$ grows large (diminishing return) and that $\tau(x)$ monotonically decreases with $x$. Our framework uses $\vec{f} = \langle \alpha(x), \tau(x), \rho(x) \rangle$.

## 5.3 Transformation for $\vec{g}$

Since $\vec{f}$ has varying units of measurement specific to each parameter's native unit, transforming from sensor measurements, $\vec{f}$, to a consistent unit of monetary
<table><caption>**Table 1.** Definition of all relevant variables.</caption><thead><tr><th>Name</th><th>Definition</th><th>Name</th><th>Definition</th></tr></thead><tbody><tr><td>x</td><td>Number of peer connections</td><td>ψ</td><td>Block solve interval (s)</td></tr><tr><td>α</td><td>Mining hashrate (hash/s)</td><td>D</td><td>Block difficulty</td></tr><tr><td>τ</td><td>Block propagation time (s)</td><td>P(D)</td><td>Probability a hash is a block</td></tr><tr><td>ρ</td><td>Power usage (kWh)</td><td>Γ</td><td>Block coinbase reward (satoshi)</td></tr><tr><td>β<sup>U</sup></td><td>Unique transaction rate (tx/s)</td><td>π</td><td>Block transaction reward (satoshi)</td></tr><tr><td>β<sup>R</sup></td><td>Redundant transaction rate (tx/s)</td><td>κ</td><td>Electric exchange rate (¢/kWh)</td></tr><tr><td>U</td><td>Utility function (satoshi/h)</td><td>ζ</td><td>Exchange rate (satoshi/$)</td></tr></tbody></table>

value, $\vec{g}$, depends on the Bitcoin mining system and environment. Thus, the definitions of each parameter in $\vec{g}$ must be explicit with regards to the application integrating the framework, e.g. $\tau$ is only relevant in blockchain applications where the monetary reward is proportional to block transmission time. The function that does this modeling is $\vec{g}$.

We identify those environmental parameters independent of $x$ here, as well as list them in Table 1, including those from the Bitcoin protocol, for electricity use in general, and those for converting between the Bitcoin currency to fiat currency. In the Bitcoin protocol, we define the expected block arrival time, $\psi$, to be 600 s (10 min) which is fixed by adjusting Bitcoin's difficulty for mining a block, which we define to be $D$. In Bitcoin, this automatically adapts to the active miner network size (i.e. more nodes mining increases $D$ to fix the average block arrival time to be $\psi = 600$). By design, the probability of finding a block depends on the block difficulty, $D$ [2].

For the mining **hashrate** conversion, $g_1$, the power that gets utilized for mining is able to directly convert back to monetary value. The equation to estimate the mining reward income (coins earned per hour) for solo mining in a PoW scheme is as follows:

$$g_1 = \alpha \times \Gamma \times P \times 3600$$

Increasing **block propagation time** for $g_1$ results in a cost since mining on an outdated block wastes hash computations while using the outdated block before the new block arrives. For example, if the block propagation time is 30 s then that 30-s-transition to the new block can be seen as a loss. The number of hash computations wasted for the outdated block is the product of the **hashrate** ($\alpha$) and **block propagation time** ($\tau$) relative to its expected arrival time ($\frac{\tau}{\psi}$). The expected monetary compensation/income for each hash computation is the product of the reward amount $\Gamma$ and the probability of finding a block per hash computation, $P$. Therefore, multiplying the two and using $-\tau$ (because $\tau$ monotonically decreases with $x$), the monetary loss on the outdated block for delayed block propagation in satoshi per hour is:

$$g_2 = - \frac{\tau \times \alpha \times \Gamma \times P \times 3600}{\psi}$$
Our standard unit for $\vec{g}$ is in the unit of hours, thus, since $\tau$ and $\alpha$ are based in seconds, multiplication by 3600 converts from satoshi per second to satoshi per hour. For Bitcoin, $P(D) = \frac{1}{D \times 2^{32}}$ [2]. At the time of writing, $D \approx 2^{44.19}$ and $\Gamma = (6.25 + \pi) \times 10^8$ satoshi, where $\pi$ is the aggregate of the transaction fees selected by the block.

Outside of the Bitcoin protocol are system-dependent parameters such as **power**. For power in $g_3$, the monetary cost increases with power consumption in price per kilowatt-hour (kWh). We denote $\kappa$ and $\zeta$ as environmental parameters independent of our control variable $x$. More specifically, $\kappa$ is the cents per kWh in USD (where $\frac{\kappa}{100}$ is the dollars per kWh) with $\zeta$ being the exchange rate for the coin. At the time of writing, $\frac{\kappa}{100} = \$0.1105$, and $\zeta = 6.325 \times 10^{-4}$. The equation to convert from power usage to satoshi per hour is as follows:

$$g_3 = - \frac{\frac{\kappa}{100} \times \rho \times 3600}{\zeta}$$

Putting them together for processing $\vec{g}$, we compute our utility function as the aggregation of $\vec{g}$. $g_1$ is the income-based mining incentive earned from mining and therefore $g_1 > 0$. $g_2$ is the lost income due to block propagation delay, $g_2 \le 0$. Similarly, $g_3$ is the power cost to run such a node, so $g_3 < 0$, hence, the negations in $g_2$ and $g_3$ denote costs or disincentives, while $g_1$ is a benefit. Combining these parameters, we define our utility function, $U(x) = \sum_i g_i(f_i(x))$ where the optimal number of peer connections can be defined as:

$$\hat{x} = \operatorname{argmax}(U(x))$$

In the following sections, we discuss our implementation and experiment-based computation of $\hat{x}$ to derive the optimal greedy networking behavior.

# 6 Implementation and Analyses

Our framework models the rational strategy by analyzing multiple parameters for the dynamic environment (described in Sect. 5.1) that give us insight into greedy networking and connectivity optimization. We build our experimentation around 275 parameters that we log in our Bitcoin prototype and identify those that are the most relevant for greedy networking, which are $\alpha$, $\tau$, and $\rho$. The rest of this section discusses our implementation and the resulting analysis from the implementation.

## 6.1 Greedy Networking Implementation

To deviate from the default protocol and implementation limiting outbound peer connections, we modify the source code of Bitcoin Core (version 0.21.0), which involves minimal code change after identifying the relevant data parameters. For example, while Bitcoin Core already contains the *maxconnections* configuration parameter to enable peers to specify their own upper bound in peer connections,
<figure><img src="image_5.png" /><figcaption>**Fig. 3.** Our experimental setup with varying computational capabilities. We test with two CPUs (□), one GPU (○), and two ASICs (■), defined in Table 2.</figcaption></figure>

these are inbound connections only (i.e. the subject node must wait for other nodes to connect to it). Consequently, this can only be used when the node chooses to be public and enables incoming connections. We add a new configuration, *minconnections*, to specify the lower bound for the number of outbound connections (i.e. a non-public node can define an arbitrary connection quantity that will be pro-actively achieved), which has previously been fixed to 10.

## 6.2 Experimental Setup and Reference Measurements Varying Mining Computing

Figure 3 provides a high-level overview of our experimental setup where we connect multiple miner types in processing units to a miner networking host machine. For this networking machine, our implementation makes use of a 4-core Intel Core i7 6700K processor with 8 threads and 16 GBs of RAM; for the networking machine, the operating system we use is Linux Mint 20, and the parameters are logged with our modified Bitcoin Core instance using C++17 and Python 3.7.

Varying the computational capabilities of the miner is important for analysis as it influences the optimal mining behavior due to its correlation with hashrate and mining income. Table 2 enumerates our experimental setup from Fig. 3 by defining the machine type and specifications, along with the hashrate of the device and total power consumption when maintaining the hashrate. We derive all values in Table 2 through our experimentation which is then used to derive the optimal behavior in the last column (introduced in Sect. 6.5).

## 6.3 Bitcoin Networking Sensor and Logging

The Bitcoin networking protocol has a protocol-defined set of 18 actively used signaling traffic message types [2]. The default Bitcoin Core keeps these messages private from the node operator with the exception of blocks, transactions, and ping/pong transmissions (for node latency). Therefore, we build and implement our message logger within Bitcoin's interface with the network and its corresponding RPC controller (*net-processing.cpp* and *net.cpp*, respectively). Upon a message transmission on the receiver's end, we log the number of bytes for
<table><caption>**Table 2.** The device resources and computational capabilities (in ascending order) used in our experimentation.</caption><thead><tr><th>Type</th><th>Processor/Model</th><th>α (hash/s)</th><th>ρ (kWh)</th><th>Optimal strategy, x̂</th></tr></thead><tbody><tr><td>CPU (Intel Core i7-6700K, 4 GHz)</td><td></td><td>2<sup>19.07</sup></td><td>0.08145</td><td>0.5997</td></tr><tr><td>CPU (Intel Core i7-11800H, 2.60 GHz)</td><td></td><td>2<sup>20.19</sup></td><td>0.02978</td><td>0.6703</td></tr><tr><td>GPU (NVIDIA GeForce GTX 1660S)</td><td></td><td>2<sup>30.80</sup></td><td>0.09385</td><td>16.87</td></tr><tr><td>ASIC (Rev 3 GekkoScience NewPac)</td><td></td><td>2<sup>36.20</sup></td><td>0.1678</td><td>112</td></tr><tr><td>ASIC (MicroBT Whatsminer M32)</td><td></td><td>2<sup>45.70</sup></td><td>75.48</td><td>3060</td></tr></tbody></table>

<table><caption>**Table 3.** Measurement values while varying the number of connections, *x*, from our experiment. The table shows the average and the 95% confidence intervals.</caption><thead><tr><th></th><th>x = 1</th><th>x = 8</th><th>x = 64</th><th>x = 512</th><th>Line of best fit</th></tr></thead><tbody><tr><td>α(x)</td><td>2<sup>20.19</sup> ± 6909</td><td>2<sup>20.19</sup> ± 6352</td><td>2<sup>20.12</sup> ± 5760</td><td>2<sup>19.57</sup> ± 5874</td><td>-6.873 × 10<sup>5</sup> × x<sup>0.161</sup> + 2.62 × 10<sup>6</sup></td></tr><tr><td>τ(x)</td><td>30.94 ± 2.434</td><td>25.3 ± 1.667</td><td>22.84 ± 1.284</td><td>19.18 ± 0.3826</td><td>1.818 × 10<sup>-5</sup> × x<sup>0.3369</sup> + 3.149 × 10<sup>-5</sup></td></tr><tr><td>ρ(x)</td><td>5.165 × 10<sup>-5</sup> ± 1.121</td><td>6.665 × 10<sup>-5</sup> ± 1.15</td><td>11.74 × 10<sup>-5</sup> ± 1.765</td><td>21.04 × 10<sup>-5</sup> ± 2.138</td><td>324.7 × x<sup>-1.802</sup> + 22.72</td></tr><tr><td>β<sup>U</sup>(x)</td><td>3.3621 ± 0.09321</td><td>3.476 ± 0.09176</td><td>3.457 ± 0.0898</td><td>3.689 ± 0.09445</td><td>0.01062 × x<sup>0.5349</sup> + 3.386 × 10<sup>4</sup></td></tr><tr><td>β<sup>R</sup>(x)</td><td>0.009209 ± 0.002557</td><td>0.066 ± 0.01523</td><td>0.4481 ± 0.1081</td><td>1.145 ± 0.7849</td><td>0.09557 × x<sup>0.4136</sup> - 0.1122</td></tr></tbody></table>

each message, the number of CPU clock cycles taken to process the message, and a counter to keep track of how many times each message has been received from the time that the node initially started, all of which can be accessed with our new RCP command, *getmsginfo*. For our experiment, we vary the number of peer connections, *x*, using the *minconnections* configuration parameter. Given *x*, the Bitcoin node selects its nodes randomly according to its random peer selection algorithm [14], and we periodically reset/restart the peer selections every 100 min (10 block arrivals on average) to sample and experiment with a new set of peer connections<fnref n="1" />. Our experimental measurements spanned 444 d with a resulting 88.8 GB of data.

## 6.4 Experimental Results

Figure 4a visualizes the block propagation time, $\tau(x)$. When *x* increases we see a decrease in the block propagation time due to a shorter path to the random block solver. The line of best-fit approximation based on minimizing the root mean squared error is in Table 3. Despite the long logging window, $\tau$ suffers great variation in block propagation time and as such, the confidence interval converges towards a range rather than a singular value. Figure 5a shows the individual distributions of $\tau(x)$ and we find that, for smaller values of *x*, the distribution of $\tau$ yields greater variance. Similarly, when $\tau = 512$, the top 95%

<footnote n="1">¹ For larger values of *x*, we modify/etc./security/limits.conf to increase the file limit. For our experiments, *x* is composed of outbound connections only. More concretely, we disable the random inbound connections and control the number of outbound connections for our experimental measurements.</footnote>
<figure><img src="image_6.png" /><figcaption>Fig. 4. Block propagation time delay, $\tau$, and transaction rates, $\beta$.</figcaption></figure>

quantile is 25 s, and the lower 5% quantile is 13.08 s. Comparing this with $x = 1$, we find that the 95% and 5% quantiles are 98 and 14.5 s, respectively, thus, there is a more stable and faster block delivery time for larger $x$, as hypothesized in Sect. 5.2.

We also include the rate at which transactions are received (in bytes per second or B/s), $\beta$, by our subject node in Fig. 4b. Due to the increase in connectivity, new information is received faster and $\beta^U(x)$ quickly converges towards $c$, the rate of transaction submissions in the network. We find that $c \approx 3.496$ B/s. $\beta^R(x)$ continues to increase because the Bitcoin Core v0.21.0 protocol does not have a mechanism to distinguish between the transactions that have already been seen by our node and those which have not (unlike blocks that depend on the flooding of block headers). From these results, we discover that there exists a critical point in $U(x)$ where $x$ loses incentive when it increases past this threshold.

## 6.5 Greedy Networking Analyses Results

Our experimental measurements are aggregated for the utility function as described in Sect. 5.3, i.e., $U = g_1 + g_2 + g_3$, which yields a polynomial line-of-best-fit approximation of:

$$U(x) = a_1x^{b_1} + a_2x^{b_2} + a_3x^{b_3} + a_4x^{b_4} + c$$

where $a_1 = 3.791 \times 10^{-8}$, $b_1 = -1.802$, $a_2 = 1.395 \times 10^{-11}$, $b_2 = -1.641$, $a_3 = -1.546 \times 10^{-9}$, $b_3 = 0.161$, $a_4 = -3.176 \times 10^{-11}$, $b_4 = 0.3369$, and
<figure><img src="image_7.png" /><figcaption>**Fig. 5.** Distribution of block propagation time, $\tau$, along with utility function $U$.</figcaption></figure>

$c = 3258$. Figure 5b shows $\tilde{g}(\tilde{f}(x))$ when $\alpha = 2^{30.8}$ for the GPU, GeForce GTX 1660S as specified in Table 2, and shows that there is an optimal maximum, $\hat{x}$, at 16.87 peer connections (which can be rounded to 17, and is greater than Bitcoin's default value of 10 outbound connections). Using this mining device as our control with $\alpha$ being varied to change $\hat{x}$, we find that for lower hashrates, $\forall x, U(x) < 0$. This occurs when $\alpha \le 2^{28.23} \approx 315$ MH/s using our experimental parameters. Thus, all the computing units we test would be more costly than beneficial, yielding a negative net income because Bitcoin mining has an increasingly competitive nature as there are a greater number of nodes participating in mining [8,26].

# 7 Related Work in Greedy Networking

## 7.1 Greedy Strategies in Cryptocurrency

Previous research in greedy/rational mining strategies (incentive-compatible but destructive to the network) controls the timing/conditions of the block submissions, e.g., selfish mining [12, 13, 21, 23] or block withholding [6, 7, 13, 17, 22]. Other rational mining strategies include controlling the mining power and selectively turning off mining [8,25]. Our work is different since greedy networking controls an orthogonal parameter (the number of network connections).

## 7.2 Security Threats on Cryptocurrency Networking Connections

This paper is the first to study a node's greedy networking by increasing the number of its own networking connections in the cryptocurrency context (Sect. 7.3
describes greedy networking in general P2P networks beyond cryptocurrency). Other previous research studied threats based on compromising/occupying the other cryptocurrency node's connections (the victim node(s), distinct from the subject node launching the threat). Prominent studies include eclipse attack (to control the information to/from the victim node, enabling the attacker to reverse a block and launch a double-spending attack) [14,21] and partitioning attack (to partition the cryptocurrency network to prevent the network-wide block/ledger synchronization) [4,24]. Our work is different from these previous studies on the security threats attacking other cryptocurrency nodes in that our work considers the node's self strategy to improve its own unfair advantage. Furthermore, the eclipse attack is no longer considered practically feasible due to the measures and bug patches Bitcoin and cryptocurrency implementations took after the threat/exploit discovery [14,24], and partitioning attack is relatively difficult for the attacker to implement due to its requirement to compromise or manipulate the routing of the autonomous systems (AS). In contrast, greedy networking is currently applicable, incentivized, and requires only changes in the node's own implementation, as demonstrated by our proof-of-concept implementation from Sect. 6.1.

## 7.3 Greedy Networking in P2P Networks

Greedy networking has been studied in the general P2P community beyond cryptocurrency. In [28] the authors analyze the peer selection algorithm and probabilistic transmission in favor of Bitcoin information propagation time. They find that the optimal strategy exists in the NP-hard space, and instead propose a greedy probabilistic strategy to decrease the transaction propagation times in Bitcoin. While the authors propose a new information transmission protocol, our work utilizes the networking protocol of current PoW-based blockchains and does so with the inclusion of two additional parameters.

To further highlight the importance of greedy networking, [10, 16, 18], and [11] propose new incentive mechanisms designed to function on the information propagation layer of the subnet. These schemes increase the need to divert from the honest strategy in favor of a more financially rewarding strategy, however, [10,16], and [18] propose network-based optimization and incentive strategies that do not apply to blockchain and PoW. The authors in [11] consider blockchain-based networking overhead as the cost but do not apply them to greedy behaviors. Similarly, [15] proposes a mechanism for determining a node's connectivity to the network but does not analyze its influence on an incentive-based blockchain architecture, which we focus on.

# 8 Discussion About Security Relevance and Future Work

Greedy networking in blockchain and cryptocurrency is relevant to security because it provides an unfair advantage to the miners violating the integrity/fairness of the PoW consensus protocol design (the focus of this paper)
and because it can have a negative impact on the network by causing excessive networking/broadcasting overhead impacting the network availability (beyond the scope of this paper).

Our work considers a node's own incentives to modify its peer connections. As stated by [27] and [9], described in Sect. 3, the concern lies in the nodes individually increasing their peer connections beyond the default protocol for an unfair networking advantage. We discover and highlight that continuing to increase the peer connections is not optimal for incentive-driven miners, in contrast to the previous belief in blockchain and cryptocurrency.

However, our work does not consider the networking impact of the greedy networking behavior beyond the individual node perspective. Many nodes practicing greedy networking can excessively increase the broadcasting repetition and overhead. Such greedy networking can be detrimental to the network by yielding congestion and thus disrupting the availability for other nodes [27]. We leave such network-level analyses, including greedy networking by multiple miner nodes and the Nash equilibrium, for future work.

## 9 Conclusion

Rational mining and incentivization are important in cryptocurrencies since the cryptocurrency integrity (for example, against revoking transactions and double-spending) relies on the networking node participation driven by the financial incentives/rewards. In this work, we propose a framework to study greedy networking and control the number of peer connections with respect to connectivity in the cryptocurrency application. We implement the framework on an active Bitcoin prototype connected to the Mainnet and vary the computing units. Our results show that a rational greedy networking miner will not continue to increase its peer connections, in contrast to the previous belief, and that the optimal number of connections depends on the hash computing capabilities of the miner. We shed light on the greedy networking behavior in cryptocurrency/PoW blockchains to facilitate further research in advancing and aligning the incentives for blockchain networking and consensus protocols.

**Acknowledgment.** This material is based upon work supported by the National Science Foundation under Grant No. 1922410.

## References

1. Blockchain charts. https://www.blockchain.com/charts#network

2. Protocol documentation. https://en.bitcoin.it/wiki/Protocol_documentation

3. Powertop (2020). https://01.org/powertop

4. Apostolaki, M., Zohar, A., Vanbever, L.: Hijacking bitcoin: routing attacks on cryptocurrencies. In: 2017 IEEE Symposium on Security and Privacy (SP), pp. 375–392. IEEE (2017)

5. Cap, C.M.: Crypto-currency market capitalizations (2015). https://coinmarketcap.com
6. Chang, S.Y.: Share withholding in blockchain mining. In: Park, N., Sun, K., Foresti, S., Butler, K., Saxena, N. (eds.) Security and Privacy in Communication Networks, pp. 161–187. Springer International Publishing, Cham (2020). https://doi.org/10.1007/978-3-030-63095-9_9

7. Chang, S.-Y., Park, Y., Wuthier, S., Chen, C.-W.: Uncle-block attack: blockchain mining threat beyond block withholding for rational and uncooperative miners. In: Deng, R.H., Gauthier-Umaña, V., Ochoa, M., Yung, M. (eds.) ACNS 2019. LNCS, vol. 11464, pp. 241–258. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-21568-2_12

8. Chang, S.Y., Wuthier, S.: Dynamic power control for rational cryptocurrency mining. In: Proceedings of the 3rd Workshop on Cryptocurrencies and Blockchains for Distributed Systems, pp. 47–52 (2020)

9. Claris: how do block explorers determine propagation through nodes/p2p protocol?. https://bitcoin stackexchange.com/a/80877/128178

10. Drucker, F.A., Fleischer, L.K.: Simpler sybil-proof mechanisms for multi-level marketing. In: Proceedings of the 13th ACM conference on Electronic commerce, pp. 441–458 (2012)

11. Ersoy, O., Ren, Z., Erkin, Z., Lagendijk, R.L.: Transaction propagation on permissionless blockchains: incentive and routing mechanisms. In: 2018 Crypto Valley Conference on Blockchain Technology (CVCBT), pp. 20–30. IEEE (2018)

12. Eyal, I., Sirer, E.G.: Majority is not enough: bitcoin mining is vulnerable. In: Christin, N., Safavi-Naini, R. (eds.) FC 2014. LNCS, vol. 8437, pp. 436–454. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-662-45472-5_28

13. Gao, S., Li, Z., Peng, Z., Xiao, B.: Power adjusting and bribery racing: novel mining attacks in the bitcoin system. In: Proceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security, pp. 833–850. CCS ’19, Association for Computing Machinery, New York (2019). https://doi.org/10.1145/3319535.3354203. https://doi.org/10.1145/3319535.3354203

14. Heilman, E., Kendler, A., Zohar, A., Goldberg, S.: Eclipse attacks on bitcoin’s peer-to-peer network. In: 24th {USENIX} Security Symposium ({USENIX} Security 15), pp. 129–144 (2015)

15. Hong, H.J., et al.: Robust p2p connectivity estimation for permissionless bitcoin network. In: 2021 IEEE/ACM 29th International Symposium on Quality of Service (IWQOS), pp. 1–6. IEEE (2021)

16. Kleinberg, J., Raghavan, P.: Query incentive networks. In: 46th Annual IEEE Symposium on Foundations of Computer Science (FOCS’05), pp. 132–141. IEEE (2005)

17. Kwon, Y., Kim, D., Son, Y., Vasserman, E., Kim, Y.: Be selfish and avoid dilemmas: fork after withholding (faw) attacks on bitcoin. In: Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, pp. 195–209 (2017)

18. Li, C., Yu, B., Sycara, K.: An incentive mechanism for message relaying in unstructured peer-to-peer systems. Electron. Commer. Res. Appl. 8(6), 315–326 (2009)

19. Nakamoto, S.: Bitcoin: A Peer-to-peer Electronic Cash System. Tech. rep, Manubot (2019)

20. Nakamoto, S., Bitcoin, A.: A peer-to-peer electronic cash system. Bitcoin, 4 (2008). https://bitcoin.org/bitcoin.pdf

21. Nayak, K., Kumar, S., Miller, A., Shi, E.: Stubborn mining: Generalizing selfish mining and combining with an eclipse attack. In: 2016 IEEE European Symposium on Security and Privacy (EuroS P), pp. 305–320 (2016). https://doi.org/10.1109/EuroSP.2016.32
22. Rosenfeld, M.: Analysis of bitcoin pooled mining reward systems (2011). arXiv preprint arXiv:1112.4980

23. Sapirshtein, A., Sompolinsky, Y., Zohar, A.: Optimal selfish mining strategies in bitcoin. In: Grossklags, J., Preneel, B. (eds.) FC 2016. LNCS, vol. 9603, pp. 515–532. Springer, Heidelberg (2017). https://doi.org/10.1007/978-3-662-54970-4_30

24. Tran, M., Choi, I., Moon, G.J., Vu, A.V., Kang, M.S.: A stealthier partitioning attack against bitcoin peer-to-peer network. In: 2020 IEEE Symposium on Security and Privacy (SP), pp. 894–909 (2020). https://doi.org/10.1109/SP40000.2020.00027

25. Tsabary, I., Eyal, I.: The gap game. In: Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, pp. 713–728. CCS ’18, Association for Computing Machinery, New York (2018). https://doi.org/10.1145/3243734.3243737, https://doi.org/10.1145/3243734.3243737

26. Wuille, P.: Bitcoin network graphs. http://bitcoin.sipa.be

27. Wuille, P.: How does one attain 1,000+ connections like blockchain.info?. https://bitcoin stackexchange.com/a/8140/128178

28. Zhang, H., Feng, C., Wang, X.: A greedy-based approach of fast transaction broadcasting in bitcoin networks. In: Proceedings of the ACM Turing Celebration Conference-China, pp. 1–5 (2019)