## 3 Methodology
### Proposed ECC Key Distribution and Management  
In this proposed scheme, we have used a private key generated using a random integer in a certain range of the curve's field size. The scheme is summarized into four phases starting with: identifying the number of clusters, authenticating all the nodes, identifying the cluster head, key distribution by all the members in the group, generating the routing table using routing protocol, and the last phase is the rekeying process in case of any change in the group. A list of notations is explained in Table 1.  
The scheme operates on the assumption that the network contains several nodes, and all the nodes have the same characteristics with the same level of authority. At each instance, any node that has data to send uses a procedure defined by the protocol to decide on where to send it. Each node in the network can compute and generate its private key in the ECC, which are integers in the range of the curve's field size, which is 256-bit integers. This study uses the elliptic curve digital signature algorithm (ECDSA) on the secp256k1 curve, which is mostly used in cryptocurrency systems. secp256k1 is constructed in a special non-random way which allows for especially efficient computation. In many cases, a sufficiently optimized implementation of secp256k1 is 30% or more faster than other known EC curves. secp256k1, often referred to as the Koblitz curve, has six domain parameters specified as a sextuple T = (P, a, b, G, n, and h) over a curve \(\mathbf{E}(\mathbb{F}_{p})\) defined by Equation (1) [32]. Each node in the group computes a new point (public key) on the curve by taking the scalar product between its private key and the reference point on the curve. The protocol that we have used to agree on a common key in a distributed way was introduced in [33] \begin{table}
\begin{tabular}{c c} \hline \hline
**Notation** & **Description** \\ \hline ID\({}_{\text{CHi}}\) & Identity for group head GHi \\ GHi & Group heads (gateway, sink node) \\ rg & Random number generated by each node \\ AUG & Authentication message by group head \\ \(x_{i}\) & Private key for node i \\ Ui & Node in the group \\ Sid & Source ID \\ Did & Destination ID \\ Mid & Message ID \\ NC & Node counts, indicates the number of nodes in the network that computed \\  & their points on the elliptic curve. \\ P\({}_{x}\), Py & P\({}_{x}\) and P\({}_{y}\) are the x and y coordinates of a point P on the EC. \\ P\({}_{mid}\) & Previous message id, which is used to save the id of the last seen message \\ NN & Total number of nodes in the network \\ Skey & Shared key \\ P & Odd prime modulus \\ G & Generator base point on the EC with \(G_{x}\ and\ G_{y}\) as x and y coordinates \\ N & EC group order \\ a,b & Constant integers for the curve \\ H & Co-factor \\ \hline \hline \end{tabular}
\end{table} 
Table 1: List of notations. as an extension of the foundational paper by [PERSON] and [PERSON]. The protocol runs as it is shown in Algorithm 1. ```
1. Node \(N_{g}\) broadcast beginning of keying process
2. Initialize \(P_{i-1}\gets G\)
3. Choose node \(i\) to generate its shared key \(P_{j}\)
4. while\(i<=N-1\)do:
5. If\(i\
eq j\)
6. Send public key \(P_{i-1}\) to node \(i\)
7. Node \(j\) computes new: \(P_{i-1}\gets r_{i}P_{i-1}\)
8. End
9. Send public key \(P_{i-1}\) to node \(j\)
10. node \(j\) computes it shared key as: \(P_{j}=r_{j}.P_{i-1}\)
11. repeat step 2 to 10 until all nodes generate their shared keys
```  
**Algorithm 1****Cyclic ECC Key generation and distribution**  
Steps (1-2). Initially, GHi (\(N_{g}\)) prepares a broadcast message M1 and transmits it to all the members in the network, requesting to abort transmission for a period of time which is specified by the protocol for key initialization. Steps (3-8). Group head initializes key exchange by sending point \(P_{i-1}\) to node I, which is the generator point G on the EC curve. The group head implements a cyclic public key P exchange with all other member nodes in the network except \(j\).