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

HAL
open science

# Proof of Clustering: an efficient and reliable blockchain-based clustering framework

Yamina Khenfouci, Yacine Challal

► To cite this version:

Yamina Khenfouci, Yacine Challal. Proof of Clustering: an efficient and reliable blockchain-based clustering framework. 2024 IEEE/ACM International Conference on Big Data Computing, Applications and Technologies (BDCAT), Dec 2024, Sharjah, United Arab Emirates. pp.149-158, 10.1109/BD-CAT63179.2024.00034. hal-05234188

HAL Id: hal-05234188

https://hal.science/hal-05234188v1

Submitted on 1 Sep 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_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Proof of Clustering: an efficient and reliable blockchain-based clustering framework

1st Yamina Khenfouci

Ecole nationale supérieure d'informatique

Laboratoire des Methodes de Conception des Systemes

Algiers, Algeria

y_khenfouci@esi.dz

2nd Yacine Challal

University of Doha for Science and Technology

College of Computing and IT

Doha, Qatar

yacine.challal@udst.edu.qa

**Abstract**—We propose a novel blockchain-based collaborative clustering framework, designed to enhance the efficiency and reliability of data clustering by decentralizing the clustering process across multiple nodes within the blockchain network. The system incorporates a consensus mechanism called Proof of Clustering to achieve the accuracy and consistency of clustering. This results thereby in ensuring confidence and reliability of the final clusters and prevents any breaches or corruption. To improve the performance of clustering process in the decentralized blockchain environment, data parallelism is employed. Through extensive experimentation and performance evaluation, we demonstrate the effectiveness and efficiency of proof of clustering consensus in various scenarios. Comparative studies with traditional centralized and distributed clustering methods showcase the superiority of our proposed solution by in terms of computational speed and resource utilization. PoC improves the Silhouette Score by 5.05% and reduces the Davies-Bouldin Index by 22.93%, indicating better cluster cohesion and separation in the PoC framework.

**Index Terms**—Artificial Intelligence, Machine Learning, Clustering, Blockchain, Consensus Protocols, Proof of Useful Work.

## I. INTRODUCTION

In recent years, the rapid growth of data-intensive applications and the emergence of Internet of Things (IoT) devices have led to an unprecedented increase in the volume and complexity of data generated across various domains [9]. However, handling and analyzing this massive flux of data can be challenging and resource-intensive. Clustering, a fundamental data analysis technique in machine learning (ML) and artificial intelligence (AI), plays a crucial role in organizing data into homogeneous groups to extract meaningful insights and facilitate decision-making. This technique typically requires access to the complete dataset. However, as massive amounts of data increasingly originate from multiple, dispersed sources such as IoT devices, the demand for effective and scalable clustering algorithms to uncover meaningful patterns and structures within this vast data landscape has become more pronounced. Moreover, traditional clustering methods face significant challenges in ensuring data privacy, security, and reliability, particularly in centralized environments. Recently, blockchain has emerged as one of

the most popular technology for decentralization through a large scale distributed and immutable data [3]. Blockchain is a distributed ledger for immutable and secured records [27], has significantly revolutionized different domains and present a promising avenue for addressing AI and ML challenges [13]. By leveraging the principles of decentralization, transparency, and immutability, blockchain offers a novel paradigm for data clustering that can enhance trust, security, and scalability in data analysis. Furthermore, the inherent properties of blockchain, such as its distributed consensus mechanism and smart contract capabilities, open up exciting possibilities for fostering confidence in the clustering results. The consensus algorithm is the core concept of the blockchain technology. The consensus algorithm is a set of mechanisms designed to ensure the accuracy and consistency of the data, transaction and block within the blockchain network. To achieve lower transaction and block verification delays and higher fault tolerance, the consensus algorithm used on the blockchain is primarily determined by the requirements of the service and performance deployed on the blockchain [8].

Motivated by these principles to develop a collaborative, reliable and trustworthy ecosystem for data clustering in various applications such as healthcare, IoT, financial analytic, network security, the introduction of blockchain as a consensus mechanism can significantly improve the clustering process. In healthcare, for example, data clustering can help identify trends and anomalies in patient data, leading to better diagnoses and treatments. In the IoT domain, clustering helps manage and analyze data streams in real-time, optimizing the performance and security of connected devices. Financial analytic benefits from clustering to detect fraud and predict market trends, while network security uses this technique to identify cyber threats and anomalous behaviors. Integrating blockchain into these processes provides an additional layer of security and transparency. The decentralized nature of blockchain ensures that the data used for clustering is immutable and verifiable, including the risk of manipulation and improving the trust of the parties involved. By providing a distributed consensus mechanism, blockchain also ensures
that clustering results are reproducible and reliable, which is
crucial for sensitive areas like healthcare and finance.

In this context, we propose a new framework for a secure
and decentralized clustering with a new Proof of Clustering
(PoC) consensus within a blockchain network to reach agree-
ment on the state of the blockchain among the participating
nodes and ensures that all participants in the network agree on
the validity of the clustered data. This system not only decen-
tralizes the clustering process but also establishes a mechanism
for attaining higher confidence, transparency and visibility of
the clustering outcomes and opens up new possibilities for
collaborative data analysis and machine learning applications
within distributed environments. PoC enables an incentive
mechanism that encourages nodes to jointly collaborate to
perform consensus of clustering data decisions between all
miners and saves the best decisions on the blocks which
could be traced back and are difficult to alter. This solution is
decentralized and approved by a validation committee whose
members are randomly designated.

The contribution of this work are twofold: first, we devel-
oped a blockchain-based clustering approach promoting trans-
parency and immutability in the clustering process; second,
we enhanced the reliability of clustering results by validating
them through a consensus mechanisms.

Our methodology involves the design and implementation
of decentralized clustering system over a public blockchain
network, followed by an in-depth evaluation of its performance
against various real-world datasets and robustness to mitigate
the different potential attacks. We anticipate that the findings
of this research will not only contribute to the existing AI
and blockchain integration frameworks but also pave the way
for a new generation of decentralized data analysis tools with
enhanced trustworthiness and efficiency. As the Field of data-
driven decision-making continues to expand, the proposed
decentralized and confident clustering paradigm holds the
potential to revolutionize how organizations and individuals
extract meaningful insights from massive datasets without
compromising on data privacy and security. By combining the
power of blockchain with advanced clustering techniques, we
take a significant step forward in unlocking the true potential
of data analytic in the era of decentralization.

In summary, we present the following key contributions:

* We propose a new proof of clustering consensus algorithm decentralized and trustworthy framework for a decentralized clustering process across multiple nodes within the blockchain network with an incentive mechanism that encourages parties to jointly participate in model training.

* We propose a new proof of clustering consensus in blockchain network as a proof of distributed clustering based on performing a distributed execution of k-means algorithm.

* We demonstrate the efficiency, security and performance

of the proposed proof of clustering consensus.

The rest of the paper is organized as follows. In Section
II, we present a background relating to blockchain technology
and clustering. Section III presents a literature review on the
convergence of AI and blockchain. Section IV presents in
depth the proof of clustering consensus mechanism and its
implementation in section V. In Section VI, the proposed
mechanism is analyzed and evaluated for both system ro-
bustness and performance. Finally, we conclude the paper in
Section VIII.

## II. BACKGROUND

### A. *Blockchain technology overview*

A blockchain consists of blocks with a growing list of
records that are linked using cryptography to resist the al-
teration of the data. Each block in the blockchain possesses a
cryptographic hash value of the previous block, a timestamp,
and transaction data. Because all blocks in the blockchain are
decentralised and distributed in nature, any involved block
in the blockchain cannot be modified retroactively without
affecting all subsequent blocks [22].

#### 1) *Blockchain Components*:

*   **Blocks:** contain the transactions in a Merkle tree and the block header.

*   **Block header:** contains the hash of the previous block, Merkle root of the transactions, timestamp, nonce,...etc.

*   **Transactions:** contain inputs and outputs. Inputs have signatures and public keys. Outputs have scripts depending on the usage.

*   **Merkle Tree:** transactions within a block are organized into a Merkle tree. The Merkle root, which is a cryptographic hash that summarizes the entire set of transactions, is then included in the block header [4].

2) *Overview on how the Blockchain works:* When a user initiates a transaction, it is broadcasted to the blockchain network, and miners typically save these transactions in a pool known as the mempool which contains pending transactions waiting to be included in a block. Miners continuously compete to create a new block by solving a complex mathematical puzzle through the mining process. This puzzle involves finding a hash value that meets certain criteria, such as having a specific number of leading zeros. Miners use their computational power to perform numerous calculations until they find a valid solution. Once a miner successfully solves the puzzle, they broadcast the newly mined block to the network. Other nodes in the network receive the block and verify its validity. This verification process includes checking the transactions within the block to ensure they meet the required criteria (e.g., correct digital signatures, available funds). If the block is deemed valid by the network's consensus mechanism (e.g., PoW), it is added to the blockchain as shown in Figure 1. The new block contains a reference (hash) to the previous block, which establishes a chronological order and creates
a chain of blocks. The addition of the new block to the blockchain is typically followed by updating the distributed ledger maintained by each node in the network. The ledger contains a copy of the complete transaction history of the blockchain. It provides transparency and allows any participant to verify the integrity of the transactions recorded on the blockchain. As subsequent blocks are added to the chain, the ledger grows, and the transactions become increasingly difficult to modify or tamper with, ensuring the immutability and security of the blockchain data [14].

<figure><img src="image_3.png" /><figcaption>Fig. 1. How the Blockchain works</figcaption></figure>

3) *Blockchain properties:* There are several key properties that are inherent to most blockchain implementations [20]:

* **Immutability:** Once a block is added to the blockchain, it is extremely difficult to modify or tamper with. The use of cryptographic hashing and consensus mechanisms ensures the integrity and immutability of the recorded data.

* **Security:** Blockchains employ cryptographic techniques, such as digital signatures and hashing, to secure transactions and protect against fraudulent activities.

* **Transparency:** Making the entire transaction history visible to all participants. This transparency enhances trust and accountability within the network.

* **Decentralization:** Blockchains distribute control and decision-making across a network of nodes, eliminating the need for a central authority.

* **Trustlessness:** Blockchains enable participants to interact and transact without requiring trust in a central authority or each other. The consensus mechanisms and cryptographic protocols ensure that trust is established through mathematics, game theory or others approaches.

* **Data Consistency:** Each participant in the network maintains a copy of the blockchain, and consensus mechanisms ensure that all participants agree on the state of the ledger.

## B. Clustering

The unsupervised learning algorithms learn few features from the data. When new data is introduced, it uses the

previously learned features to recognize the class of the data. It is mainly used for clustering and feature reduction. Clustering is the classification of data points due to certain similarities and is a common unsupervised machine learning task. Cluster analysis [11] provides insight into the data by dividing the objects into groups (clusters) of objects, such that objects in a cluster are more similar to each other than to objects in other clusters. K-means [18] is a well-known and widely used partitional clustering method.

### k-means clustering algorithm

K-means [18] is a prototype-based, simple partitional clustering technique. It aims to find a user-specified k number of clusters. These clusters are represented by their centroids (a cluster centroid is typically the mean of the points in the cluster). The clustering process of K-means is as follows. First, k initial centroids are selected randomly, where k is specified by the user and indicates the desired number of clusters. Every point in the data is then assigned to the closest centroid, and each set of points assigned to a centroid forms a cluster. The centroid of each cluster is then updated based on the points assigned to the cluster. This process is repeated until no point changes clusters (see Algorithm 1).

**Algorithm 1 k-Means clustering**

1: Randomly select k cluster centers $c_i, \dots, c_k$.

2: **Repeat**

3: Assign each data entity to the closest cluster center $c_i$.

4: Replace each cluster center $c_i$ by the mean of the cluster $i$.

5: **Until** cluster centers do not change.

## III. RELATED WORKS

Several researchers have devoted their efforts to the implementation of blockchain and AI in various domains and examine their potential convergence. Authors Ding et al. [7], Ural et al. [24], Qu et al [21] and Kayikci et al [13] aim to provide insights into the current state of research and identify opportunities and challenges in combining these technologies.

Authors Salah et al. [23] was the first to provide an overview of the Blockchain for AI. They provide a review of existing literature and investigate open research challenges in utilizing blockchain for AI applications.

Karger et al. [12] provide a comprehensive overview of the state-of-the-art and explore existing approaches of the utilization of the blockchain in the context of AI data. They examines the functionalities offered by these approaches and the potential benefits they can bring. Additionally, the authors investigate the risks associated with using blockchain for AI data management and the research challenges that still need to be addressed.

In [17], Liu et al. introduce a novel approach to incentive miners in a blockchain network by incorporating machine learning training work. By providing an extra incentive for
participants and implementing mechanisms for rewarding useful work and punishing malicious actors, the protocol aims to create a secure and reliable distributed environment for ordering, completing, and verifying tasks. In this protocol, clients submit tasks to the network, and these tasks are then assigned to miners. The miners perform honest ML training work, which involves training a machine learning model on the blockchain. This work is considered useful because it contributes to the improvement and development of the ML model. Once the training work is completed, the clients pay all the training contributors, including the miners. This payment serves as an additional reward for the miners, encouraging their participation in the network. By incorporating machine learning training into the mining process, the protocol aims to enhance the usefulness and practicality of the work performed by miners. To ensure the integrity and security of the network, the protocol includes mechanisms to reward useful work and punish malicious actors. Authors Chauras et al. [4] propose a way to use proof of useful work for solving TOR vanity URL generation and bitcoin vanity address generation problems: anybody can be puzzler, in the absence of the problems to solve, it can revert to a normal PoW blockchain and provision of puzzlers rewarding miners (thereby reducing the importance of transaction fees).

Authors Chen et al. [6] propose DLchain, a blockchain system built on deep learning with a consensus mechanism comparable to PoW in terms of robustness. It showcases improvements over previous work and demonstrates practicality through experiment results. However, some limitations related to selfish publisher attacks have been identified, and further analysis has been conducted to address these concerns.

Similarly, Authors Lihu et al. [16] propose a novel proof of useful work concept using a distributed and decentralized machine learning system on blockchain. Miners get a chance to create new coins after performing honest ML training work. Clients submit tasks and pay all training actors involved in the process (miners, supervisors and evaluators) if the model is satisfactory. They outline mechanisms to reward useful work and punish malicious actors.

Authors Lan et al. [15] present a Proof of Learning, a consensus algorithm having data nodes and consensus nodes to do ML on blockchain. Data nodes push training requests and consensus nodes choose the request with highest reward / time value to train. The model with the highest test accuracy wins and the corresponding block is published.

Authors Yamina et al. [26] propose a ClusterChain framework for clustering within a blockchain network in which multiple competing nodes locally execute a clustering model and synchronize the best solution. In this framework, the network is composed of a manager node and Miner nodes for clustering. Thereafter, we will compare the performance of our solution, based on the Proof of Clustering framework, with that of the ClusterChain framework.

## IV. CONSENSUS "PROOF OF CLUSTERING" (POC)

### A. System Model

<figure><img src="image_4.png" /><figcaption>Fig. 2. Node Type</figcaption></figure>

The system is composed of multiple nodes type as shown in Figure 2.

* **Data holder node:** entities who possess datasets and want to gain insights or value from their data can act as data providers by providing the training data and order the machine learning tasks (Clustering algorithm, requirements of the training...etc) within the blockchain network; The data holder node goal is to buy a good ML model of a data set to which it has access. The data provider has to commit to payment in exchange for the winning model.

* **Training node:** provider of computing power to the system to resolve the clustering tasks; they collaborate to perform the performante clustering for data delivred but the data owner, instead of solving complex mathematical puzzles as in traditional mining, miners would now run clustering algorithms on the data to find meaningful patterns that meets the requirements specified by the data holder node.

* **Validation node:** plays a crucial role in the blockchain network by verifying and evaluating the results produced by the training nodes. After the training nodes have performed the clustering on the data provided by the data holder. The validation node examines the clustering results to ensure that they meet the requirements specified by the data holder. This involves assessing the effectiveness of the clustering algorithm in identifying meaningful patterns and producing accurate models. The validation node may use various evaluation metrics to measure the performance of the clustering results: silhouette coefficient, accuracy...etc. If the clustering results meet the
specified requirements, the validation node approves and confirms their validity within the blockchain network. On the other hand, if the clustering results do not meet the desired quality standards, the validation node rejects the results and requests the training nodes to refine their algorithms and generate improved models.

## B. Design overview

In traditional blockchains like Bitcoin, miners compete to solve complex mathematical puzzles (PoW) to validate and add blocks to the blockchain. In PoC, mining involves data clustering, and the consensus mechanism could be based on the effectiveness of the clustering results. Now, we introduce a comprehensive solution for PoC consensus, that combine between mining and clustering data over blockchain. The goal of this consensus is to achieve agreement on the state of the blockchain among the participating nodes and ensures that all participants in the network agree on the validity of the clustered data. Mainly PoC is based on the work of Algorand blockchain [10]. Combining mining and clustering data over a blockchain poses some challenges described in the above section, such as security, computational power requirements, and ensuring fair and accurate analysis.

### Algorithm 2 Dataholder Node Operation

1. **procedure** INITIALIZENETWORK

2. $data \leftarrow READDATASET()$

3. $NBCluster \leftarrow READNUMBEROFCLUSTERS()$

4. $dataPartitions \leftarrow SPLITDATASET(data, NBminers)$

5. **for all** partition in $dataPartitions$ **do**

6. &nbsp;&nbsp;&nbsp;&nbsp;Send partition and $NBCluster$ to each miner

7. **end for**

8. **end procedure**

### Algorithm 3 Clustering Process

**procedure** KMEANSCLUSTERING

Wait to receive $NBCluster$ and $dataPartition$ from Dataholder

$TrainingNodeResults \leftarrow KMEANS(dataPartition, NBCluster)$

$SENDRESULTSTOVALIDATOR(TrainingNodeResults)$

**end procedure**

In the following, we will provide detailed explanations of the operations involved in the proposed consensus protocol.

First, we illustrate in Figure 3 the workflow of PoC, in which multiple training nodes collaborate to perform clustering tasks using a decentralized network based on blockchain technology.

* **Initialization:** Data holder provides data to the blockchain network and define the clustering task containing the number of clusters, $K$ ...etc. (See Algorithm 2).

* **Clustering Process:** The training nodes perform clustering mechanism on their local data independently, using algorithms such as k-means, nodes iterate until convergence. Once the clustering process is complete, the results are shared with the validation committee through the blockchain (See Algorithm 3). The concept of proof of useful work ensures that the computational efforts expended by the participants contribute to the overall clustering task.

* **Validation and Threshold Evaluation:** The validation committee evaluates the received clustering results based on the predefined threshold set by the data holder. Only the clustering results that meet or exceed the threshold are considered for further analysis (See Algorithm 4).

* **Aggregation:** The validation committee aggregates the selected clustering results, by calculating an average of clustering results, to generate the final clustering outcome.

* **Final Result and Blockchain Update:** The validation committee creates a new block on the blockchain, including the validated final clustering outcome. The new block is added to the blockchain, ensuring its immutability and transparency.

This process ensures that the clustering outcome aligns with the data holder's expectations and is securely recorded on the blockchain for future reference. The blockchain validation nodes validate and stores these results, ensuring transparency and immutability. By leveraging blockchain, this collaborative clustering approach offers several advantages. First, it provides a decentralized framework where participants can contribute their computational power and data resources without relying on a central authority. Second, the use of blockchain enhances data privacy and security, as the data remains encrypted and is only accessible to authorized participants. Finally, the proof of useful work mechanism ensures that participants' efforts contribute meaningfully to the overall clustering task, preventing malicious or fraudulent activities. Overall, collaborative clustering with blockchain as a proof of useful work is a promising approach that combines the benefits of decentralized collaboration, data privacy, and secure validation in the field of clustering tasks.

## V. IMPLEMENTATION

PoC was implemented by Go (Golang), known for its simplicity, reliability, and efficiency in building multithreaded networking applications [1], and Go-LibP2P is used to construct a peer-to-peer modular network stack [2]. The implementation was carried out on an Ubuntu Operating System with an
<figure><img src="image_5.png" /><figcaption>Fig. 3. Proof of Clustering Steps</figcaption></figure>

**Algorithm 4 Validation and evaluation clustering results**

1: **procedure** VALIDATIONTRAININGNODEOUT-PUT(threshold)
2: Wait to receive clustering results from Training nodes
3: allCentroids ← empty list
4: **for** all Result in TrainingNodeResultslist **do**
5: silhouetteScore ← CALCULATEPERFORMANCE(km) ▷ km structure contains the clustering results
6: **if** silhouetteScore ≥ threshold **then** ▷ Threshold is defined in Data holder task template
7: allCentroids ← allCentroids ∪ km.Centroids ▷ aggregate accurate clustering results
8: **end if**
9: **end for**
10: aggregatedCentroids ← AGGREGATECENTROIDS(allCentroids) ▷ AggregateCentroids calculates the average of all selected centroids
11: newBlock.Centroids ← aggregatedCentroids
12: newBlock ← GENERATEBLOCK()
13: **if** ISBLOCKVALID() **then**
14: Blockchain ← append(Blockchain, newBlock)
15: Update blockchain
16: **end if**
17: **end procedure**

Intel(R) Xeon(R) E-2276M CPU @ 2.80GHz, 2.81 GHz, and 32.0 GB (31.7 GB usable) of RAM to ensure that each training and validation node has equal processing power.

A. Dataset

All experiments were conducted using the data provided by
the UCI Irvine Machine Learning repository, specifically:

*   **Iris dataset:** It contains four features: length and width of sepals and petals of Iris setosa, Iris virginica, and Iris versicolor [19].

*   **Mall Customer dataset** which provides information about customers in a mall to score a customer based on their behaviors and purchasing data, it contains the basic information (ID, age, gender, income, spending score) about the customers [5].

*   **Breast Cancer Wisconsin(BCW):** provides results of diagnosing breast masses based solely on Fine Needle Aspiration tests. It consists of 699 instances of clinical data and includes 32 features that describe the cell nuclei present in the image, such as radius, texture, perimeter, area, smoothness, compactness, ...etc. The target variable is the diagnosis, which is either "malignant" (indicating a cancerous tumor) or "benign" (indicating a non-cancerous tumor) [25].

For data distribution, IPFS was initialized and its daemon.
We divided the data programmatically for testing by using a
horizontal split. Subsequently, we downloaded files containing
different segments of the data onto IPFS.

B. Performance criteria

This work addresses multiple challenges:

**Better performance:** Clustering models performance as:accuracy criterion, Silhouette Score, the variance in the number of clusters, model quality.

**Silhouette Score:** Provides an indication of how close points in a cluster are to other points in the same cluster (cohesion) compared to points in different cluster (separation). It ranges from -1 to +1, a higher Silhouette score indicates better results.

$$
s(i) = \frac{b(i) - a(i)}{\max(a(i), b(i))}
$$
* a(i) is the average distance between the sample i and all other points within the same cluster. This is the cohesion of i.

* b(i) is the average distance between the sample i and all points in the nearest cluster to which i does not belong. This is the separation of i.

**Davies-Bouldin Index (DBI):** Unlike the silhouette score, the DBI focuses on the average similarity ratio of each cluster with its most similar cluster. Lower values of the DBI indicate better clustering.

$$DBI = \frac{1}{k} \sum_{i=1}^{k} R_{i}$$

Where $R_i$ is the maximum value of $R_{ij}$ for all $j \neq i$, and k is the number of clusters

$$R_{ij} = \frac{S_{i} + S_{j}}{d_{ij}}$$

* $S_i$ is the average distance between each sample in the cluster $C_i$ and the cluster centroid.

* $d_{ij}$ is the distance between the cluster centroids $C_i$ and $C_j$.

## C. Safety, correctness and liveness of consensus protocol

**Decentralizing decision:** Across multiple nodes to enable parallel, multi-tasking decision making for accelerated decision making.

**Finality or Liveness:** The consensus mechanism should provide finality, meaning once a transaction is confirmed and added to the blockchain, it cannot be reversed or altered. Alternatively, if the blockchain uses probabilistic finality (e.g., in Proof of Work(PoW)), it should provide strong guarantees on the probability of a transaction being reverted.

**Security:** The consensus algorithm must be secure against various attacks (Sybil attacks,...etc), including malicious nodes trying to manipulate the system, double-spending, or attempting to disrupt the network.

**Consistency:** All nodes in the network should reach an agreement on the order of transactions. This ensures that the data stored in the blockchain is consistent across the entire network.

# VI. EXPERIMENT RESULTS AND DISCUSSION

We conduct two sets of experiments. The first is to verify whether the PoC can reliably control the time between the creation of two sequential blocks. If so, the blocks are generated at regular intervals, transactions made through the system will not experience unexpected delays. The second is to verify the effectiveness of the PoC by comparing the performance of clustering models trained in our framework with other clustering methods.

## Experiment 1:Time between the creation of two sequential blocks

In this experiment, we measure the amount of time between the creation of two sequential blocks to verify if PoC is reliable. The result of this experimentation is shown in Table I, each execution of a ML task within the PoC consistently converged, and a new block was added to the blockchain within 4 to 5 minutes after each learning round. This demonstrates the reliable and reasonably efficient nature of the PoC approach in terms of block creation.

## Experiment 2: Decentralized K-means within PoC optimization

The purpose of these experiments is to evaluate the effectiveness and efficiency of the K-means PoC approach.

**Determination of Optimal Clustering Configuration:** We compare the performance of our decentralized K-means approach using the PoC comparing it with both traditional (centralized) K-means and K-means as described in the ClusterChain approach [26]. The experiments were conducted on multiple datasets, including the Iris, Mall Customers, and Breast Cancer datasets, with varying numbers of clusters (K) from 2 to 6. According to results shown in Table II, Table III, Table IV and Figure 4, we observe the following:

* **Iris Dataset:** The results show that all three approaches yield similar Silhouette scores indicating comparable clustering quality. However, the PoC framework resulted in a higher DBI, suggesting that while the clusters were somewhat well-separated, there might be higher intra-cluster variance in PoC compared to the other methods.

* **Mall Customers Dataset:** The PoC framework showed an increase in Silhouette score compared to the other approaches, indicating improved clustering quality. The DBI for PoC was also close to the traditional and ClusterChain approaches, suggesting that the decentralized approach does not compromise the inter-cluster separation.

* **Breast Cancer (BCW):** For this dataset, traditional K-means outperformed both ClusterChain and PoC in terms of Silhouette score, achieving a nearly perfect clustering. However, PoC still provided a reasonable clustering with a noticeable DBI, which was lower compared to ClusterChain.

**Performance Comparison of Decentralized vs. Centralized K-mean:** We evaluated the different K-means approaches using the Silhouette score and DBI across three datasets: Iris, Mall Customers, and Breast Cancer to determine the optimal clustering configuration. The results, averaged over multiple runs with K=2, are presented in Tables V, Figure 5, Figure 6 and Figure 7. We observed that traditional (centralized) K-means, K-means within ClusterChain, and decentralized K-means with distributed data produce comparable Silhouette scores for the Iris dataset. However, the PoC approach shows an increase in the DBI compared to the other methods for
<table><caption>TABLE I
COMPARISON OF BLOCK CREATION TIME PERFORMANCES.</caption><thead><tr><th>Block Index</th><th>Timestamp</th></tr></thead><tbody><tr><td>Genesis block (block 0)</td><td>2024-08-08 18:49:01.972435683 +0100 WAT m=+0.205962143</td></tr><tr><td>Block 1</td><td>2024-08-08 18:49:10.03167214 +0100 WAT m=+7.42415200</td></tr><tr><td>Block 2</td><td>2024-08-08 18:54:15.2117034 +0100 WAT m=+8.51452489</td></tr><tr><td>Block 3</td><td>2024-08-08 19:00:18.9027696 +0100 WAT m=+9.96882679</td></tr></tbody></table>

this dataset. When applying the PoC framework to the Mall Customers dataset, there is an increase in the Silhouette score (value = 0.416) and a relatively close DBI value to 0.241 compared to other approaches. The decrease in DBI suggests that the PoC framework achieves higher inter-cluster similarity and lower intra-cluster similarity, indicating that this dataset is well matched to the assigned clusters. Compared to the centralized and ClusterChain approaches, which achieve high Silhouette scores of 0.975 and DBI values of 0.021 for the BCW and Iris datasets indicating strong clustering the PoC framework demonstrates lower clustering performance with a Silhouette score of 0.612 and a DBI of 0.253. It's important to note that the performance of clustering algorithms can vary depending on the characteristics of the dataset and the specific problem domain.

**Impact of Network Configuration on Performance:** We examine the performance of the two approaches ClusterChain vs PoC across multiple network configuration (different number of training nodes) to assess its impact on clustering performance. In Table VI, we remark that the performance score of clustering increases with the increase of nodes number which confirm the advantages of decentralization and distribution of data. This suggests that the PoC framework can effectively scale with the network size, improving both clustering quality and efficiency.

**Blockchain's Overhead and Its Influence on Clustering Efficiency:** Blockchain enhances ML in particular the clustering process by providing a secure, tamper-proof data source that preserves the integrity of training data and protects against malicious alterations, thus improving model accuracy. Its transparent ledger allows nodes to track model performance and updates, resulting reduce biases. Immutable model storage and model verification enable accurate and consistent deployment, enhancing reliability. Blockchain's decentralized structure also prevents single points of failure, supporting resilient model updates and efficient consensus-driven validation for quality assurance. However, blockchain introduces overhead in processing, data storage, and transaction latency, which can slow down model training and data exchange, impacting clustering performance in time-sensitive or resource-constrained settings. Therefore, while blockchain provides robust security and transparency, these benefits must be balanced against the added operational costs.

<figure><img src="image_6.png" /><figcaption>Fig. 4. Optimal number of clusters for k-means clustering within ClusterChain and PoC</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Fig. 5. Clustering performance of ClusterChain and PoC clustering approaches based on (Iris Dataset)</figcaption></figure>

## VII. SECURITY ANALYSIS

Regarding the security analysis of the PoC framework, we can confirm its reliability and trustworthiness. PoC is based on blockchain technology which ensures the integrity and traceability of learning data by design, as all data is saved in the blockchain and can be easily verified and traced back. Consensus protocol executed between all blockchain network in particular a validation nodes work to collaboratively validate final clustering updates, ensuring the credibility and integrity of the system. It's essential to emphasize that Segregation of Duties (SoD) is implemented across different nodes in the PoC network. The data holder, cannot perform any clustering
<table><caption>TABLE II
SILHOUETTE AND DBI SCORE ANALYSIS FOR OPTIMAL K(NUMBER OF CLUSTER) BASED ON IRIS DATASET</caption><thead><tr><th rowspan="2">Approach</th><th colspan="5">Silhouette score</th><th colspan="5">DBI</th></tr><tr><th>k=2</th><th>k=3</th><th>k=4</th><th>k=5</th><th>k=6</th><th>k=2</th><th>k=3</th><th>k=4</th><th>k=5</th><th>k=6</th></tr></thead><tbody><tr><td>Traditional K-means</td><td><strong>0.685</strong></td><td>0.561</td><td>0.560</td><td>0.424</td><td>0.389</td><td>0.217</td><td>0.217</td><td>0.227</td><td>0.217</td><td><strong>0.192</strong></td></tr><tr><td>K-means(ClusterChain)</td><td><strong>0.685</strong></td><td>0.560</td><td>0.5116</td><td><strong>0.393</strong></td><td>0.685</td><td>0.395</td><td>0.666</td><td>0.775</td><td>0.912</td><td>1.093</td></tr><tr><td>K-means (PoC))</td><td><strong>0.685</strong></td><td>0.393</td><td>0.536</td><td>0.451</td><td>0.217</td><td>0.393</td><td>0.451</td><td><strong>0.205</strong></td><td>0.348</td><td>0.348</td></tr></tbody></table>

<table><caption>TABLE III
SILHOUETTE AND DBI SCORE ANALYSIS FOR OPTIMAL K(NUMBER OF CLUSTER) BASED ON MALL CUSTOMER DATASET</caption><thead><tr><th rowspan="2">Approach</th><th colspan="5">Silhouette score</th><th colspan="5">DBI</th></tr><tr><th>k=2</th><th>k=3</th><th>k=4</th><th>k=5</th><th>k=6</th><th>k=2</th><th>k=3</th><th>k=4</th><th>k=5</th><th>k=6</th></tr></thead><tbody><tr><td>Traditional K-means</td><td>0.338</td><td>0.391</td><td>0.416</td><td>0.374</td><td><strong>0.608</strong></td><td>0.385</td><td>0.306</td><td>0.257</td><td>0.257</td><td><strong>0.257</strong></td></tr><tr><td>K-means(ClusterChain)</td><td><strong>0.489</strong></td><td>0.333</td><td>0.396</td><td>0.455</td><td><strong>0.405</strong></td><td>0.404</td><td>0.5042</td><td>0.266</td><td>0.224</td><td><strong>0.179</strong></td></tr><tr><td>K-means (PoC))</td><td>0.355</td><td>0.382</td><td>0.335</td><td>0.408</td><td><strong>0.421</strong></td><td>0.418</td><td>0.393</td><td>0.451</td><td><strong>0.205</strong></td><td><strong>0.348</strong></td></tr></tbody></table>

<table><caption>TABLE IV
SILHOUETTE AND DBI SCORE ANALYSIS FOR OPTIMAL K(NUMBER OF CLUSTER) BASED ON BREAST CANCER DATASET</caption><thead><tr><th rowspan="2">Approach</th><th colspan="5">Silhouette score</th><th colspan="5">DBI</th></tr><tr><th>k=2</th><th>k=3</th><th>k=4</th><th>k=5</th><th>k=6</th><th>k=2</th><th>k=3</th><th>k=4</th><th>k=5</th><th>k=6</th></tr></thead><tbody><tr><td>Traditional K-means</td><td><strong>0.975</strong></td><td>0.975</td><td>0.966</td><td>0.966</td><td><strong>0.972</strong></td><td>0.021</td><td>0.021</td><td>0.021</td><td>0.021</td><td>0.021</td></tr><tr><td>K-means(ClusterChain)</td><td>0.975</td><td>0.975</td><td>0.975</td><td>0.975</td><td>0.975</td><td>0.021</td><td>0.021</td><td>0.021</td><td>0.021</td><td>0.021</td></tr><tr><td>K-means (PoC))</td><td><strong>0.663</strong></td><td>0.612</td><td>0.612</td><td>0.528</td><td>0.526</td><td><strong>0.156</strong></td><td>0.351</td><td>0.154</td><td><strong>0.131</strong></td><td><strong>0.121</strong></td></tr></tbody></table>

<table><caption>TABLE V
COMPARING THE CLUSTERING PERFORMANCES OF DIFFERENT APPROACHES.</caption><thead><tr><th rowspan="2">Dataset</th><th colspan="3">Traditional K-means</th><th colspan="3">K-means(ClusterChain)</th><th colspan="3">K-means (PoC)</th></tr><tr><th>BCW</th><th>Iris</th><th>Mall Customer</th><th>BCW</th><th>Iris</th><th>Mall Customer</th><th>BCW</th><th>Iris</th><th>Mall Customer</th></tr></thead><tbody><tr><td>Silhouette</td><td>0.975</td><td>0.685</td><td>0.356</td><td>0.972</td><td>0.706</td><td>0.398</td><td>0.612</td><td><strong>0.631</strong></td><td><strong>0.416</strong></td></tr><tr><td>Davies Bouldin Index</td><td>0.021</td><td>0.217</td><td>0.362</td><td>0.021</td><td>0.217</td><td>0.312</td><td>0.253</td><td><strong>0.367</strong></td><td><strong>0.241</strong></td></tr></tbody></table>

<figure><img src="image_8.png" /><figcaption>Fig. 6. Clustering performance of different clustering approaches (Mall Customers Dataset)</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>Fig. 7. Clustering performance of different clustering approaches (Breast Cancer Dataset)</figcaption></figure>

tasks, as its role is solely as a data provider. Similarly, validation nodes are restricted from validating their own clustering results, ensuring unbiased oversight. Additionally, each node holds a unique profile and ID within the PoC blockchain, preventing identity duplication. This SoD structure is critical

in preventing potential malicious faults within the system. By enforcing independent validation of clustering results, PoC ensures that nodes with different responsibilities cross-verify each other's outputs. By assigning distinct roles to nodes, PoC effectively manages faults without compromising the overall clustering process. Furthermore, communication between
<table><caption>TABLE VI
COMPARISON OF K-MEANS SILHOUETTE PERFORMANCES WITHIN POC VS CLUSTERCHAIN</caption><thead><tr><th rowspan="2">Dataset</th><th colspan="7">K-means (PoC)</th></tr><tr><th>Iris (Node=04)</th><th>Iris (Node=06)</th><th>Iris (Node=08)</th><th>Iris (Node=10)</th><th>Iris (Node=12)</th><th>Iris (Node=14)</th><th>Iris (Node=16)</th></tr></thead><tbody><tr><td>Silhouette</td><td>0.523</td><td>0.598</td><td>0.505</td><td>0.533</td><td>0.423</td><td>0.521</td><td>0.623</td></tr></tbody></table>

nodes in the PoC network is secured. Training node relay their clustering results to other peers through the blockchain, maintaining data integrity and security throughout the network.

In terms of safety, correctness, and liveness properties, the PoC approach satisfies these criteria. The safety property ensures that the new blocks are valid and identical for all nodes. The correctness property ensures that only validated results are appended to the network by validation node and not other nodes. Finally, the liveness property guarantees that the K-means algorithm consistently converges as discussed, and in each round, a new block is added to the blockchain, as indicated in the provided Table I.

## VIII. CONCLUSION

This article proposes Proof of Clustering framework for collaborative clustering and data analysis with a consensus algorithm. By combining the strengths of blockchain and data analysis, PoC enhances the reliability, security, and quality of clustering results. The improvements in Silhouette scores, Davies-Bouldin Index values and decentralized nature underlie the frameworks potential to revolutionize how clustering is performed and validated in distributed and collaborative environments. This work opens new avenues for research and applications in secure and efficient data analysis, with broad implications for various industries relying on accurate and trustworthy clustering results. In our future work, we plan to develop hierarchical distributed clustering algorithms, which better satisfy specific requirements of distributed systems. Additionally, we plan to enhance security and fault tolerance by incorporating advanced cryptographic techniques, such as zero-knowledge proofs, and by designing more robust consensus mechanisms to mitigate the risk of node failures and malicious attacks. These enhancements will further solidify PoC as a reliable solution for secure, resilient, and scalable collaborative data analysis.

## REFERENCES

[1] The go programming language. https://golang.org/.

[2] libp2p - modular peer-to-peer networking stack. https://libp2p.io/.

[3] Dana Alsagheer, Lei Xu, and Weidong Shi. Decentralized machine learning governance: Overview, opportunities, and challenges. IEEE Access, 2023.

[4] Yash Chaurasia, Visvesh Subramanian, and Sujit Gujar. Pupow: A framework for designing blockchains with practically-useful-proof-of-work & vanitycoin. In 2021 IEEE International Conference on Blockchain (Blockchain), pages 122–129. IEEE, 2021.

[5] Zhi Chen and Zhi Chen. Mall customers. https://www.kaggle.com/code/cdabakoglu/clustering-mall-customers-k-means/input, 2024.

[6] Changhao Chenli, Boyang Li, and Taeho Jung. Dlchain: Blockchain with deep learning as proof-of-useful-work. In Services-SERVICES 2020: 16th World Congress, Held as Part of the Services Conference Federation, SCF 2020, Honolulu, HI, USA, September 18-20, 2020, Proceedings 16, pages 43–60. Springer, 2020.

[7] Shengwen Ding and Chenhui Hu. Survey on the convergence of machine learning and blockchain. In Proceedings of SAI Intelligent Systems Conference, pages 170–189. Springer, 2022.

[8] Mingxiao Du, Qijun Chen, and Xiaofeng Ma. Mbft: A new consensus algorithm for consortium blockchain. IEEE Access, 8:87665–87675, 2020.

[9] Ayodeji Falayi, Qianlong Wang, Weixian Liao, and Wei Yu. Survey of distributed and decentralized iot securities: Approaches using deep learning and blockchain technology. Future Internet, 15(5):178, 2023.

[10] Yossi Gilad, Rotem Hemo, Silvio Micali, Georgios Vlachos, and Nickolai Zeldovich. Algorand: Scaling byzantine agreements for cryptocurrencies. In Proceedings of the 26th symposium on operating systems principles, pages 51–68, 2017.

[11] Anil K Jain and Richard C Dubes. Algorithms for clustering data. Prentice-Hall, Inc., 1988.

[12] Erik Karger, Marvin Jagals, and Frederik Ahlemann. Blockchain for ai data—state of the art and open research. In Proceedings of the 42nd International Conference on Information Systems (ICIS), Austin, TX, USA, pages 12–15, 2021.

[13] Safak Kayikci and Taghi M Khoshgoftaar. Blockchain meets machine learning: a survey. Journal of Big Data, 11(1):9, 2024.

[14] C Komalavalli, Deepika Saxena, and Chetna Laroiya. Overview of blockchain technology concepts. In Handbook of research on blockchain technology, pages 349–371. Elsevier, 2020.

[15] Yixiao Lan, Yuan Liu, Boyang Li, and Chunyan Miao. Proof of learning (pole): Empowering machine learning with consensus building on blockchains. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 16063–16066, 2021.

[16] Andrei Lihu, Jincheng Du, Igor Barjaktarevic, Patrick Gerzanics, and Mark Harvilla. A proof of useful work for artificial intelligence on the blockchain. arXiv preprint arXiv:2001.09244, 2020.

[17] Yiming Liu, F Richard Yu, Xi Li, Hong Ji, and Victor CM Leung. Blockchain and machine learning for communications and networking systems. IEEE Communications Surveys & Tutorials, 22(2):1392–1431, 2020.

[18] J MacQueen. Classification and analysis of multivariate observations. In 5th Berkeley Symp. Math. Statist. Probability, pages 281–297, 1967.

[19] Z. Mushtaq. Iris dataset analysis. UCI Machine Learning Repository, 2024.

[20] Suyel Namasudra, Ganesh Chandra Deka, Prashant Johri, Mohammad Hosseinpour, and Amir H Gandomi. The revolution of blockchain: State-of-the-art and research challenges. Archives of Computational Methods in Engineering, 28:1497–1515, 2021.

[21] Chongxiao Qu, Lei Jin, Yongjin Zhang, Changjun Fan, Jinqi Chu, and Shuo Liu. Exploration on the fusion of artificial intelligence and blockchain. In 2022 3rd International Conference on Big Data Economy and Information Management (BDEIM 2022), pages 156–163. Atlantis Press, 2023.

[22] Arun Sekar Rajasekaran, Maria Azees, and Fadi Al-Turjman. A comprehensive survey on blockchain technology. Sustainable Energy Technologies and Assessments, 52:102039, 2022.

[23] Khaled Salah, M Habib Ur Rehman, Nishara Nizamuddin, and Ala Al-Fuqaha. Blockchain for ai: Review and open research challenges. IEEE Access, 7:10127–10149, 2019.

[24] Ozgur Ural and Kenji Yoshigoe. Survey on blockchain-enhanced machine learning. IEEE Access, 2023.
[25] W. H. Wolberg, W. N. Street, and O. L. Mangasarian. Breast cancer wisconsin (diagnostic) data set, 2016. Online [Available]: https:// www.kaggle.com/datasets/uciml/breast-cancer-wisconsin-data (accessed Jul. 07, 2024).

[26] Khenfouci Yamina, Challal Yacine, and Hamdad Leila. Clusterchain: Decentralized and trustworthy clustering over blockchain. In *2021 International Conference on Networking and Advanced Systems (ICNAS)*, pages 1–6. IEEE, 2021.

[27] Jesse Yli-Huumo, Deokyoon Ko, Sujin Choi, Sooyong Park, and Kari Smolander. Where is current research on blockchain technology?—a systematic review. *PloS one*, 11(10):e0163477, 2016.