  The blockchain technology has been extensively studied to enable distributed
and tamper-proof data processing in federated learning (FL). Most existing
blockchain assisted FL (BFL) frameworks have employed a third-party blockchain
network to decentralize the model aggregation process. However, decentralized
model aggregation is vulnerable to pooling and collusion attacks from the
third-party blockchain network. Driven by this issue, we propose a novel BFL
framework that features the integration of training and mining at the client
side. To optimize the learning performance of FL, we propose to maximize the
long-term time average (LTA) training data size under a constraint of LTA
energy consumption. To this end, we formulate a joint optimization problem of
training client selection and resource allocation (i.e., the transmit power and
computation frequency at the client side), and solve the long-term mixed
integer non-linear programming based on a Lyapunov technique. In particular,
the proposed dynamic resource allocation and client scheduling (DRACS)
algorithm can achieve a trade-off of [$\mathcal{O}(1/V)$,
$\mathcal{O}(\sqrt{V})$] to balance the maximization of the LTA training data
size and the minimization of the LTA energy consumption with a control
parameter $V$. Our experimental results show that the proposed DRACS algorithm
achieves better learning accuracy than benchmark client scheduling strategies
with limited time or energy consumption.
