# A Blockchain-Based Protocol for Fair Delivery for Receips
## 1 Introduction  
Acknowledgment of receipt in exchanging documents is a method used in multiple environments, especially in public administration. Referrals of sanctions, summonses, and requirements are examples of processes that use this service. The replacement of paper documents with their electronic equivalent transfers the need for this service to the electronic world. This problem falls under the broader category of problems concerning the fair exchange of values, encompassing examples such as contract signing, payment for receipt, certified email, and electronic notifications. These use cases share various similarities, particularly the fairness requirement: a protocol must guarantee fair conditions for all participants during the exchange. However, even though the use cases all share the most challenging objective of ensuring fairness, the methods used to achieve fairness can be quite different depending on the scenario. Therefore, each use case introduces specific challenges, necessitating tailored approaches to address its unique requirements. As stated above, for the particular case of the acknowledgment of receipt, which we address in this research, the main requirement that must be met in this process is fairness. The sender wants the recipient to be unable to access the contents of the document if the recipient does not sign an acknowledgment of receipt. The recipient does not want to sign an acknowledgment of receipt if they do not have a guarantee that they are able to access the contents of the document. This problem has traditionally been resolved with theintervention of trusted third parties (in the case of both paper documents and electronic documents [1; 2]). The use of TTPs is not without problems. A TTP can be dishonest and can help one of the parties (for example, by allowing the document to be read without requesting an acknowledgment of receipt); the TTP also constitutes a single point of failure. Therefore, blockchains have arisen as a possible substitute for TTPs. However, the use of public blockchains entails an economic cost that must be analyzed to guarantee the viability of this proposed approach. The use of private blockchains in \"open\" environments does not seem to be a viable solution from a system security perspective. The fairness requirement is not the only requirement that must be met. Proposed approaches must ensure that the document is seen only by the sender and recipient. The use of TTPs in addition to blockchains should be avoided (in the Related Work section, we show that some proposed approaches use both blockchains and TTPs). Users must be guaranteed that the exchange ends fairly within a finite time, and these users must not be able to deny their actions after the exchange. _Contributions._ The main contribution of this paper is the proposal of the first blockchain-based approach for exchanging a message for a receipt that satisfies all of the following requirements: fairness, confidentiality, and no use of TTPs. We analyze the previous solutions found in the literature, and in the \"Related Work\" section, we show that each of them fails to fulfill one or more of these three requirements. Another contribution is the evaluation of the cost of the proposed solution for different public blockchains based on the EVM (Ethereum Virtual Machine) considering the trade-off between cost and delay. The results show that the proposed approach is feasible in terms of cost and that it outperforms the previously analyzed solutions. In addition, we provide the code corresponding to the smart contracts, enabling other authors to verify the accuracy of our results. Finally, we provide a proof-of-concept implementation to show that our approach is feasible from a practical point of view. _Organization._ The remainder of this paper is organized as follows: Section 2 introduces the features of blockchain technology and smart contracts. Related work is analyzed in Section 3.