# AirCon: Over-the-Air Consensus for Wireless Blockchain Networks

Xin Xie,Cunqing Hua, Pengwenlong Gu, and Wenchao Xu, X. Xie and C. Hua are
with the School of Cyber Science and Engineering, Shanghai Jiao Tong
University, Shanghai 200240, China.
E-mail<EMAIL_ADDRESS><EMAIL_ADDRESS>P. Gu is with the
Department INFRES, LTCI, Telecom Paris, Institut Polytechnique de Paris,
France. E-mail<EMAIL_ADDRESS>Xu is with the Department of Computing, The Hong
Kong Polytechnic University, Hong Kong, China. E-mail:
<EMAIL_ADDRESS>
###### Abstract

Blockchain has been deemed as a promising solution for providing security and
privacy protection in the next-generation wireless networks. Large-scale
concurrent access for massive wireless devices to accomplish the consensus
procedure may consume prohibitive communication and computing resources, and
thus may limit the application of blockchain in wireless conditions. As most
existing consensus protocols are designed for wired networks, directly apply
them for wireless users may exhaust their scarce spectrum and computing
resources. In this paper, we propose AirCon, a byzantine fault-tolerant (BFT)
consensus protocol for wireless users via the over-the-air computation. The
novelty of AirCon is to take advantage of the intrinsic characteristic of the
wireless channel and automatically achieve the consensus in the physical layer
while receiving from the end users, which greatly reduces the communication
and computational cost that would be caused by traditional consensus
protocols. We implement the AirCon protocol integrated into an LTE system and
provide solutions to the critical issues for over-the-air consensus
implementation. Experimental results are provided to show the feasibility of
the proposed protocol, and simulation results to show the performance of the
AirCon protocol under different wireless conditions.

###### Index Terms:

Consensus protocol, Over-the-air computation, Wireless blockchain network,
Lattice coding

##  1 Introduction

The next-generation wireless networks are expected to provide ubiquitous
access to heterogeneous devices with ultra-high throughput, reliability, and
extremely low latency [1]. This will bring great challenges to the security
management in current 4G/5G mobile systems. Blockchain, a generic distributed
ledger technology (DLT), has received extensive attention due to the
significant advantages from decentralization, immutability, and security in
recent years. The blockchain technology enables registering and updating
transactions in a decentralized fashion via consensus among participants,
which has become the foundation of new security architecture for future
wireless networks.

The consensus protocol plays an important role in the blockchain system. The
efficiency of the consensus protocol determines blockchain system security
bounds (fault tolerances) and performance such as transaction throughput,
delay, and node scalability[2]. Among many consensus protocols, the proof-
based algorithm (PoX) is often used in a public chain, such as proof-of-work
(PoW)[3], proof-of-stake (PoS)[4], whereby participants can join/leave the
network without authentication. These PoX-based consensus protocols achieve
good scalability with the cost of high resource consumption. For instance, the
PoW protocol employed in Bitcoin consumes a huge amount of power resources to
compute a meaningless hash value. And the confirmation delay and throughput of
these consensus protocols also limit the application scenario. The voting-
based consensus protocols, such as PBFT[5], RAFT[6], relies heavily on inter-
participant communications to achieve consensus. Therefore, the communication
resource is critical for the voting-based protocols, which can only be
applicable for small/middle scale networks.

Most of the existing consensus protocols are primarily designed over wired
communication networks, some new challenges may arise when they are deployed
in wireless networks. First, wireless devices usually have limited resources
(energy, storage, computation, etc.), so the resource-consuming PoX protocols
are not suitable. Second, the wireless communication channel condition varies
dynamically, not to mention that users often suffer from limited bandwidth
resources, which significantly affects the consensus performance, especially
for the voting-based protocols.

As a solution, the wireless channel features can be utilized to offer a
solution to this dilemma. For the voting-based protocols, a block is generated
based on the decision from the majority participants[7]. For instance, in the
PBFT protocol, each participant determines the consensus results by counting
the number of messages with consistent hash from other participants. For
traditional “communicate-then-consensus” solutions, the consensus process can
be conducted only after all messages from other participants are successful
received and decoded. Instead of collecting messages from all participants,
the consensus process only require the result of a function of these messages,
e.g., the number of messages with consistent hash from other participants,
rather than the details bits of each message. Therefore, a “communicate-and-
consensus” scheme can be adopted to reduce the communication and computational
complexity. Specifically, the communicating and consensus tasks can be
accomplished simultaneously by leveraging the over-the-air computation
(AirComp) technology[8] in wireless networks, which is a novel technology that
exploits the superposition property of wireless multiple access channel (MAC)
to aggregate signals from multiple participants over the same wireless
channel. In this way, the destructive interferences from different
participants are turned into a constructive one by appropriately matching the
structure of the wireless channel and the function of the signals can be
computed from the aggregated signal.

In this paper, we propose “AirCon”, an over-the-air consensus protocol for
wireless networks, which significantly reduces the communication and
computational overhead in a wireless network by using the AirComp technique.
The novelty of this protocol is two-folded. First, the hash symbols of all
participating users are encoded using lattice codes and transmitted to the
base station (BS) simultaneously over the same wireless spectrum via the
AirComp technique, which greatly reduces the wireless resource usage. Second,
by leveraging the structural property of the lattice codes, each user can
verify the consistency of its hash value with respect to the aggregated hash
symbols without decoding the signal, whereby the consensus can be achieved
with extreme low computational complexity.

To show the feasibility of the AirCon protocol, we implement AirCon on an LTE
system, where two key issues are solved: 1) Synchronization problem, which is
the key to ensure that all participants transmit data in the same frequency
simultaneously such that the signals can be accurately aligned at the BS. We
will discuss the details of LTE synchronization mechanisms and show that these
intrinsic mechanisms are sufficient for satisfying the synchronization
requirement for the implementation of AirComp in an LTE system. 2) Uplink
channel estimation and feedback problem. The participants need to learn the
uplink channel state information (CSI) so that the channel fading can be pre-
compensated. To this end, we propose a flexible reference symbol assignment
scheme, which achieves a better tradeoff between estimation accuracy and
estimation latency.

The main contributions of the paper are summarized as follows:

  * •

We propose a novel AirComp-based consensus protocol (AirCon), which enables
all participants to transmit their hash symbols to the BS simultaneously using
the same wireless channel, and thus significantly reduces the communication
cost of consensus messages.

  * •

We propose a hash consistency verification scheme in the physical layer,
wherein each participant determines whether its hash value is consistent with
the aggregated hash symbols or not without decoding the signal, which
significantly reduces the complexity of consensus computation.

  * •

We implement AirCon based on srsLTE111The latest version of srsLTE has been
renamed as srsRAN and to support 5G standards.[14], an open-source LTE soft
defined radio (SDR) platform. Extensive experiments are conducted to validate
the practical performance of AirCon in a real-world LTE testbed. We also
provide simulation results to evaluate the performance of the proposed schemes
under more general network conditions.

The rest of this paper is organized as follows. In Section 2, we discuss the
research progress in blockchain-enabled wireless networks and the AirComp
technique. In Section 3, we introduce the system model and propose a modified
PBFT-based over-the-air consensus (AirCon) procedure for wireless blockchain
systems. The detailed design of AirCon protocol is presented in Section 4 and
the details for implementation of AirCon in the LTE system are discussed in
Section 5. Experimental and simulation results are provided in Section 6.
Finally, we summarize this work in Section 7.

##  2 Related Works

In this section, we give a brief introduction to the research progress on
blockchain-enabled wireless networks and AirComp technique.

###  2.1 Blockchain-enabled wireless networks

Blockchain has been studied extensively in literature as a security and
privacy protection scheme for various application scenarios in wireless
networks. In [15], the authors examined the application of blockchain in the
Internet of things (IoT). They concluded that the blockchain-IoT combination
is powerful and can lead to significant transformations across several
industries. Blockchain technology also can be applied in the internet of
vehicles[16] to provide cybersecurity protection for vehicular communications,
including the dynamic control of source reliability, and the integrity and
validity of the information exchanged. The incorporation of blockchain into
the next-generation radio access network (RAN) also attracted great interest.
A unified framework of the blockchain radio access network (B-RAN) was
proposed in[17] as a trustworthy and secure paradigm for upcoming 6G
networking. Some critical elements of B-RAN, such as the deployment of smart
contract[18], trustworthy access[19, 20], mathematical modeling[21] were also
explored.

Due to the resource-limited feature of wireless devices, the blockchain system
needs to be improved for the wireless environment. The authors in[17] proposed
proof-of-devices (PoD) as a low-cost consensus protocol, which is based on the
fact that B-RAN is comprised of a tremendous number of devices and attackers
cannot control $51\%$ devices of the whole network. In an edge computing
scenario, the authors in [22] consider constructing a collaborative mining
network (CMN) to execute mining tasks for mobile blockchain. Miners can
offload their mining tasks to non-mining devices within a CMN when the
resources are insufficient. The authors in [23] proposed a lightweight
blockchain system to reduce the computational cost and speed up the block
generation rate in the industrial IoT (IIoT).

On the other hand, some research works were concerned with the impact of a
wireless channel on blockchain performance. In[24], the authors analyzed the
trade-off between communication reliability and computing power in blockchain
security and presented a lower bound to the computing power that is needed to
conduct an attack with given communication reliability. Based on the widely
used CSMA/CA mechanism, the impact of communication transmission delay on the
confirmation delay, transaction per second, and transaction loss probability
is analyzed in [25]. The authors in [26] analyzed the impact of node
geographical distribution in the spatial domain and designed an algorithm to
determine the optimal full-function node deployment. In [2], the authors
evaluated the impact of scarce frequency spectrum resources on blockchain
performance.

###  2.2 Over-the-air computation

In this paper, we design a novel consensus protocol based on the AirComp
technology, which exploits the intrinsical superposition property of the
wireless channel to achieve efficient transmissions of multiple users. AirComp
was proposed by B. Nazer and M. Gastpar in their cornerstone work[8], where an
optimal joint source-channel strategy was developed to reliably reconstruct a
function of sources over a multiple-access channel. Early research works of
AirComp took on the information-theoretic view and focuses on the achievable
computation rate under structured coding schemes. The transmission strategy
under different source distribution was explored in [27, 28, 29]. The authors
in [27, 28] employed lattice codes to efficiently compute the sum of source
signals over MACs. Some recent research efforts have been made to study
AirComp from other aspects. The authors in [30, 31] considered a more general
power-limited scenario where some devices cannot fully compensate for channel
fading, then a threshold-based power-control policy was proposed to minimize
the mean square error (MSE) of the whole system. Multifunction computation was
achieved by using AirComp in a multiple antenna system, beamforming strategies
have been designed in [32, 33] to achieve optimal performance. In[34], the
blind AirComp technique was proposed for low-complexity and low-latency
wireless networks, which does not require channel state information for
AirComp.

The AirComp technique can be applied in a wide range of application scenarios.
In[10, 11], AirComp was proposed for fast data fusion, whereby the fusion
center (FC) attempts to compute a specific function from the data of all
sensor nodes (e.g., average reading). AirComp also has been extended for model
aggregation in the distributed edge learning system [35, 36, 37], which is
shown to reduce the communication latency without significant loss of the
learning accuracy[38]. In a multi-agent system, AirComp can be used for
distributed consensus control[39, 40] to reach an agreement over a set of
variables of common interest, such as velocity, acceleration, and trajectory
in vehicular platooning. Our work extends the application of AirComp to the
consensus protocol in wireless blockchain systems.

Despite the extensive theoretical work in literature, the research on the
implementation issues for AirComp is relatively scarce. In[10] and [11], the
authors proposed to modulate the value to be computed through AirComp as the
mean value or power of a random sequence, so the accurate synchronization and
CSI is not necessary for implementing the AirComp technique. In [12], the
authors proposed to achieve system synchronization via the “AirShare” scheme
[41], and the uplink CSI was obtained by using channel reciprocity between
uplink and downlink transmissions. In [13], the uplink CSI was obtained by
feedback from the fusion center. These implementation schemes were designed
for analog function computation (AFC) in a wireless network. In this paper, we
implement the AirComp technique based on the universal LTE system, which
demonstrate that AirComp can be realized in the current digital communication
systems.

##  3 System model

Figure 1: Blockchain-enabled wireless network model. Figure 2: Diagram of the
over-the-air consensus protocol. Hash verification for the generated block is
achieved through the BS using the multiple access and broadcast channels.

We consider a blockchain-enabled wireless network as illustrated in Fig. 1,
where a set of $K$ users are served by a BS. These users maintain the same
blockchain. The transaction blocks are generated periodically based on a
consensus protocol, and stored in a distributed manner in all users.

In a blockchain system, the block appending procedure can be separated into
three stages: Request, Consensus and Confirm, as shown in Fig. 2. Our work
focus on the consensus step and the other two steps are the same as the
traditional blockchain systems.

Request: the client sends a request to the primary user to trigger a
transaction. After collecting enough transactions, the primary user generates
a candidate block and broadcasts it to other replica users and requests to
start the consensus procedure 222We assume that the primary user is always
honest. If other users or clients detect some malicious behavior from the
primary user (such as broadcasting some illegal transactions), view change
procedures[5] can be triggered to replace the primary user.

Consensus: The consensus protocol in Fig. 2 is a revision of the PBFT protocol
for wireless networks, which consists of four phases as follows:

  * •

Pre-prepare: After receiving the candidate block and request from the primary
user, all replica users verify the transactions of the candidate block, then
send the hash symbols of candidate blocks to the BS in the same uplink channel
and enter the prepare phase. Note that user-specific information (such as user
ID) should not be included in the generation of the hash value.

  * •

Prepare and Commit: The BS obtains the superposed hash symbols and broadcasts
them to all users. All replica users adopt a threshold-based two-round hash
verification method to determine the consensus result.

  * •

Reply: Only those users satisfying the threshold return the reply message to
the primary user through the BS. If more than $\lceil{K/2}\rceil$ users return
the message, the primary user determines that the consensus has been achieved.

Confirm: If the consensus has been achieved, the primary user sends a confirm
message to the BS, which is broadcast to all replica users and the client,
then the candidate block is appended in each blockchain which is
distributively stored at each replica user.

The bottleneck of the consensus protocol shown in Fig. 2 lies in the _Prepare_
and the _Commit_ phases. In the traditional hash cross-validation, the hash
value generated by different users should be transmitted to each other via
orthogonal wireless channels (such as TDMA, FDMA, or OFDMA in 4G/5G networks).
Therefore, the wireless resource usage in these two phases increases with the
number of participating users, which cannot guarantee reliable and low latency
consensus for larger network size.

##  4 AirCon Protocol Design

In this section, we propose a novel over-the-air consensus (AirCon) protocol
to address the transmission bottleneck problem in the _Prepare_ and the
_Commit_ phases based on the AirComp and the lattice coding techniques. The
idea is to modulate the hash bits of different users using the lattice codes,
which can be transmitted simultaneously to the BS over the same wireless
channel. Due to the structural property of the lattice codes, the BS can adopt
the AirComp technique to aggregate the linear combination of all codes (which
is a codeword itself), and forwards it back to all users, which can be used by
each user to make a consensus decision without decoding the signal.

In the following, we first introduce the preliminary background on the AirComp
and lattice coding techniques. We then present the hash consistency
verification scheme based on these two techniques, with which a two-round
consensus procedure for the AirCon protocol is designed.

###  4.1 Over-the-air computation

We consider an OFDM-based wireless system, which consists of a single BS and a
set of $K$ users. All users transmit signals to the BS through the same uplink
channel. The received signal at the BS is expressed as:

$\mathbf{y}=\sum_{k=0}^{K-1}\mathbf{H}_{k}\mathbf{B}_{k}\mathbf{x}_{k},$ (1)

where $\mathbf{x}_{k}\in\mathbb{C}^{N\times 1}$ is the symbol vector
transmitted by user $k$ with the covariance matrix
$\mathbb{E}\\{\mathbf{x}_{k}\mathbf{x}_{k}^{H}\\}=\mathbf{I}$, where
$\mathbf{I}$ is the identity matrix.
$\mathbf{B}_{k}=\texttt{Diag}\\{b_{k0},b_{k1},\cdots,b_{kN-1}\\}\in\mathbb{C}^{N\times
N}$ is the pre-processing matrix for user $k$.
$\mathbf{H}_{k}=\texttt{Diag}\\{h_{k0},h_{k1},\cdots,h_{kN-1}\\}\in\mathbb{C}^{N\times
N}$ is the channel matrix from user $k$ to the BS. $N$ is the total number of
sub-carriers. $K$ is the total number of users. The superscript $(\cdot)^{H}$
denotes Hermitian transpose.

Under the condition that each user $k$ has perfect knowledge of
$\mathbf{H}_{k}$, and its transmit power is not bounded, then the channel
fading can be pre-compensated by a simple channel-inversion operation as
$\mathbf{B}_{k}=\mathbf{H}_{k}^{-1}$. In this way, the signals transmitted by
all users will be aggregated at the BS as follows:

$\mathbf{y}=\sum_{k=0}^{K-1}\mathbf{x}_{k},$ (2)

which is equivalent to the computation of the summation of all
$\mathbf{x}_{k}$s over the wireless channel.

Motivated by this property, the AirComp technique can be generalized to
support a wide range of mathematical operations, which are based on the
property of nomographic function in the following form:

$f(\mathbf{s}_{0},\mathbf{s}_{1},...,\mathbf{s}_{K-1})=\psi{\bigg{(}}\sum_{k=0}^{K-1}\phi{(\mathbf{s}_{k})}{\bigg{)}},$
(3)

where $\phi(\cdot)$ and $\psi(\cdot)$ denote pre- and post-processing
functions, respectively.

Some well-known nomographic functions include:

  1. 1.

Arithmetic Mean:
$f(s_{0},s_{1},...,s_{K-1})=\frac{1}{K}\sum_{k=0}^{K-1}s_{k}$, with
$\phi(s_{k})=s_{k}$ and $\psi(y)=y/N$;

  2. 2.

Euclidean Norm: $f(s_{0},s_{1},...,s_{K-1})=\sqrt{\sum_{k=0}^{K-1}s_{k}^{2}}$,
with $\phi(s_{k})=s_{k}^{2}$ and $\psi(y)=\sqrt{y}$;

  3. 3.

Number of Active Node: $f(s_{0},s_{1},...,s_{K-1})$ is the number of active
node, with $\phi(s_{k})=1\,(\text{active})\,\text{or}\,0\,(\text{inactive)}$
and $\psi(y)=y$.

###  4.2 Nested lattice code

A lattice is an infinite discrete set of points in the Euclidean space that
are regularly arranged and are closed under addition[42]. As an important
channel coding technique, the structural properties of nested lattice coding
are well suited for multiple access channel in wireless networks, which allows
multiple transmitters to effectively share the same radio resources and can
protect against channel noise. Specifically, a $d$-dimensional lattice
$\Lambda$ in the Euclidean space $\mathbb{R}^{d}$ can be generated as follows:

$\Lambda=\\{\mathbf{Gu}\ :\ \textbf{u}\in\mathbb{Z}^{d}\\},$ (4)

where $\mathbf{G}=[\mathbf{g}_{1},\mathbf{g}_{2},...,\mathbf{g}_{d}]$ is a
full-rank generator matrix.

A lattice $\Lambda_{C}$ is _nested_ in some lattice $\Lambda_{F}$ if
$\Lambda_{C}\subseteq\Lambda_{F}$, i.e., $\Lambda_{C}$ is a sublattice of
$\Lambda_{F}$. In this case, $\Lambda_{F}$ is denoted as the fine lattice,
which defines the codewords, while $\Lambda_{C}$ is denoted as the coarse
lattice, which is used for shaping. Specifically, the _nested lattice code_
$\mathcal{L}$ is the set of all points of a fine lattice $\Lambda_{F}$ that is
within the fundamental Voronoi region $\mathcal{V}_{C}$ of a coarse lattice
$\Lambda_{C}$:

$\mathcal{L}=\Lambda_{F}\cap\mathcal{V}_{C}=\\{\textbf{x}\ :\
\textbf{x}=\lambda\ \text{mod}\ \Lambda_{C},\lambda\in\Lambda_{F}\\},$ (5)

where the _fundamental Voronoi region_ , $\mathcal{V}_{C}$, of the lattice
$\Lambda_{C}$, is the set of all points in $\mathbb{R}^{d}$ that are closest
to the zero vector:

$\mathcal{V}_{C}=\\{\textbf{z}\ :\
||\textbf{z}||\leq||\textbf{z}-\lambda||,\forall\lambda\in\Lambda_{C},\textbf{z}\in\mathbb{R}^{d}\\},$
(6)

For each user $k$, a $d$-dimension nested lattice codeword
${\bf{x}}_{k}\in\mathcal{L}$ can be generated based on its hash value
${\bf{s}}_{k}\in\mathbb{F}^{l}_{p}$ by the encoding function $\phi(\cdot)$ as
follows:

$\displaystyle\phi({\bf{s}}_{k}):\mathbb{F}^{l}_{p}$
$\displaystyle\rightarrow\mathbb{R}^{d}$ (7) $\displaystyle{\bf{s}}_{k}$
$\displaystyle\rightarrow{\bf{x}}_{k}$

where $\mathbb{F}_{p}=\\{0,1,...,p-1\\}$ forms a finite field under integer
arithmetic modulo $p$. Then for a nested lattice codebook $\mathcal{L}$, the
following property is held for all ${\bf{x}}_{k}\in\mathcal{L}$:

${\bigg{[}}\sum_{k=0}^{K-1}{\bf{x}}_{k}\mod{\Lambda}_{C}{\bigg{]}}\in\mathcal{L},$
(8)

that is, the sum of lattice codewords modulo the shaping lattice is a codeword
itself. Due to this linearity preserving characteristic, there exists a post-
processing function $\psi(\cdot)$ that satisfies[9]:

$\psi{\bigg{(}}\sum_{k=0}^{K-1}\phi({\bf{s}}_{k})\mod{\Lambda_{C}}{\bigg{)}}=\underset{k=0}{\overset{K-1}{\bigoplus}}{\bf{s}}_{k},$
(9)

which is a nomographic function, that is,
$f({\bf{s}}_{0},{\bf{s}}_{1},...,{\bf{s}}_{K-1})=\underset{k=0}{\overset{K-1}{\bigoplus}}{\bf{s}}_{k}$.

Based on this property, AirComp can be used to transmit and compute the
superposition of hash values from all users. Specifically, each user $k$ maps
its hash value $\mathbf{s}_{k}$ to a lattice codeword $\mathbf{x}_{k}$ using
the mapping operation in Eq.(7), then all users can transmit their lattice
codes simultaneously to the BS using the AirComp technique. At the BS, the
received signal is $\mathbf{y}=\sum_{k=0}^{K-1}\mathbf{x}_{k}+\mathbf{w}$,
which is a $d$-dimension linear combination of the lattice codes of all users
with noise of $\mathbf{w}$.

In theory, there are many choices for the lattice codes with different
codeword dimensions. However, in practice, the transmitted symbol can only
represent information in a 2-dimensional space (in-phase and quadrature
dimension). Therefore, for the high dimensional hash value, such as the
128-bits hash generated by the MD5 algorithm[43], it needs $2^{64}$ codewords
at each dimension to represent the hash, which is impossible in a real
communication system.

Figure 3: Nested $\mathbb{Z}^{2}$ cubic lattice.

In this work, we consider an $\mathbb{Z}^{2}$ cubic lattice
$\tilde{\Lambda}_{F}$ as illustrated in Fig. 3, where the points are
$\tilde{\Lambda}_{F}$ points and the Voronoi region of the coarse lattice
$\tilde{\Lambda}_{C}$ is drawn in dashed lines. Only the eight codes in the
outer tier of the Voronoi region are used (shown in red color), so the code
rate is $B=\log_{2}8=3$ bits/symbol. Therefore, for an $L$-bits hash value, it
can be partitioned into $N=\lceil{L/3}\rceil$ symbols.

###  4.3 Hash consistency verification

Based on the $\mathbb{Z}^{2}$ cubic lattice in Fig. 3, each user $k$ can
construct a hash symbol vector
$\tilde{\bf{x}}_{k}=[\tilde{x}_{k0},\tilde{x}_{k1},...,\tilde{x}_{kN-1}]^{T}$,
where $\tilde{x}_{kn}$ is mapped to one of the eight codes. Then each element
of $\tilde{\bf{x}}_{k}$ is transmitted in an OFDM sub-carrier. The received
symbol at the BS in sub-carrier $n$ is
$\tilde{y}_{n}=\sum_{k=0}^{K-1}\tilde{x}_{kn}+w_{n}$.

The received symbol at sub-carrier $n$ can be quantized to the nearest point
$t_{n}\in\mathbb{Z}^{2}$ in the $\tilde{\Lambda}_{F}$ as follows:

${t_{n}}=\arg\underset{\lambda\in{\tilde{\Lambda}_{F}}}{\min}||\tilde{y}_{n}-\lambda||,\,n\in[0,N-1],$
(10)

which are then broadcasted to all users through the downlink channel. A vector
$\mathbf{t}=[t_{0},t_{1},...,t_{N-1}]^{T}\in\mathbb{Z}^{2N}$ is constructed by
each user, which is the complete linear combination of the lattice codes of
all users.

Based on the received vector $\mathbf{t}$, we design a consensus algorithm by
exploiting the geometric characteristics of lattice codes. Let $C_{m}$ denote
a set of $m$ users that transmit the consistent hash symbol vector, and
$C_{K-m}$ denote the rest $K-m$ users that transmit different hash symbol
vectors. Then $\mathbf{t}$ can be re-written as follows:

$\mathbf{t}=\sum_{k\in C_{m}}\tilde{\mathbf{x}}_{k}+\sum_{k\in
C_{K-m}}\tilde{\mathbf{x}}_{k}+\mathbf{e},$ (11)

where $\mathbf{e}$ is the random error pattern after symbols quantization in
(10) with $\mathbb{E}\\{\mathbf{e}\\}=\mathbf{0}$.

We assume that the hash symbol vector elements are uniformly mapped from the
lattice codewords as shown in Fig. 3. For each user $k\in C_{m}$, we assume
the transmitted hash symbol vector is $\bar{\mathbf{x}}$, i.e.,
$\tilde{\mathbf{x}}_{k}=\bar{\mathbf{x}},\forall k\in C_{m}$. For each user
$k\in C_{K-m}$, we firstly consider the case that the hash symbol vector is
independent of each other. Then for $k\neq j$, we have

$\mathbb{E}\\{\tilde{\mathbf{x}}_{k}^{T}\tilde{\mathbf{x}}_{j}\\}=\begin{cases}N\sigma_{s}^{2},&{\text{If}~{}\forall
k,j\in C_{m}}\\\ 0,&{\text{Otherwise}}\end{cases}$ (12)

where $\sigma_{s}^{2}$ is the variance of codewords. Furthermore, we define
$\tilde{I}_{k}$ as the hash consistency factor (HCF) of user $k$, which is the
normalized inner product of its hash symbol vector $\tilde{\mathbf{x}}_{k}$
and vector $\mathbf{t}$, that is:

$\displaystyle\tilde{I}_{k}=\frac{\mathbf{t}^{T}\tilde{\mathbf{x}}_{k}}{K|\tilde{\mathbf{x}}_{k}|^{2}},$
(13)

From (12), we can obtain the expectation of $\tilde{I}_{k}$ as follows:

$\mathbb{E}\\{\tilde{I}_{k}\\}=\begin{cases}\frac{m}{K},&{\forall k\in
C_{m}}\\\ \frac{1}{K}.&{\forall k\in C_{K-m}}\end{cases}$ (14)

Figure 4:  $\mathbb{E}\\{\tilde{I}_{k^{\prime}}\\}$ and
$\mathbb{E}\\{\tilde{I}_{k^{\prime\prime}}\\}$ vs. $m$ ($K=21$).

In Fig. 4, we plot $\mathbb{E}\\{\tilde{I}_{k}\\}$ with 21 users ($K=21$) for
$m$ varying from 1 to 20. It can be seen that for $m\geq 2$,
$\mathbb{E}\\{\tilde{I}_{k^{\prime}}\\}>\mathbb{E}\\{\tilde{I}_{k^{\prime\prime}}\\},\forall
k^{\prime}\in C_{m},k^{\prime\prime}\in C_{K-m}$. Thus $\tilde{I}_{k}$ can be
used as a reliable metric for each user to determine whether its hash symbol
vector is consistent with the majority of hash vectors in $\mathbf{t}$ or not,
that is, it belongs to one of the $m$ users sending the same hash or not.
Therefore, this metric can be used to check if the consensus is reached or
not. Specifically, in the proposed AirCon protocol, the consensus can be
reached if $m>\lfloor{K/2}\rfloor$ users generate the same hash vector.
According to (14), we can set a threshold as $T_{h}=0.5$. After receiving the
superposed hash vector $\mathbf{t}$, each user $k$ calculates $\tilde{I}_{k}$
as defined in (13). If $\tilde{I}_{k}\geq T_{h}$, the user assumes that the
consensus can be achieved and sends the result to the primary user.

However, if some users are controlled by an attacker, the consensus
performance will be degraded based on this ideal threshold. For instance,
consider the case where $m$ users are honest and the rest of $K-m$ users are
controlled by a malicious attacker. The hash symbol vector transmitted by
honest users is $\bar{\mathbf{x}}$, while the hash symbol vector transmitted
by malicious users is $\hat{\mathbf{x}}=-\bar{\mathbf{x}}$, then the
aggregated vector at the BS is
$\mathbf{t}=m\bar{\mathbf{x}}+(K-m)\hat{\mathbf{x}}=(2m-K)\bar{\mathbf{x}}$.
In this case, $\tilde{I}_{k}=(2m-K)/K$ for a honest user $k$, so the consensus
cannot be achieved with a threshold of $T_{h}=0.5$ unless
$m>\lfloor{3K/4}\rfloor$. Therefore, this one-round consensus procedure is
vulnerable to this kind of conspiracy attack.

As a solution, we propose a two-round consensus procedure to improve the
security of the proposed consensus procedure. Specifically, in the first
round, malicious users can be filtered by setting a proper threshold and only
honest users enter the second round to decide the consensus results. In the
following, we will analyze the optimal threshold for the first round and the
corresponding fault tolerance of the proposed consensus protocol.

Before getting into the details, we first make some assumptions about the
capabilities of an attacker:

  1. 1.

_AS_ 1: An attacker knows the hash symbols transmitted by each honest user.
This is feasible because the attacker can calculate the legal hash by acting
as an honest user;

  2. 2.

_AS_ 2: An attacker cannot manipulate the parameters of the physical layer,
such as the transmitting power.

  3. 3.

_AS_ 3: An attacker cannot manipulate the consensus protocol, such as the
consensus threshold.

We assume that an attack is successful if the consensus cannot be achieved
even if the number of honest users is more than half of the total number of
users (i.e., $m>\lfloor{K/2}\rfloor$).

Based on the aforementioned attacking model, we assume all honest users
transmit $\bar{\mathbf{x}}$ and all malicious users transmit
$\hat{\mathbf{x}}$. Then $\mathbf{t}$ can be re-written as follows:

$\mathbf{t}=m\bar{\mathbf{x}}+(K-m)\hat{\mathbf{x}}+\mathbf{e},$ (15)

and the expectation of $\tilde{I}_{k}$ can be re-written by

$\mathbb{E}\\{\tilde{I}_{k}\\}=\begin{cases}1-\alpha+\alpha\rho,&{\forall k\in
C_{m}}\\\ \alpha+(1-\alpha)\rho,&{\forall k\in C_{K-m}}\end{cases}$ (16)

where $\alpha=\frac{K-m}{K}$ is the percentage of malicious users and
$\rho=\mathbb{E}\\{\frac{\hat{\mathbf{x}}^{T}\bar{\mathbf{x}}}{|\bar{\mathbf{x}}|^{2}}\\}=\mathbb{E}\\{\frac{\bar{\mathbf{x}}^{T}\hat{\mathbf{x}}}{|\hat{\mathbf{x}}|^{2}}\\}$
denote the correlation coefficient between $\hat{\mathbf{x}}$ and
$\bar{\mathbf{x}}$. The attacker can change $\tilde{I}_{k}$ of the honest
users by manipulating $\rho$ between $[-1,1]$ with properly setting of
$\hat{\mathbf{x}}$.

In the first round of consensus, a threshold should be set such that all
honest users can get into the second round while the malicious users should be
filtered as many as possible. To this end, the threshold should be set to

$T_{h1}=\underset{\rho\in[-1,1]}{\text{min}}(1-\alpha+\alpha\rho)=1-2\alpha$
(17)

From the attacker’s perspective, it must find a $\rho$ satisfying
$\alpha+(1-\alpha)\rho>T_{h1}=1-2\alpha$ such that malicious users also can
get into the second round. Otherwise, all malicious users will be filtered in
the first round. Therefore, the range of $\rho$ can be given by

$\rho>\frac{1-3\alpha}{1-\alpha}$ (18)

In the second round of consensus, the HCF $\tilde{I}_{k}$ of honest users
should be more than $T_{h2}=0.5$ such that the consensus can be achieved even
if all malicious users satisfy the threshold in the first round of consensus
by setting $\rho$ as in (18), that is

$\tilde{I}_{k}=1-\alpha+\alpha\rho=1-\alpha+\alpha\frac{1-3\alpha}{1-\alpha}>\frac{1}{2},~{}\forall
k\in C_{m}$ (19)

Then we can obtain the range of $\alpha$ as follows:

$\alpha<\frac{\sqrt{17}-1}{8}\approx 0.39:=\alpha^{*}$ (20)

Substituting (20) into (17), we can obtain the optimal value of $T_{h1}$ as
follows:

$T_{h1}^{*}:=0.22$ (21)

The range of $\alpha$ in (20) specifies the fault tolerance of the two-round
consensus protocol. If the percentage of malicious users does not exceed 0.39,
then the consensus can be achieved in the second round. Otherwise, the
consensus cannot be achieved even if $m>\lfloor{K/2}\rfloor$.

We show two examples in Fig. 5 and Fig. 6. In Fig. 5, we plot the HCF for all
users with $\alpha=0.35$, which is under the threshold $\alpha^{*}$. The range
of $\rho$ can be divided into two parts by the critical point $\rho_{0}$ that
satisfies $\alpha+(1-\alpha)\rho_{0}=T_{h1}=1-2\alpha$. When $\rho<\rho_{0}$,
the region is denoted as _Safety Region_ , all malicious users will be
filtered by $T_{h1}$ and cannot enter the second round. When $\rho>\rho_{0}$,
the region is denoted as _Consensus Region_ , malicious users can enter the
second round, but they cannot affect the consensus results because the HCF of
all honest users always exceeds $T_{h2}=0.5$ such that all honest users can
enter _Reply Phase_ and send the reply message to the primary user. Note that
in the second round, if $\rho_{0}<\rho<\rho^{\prime}_{0}$, the HCF of
malicious users is less than $T_{h2}$ such that they cannot send the reply
message. If $\rho>\rho^{\prime}_{0}$, malicious users also send a reply
message. However, regardless of whether malicious users can send a reply
message or not, it will not affect the consensus result because all honest
users always send the reply message. Therefore, malicious users cannot affect
consensus results whatever $\rho$ is set when $\alpha=0.35$.

In Fig. 6, we plot the HCF of all users with $\alpha=0.45$, which is over the
threshold $\alpha^{*}$. In this case, we can divide the range of $\rho$ into
three parts by two critical point $\rho_{0}$ and $\rho_{1}$, where $\rho_{0}$
satisfies $\alpha+(1-\alpha)\rho_{0}=T_{h1}=1-2\alpha$ and $\rho_{1}$
satisfies $1-\alpha+\alpha\rho_{1}=T_{h2}=0.5$. Similarly, when
$\rho<\rho_{0}$, the consensus can be achieved because malicious users cannot
enter the second round. When $\rho>\rho_{1}$, the consensus also can be
achieved because the HCF of honest users always exceeds $T_{h2}$. However,
when $\rho_{0}<\rho<\rho_{1}$, we denote it as _Attacking Region_ , malicious
users can enter the second round, and the HCF of all honest users does not
exceed $T_{h2}$, so the consensus cannot be achieved and the attack is
successful in this region.

Figure 5: Consensus performance under fault tolerance, $\alpha=0.35$ Figure 6:
Consensus performance over fault tolerance, $\alpha=0.45$

###  4.4 Two-round consensus procedure

Based on the hash consistency verification scheme discussed in the previous
subsection, we propose a two-round consensus procedure as follows.

In the first round (_Prepare phase_), all users send their hash symbols to the
BS via the AirComp technique. The BS feeds back the superposed hash symbol
vector $\mathbf{t}$ to all users. Each user $k$ calculates the HCF
$\tilde{I}_{k}$ according to (13) and compares it with the threshold
$T_{h1}=0.22$. If $\tilde{I}_{k}>T_{h1}$, then the user changes to the
prepared state and enters the second round of the consensus process.

In the second round (_Commit phase_), only users who are in the prepared state
send the hash symbols to the BS via the AirComp technique. The BS feeds back
the new superposed hash symbol vector $\mathbf{t}^{\prime}$ to all users. Each
prepared user $k$ calculates the HCF $\tilde{I}_{k}$ once again using
$\mathbf{t}^{\prime}$ and compares with the threshold $T_{h2}=0.5$. Only those
users with $\tilde{I}_{k}>T_{h2}$ enter the _Reply Phase_ and return the reply
message to the BS via the AirComp technique. The superposed reply message is
forwarded to the primary user by the BS.

The final consensus result is determined by the primary user based on the
superposed reply message from the BS. The primary user also can calculate the
HCF in (13) between its reply message and the superposed message. If the HCF
exceeds $T_{h}=0.5$, which suggests that more than half of the total users
return the consistent reply message, then the consensus is achieved.

##  5 AirCon implementation based on LTE system

In this section, we consider the implementation of AirCon protocol based on
the open-source srsLTE platform, which provides the standard LTE protocols. We
present solutions to some of the critical issues for practical AirComp
implementation. Specifically, two problems are considered for AirComp
implementation: 1) Synchronization problem; 2) Uplink channel estimation and
feedback problem.

###  5.1 Synchronization

The first challenging problem for AirComp implementation is to achieve strict
timing/frequency synchronization across different users so that accurate
signal superposition can be obtained at the BS.

Fortunately, the LTE system has a complete set of synchronization mechanisms
that can meet the synchronization requirement of AirComp. Specifically, in the
downlink of the LTE system, the BS broadcasts synchronization channels
(including PSS and SSS) periodically. If a user wants to connect to the BS,
the first step is to search for these two channels to get timing and frequency
synchronization. As long as the user is connected to the BS, it will keep
tracking the timing/frequency synchronization via PSS/SSS. The user also
compensates for the frequency offset of uplink channels according to the
estimated value from the downlink channels.

In the uplink, a “timing advance” mechanism is adopted by all users for timing
synchronization with the BS. Specifically, when the user connects to the BS,
the BS measures the propagation delay and calculates a timing offset, named
“Timing Advance (TA)”, which is fed back to the corresponding user. Whenever
the user transmits data to the BS, it should transmit at the time with an
advance of TA so that the signals from different users arrive at the BS
without timing offset.

In addition, the physical layer of the LTE system is based on the OFDM
technique, which adopts a cyclic prefix (CP) to cope with the multipath
interference problem. Due to the cyclic property, the CP can also be used for
channel synchronization. That is, as long as the timing offset is within a CP,
the impact of the timing offset can be treated as a channel phase shift and
compensated as a part of channel fading.

In summary, the existing synchronization mechanisms in the LTE system are
sufficient for the implementation of AirComp, so there is no need to design a
dedicated AirComp synchronization scheme in an LTE system, which is part of
the reason we choose the LTE system as the implementation platform of the
AirCon protocol.

###  5.2 Channel estimation and feedback

The purpose of uplink channel estimation is to cope with the channel fading
problem via pre-compensation on the user side. In practice, there are two
different ways to obtain uplink CSI. One way is that the BS estimates the
uplink channel and sends feedback to the corresponding user, the other way is
that a user infers the uplink CSI from the downlink signals by leveraging the
channel reciprocity of the TDD channel. In this work, we choose the first
solution since it can be used for both FDD and TDD systems.

To get uplink CSI at the BS, a user needs to transmit reference symbols in the
uplink channel. Ideally, the reference symbols should be transmitted at each
sub-carrier so that the channel can be estimated accurately for all sub-
carriers. However, this will consume too many channel resources and take a
longer time for channel estimation for a large number of participating users.
To this end, we exploit the property that the sub-carriers within coherence
bandwidth may have a similar fading coefficient, so the reference symbols are
only needed for every $M$ sub-carriers333$M$ is a parameter depending on the
coherence bandwidth. Note that this scheme is also adopted by the uplink
sounding reference signal (SRS) in the LTE system.. As a result, at most $M$
users can share an OFDM symbol, therefore a total of $\lceil{K/M}\rceil$ OFDM
symbols are needed for reference symbol transmissions. Fig. 7 illustrates the
assignment of the reference symbols for different users.

Figure 7: Assignment of reference symbols.

Upon receiving the reference symbols, the BS extracts the received symbols and
estimates the CSI in the order of user index one by one. The simplest
estimation method is the least square (LS) method. Taking user 0 as a example,
the BS firstly constructs the received symbol vector
$\mathbf{y}=[y_{0},y_{M},\cdots,y_{\lfloor{N/M}\rfloor{M}}]$ from symbol 0,
the corresponding transmitted reference signal for user 0 is
$\mathbf{x}=[x_{0},x_{1},\cdots,x_{\lfloor{N/M}\rfloor}]$, then the LS
estimation for uplink channel knowledge of user 0 can be expressed as

$\tilde{\mathbf{h}}_{\text{LS}}=\left[\frac{y_{0}}{x_{0}},\frac{y_{M}}{x_{1}},\cdots,\frac{y_{\lfloor{N/M}\rfloor{M}}}{x_{\lfloor{N/M}\rfloor}}\right]^{T}$
(22)

However, the LS method does not consider the noise in the reference symbols.
The LMMSE method[46] can be employed to further reduce the noise impact by
utilizing the cross-correlation between sub-carriers, which is given by [46]:

$\tilde{\mathbf{h}}_{\text{LMMSE}}=\mathbf{R}_{\mathbf{h}\mathbf{h}}(\mathbf{R}_{\mathbf{h}\mathbf{h}}+\frac{\beta}{\text{SNR}}\mathbf{I})^{-1}\tilde{\mathbf{h}}_{\text{LS}},$
(23)

where $\beta=\mathbb{E}\\{|x_{n}|^{2}\\}\mathbb{E}\\{|1/x_{n}|^{2}\\}$ is a
constant depending on the reference symbol,
$\mathbf{R}_{\mathbf{h}\mathbf{h}}=\mathbb{E}\\{\mathbf{h}\mathbf{h}^{H}\\}$
is the channel autocorrelation matrix444The matrix
$\mathbf{R}_{\mathbf{h}\mathbf{h}}$ can be obtained from either a typical
channel model[46] or the channel LS estimation..

Based on the channel estimation $\tilde{h}_{kn}$ for each subcarrier, the BS
can set the coefficient of $\mathbf{B}_{k}$ as
$b_{kn}={\tilde{h}^{\dagger}_{kn}}/{|\tilde{h}_{kn}|^{2}}$, which can
compensate the channel fading and achieve the ideal signal aggregation as
shown in Eq.(1) and Eq.(2). This parameter should be fed back to the users as
shown in Fig. 8. Similar to the uplink channel estimation, two OFDM symbols
are shared by every $M$ users, where the uplink CSI is transmitted in the
_Data Symbol_ and downlink reference symbols are transmitted in the _Pilot
Symbol_ for downlink channel estimation. Therefore, totally
2$\lceil{K/M}\rceil$ OFDM symbols are needed for downlink feedback
transmissions. We still take user 0 as example: the coefficient vector
$\mathbf{b}_{0}=[b_{00},b_{0M},\cdots,b_{0~{}\lfloor{N/M}\rfloor{M}}]$ is
transmitted at the corresponding sub-carrier in the _Data Symbol_ 0\. In the
_Pilot Symbol_ 0, the downlink reference symbol $s_{0}$ is transmitted at the
corresponding sub-carrier. After receiving these two symbols, user $0$ firstly
estimates the downlink channel using the received symbols from _Pilot Symbol_
0\. Then the user can obtain the coefficient vector $\mathbf{b}_{0}$ from
_Data Symbol_ 0 by canceling the impact of downlink channel fading. Since each
user only utilizes $1/M$ sub-carriers, the coefficients for the rest of sub-
carriers can be estimated by interpolation[45, 47] at the users.

Figure 8: Assignment of downlink feedback symbols.

In the low-SNR scenario, in addition to the channel estimation algorithm, a
retransmission scheme (i.e., the uplink reference symbols and downlink
feedback symbols are transmitted multiple times) can be adopted to further
improve the performance. The impact of retransmission times on the consensus
accuracy will be studied in section 6.

###  5.3 AirCon implementation

The transmission procedure of the AirComp protocol is summarized in Fig. 9,
which consists of all procedures discussed in previous subsections. Firstly,
the synchronization between the users and the BS will be established. Then the
BS estimates uplink CSI for all users based on the uplink reference signals.
The coefficients of $\mathbf{B}_{k}$ are computed based on the channel
estimation results and fed back to all users. Finally, all users transmit data
using the AirComp technique.

Figure 9: AirComp signaling and data transmission procedures.

We implement the AirCon protocol based on the above AirComp procedures in the
LTE system. The AirCon protocol is started when all users are in a stable
state, such as the RRC IDLE state. In our implementation, we mainly focus on
the feasibility of AirComp technology on hash verification of blockchain
consensus, so only hash bits are generated in each user, rather than
broadcasting an entire block from the primary user. In this case, we do not
appoint a specific primary user. The consensus request is generated in the BS,
which is a dedicated system information block (SIB) to notify all users that
the BS is ready for consensus and users can transmit an uplink reference
signal for AirComp uplink channel estimation. Since a user usually does not
receive SIBs when it is in RRC IDLE state, the BS can set the
_systemInfoModification_ field in the paging message (all users must receive
the paging message periodically) to ensure all users receive the SIB (i.e.,
the consensus request). Similarly, the consensus result is determined by the
BS rather than the primary user.

###  5.4 Complexity analysis of the AirCon protocol

The complexity of the consensus protocol in wireless networks mainly comes
from two aspects: communication complexity and computation complexity. As a
benchmark, the traditional PBFT protocol is also illustrated in Fig. 10 for
the convenience of complexity comparison. We mainly focus on the complexity in
the _Prepare_ and _Commit_ phases.

Figure 10: Traditional PBFT consensus diagram.

The total number of messages in the _Prepare_ and _Commit_ phases of the
traditional PBFT protocol is

$\text{Num}^{\text{message}}_{\text{PBFT}}=(K-1)(K-1)+K(K-1)=(2K-1)(K-1)$ (24)

Assuming each message consumes $N$ wireless resource blocks (RBs), then the
number of wireless RBs consumed by the PBFT protocol is

$\text{Num}^{\text{RBs}}_{\text{PBFT}}=2N\cdot\text{Num}^{\text{message}}_{\text{pbft}}=2N(2K-1)(K-1)$
(25)

where the RE consumption in both the uplink and downlink directions is
considered.

For the AirCon protocol, the total number of wireless RBs consumed in the
_Prepare_ and _Commit_ phases is

$\text{Num}^{\text{REs}}_{\text{AirCon}}=4N$ (26)

Therefore, the communication complexity of the traditional PBFT protocol is
$\mathbb{O}(K^{2})$, while the communication complexity of the AirCon protocol
is $\mathbb{O}(1)$.

If the overhead of channel estimation (CE) and feedback are also considered,
the extra overhead is $4\lceil{K/M}\rceil N$, which has a complexity of
$\mathbb{O}(K)$. In this case, the total number of consumed RBs is

$\text{Num}^{\text{REs}}_{\text{AirCon\\_CE}}=4N+4\lceil{K/M}\rceil N$ (27)

Note that the complexity of channel estimation depends on the system. If
channel reciprocity is utilized to estimate the uplink channel, the complexity
of channel estimation can be reduced to $\mathbb{O}(1)$. The RB consumption in
both consensus protocols under different users number is illustrated in
Fig.11.

Figure 11: Consensus protocol REs consuming.

As for the computational complexity, the hash verification procedures in the
traditional consensus protocol are carried out in the application layer.
Therefore, demodulation, decoding in the physical layer, and decryption in the
upper layer are required. However, in our AirCon protocol, the consensus
procedures are conducted in the physical layer, and the demodulation/decoding
procedures are not required using the proposed hash consistency verification
method. Therefore, the computational complexity only comes from
$\mathbb{O}(K)$ multiplication operations.

In summary, compared with the traditional PBFT protocol, the AirCon protocol
has much lower communication overhead and computational complexity.

##  6 Performance Evaluation

In this section, we show the implementation of the AirCon testbed and provide
experimental results to demonstrate the performance under the real-world
testbed. Due to the limitation of testbed conditions, we also present
simulation results to evaluate the performance of the AirCon protocol under
more general channel conditions.

###  6.1 AirCon testbed design

We implement the AirCon protocol based on srsLTE (version 20.04), an open-
source LTE platform consisting of complete UE/eNodeB protocol stacks and a
lightweight core network (CN) protocol stack. The software defines radio (SDR)
board USRP B210[48] is used to transmit and receive RF signals. Based on the
srsLTE platform, the following modules are re-used for AirComp implementation:
(1) user attaching procedures, which guarantees all users are synchronized to
the eNodeB; (2) The OFDM waveform generation, which can generate waveform
based on the LTE frame structure. We then develop all other modules related to
the AirCon protocol, which include: (1) reference symbols, hash bits
generation, and lattice code modulation; (2) channel estimation module; (3)
downlink feedback module; (4) hash consistency verification module and (5)
AirCon protocol control module.

All devices of the testbed and setup of the test environment are shown in Fig.
12. Totally eight USRP boards are used in our experiment, where one board is
used as BS and the other seven boards are used as users. All these USRP boards
are driven by four PCs via USB3.0 interfaces.

For each experiment setup, the consensus procedures are repeated 1000 times.
For a given number of $m$ users with consistent hash symbols, we define
consensus error ratio ($\text{CER}(m)$) as a measure of consensus performance,
which is given by:

$\text{CER}(m)=\frac{\text{Number of consensus errors}}{\text{Total number of
consensuses}}$ (28)

whereby a consensus error corresponds to one of the following two cases: (1)
The consensus is achieved when $m\leq\lfloor{\frac{K}{2}}\rfloor$; (2) The
consensus is not achieved when $m>\lfloor{\frac{K}{2}}\rfloor$.

Figure 12: Testbed components and environment

###  6.2 Testbed results

Firstly, we demonstrate the symbol superposition results of the AirComp
technique. As shown in Fig. 13, if all users transmit the same hash symbols,
the received symbols at the BS are scaled with the number of users. On the
contrary, as shown in Fig. 14, if all users transmit different hash symbols,
the superposed symbols should be distributed on all lattice nodes randomly.
From these two figures, it can be seen that the channel fading is effectively
eliminated using the proposed AirComp implementation schemes (in particular
the channel estimation, feedback, and pre-compensation schemes), and the
desired channel superposition is achieved. Therefore, it is feasible to apply
the AirComp technology in a digital communication system.

Figure 13: Symbol superposition when all users transmit same hash symbols, the
received symbols are scaled with the number of users Figure 14: Symbol
superposition when three users transmit different hash symbols, the received
symbols fall on all fine lattice points

Secondly, we show the superposed hash symbols at the BS at different consensus
stages. In Fig. 15, we show the case that all users transmit consistent hash
symbols. It can be seen that all users can get into the Commit and Reply
stages. In the second case, only four users transmit consistent hash symbols,
while the other three users transmit random hash symbols. As shown in Fig. 16,
these three users with random hash symbols are filtered in the Commit stage,
and only four users with consistent hash symbols enter the Reply stage.

(a) _Prepare_ stage

(b) _Commit_ stage

(c) _Reply_ stage

Figure 15: Seven users transmit consistent hash symbols, all users determine
the final consensus result

(a) _Prepare_ stage

(b) _Commit_ stage

(c) _Reply_ stage

Figure 16: Four users transmit consistent hash symbols, three users transmit
random hash symbols, those users with random hash symbols are filtered

The performance of the AirCon protocol are shown in Fig. 17 and Fig. 18 with
different users number ($K$). For $K=5$, UE5 and UE6 in Fig. 12 are excluded
in the experiments. It can be observed that when the number of users with
consistent hash symbols ($m$) is close to the threshold for reaching a
consensus ($m=3$ for $K=5$ and $m=4$ for $K=7$), it may lead to consensus
error. However, even in the worst case, the consensus error is lower than
$1\%$, which demonstrates that the proposed AirCon protocol is reliable in
practice. By carefully examining the experimental results, we observe that the
consensus error is mainly caused by inaccurate downlink feedback.

Figure 17: Consensus error ratio for real testbed result with $K=5$ Figure 18:
Consensus error ratio for real testbed result with $K=7$

###  6.3 AirCon simulation setup

We further evaluate the performance of the proposed AirCon protocol under more
general conditions using simulations. In the simulation, the frame structure
is the same as the practical LTE system with a 1.92MHz sampling rate. The
channel gains for different users are generated independently.

In our simulation, three wireless channels are considered: 1) AWGN; 2) flat
fading; 3) EPA (Extended Pedestrian A model), which is a multi-path channel
model defined in the 3GPP TS 36.104[50] for the typical pedestrian wireless
environments. The path delay and the corresponding delay power of the EPA
channel are shown in Table I. We introduce the average CER (ACER) as a metric
to compare the performance difference among different simulation setups, which
is given by

$\text{ACER}=\frac{1}{K}\sum_{m=1}^{K}\text{CER}(m)$ (29)

TABLE I: Parameters of EPA channel Delay (ns) | 0 | 30 | 70 | 90 | 110 | 190 | 410
---|---|---|---|---|---|---|---
Power (dB) | 0 | -1 | -2 | -3 | -8 | -17.2 | -20.8

###  6.4 Simulation results

In Fig. 19, we show the ACER of the AirCon protocol under different channel
conditions. Firstly, it can be seen that the consensus performance is degraded
among all types of channels when SNR decreases. Secondly, the performance gap
between different types of channels is increasing in the low-SNR region, which
suggests that the channel estimation accuracy loss is the dominant factor of
the consensus performance loss in the low-SNR region. If the channel fading is
well pre-compensated (e.g., an AWGN case), the average consensus error ratio
of AirCon is about $1\%$ even if the SNR is only 0 dB.

Figure 19: Consensus error ratio under different SNR ($K=11$)

In the low-SNR region, the retransmission scheme can help improve consensus
accuracy. In Fig. 20, we show the consensus performance improvement under
different retransmission numbers. It can be observed that the consensus error
ratio decreases gradually with the increase of the retransmission number. Note
that the retransmission will consume more wireless resources. Therefore, the
trade-off between retransmission number and consensus performance needs to be
considered in practice.

Figure 20: Consensus error ratio under different repetition number (SNR = 0
dB)

We also study the influence of total user number ($K$) on consensus accuracy.
Due to space limitation, we only show the AWGN channel case. It can be
observed from Fig. 21 that the AirCon protocol performs better when $K$
increases. The improvement of consensus performance comes from two aspects:
(1) The consensus error only appears when $m$ is around the threshold for
reaching the consensus (namely, $m=\lceil{\frac{K}{2}}\rceil$ and
$m=\lceil{\frac{K}{2}}\rceil+1$ in our simulation). Therefore, the proportion
of cases that will not incur consensus error increases when the total number
of users increases. (2) Even in the cases that $m=\lceil{\frac{K}{2}}\rceil$
and $m=\lceil{\frac{K}{2}}\rceil+1$, the consensus error ratio also decreases,
which is illustrated in Fig. 22. That is because when more users participate
in the AirComp process, the average effect of noise on each user in the
superposed signal is reduced, so the consensus performance becomes better.

Figure 21: Averaging consensus error ratio under different $K$ (AWGN channel)
Figure 22: Consensus error ratio around threshold under different $K$ (SNR = 0
dB)

##  7 Conclusion

In this paper, we have proposed the AirCon to achieve low complexity consensus
for blockchain-enabled wireless networks, which is novel in that the hash
symbols of all users are transmitted to the BS simultaneously over the same
wireless spectrum via the AirComp and lattice coding techniques, and the
consensus can be done in the physical layer without decoding the hash symbols.
We have shown that the AirCon protocol can significantly reduce the
transmission and computational complexity during the consensus procedure. We
have shown the design of AirCon based on the universal LTE system and provided
solutions for the critical issues involved in the AirComp implementation, such
as channel estimation and feedback. We also have implemented AirCon based on a
srsLTE testbed, and real-world measurement results demonstrate that the
proposed AirCon protocol is feasible in a practical LTE system. In addition,
we have also conducted extensive simulation experiments and shown the accuracy
and robustness of the proposed consensus protocol under different network
conditions. The proposed AirCon is inspiring for designing efficient consensus
schemes over wireless networks, where a more efficient channel status
acquiring scheme can bring significant performance gain for AirCon.

## References

  * [1] J. Wang, X. Ling, Y. Le, Y. Huang, and X. You, “Blockchain-enabled wireless communications: a new paradigm towards 6g,” _Natl. Sci. Rev._ , no. 9, p. 9, 2021.
  * [2] L. Zhang, H. Xu, O. Onireti, M. A. Imran, and B. Cao, “How much communication resource is needed to run a wireless blockchain network?” _IEEE Network_ , vol. 36, no. 1, pp. 128–135, 2022.
  * [3] S. Nakamoto, “Bitcoin: A peer-to-peer electronic cash system,” [Online]. Available: http:// bitcoin.org/bitcoin.pdf, Tech. Rep., Oct. 2008.
  * [4] P. Vasin, “Blackcoin’s proof-of-stake protocol v2,” [Online]. Available: http:// blackcoin.org/blackcoin-pos-protocol-v2-whitepaper.pdf, Tech. Rep.
  * [5] Miguel, Castro, Barbara, and Liskov, “Practical byzantine fault tolerance and proactive recovery,” _ACM Trans. Comput. Syst._ , vol. 20, no. 4, pp. 398–461, 2002.
  * [6] D. Ongaro and J. Ousterhout, “In search of an understandable consensus algorithm,” in _2014 USENIX Ann. Tech. Conf., USENIX ATC 2014_ , vol. 22, no. 2, 2014, pp. 305–320.
  * [7] G. T. Nguyen and K. Kim, “A survey about consensus algorithms used in blockchain,” _J. Inf. Process. Syst._ , vol. 14, no. 1, pp. 101–128, 2018\.
  * [8] B. Nazer and M. Gastpar, “Computation over multiple-access channels,” _IEEE Trans. Inf. Theory_ , vol. 53, no. 10, pp. 3498–3516, 2007.
  * [9] ——, “Compute-and-forward: Harnessing interference through structured codes,” _IEEE Trans. Inf. Theory_ , vol. 57, no. 10, pp. 6463–6486, 2011\.
  * [10] S. Sigg, P. Jakimovski, and M. Beigl, “Calculation of functions on the rf-channel for iot,” in _2012 3rd IEEE Int. Conf. the Internet of Things_ , 2012, pp. 107–113.
  * [11] A. Kortke, M. Goldenbaum, and S. Stańczak, “Analog computation over the wireless channel: A proof of concept,” in _SENSORS, 2014 IEEE_ , 2014, pp. 1224–1227.
  * [12] O. Abari, H. Rahul, and D. Katabi, “Over-the-air function computation in sensor networks,” [Online]. Available: arXiv: http:// arxiv.org/abs/1612.02307.
  * [13] U. Altun, S. T. Başaran, H. Alakoca, and G. K. Kurt, “A testbed based verification of joint communication and computation systems,” in _2017 25th Telecommunication Forum (TELFOR)_ , 2017, pp. 1–4.
  * [14] “Open source sdr lte software suite,” [Online; accessed 18-April-2022]. Available: http:// github.com/srsRAN/.
  * [15] K. Christidis and M. Devetsikiotis, “Blockchains and smart contracts for the internet of things,” _IEEE Access_ , vol. 4, pp. 2292–2303, 2016.
  * [16] V. Ortega, F. Bouchmal, and J. F. Monserrat, “Trusted 5g vehicular networks: Blockchains and content-centric networking,” _IEEE Veh. Technol. Mag._ , vol. 13, no. 2, pp. 121–127, 2018.
  * [17] X. Ling, J. Wang, T. Bouchoucha, B. C. Levy, and Z. Ding, “Blockchain radio access network (b-ran): Towards decentralized secure radio access paradigm,” _IEEE Access_ , vol. 7, pp. 9714–9723, 2019.
  * [18] Y. Le, X. Ling, J. Wang, and Z. Ding, “Prototype design and test of blockchain radio access network,” in _2019 IEEE Int. Conf. Communications Workshops (ICC Workshops)_ , 2019, pp. 1–6.
  * [19] X. Ling, Y. Le, J. Wang, and Z. Ding, “Hash access: Trustworthy grant-free iot access enabled by blockchain radio access networks,” _IEEE Network_ , vol. 34, no. 1, pp. 54–61, 2020.
  * [20] B. Zhang, X. Ling, Y. Le, J. Wang, C. Cai, and Z. Tang, “Analysis and evaluation of hash access for blockchain radio access networks,” in _2020 Int. Conf. Wireless Communications and Signal Processing (WCSP)_ , 2020, pp. 62–67.
  * [21] X. Ling, Y. Le, J. Wang, Z. Ding, and X. Gao, “Practical modeling and analysis of blockchain radio access network,” _IEEE Trans. Commun._ , vol. 69, no. 2, pp. 1021–1037, 2021.
  * [22] S. Guo, Y. Dai, S. Guo, X. Qiu, and F. Qi, “Blockchain meets edge computing: Stackelberg game and double auction based task offloading for mobile blockchain,” _IEEE Trans. Veh. Technol._ , vol. 69, no. 5, pp. 5549–5561, 2020.
  * [23] Y. Liu, K. Wang, Y. Lin, and W. Xu, “Lightchain: A lightweight blockchain system for industrial internet of things,” _IEEE Trans. Ind. Inf._ , vol. 15, no. 6, pp. 3571–3581, 2019.
  * [24] H. Wei, W. Feng, Y. Chen, C.-X. Wang, and N. Ge, “Rethinking blockchains in the internet of things era from a wireless communication perspective,” _IEEE Network_ , vol. 34, no. 6, pp. 24–30, 2020.
  * [25] B. Cao, M. Li, L. Zhang, Y. Li, and M. Peng, “How does csma/ca affect the performance and security in wireless blockchain networks,” _IEEE Trans. Ind. Inf._ , vol. 16, no. 6, pp. 4270–4280, 2020.
  * [26] Y. Sun, L. Zhang, G. Feng, B. Yang, B. Cao, and M. A. Imran, “Blockchain-enabled wireless internet of things: Performance analysis and optimal communication node deployment,” _IEEE Internet Things J._ , vol. 6, no. 3, pp. 5791–5802, 2019.
  * [27] M. Gastpar, “Uncoded transmission is exactly optimal for a simple gaussian “sensor” network,” _IEEE Trans. Inf. Theory_ , vol. 54, no. 11, pp. 5247–5251, 2008.
  * [28] A. B. Wagner, S. Tavildar, and P. Viswanath, “Rate region of the quadratic gaussian two-encoder source-coding problem,” _IEEE Trans. Inf. Theory_ , vol. 54, no. 5, pp. 1938–1961, 2008.
  * [29] R. Soundararajan and S. Vishwanath, “Communicating linear functions of correlated gaussian sources over a mac,” _IEEE Trans. Inf. Theory_ , vol. 58, no. 3, pp. 1853–1860, 2012.
  * [30] X. Cao, G. Zhu, J. Xu, and K. Huang, “Optimized power control for over-the-air computation in fading channels,” _IEEE Trans. Wireless Commun._ , vol. 19, no. 11, pp. 7498–7513, 2020.
  * [31] W. Liu, X. Zang, Y. Li, and B. Vucetic, “Over-the-air computation systems: Optimization, analysis and scaling laws,” _IEEE Trans. Wireless Commun._ , vol. 19, no. 8, pp. 5488–5502, 2020.
  * [32] L. Chen, N. Zhao, Y. Chen, F. R. Yu, and G. Wei, “Over-the-air computation for iot networks: Computing multiple functions with antenna arrays,” _IEEE Internet Things J._ , vol. 5, no. 6, pp. 5296–5306, 2018.
  * [33] G. Zhu and K. Huang, “Mimo over-the-air computation for high-mobility multimodal sensing,” _IEEE Internet Things J._ , vol. 6, no. 4, pp. 6089–6103, 2019.
  * [34] J. Dong, Y. Shi, and Z. Ding, “Blind over-the-air computation and data fusion via provable wirtinger flow,” _IEEE Trans. Signal Process._ , vol. 68, pp. 1136–1151, 2020.
  * [35] K. Yang, T. Jiang, Y. Shi, and Z. Ding, “Federated learning via over-the-air computation,” _IEEE Trans. Wireless Commun._ , vol. 19, no. 3, pp. 2022–2035, 2020.
  * [36] G. Zhu, Y. Du, D. Gündüz, and K. Huang, “One-bit over-the-air aggregation for communication-efficient federated edge learning: Design and convergence analysis,” _IEEE Trans. Wireless Commun._ , vol. 20, no. 3, pp. 2120–2135, 2021.
  * [37] M. Mohammadi Amiri and D. Gündüz, “Machine learning at the wireless edge: Distributed stochastic gradient descent over-the-air,” _IEEE Trans. Signal Process._ , vol. 68, pp. 2155–2169, 2020.
  * [38] G. Zhu, J. Xu, K. Huang, and S. Cui, “Over-the-air computing for wireless data aggregation in massive iot,” _IEEE Wireless Commun._ , vol. 28, no. 4, pp. 57–65, 2021.
  * [39] F. Molinari, S. Stanczak, and J. Raisch, “Exploiting the superposition property of wireless communication for average consensus problems in multi-agent systems,” in _2018 European Control Conference (ECC)_ , 2018, pp. 1766–1772.
  * [40] F. Molinari, N. Agrawal, S. Stańczak, and J. Raisch, “Max-consensus over fading wireless channels,” _IEEE Trans. Control Network Syst._ , vol. 8, no. 2, pp. 791–802, 2021.
  * [41] O. Abari, H. Rahul, D. Katabi, and M. Pant, “Airshare: Distributed coherent transmission made seamless,” in _2015 IEEE Conference on Computer Communications (INFOCOM)_ , 2015, pp. 1742–1750.
  * [42] L. Natarajan, Y. Hong, and E. Viterbo, “Lattice codes achieve the capacity of common message gaussian broadcast channels with coded side information,” _IEEE Trans. Inf. Theory_ , vol. 64, no. 3, pp. 1481–1496, 2018.
  * [43] R. L. Rivest, “The MD5 Message-Digest Algorithm,” RFC 1321, Apr. 1992.
  * [44] 3GPP, “Evolved Universal Terrestrial Radio Access (E-UTRA); Physical layer procedures,” 3rd Generation Partnership Project (3GPP), Technical Specification (TS) 36.213, 03 2017, version 14.2.0. [Online]. Available: https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=2427
  * [45] Y. Zhao and A. Huang, “A novel channel estimation method for ofdm mobile communication systems based on pilot signals and transform-domain processing,” in _1997 IEEE 47th Vehicular Technology Conf. Technology in Motion_ , vol. 3, 1997, pp. 2089–2093.
  * [46] O. Edfors, M. Sandell, J.-J. van de Beek, S. Wilson, and P. Borjesson, “Ofdm channel estimation by singular value decomposition,” _IEEE Trans. Commun._ , vol. 46, no. 7, pp. 931–939, 1998.
  * [47] X. Dong, W.-s. Lu, and A. C. Soong, “Linear interpolation in pilot symbol assisted channel estimation for ofdm,” _IEEE Trans. Wireless Commun._ , vol. 6, no. 5, pp. 1910–1920, 2007.
  * [48] “Ettus research usrp b210,” [Online; accessed 18-April-2022]. Available: http:// www.ettus.com/all-products/UB210-KIT/.
  * [49] K. Baddour and N. Beaulieu, “Autoregressive modeling for fading channel simulation,” _IEEE Trans. Wireless Commun._ , vol. 4, no. 4, pp. 1650–1662, 2005.
  * [50] 3GPP, “Evolved Universal Terrestrial Radio Access (E-UTRA); Base Station (BS) radio transmission and reception,” 3rd Generation Partnership Project (3GPP), Technical Specification (TS) 36.104, 03 2017, version 14.3.0. [Online]. Available: https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=2412