## 3 Method
### Payment Verification and Browsing Phase
#### 3.6.2 Case 2: Proxy Authorization
  
The Proxy calculates:  
\[BC_{L-P}=h(r_{L-P},s_{L-P}), \tag{122}\]  
\[(ID_{BC},BC_{L-P})\]  
will also be uploaded to the blockchain center. * Step 3: The Proxy then generates a random value \(k_{P-C}\) and calculates:  
\[z_{P-C}=h(ID_{P},ID_{L},M_{P-C},ert_{P},ert_{L},TID,ert_{pay},TS_{P-C},ID_{BC}), \tag{123}\]  
\[(x_{P-C},y_{P-C})=k_{P-C}G, \tag{124}\]  
\[r_{P-C}=x_{P-C}{\rm mod}n, \tag{125}\]  
Figure 15: Payment verification and browsing phase (P to L). \[s_{P-C}=k_{P-C}{}^{-1}(z_{P-C}+r_{P-C}d_{P})\text{mod}n, \tag{126}\]  
\[Enc_{P-C}=E_{PK_{C}}(ID_{P},ID_{L},M_{P-C},Cert_{P},Cert_{L},TID,Cert_{pay},TS_{P-C },ID_{BC}), \tag{127}\]  
and sends \(ID_{P},Enc_{P-C},(r_{P-C},s_{P-C})\) to the content administrator. * Step 4: The CA first calculates: \[(ID_{P},ID_{L},M_{P-C},Cert_{P},Cert_{L},TID,Cert_{pay},TS_{P-C},ID_{BC})=D_{SK_{C }}(Enc_{P-C}),\] (128)  
uses  
\[TS_{NOW}-TS_{P-C}\leq\Delta T \tag{129}\]  
to confirm whether the timestamp is valid, verifies \(Cert_{L}\) with \(PK_{L},Cert_{P}\) with \(PK_{P}\) and \(Cert_{pay}\) with \(PK_{BANK}\), verifies the correctness of the ECDSA signature, and then calculates:  
\[(ID_{BC},BC_{L-P})\]0  
\[(ID_{BC},BC_{L-P})\]1  
\[(ID_{BC},BC_{L-P})\]2  
\[(ID_{BC},BC_{L-P})\]3  
\[(ID_{BC},BC_{L-P})\]4  
If the verification is passed, the content administrator will get the relevant payment information and trigger the smart contracts pcins and pcchk. The content is as follows (Scheme 12): \begin{tabular}{|p{142.3 pt}|} \hline function insert smart contract pcins( \\ string pc\_id, string pc\_detail, \\ string pc\_payment, string pc\_tsp) { \(\text{count}\),id = id; \\ pc[count].detail = detail; \\ pc[count].payment = payment; \\ pc[count].tsp = tsp; \\ \} \\ sign string p\_key (pc\_id, pc\_detail, \\ pc\_cert, pc\_tsp); \\ \hline \end{tabular}   
**Scheme 12. ** The smart contracts pcins and pcchk. The content administrator calculates:  
\[BC_{P-C}=h(r_{P-C},s_{P-C}), \tag{135}\]  
\((ID_{BC},BC_{P-C})\) will also be uploaded to the blockchain center. * Step 5: The content administrator generates a random value \(k_{C-P}\) and calculates: \[P_{m}=f(ID_{DC},Vtime),\] (136)  
\[C_{1}=e(raG,a^{-1}bG), \tag{137}\]  
\[C_{2}=Z^{\prime}G^{2}+P_{m}, \tag{138}\]  
\[z_{C-P}=h(ID_{C},M_{C-P},(C_{1},C_{2}),TS_{C-P},ID_{BC}), \tag{139}\]  
\[(x_{C-P},y_{C-P})=k_{C-P}G, \tag{140}\]  
\[r_{C-P}=x_{C-P}\text{mod}n, \tag{141}\]\[s_{C-P}=k_{C-P}{}^{-1}(z_{C-P}+r_{C-P}d_{C})\text{mod}n, \tag{142}\]  
\[Enc_{C-P}=E_{PK_{P}}(ID_{C},M_{C-P},(C_{1},C_{2}),TS_{C-P},ID_{BC}), \tag{143}\]  
and sends \(ID_{C},Enc_{C-P},(r_{C-P},s_{C-P})\) to the proxy. * Step 6: The Proxy first calculates:  
\[(ID_{C},M_{C-P},(C_{1},C_{2}),TS_{C-P},ID_{BC})=D_{SK_{P}}(Enc_{C-P}), \tag{144}\]  
uses  
\[P_{m}=f(ID_{DC},Vtime),\]0  
to confirm whether the timestamp is valid, it verifies the correctness of the ECDSA signature, and then calculates:  
\[P_{m}=f(ID_{DC},Vtime),\]1  
\[P_{m}=f(ID_{DC},Vtime),\]2  
\[P_{m}=f(ID_{DC},Vtime),\]3  
\[P_{m}=f(ID_{DC},Vtime),\]4  
\[P_{m}=f(ID_{DC},Vtime),\]5  
If the verification is passed, the payment information is confirmed by the content administrator, and the smart contracts cpins and cpchk will be sent. The content is as follows (Scheme 13): \begin{tabular}{|p{142.3 pt}|} \hline function insert smart contract cpins( \\ string cp\_id, string cp\_detail, \\ string cp\_key, string cp\_tsp) \{ \\ count ++; \\ cp[count].id = id; \\ cp[count].detail = detail; \\ cp[count].key = key; \\ cp[count].tsp = tsp; \\ \} \\ sign string c\_key (cp\_id, cp\_detail, \\ cp\_key, cp\_tsp); \\ \hline \end{tabular} \begin{tabular}{|p{142.3 pt}|} \hline verify string c\_key (cp\_id, cp\_detail, \\ cp\_key, cp\_tsp); \\ function check smart contract cpchk( \\ string cp\_id, string cp\_detail, \\ string cp\_key, string cp\_tsp) \{ \\ return cp\_id.exist; \\ return cp\_detail.exist; \\ return cp\_key.exist; \\ return cp\_tsp.exist; \\ \} \\ \hline \end{tabular}   
**Scheme 13. ** The smart contracts cpins and cpchk.