# Blockchain and Smart Contracts for Digital Copyright Protection
## 5 Proposed Protocol
### Protection Protocol  
As shown in Table 2 and in Figure 1, after choosing the content \(X\), \(\mathcal{B}\) starts the protocol by sending the purchase request to \(\mathcal{CP}\) in the message \(m_{1}\). \(\mathcal{CP}\) receives the request and sends the message \(m_{2}\) to \(\mathcal{B}\) and \(\mathcal{BC}\). \(m_{2}\) contains \(X_{d}\) and \(T_{X}\): the former is a string that unambiguously identifies the requested content \(X\), whereas the latter is a timestamp that refers to the ongoing transaction. When \(\mathcal{B}\) receives \(m_{2}\), it can send the message \(m_{3}\) to \(\mathcal{BC}\). \(m_{3}\) includes \(X_{d}\) and \(T_{X}\). Moreover, it also contains \(B_{id}\), which is the token used to recognize \(\mathcal{B}\) uniquely. It can be, for instance, a personal digital certificate, an anonymous digital certificate, or a credit card. The choice is made by \(\mathcal{B}\), who thus decides which \"negotiation mechanism\", defined within the concept of \"multilateral security\" [41], best suits the current transaction. Once \(m_{2}\) and \(m_{3}\) are received, the smart contract \(sm_{s}\) can run in the blockchain \(\mathcal{BC}\). It carries out two preliminary checks: it verifies (1) if the tokens included in the received messages coincide and (2) if \(X_{d}\) and \(T_{X}\) were never used in previous purchase transactions, that is, if these tokens are present or not in the blocks published by \(\mathcal{BC}\). If the checks are passed, \(sm_{s}\) can continue execution and generate the security tokens needed for the protocol. In particular, it generates: (1) a one-time public and private key pair, \(pk^{X}\) and \(sk^{X}\), to be used only in the current transaction; (2) a \"nonce\" \(N\), which is represented by a binary string and is encrypted with \(pk^{X}\) and a \"privacy homomorphic\" cryptosystem [18] with respect to the watermark insertion. The resulting token \(\mathbb{E}_{pk^{X}}(N)\) is then used to generate the watermark to be inserted into the content \(X\). \(sm_{s}\) generates the \"secret\" block, named \(SBlock\), that contains a list of tokens encrypted with \(k_{\mathcal{BC}}\), which is the secret key of \(\mathcal{BC}\). \(SBlock\) contains the tokens \(B_{id}\), \(X_{d}\), \(T_{X}\), \(pk^{X}\), \(sk^{X}\), \(N\), and \(\mathbb{E}_{pk^{X}}(N)\) encrypted with \(k_{\mathcal{BC}}\). This enables only \(\mathcal{BC}\) to access the content of the \begin{table}
\begin{tabular}{c l} \hline \hline
**Symbols** & **Meaning** \\ \hline \(\mathcal{B}\) & buyer \\ \(\mathcal{CP}\) & content provider or seller \\ \(\mathcal{BC}\) & blockchain \\ \(\mathcal{J}\) & judge \\ \(X\) & digital content purchased by \(\mathcal{B}\) \\ \(X_{d}\) & information used by \(\mathcal{CP}\) to unambiguously identify \(X\) \\ \(T_{X}\) & timestamp referred to the transaction by which \(\mathcal{B}\) buys \(X\) \\ \(B_{id}\) & information used to identify \(\mathcal{B}\) \\ \(N\) & nonce used to mark the watermarking transaction \\ \(W\) & watermark \\ \(W_{Ent.}\) & part of the watermark \(W\) generated by the entity \(Ent.\) \\ \(X\) & watermarked \(X\) \\ \(pk_{Ent.}\) & public key of the entity \(Ent.\) \\ \(sk_{Ent.}\) & secret key of the entity \(Ent.\) \\ \(pk^{X}\) & one-time public key used to watermark \(X\) \\ \(sk^{X}\) & one-time secret key used to watermark \(X\) \\ \(E_{key}(\ldots)\) & token encrypted with the key _key_ \\ \(A_{sm}(\ldots)\) & activation of the smart contract _sm_ upon receipt of messages \\ \(\mathbb{G}_{sm}(\ldots)\) & creation of a block from the smart contract _sm_ \\ \(\mathbb{END}_{sm}(\ldots)\) & end of the smart contract _sm_ \\ \(SBlock\) & secret block generated by the blockchain \\ \(PBlock\) & public block generated by the blockchain \\ \(\mathbb{E}_{key}(\ldots)\) & token encrypted with the key _key_ and using a privacy homomorphic cryptosystem with respect to the watermark insertion \\ \(\mathbb{D}_{key}(\ldots)\) & decryption function inverse of the function \(\mathbb{E}_{key}(\ldots)\) \\ \hline \hline \end{tabular}
\end{table}