## 2 Preliminaries  
Blockchain is an emerging technology introduced in 2008-2009 as the supporting ledger for the Bitcoin cryptocurrency [5], a peer-to-peer electronic cash system aimed to set financial transactions without going through a financial institution or a third party. However, this technology is also used in other platforms such as Ethereum or Hyperledger and applied in more and more sectors with increasing relevance, for the Bitcoin economy and education, as is discussed in this paper, as well as in sectors such as energy [6], agriculture [7], health [8,9], transports or logistics [10], IoT [11,12], in which applications [13], use cases [14] and open issues [15] are identified. In a nutshell, a blockchain consists of a time-ordered set of blocks in which each block is cryptographically linked to the previous one, constructing a chain. As a consequence, a blockchain is almost impossible to alter once created. All the information recorded is tamperproof and distributed across a shared peer-to-peer network. Each one of these blocks contains transactions of different types (depending on the blockchain) that are created and distributed by the peers of the network. To register new information in the chain, a consensus about its truthfulness has to be reached among the participating peers without the need for a third party. The most extended consensus mechanisms are proof of work (PoW), proof of stake (PoS), and proof of authority (PoA). With the PoW mechanism [5], transactions are validated by solving cryptographic puzzles using brute force, which requires a lot of energy and time for its execution. The active member of the network (called miner) who first solves the puzzle is rewarded. On the other hand, in systems using PoS [16], the selection of the active member of the network who validates and decides how will the next block be added is performed randomly among all peers, with a probability of being selected proportional to the stake that each member owns in the current blockchain. Therefore, the process of validating and adding new blocks is not as complex as in the PoW consensus mechanism and it is more energy and time efficient. Finally, some systems utilize a PoA [17] consensus mechanism. With this approach, a small number of active network members are authorized to verify a new block, synchronizing blocks of the chain with the rest of the network peers. A difference with PoW or PoS is that these participants will not always be participating in this process since they will be randomly selected depending on their activity. Since every piece of information in the blockchain has to be verified before it is included in a block by one or more active members of the network, depending on the consensus mechanism, the amount of data that can be registered is limited, typically some kilobytes. If a larger amount of information needs to be stored, projects such as the InterPlanetary File System (IPFS) [18] can be utilized. IPFS is a hypermedia protocol and a distributed peer-to-peer resilient file system to tamperproof store and share information that can handle bigger file sizes. When a data file is uploaded, a hash digest value of the content is calculated, and this result is used to find the file and recover the data upon request. Additionally, some blockchains support running smart contracts proposed by [PERSON] [19]. These are computer programs (Turing-complete in the case of Ethereum [20]) recorded on a block that are executed autonomously by all the active participants in the network. These smart contracts can read, write, modify, and process data according to their programming. Every action is tamperproof registered in the ledger to add confidence. With respect to the nature of the peers participating in a blockchain, there are three main blockchain types. Public blockchains present no restrictions for joining or leaving, or for accessing the information recorded. In general, all information is public, but in some specific blockchains, some information may be encrypted.