**1. Introduction**

A contract is where individuals, groups, companies, institutions, and even governments enter into an agreement, where each of them is committed to fulfilling certain conditions. If the contract is traditional, it is written in language appropriate to the territory or legislation where the agreemen<sup>t</sup> is drafted, and if the parties involved agree, then they sign the document and legally agree to comply with it. All economic transactions between companies or individuals, for goods, services, or relations between the parties, are implemented by means of contracts; purchase and sale, lease, supply, loan, transport, and work are some of the most common examples. More modern examples include the contractual relationship between authors and publishers on copyright [1] and how insurance contract law differs widely between jurisdictions [2]. The performance of a contract is, ultimately, the will of the parties, and if one of them resolves not to comply with the law, it grants actions to the other signatory parties, and the appropriate judicial or arbitral process must be conducted. However, a question always arises at any time a contract is written, which is a tradeoff that must be addressed—whether or not to make a contract flexible but incomplete or rigid but comprehensive [3].

The digital age dominates world trade, so smart contracts can have a place in the foreseeable future. It is enough to mention that firms deploying computerized order systems are now responsible for more than 60% of the trading volume in U.S.-listed stocks [4]. The emergence of electronic and self-executing contracts is the inevitable consequence of the automation process of the Internet and the Internet of things. The legal regime integrates this contracting format without di fficulty, but achieving a fully automated process implies, for example, resorting to network paymen<sup>t</sup> mechanisms, which are not always adapted to the current contractual type. The use of virtual currencies, such as bitcoin or electronic money, could cover this role, but the scarce or non-existent regulation of virtual currencies [5], and their dual character of unit of value and unit of account, hinder the functionality and legal security of the use of Blockchain technologies in standardized and automated contracting formats.

Blockchain technology is a distributed ledger that enables subscribers to enter and update records in the ledger, and cryptography assures that stored records will remain the same after they are added [6]. This ensures that no alterations can be made as changes would invalidate the whole register. The block network is represented by the nodes and virtual machines that are connected in peers, and each node involved has a ledger copy. The virtual machines run nodes. Once a new block has been agreed upon in the network, each node will refresh its record by appending the new block. All transactions are processed and sent from the involved nodes. All nodes in the network will agree on a consensus method for aggregating new records to the ledger [7]. As an example of a programming language, a JavaScript-like language called Solidity can provide a method for executing computer code on blockchain nodes. Computer programs that verify contracts digitally, enforce those contracts, and run on a blockchain network are called smart contracts [8].

So-called electronic contracts have been a known and enforced reality for several decades. A first question to be resolved is what is meant by a "self-executory" contract and smart contract. In our opinion, these terms allow us to approach the same reality from partially di fferent perspectives. From a technical or informatic prism, a smart contract would be a sequence of code and data that carries out the operation in its foreseen case and does not constitute a contract in the legal sense, even though such a term appears in its name. From a legal standpoint, the term "smart contract" would refer to an existing agreemen<sup>t</sup> between parties for which the code sequence would be a portion or all of the same. In other words, the code itself does not constitute a contract but responds to an agreemen<sup>t</sup> that gives meaning to it, and that serves as its expression.

Some authors define smart contracts as self-executing digital transactions that use decentralized cryptographic mechanisms [9]. Although novel, this form of compromise is not new; it has been on the table for more than thirty years. Specifically, it was in 1994 that US computer scientist Nick Szabo proposed what was then a fanciful notion of computerized transaction protocols for intelligent contracts that executed the terms of a contract [10]. In this way, smart contracts proposed the combination of protocols with user interfaces to formalize and secure relationships across computer networks [11]. Recently, the development of the Blockchain and Bitcoin technologies has once again driven the approach to the potential of smart contracts [12]. In Figure 1, the process of creating a smart contract and the blockchain is represented in a schematic form.

Smart contracts are not like commonly understood contracts, particularly for legal scholars and practitioners. The di fference, however, is that because these contracts are intelligent, they can be fulfilled automatically. Even if these contracts are fulfilled automatically, it is necessary for each of the members to do their part. The main di fferences between smart and traditional contracts are the ways they are written, their legal implications, and how the agreed conditions will be fulfilled. These distinctive characteristics are the ones that provide the advantages and disadvantages of both types of contracts, which are easily observable when understanding how they work.

However, there is a long history of self-executory contracts. Take the example of 'on demand' guarantees. While clearly contracts, on demand guarantees do not reflect any particularly general idea of what a contract is, but rather a highly specialized institutional context where, firstly, it is possible to codify a transaction so that self-executing rights have practical meaning and, secondly, there is a highly specific, narrow context of use, where the multiplicities generally implicit in a contract can be controlled.

**Figure 1.** Smart contracts: (**a**) transaction idea, (**b**) smart contracts and blockchains, (**c**) transaction confirmed and added as a block to the blockchain.

A novel area of law is emerging around blockchain platforms and automated transactions [10]. The so-called Internet of Things (IoT) refers to a connection to the web for millions of devices. In IoT, fridges, washing machines, televisions, and vehicles can connect to the Internet and exchange data with the millions of other users or computers on the web. In this scenario, which is predicted for the near future, smart contracts could go beyond single-tract contracts and ensure the execution of successive-tract contracts. However, some authors, specialized in law, advise on the emerging risks in the use of smart contracts, which could certainly be a branch of research in this field [13].

Blockchain systems can be beneficial for non-centrally controlled storage, notarizing, and subsequent execution of intelligent contracts. However, fundamental problems can arise about the modification and termination of intelligent contracts. To simplify the modification of intelligent blockchain contracts, declarative language could be used, but compared to its imperative counterparts, it may not live up to expectations in terms of computational complexity and associated costs. For these reasons, we must emphasize that imperative and declarative approaches are not incompatible, but instead have the potential to complement each other, which can lead to interesting theoretical and practical opportunities [14].

However, "failed" smart contracts already exist. These contracts have even classified into prodigal, suicide, and greedy contracts [15]. Prodigal contracts are those which have fallen into the hands of hackers, thereby changing the direction the Ethers should go in this case. This fraud has caused crypto-currencies to reach a fraudulent address and become the property of the fraudster who had been placed between the contracting party and the actual recipient of the crypto-currency [16]. Suicide contracts are those that are closed when an exit requirement is activated by the person carrying out the attack. It may be that there is a wrongly implemented exit clause, as has already happened, and the consequence is quick to occur. Under the cover of a legal act, the wrong person ends up taking all the encrypted money that the smart contract entails [17]. It should also be noted that inadequate protection of the information in one of these contracts also ends up allowing funds to be moved to illegitimate places. Greedy contracts may be due to bad practice or miswriting, but the fact is that the contracting party will no longer have the legitimacy to receive its encrypted currency. It gets out of their control, and ends the contract. This is an example of economic loss due to vulnerability failure [18].

From a sustainability point of view, it is possible to find many works that show the potential of smart contracts [19]. Nikolakis et al. [20] studied how law, regulation, and private standards have evolved to enhance sustainability in value chains. As an example, they show how blockchains can improve sustainability by informing consumers about the origin of products, provide guarantees about the authenticity of information, and offer a mechanism for enforcing representations through the smart contract function of the blockchain. Park et al. [21] propose the implementation of an energy transaction platform based on P2P (peer–to–peer) blockchains to support energy efficient transactions

between prosumers, which will encourage a more sustainable trading ecosystem between consumers and prosumers. Giungato et al. [22] propose the development of an Energy Internet, based on a new type of power grid structure based on the generation of renewable energy, distributed energy store devices, and the existent of the Internet [23]. Gatteschi et al. [9] propose a use for the insurance sector and give the example of B3i, the first blockchain-centered insurance consortium [24].

Other characteristics of smart contracts to expand their potential for sustainability are to accelerate and automate the exchange of information on the value of natural resources and environmental sustainability. Examples of sustainable supply chain traceability can be found as agrifood products [25], as forests (if the trees are cut without destroying natural forests) [26], or as paymen<sup>t</sup> for ecosystem services [26]. Another grea<sup>t</sup> smart contract approach is the application to improve logistics services and supply chains, such as in the pharmaceutical sector [27] or alimentary supply chain [28].

On the other hand, there are studies that warn about the problems of these technologies. For example, the advantages of blockchain technology can be overshadowed by the intentionally resource intensive nature of their transaction verification process, which now menaces the climate on which we depend to survive [17]. There is previous research that has studied the relationship of sustainability with "bitcoin", "digital currency", "cryptocurrency", and "virtual currency" [29], or the relationship of sustainability with the "Energy Internet" [30]. From a legal point of view, smart contracts, in contrast to traditional contracts, should address issues such as trial risks, enforcement risks, and jurisdictional risks. In fact, it would be useful to analyze the on-demand guarantee example to see in what kinds of institutional contexts they might be used. In this regard it is possible to find, as an example, contracts for insurance. Insurance contracts, or more specifically reimbursement in specific, narrowly defined loss scenarios, much more clearly provide a similar highly specialized institutional context comparable to the existing generally used self-executory contracts, such as on demand guarantees.

In short, this new technology has its advantages and disadvantages. Therefore, as it is a technology under development, work is continuing to optimize its operation to the maximum. On the other hand, there are investigations that alert to the problems of these technologies. For example, the advantages of blockchain technology can be overshadowed by the intentionally resource intensive nature of their transaction verification process, which now menaces the climate on which we depend to survive [31]. Until now, no systematic study of all published works related to smart contracts has been carried out. A bibliometric analysis is a useful tool, both for the study of the state of di fferent scientific disciplines and for the scientific production of a given region, discipline, or topic. Its study aim is to physically represent the products of thought in documents. In other words, intellectual knowledge supported by material support—the publications.

Bibliometric analyses can determine which fields of research have been carried out, and which organisms and countries are the main ones applicable in researching this topic. Bibliometrics and the use of their indicators are necessary scientific tools because they allow the quantification of science in an objective way, as they show the current knowledge in a given scientific field and its compilation in bibliographic databases. The importance of bibliometric studies is carried out in all branches of science, such environment [32] and education [33]. In this context, the present work has the main objective of analyzing the global research trends on smart contracts, with special attention to analyzing the main areas in which e fforts are being made by the scientific community.
