# Resource Management and Secure Data Exchange for Mobile Sensors Using Ethereum Blockchain
## 4 Methodology
### Validation of MS Identity  
The prominent actors involved in the validation process are the MS, AP, and GN. The GN enrolls the original and legitimate identity-based information of each MS once it enters its specific coverage. The secret key (both private and public) is generated, followed by the GN dispatching the security certificates to the MS. The AP facilitates the caching operation for each MS while all the information within the cache memory is forwarded to the Ethereum blockchain. Each MS can perform the data exchange process while updating its information for the AP. The complete communication via the Ethereum blockchain facilitated in the proposed scheme is carried out in multiple operational modules. The first operation module in this process is associated with _enrolling_ the identity of the MS. Under this enrollment process, the system considers that there are \(i\)th APs, i.e., \(AP_{i}\), that are responsible for performing the enrollment task to the GN, followed by forwarding the identity of AP, i.e., \(AP(iden_{i})\), along with an arbitrary number \(arb_{i}\), which is mathematically expressed by Equation (2). \[AP_{i}[AP(iden_{i}),\ arb_{i}]\to GN \tag{2}\]  
In Equation (2), each available AP forwards the identity information \(AP(iden_{i})\) and arbitrary score \(arb_{i}\) to the GN. In addition, the size of an arbitrary score can range between 128 and 512 bits, depending on the scale of data being exchanged. After the information related to enrollment is obtained from each \(AP_{i}\) by the GN, the proposed system generates a security certificate for the authorization \(sc_{i}\). Adopting the finite field encryption strategy, the GN generates a security method expressed by Equation (3). \[\Omega(p,q):h_{1}\to h_{2}+h_{3} \tag{3}\]  
In Equation (3), the generation of security method \(\Omega\) concerning two non-negative numbers of integer type \((p,\ q)\) is achieved considering three attributes of finite field encryption, where \(h_{1}=y^{2}\), \(h_{2}=x^{3}\), and \(h_{3}=(px+q(mod\ pr))\), where variable \(pr\) represents a prime number. The arbitrary variable \(arb\) is a private key for access point \(AP_{i}\) and is acquired by the GN. On the other hand, the generation of the public key is computed for an arbitrary value from the reference point in a finite field. The mathematical expression for generating private and public keys from the access point obtained by GN is shown by Equation (4). \[[A(priv)_{i},A(pub)_{i}]\longrightarrow[arb_{i},(A(priv)_{i},\varphi_{i}^{a}( loc_{i}))] \tag{4}\]  
Equation (4) exhibits two essential tasks: the generation of a private key by the access point, i.e., \(A(priv)_{i}\) that is equivalent to an arbitrary number \(arb_{i}\), and the generation of a public key by the access point, i.e., \(A(pub)_{i}\) which is equivalent to the product of a recently generated private key, i.e., \(A(priv)_{i}\) and the location of the reference point of a finite field, i.e., \(\varphi_{i}^{a}(loc_{i})\), where \(loc_{i}\) represents \((x_{i}\,y_{i})\) in elliptical curves. The suffix \(i\) represents the number of access points, AP. After generating keys, the information associated with the public key, i.e., \(A(pub)_{i}\) and timestamp \(A_{t}\), are disseminated using broadcasting to the entire network by the GN. The timestamp \(A_{t}\) represents the instantaneous time when GN completes the enrollment process for AP. Furthermore, the essential information \(E\) is forwarded to the AP by the GN, which is mathematically expressed by Equation (5). \[AP_{i}\longleftarrow GN(E_{i}) \tag{5}\]  
Equation (5) shows that a secured and dedicated communication channel is utilized for forwarding essential information \(E\), which consists of a timestamp during enrollment \(A_{t}\), the public key of access point \(A(pub)_{i}\), the private key of access point \(A(priv)_{i}\), and the security certificate for authorization \(sc_{i}\).