# Proxy Signature-Based Management Model of Sharing Energy Storage in Blockchain Environment
## 4 Proxy Signature Method Based on ElGamal Algorithm
The original signer gives the proxy key (\(K,\delta\)) to the proxy signer. Then, a congruence is checked by the proxy signer as follows:  
\[g^{b}(\bmod\ p)=yK^{K}(\bmod\ p) \tag{6}\]  
If (\(K,\delta\)) passes the congruence equation, the proxy signer accepts it as a valid delegation. Otherwise, the proxy key is rejected, and a new proxy key generated by the original signer is sent to the proxy signer, or this protocol is stopped. Once the proxy signer accepts the delegation of original signer, the principal-agent relationship and \(K\) will be multicast to other nodes. 3. Generation of proxy signature. A proxy signature is generated by the proxy signer. The proxy signature represents the recognition of the original signer for the signed message. Firstly, the hash of a message to be signed is computed by a specified hash function as follows:  
\[M=H(m) \tag{7}\]  
where \(m\) is the message to be signed; \(H\) denotes the hash function; \(M\) is the hash of \(m\), and also the message digest. Moreover, a random number \(r\) is selected by the proxy signer, and the proxy signature for \(m\) is computed as follows:  
\[0<r<p\quad r\in\mathbb{Z} \tag{8}\]Figure 4:0  
Figure 4:1  
where \(R\) and \(s\) are the part of the proxy signature, which constitute a complete proxy signature (\(R\), \(s\), \(K\)) with \(K\). \(r^{-1}\) is the multiplicative inverse modulo of \(r\), and it can be computed by an extended Euclidean algorithm. Finally, the proxy signature is sent to verification nodes with \(m\). 4. Verification of proxy signature. The proxy signature is verified by the nodes which receive the message. Once the nodes receive the message \(m\) and the proxy signature (\(R\), \(s\), \(K\)), a new key \(v\) corresponding to the proxy signature can be computed as follows:  
Figure 4:2  
The verification of the proxy signature is achieved by the following equation. \[\text{Ver}(y,\ (R,\ s,\ K),\ m)=\left\{ \begin{array}{ll}\text{True}&g^{H(m)}( \bmod p)=\!v^{R}R^{s}(\bmod p)\\ \text{False}&g^{H(m)}(\bmod p)\!\
eq v^{R}R^{s}(\bmod p)\end{array} \right. \tag{12}\]  
where Ver(Public key, Digital signature, Message) is the verification function. When the received message and proxy signature can match with the public key of the original signer, the verification result is true. It means that the message is signed by the proxy signer on behalf of the original signer, and the message is not modified after signing. Otherwise, the verification is false, and the receivers do not admit the message. Except for the basic characteristics of digital signatures, the proxy signature mechanism has some unique characteristics. Unforgeability of proxy signatures: Except for the proxy signature, anyone including the original signer cannot generate valid proxy signature because of the confidentiality for \(r\). Distinguishability of proxy signatures: A proxy signature is different from an ordinary digital signature of the original signer because the proxy signature (\(R\), \(s\), \(K\)) adds \(K\), a part of the proxy key, compared to the ordinary signature. In addition, the proxy signatures from several proxy signers are easy to be distinguished due to the difference of \(K\). Identifiability of proxy signer: An original signer can determine the identity of the corresponding proxy signer from a proxy signature according to \(K\). Private-key's dependence: The private key of the proxy signer is generated by the private key of the original signer, meaning that \(\delta\) depends on \(x\). Cancelability of proxy key: An original signer can send a message signed by him to the other to declare the invalidation of \(K\) at any time, once the original signer wants to end the delegation and cancel the proxy signature.