
Data Offloading and Processing: Depending on its available resource, each MD can choose to offload its data to one of the nearby ESs for edge learning, or learn the model locally via local data processing. We assume that the model learning process begins once the offloading phase is completed [1]}. This assumption is realistic in practical scenarios, where each MD needs to obtain an offloading policy on whether it should offload the data to an ES or not, before it allows the associated ES to train its data. For both training cases, MDs and ESs conduct stochastic gradient descent (SGD) iterations and synchronize their model parameters through block mining. In case of local execution at an MD, after model training, it uploads its ML model parameters to its nearby ES. Considering an ES, if it receives data from MDs, it allocates its resources to conduct ML model training.

Partial Model Aggregation and Consensus Update: Each ES combines its computed ML model with models received from its associated MDs to perform a partial model aggregation. Then, ESs will join a consensus update process in which they conduct multiple rounds of peer-to-peer (P2P) communications to exchange their models. After the consensus update, an ES will be randomly sampled to work as a leader and build an unverified block that contains the aggregated model for mining.

Block Mining: The leader ES broadcasts the block to the connected ESs and MDs for mining. In this work, we are mostly interested in the mining latency from the users' perspective, and thus we analyze the mining process at the MDs. Given resource constraints at the MDs, we develop a resource trading strategy where MDs can purchase hash power from the edge/cloud service provider (ESP) (e.g., Amazon cloud services) to run the mining task [2]}.

Block Generation:
After receipt of the unverified block,
the MD that is the first to successfully verify the block will append it to the Blockchain and receive a reward. Then, each MD downloads the verified block via its Blockchain account [2]} that contains the global model, and uses this for local model synchronization to begin the next round of model training.

