# Confidential Smart Contracts and Blockchain to Implement a Watermarking Protocol
## 1 Introduction and Motivations  
Digital copyright protection is one of the most pressing needs of the current Internet due to the economic losses it causes to companies that produce multimedia content. The enormous investments made in developing tools for protecting content distributed on the Internet are nullified mainly by the growing and rapid evolution of network and multimedia technologies through which it is possible to easily duplicate and distribute on the network originally protected content without reducing its perceived quality. Added to this problem is the more current one relating to the need to identify the creators of multimedia content present on the Internet so as to be able to distinguish such original content from that illegally created through the use of artificial intelligence. Many of the solutions proposed to solve the problem of digital copyright are based on the use of \"digital rights management\" (DRM) systems [1, 2, 3], which try to limit the use of digital content only to those who have regularly purchased it. However, these systems cannot prevent legitimate purchasers of content from downloading and spreading it online, thus making the protection system ineffective. On the other hand, content providers use watermarking protocols to discourage legitimate buyers of content from spreading it online [4]. These protocols implement digital copyright protection by exploiting the principle of deterrence. They are based on inserting a digital watermark in each document sold. The inserted watermark isimperceptible and represents a fingerprint uniquely linked to the seller of the content, the buyer, and the purchase transaction. The watermark thus ensures that the content represents a personalized and unique copy for the buyer. The protocol then defines the purchase transaction scheme capable of guaranteeing that only that buyer obtains his personalized copy of the purchased content. In this way, if such protected content is found in the possession of a user without the relative purchase title, it is possible to trace its legitimate buyer who has made an illegal sharing. The deterrent action, therefore, consists in the fact that the greater the sharing of protected content on the network, the greater the possibility that an illegally distributed copy will be found and allow its owner, the only one who can have done the initial sharing, to be punished. Watermarking protocols developed in recent years mostly follow the \"buyer-seller\" scheme [4; 5]. They try to guarantee the security of purchase transactions between buyers and sellers and the protection of digital copyright without having to resort to a \"trusted third party\" (TTP) and without having to request complex cryptographic actions from buyers. In this sense, an innovative solution is now represented by protocols based on blockchains and smart contracts [6]. Blockchains can be used in place of TTPs as distributed ledgers capable of publishing data on digital content purchase transactions, guaranteeing their immutability and verifiability [7; 8]. Smart contracts, for their part, can be used to execute the code that defines the scheme of interactions envisaged by watermarking protocols. Also in this case, the code included in smart contracts, once published by the blockchain, becomes de facto immutable and is executed automatically when predefined conditions occur [9; 10]. Although promising and able to satisfy the main requirements of use and security [4], watermarking protocols based on blockchains and smart contracts suffer from the main limitations exhibited by these technologies [11; 12; 13; 14; 15; 16; 17]. These limitations mainly concern the following:  
1. The poor performance in terms of the number of transactions that a blockchain can validate in the unit of time;
2. The lack of confidentiality in the execution of smart contracts, which makes the input/output parameters, the state, and the code of smart contracts accessible to blockchain nodes;
3.