# A Blockchain-Based Protocol for Fair Delivery for Receips
## 2 Blockchain and Smart Contracts  
In this section, we describe the main characteristics of blockchain technology, focusing on the operation of smart contracts. Blockchain technology has emerged as a transformative method, reducing reliance on TTPs in various sectors, such as the energy [3; 4], e-commerce [5], supply chain [6], data sharing [7], healthcare [8; 9] and 6G technology [10; 11] sectors. In the blockchain ecosystem [12], we can categorize blockchains into two main types: permissionless and permissioned [13]. Permissionless, or public, blockchains are accessible to all and offer a decentralized and trustless environment. In contrast, permissioned blockchains are managed by a central authority. While permissioned blockchains can provide greater privacy and control, permissionless blockchains are more transparent, eliminating the need for trusted entities or a private infrastructure. At its core, a blockchain acts as a transparent distributed ledger system for network nodes (also known as miners) [12]. The blockchain, as a distributed ledger, consists of linked and cryptographically secured records (blocks) recorded in a decentralized peer-to-peer network. The design of the blockchain ensures resistance to data modification, as altering one block requires changing all subsequent blocks. Owing to its decentralized and immutable structure, the blockchain can provide a verifiable and secure record of transactions. Each block published on the blockchain contains all valid transactions included in the block (see Figure 1). A transaction is essentially an operation that is to be recorded on the blockchain; cryptocurrency operations (e.g., transfers between accounts) are the most commonly recorded operations, as exemplified by bitcoin. However, the need for automated, trustworthy execution of agreements, combined with a demand for decentralized applications (DApps), has driven an evolution in the use of cryptocurrency from a simple transaction tool to a platform for smart contracts, with Ethereum being the prime example. A smart contract in Ethereum is self-executing code that runs on the Ethereum virtual machine (the Ethereum virtual machine (EVM) is a decentralized computing environment that executes smart contracts and runs decentralized applications (dApps) on the Ethereum blockchain) which is composed of executable functions that can handle digital assets or digital data [14]. A transaction that interacts with a smart contract includes key information such as the sender's address, the smart contract's address, specific data indicating which function of the contract is being called and with what input parameters, as well as the gas limit and associated fees (see Figure 1). This information is signed digitally by the sender, submitted to the network for validation, and, if accepted, executed within the contract's context, with the results recorded on the blockchain. The input parameters and values necessary for a smart contract to execute its functions are included in the transaction data invoking the smart contract and are read-only. Therefore, the input data for a smart contract are part of the blockchain transaction, meaning that they cannot be altered. When these functions are called, they execute predefined actions that could require the validation of conditions or the storage of information [15]. Smart contracts use the storage component of the EVM, which is a long-term and tamper-proof storage area, to store the information needed to execute the different functions of a smart contract [14], but this information is not recorded in the blockchain blocks. In contrast, logs are used to store information that is not essential for the smart contract but must be accessible to off-chain applications. Logs are stored in a transaction receipt (see Figure 1), which is a data structure that is generated upon completion of a transaction and contains detailed information about the transaction's outcome.