Execution of Smart Contacts Concurrently Using Fine-Grain Locking and Asynchronous Functions
Abstract Smart contracts are widely popularized to transfer an asset securely from one device to another. Smart contracts contain the blockchain’s business logic that revolutionized the concept of self-enforcing contracts without the need for a middle man. Many use cases thus are being generated day by day. Smart contracts allow us to build decentralized applications through blockchains. The transactions in the smart contract are interrelated; they define the overall flow of the application. To maintain integrity between the transactions, the execution of the smart contracts is sequential and has no conflicts. These contracts’ execution is slow and time-consuming. Thus, we cannot leverage the current systems’ complete resource utilization. To overcome this, we propose a safer multi-threading model using fine-grain locking and thread executor service mechanism to concurrently execute the smart contract which also provides integrity among the transactions. Our results prove the faster and safer execution of smart contracts.KeywordsBlockchainFine-grain lockingSmart contractThread executor service
- Research Article
225
- 10.1016/j.tele.2020.101519
- Oct 22, 2020
- Telematics and Informatics
Smart contracts on the blockchain – A bibliometric analysis and review
- Research Article
5
- 10.3390/app13106027
- May 14, 2023
- Applied Sciences
As blockchain technology advances, so has the deployment of smart contracts on blockchain platforms, making it exceedingly challenging for users to explicitly identify application services. Unlike traditional contracts, smart contracts are not written in a natural language, making it difficult to determine their provenance. Automatic classification of smart contracts offers blockchain users keyword-based contract queries and a streamlined effective management of smart contracts. In addition, the advancement in smart contracts is accompanied by security challenges, which are generally caused by domain-specific security breaches in smart contract implementation. The development of secure and reliable smart contracts can be extremely challenging due to domain-specific vulnerabilities and constraints associated with various business logics. Accordingly, contract classification based on the application domain and the transaction context offers greater insight into the syntactic and semantic properties of that class. However, despite initial attempts at classifying Ethereum smart contracts, there has been no research on the identification of smart contracts deployed in transactive energy systems for energy exchange purposes. In this article, in response to the widely recognized prospects of blockchain-enabled smart contracts towards an economical and transparent energy sector, we propose a methodology for the detection and analysis of energy smart contracts. First, smart contracts are parsed by transforming code elements into vectors that encapsulate the semantic and syntactic characteristics of each term. This generates a corpus of annotated text as a balanced, representative collection of terms in energy contracts. The use of a domain corpus builder as an embedding layer to annotate energy smart contracts in conjunction with machine learning models results in a classification accuracy of 98.34%. Subsequently, a source code analysis scheme is applied to identified energy contracts to uncover patterns in code segment distribution, predominant adoption of certain functions, and recurring contracts across the Ethereum network.
- Research Article
1
- 10.2139/ssrn.3917900
- Jan 1, 2021
- SSRN Electronic Journal
Operational and Strategic Value of Blockchain Technology: Integrating Smart Wholesale Contracting with Realtime Market Shift Analysis
- Research Article
6
- 10.24193/tras.66e.6
- Jun 28, 2022
- Transylvanian Review of Administrative Sciences
This article attempts to critically review the applications of smart contracts in public procurement. The literature on the topic is characterized by an emphasis on potential advantages and uses of this emerging technology, while it lacks in the concrete practical implementations of smart contracts in public procurement. In this context, we wish to realistically outline the legal regime of smart public procurement contracts. For this, we analyze the potential use of blockchain and smart contracts in public procurement at two stages: contract award and contract execution. Our article also discusses case studies of smart public procurement contracts, in order to assess their compatibility with and their impact on the EU public procurement system.
- Book Chapter
3
- 10.1007/978-3-031-28124-2_36
- Jan 1, 2023
Fabric is currently the most popular consortium chain platform with a modular architecture that provides high security, elasticity, flexibility and scalability. Smart contracts realize the automatic execution of transactions and the operation of reconciliation data. The Fabric platform supports general programming languages to write smart contracts. However, in the development process of smart contracts, due to insufficient understanding of the underlying operating logic of smart contracts, developers are prone to introduce some risky operations, resulting in a mismatch between the execution logic of smart contracts and business logic, resulting in a lot of losses. The read-after-write risk is a relatively complex and common security risk in smart contracts. Currently, many detection tools cannot detect this risk. There is an urgent need for a solution that can quickly and accurately detect the read-after-write risk in smart contracts. This paper proposes a static analysis smart contract read-after-write risk detection method based on key methods and call chains. The scheme extracts key method patterns on the abstract syntax tree, identifies and locates key methods with risks, greatly reduces the interference of useless nodes on detection, and realizes rapid detection. By constructing the key method call chain, the real call scene is restored according to the call type and attribute of the key method. After experimental verification, compared with the current popular smart contract risk detection tool Revive^CC, the tool proposed in this paper has higher detection accuracy and can more accurately locate the read-after-write risk in smart contracts.
- Research Article
1
- 10.1016/j.jestch.2024.101913
- Nov 28, 2024
- Engineering Science and Technology, an International Journal
Smart contracts, being security-critical code, facilitate consensus among players and ensure secure and accurate value transfer, and formal verification is necessary to guarantee functional correctness of contracts. Game theory serves as one of the tools in formal verification by assessing whether the outcomes of contract executions meet the expected goals. While most studies employing game theory to verify smart contract functionality assume rational players, in practice, players may invoke and deploy smart contracts involving irrational behavior, casting doubt on the correctness of verification results. The aim of this study is to propose an alternative game model to verify smart contract functionality in dynamic player interactions where irrational behavior is involved. Specifically, a belief-based smart contract execution game (BSC-game) model was introduced, utilizing belief – the probability that a player believes in the irrationality of others – to capture how the irrational behavior of others affects a player’s contract execution decisions. Reasonable economic incentives were introduced to encourage honest behavior of players. Moreover, a computationally feasible method was designed to update players’ beliefs in large-scale dynamic smart contract executions. Theoretical analysis discloses the existence of equilibrium in the BSC-game, as well as the conditions for the number of faulty players within the system’s fault tolerance. We conducted the simulation experiments, and verified the business-oriented smart contract written in G language by the BSC-game model. The results further indicate that although players’ beliefs impact their decisions to execute contracts, reasonable economic incentives can motivate players to execute contracts honestly. This ensures that smart contract functionality aligns with expected goals, showing that the BSC-game model can verify and guarantee the correctness of contract functions. This new approach significantly contributes to bolstering smart contract security and credibility, positively influencing blockchain stability.
- Research Article
21
- 10.1016/j.dcan.2022.08.011
- Sep 1, 2022
- Digital Communications and Networks
Applying blockchain-based method to smart contract classification for CPS applications
- Research Article
3
- 10.3390/math12142158
- Jul 10, 2024
- Mathematics
The post-deployment challenges in developing and upgrading blockchain smart contracts necessitate a high level of accuracy in their development and business logic. However, current methodologies for verifying the business logic of smart contracts frequently fail to address their alignment with end-user business requirements. This paper introduces a two-step language transformation process to bridge this gap. Initially, we establish a transformation rule from the Business Process Model and Notation (BPMN) to Prolog, enabling the translation of business processes into a Prolog representation. This step not only validates the business process logic but also ensures it meets user specifications. Subsequently, we introduce a transformation rule from the BPMN to Go, which facilitates the transformation of the BPMN model, once validated, into a Go language smart contract. To enhance usability, we have engineered a dedicated tool that streamlines this transformation process. We present a case study involving a banking loan process to exemplify the utility of our tool in creating BPMN diagrams, conducting requirement and syntax validations, and effecting the transformation to Go smart contracts. The case study and empirical results suggest that our methodology and the accompanying tool mitigate the complexities inherent in smart contract development. They also ensure the fidelity of business logic to user demands, thereby promoting the broader adoption of blockchain smart contract technology.
- Book Chapter
2
- 10.1007/978-3-030-47945-9_19
- Jan 1, 2020
The study raises the problem of using the blockchain technology in smart contracts and discusses the prospects of using this technology in conclusion and execution of “smart contracts”. The need of analysis of this subject is determined by global changes in all areas of public life caused by the full-scaled introduction of digital technologies, including computer technology for the conclusion and execution of smart contracts. The article touches upon the issues of civil law regulation of smart contracts in the light of the introduction of Federal law No. 34-FZ, adopted by the State Duma on March 12, 2019 that amends to the Civil Code of the Russian Federation, including the legal definition of “smart contract”. The benefits and disadvantages of the practical use of smart contracts and the existing problems of applying the norms of civil legislation to smart contracts are examined. The purpose of the study of these issues is to identify and consider the theoretical and practical problems of using the distributed data ledger blockchain technology in smart contracts. The decisive research method for achieving this result was a system analysis of the “smart contract” category. The methods also include general scientific dialectical method of cognition, private scientific methods (formal-legal, method of interpretation of legal norms, method of legal modeling) and empirical methods (comparison, description, interpretation). In the end, the author concludes that the definition of “smart contract” should be technologically neutral. There is strong advocacy for the view that distributed ledger data, including blockchain technology, should not be part of the definition of a smart contract, since in the future it might be possible to conclude “smart contracts” created on the basis of a more advanced technology than blockchain. The results of the study formulated by the author can serve as a basis for further research of transactions made by electronic or other technical means, and other problems of the theory of civil law.
- Conference Article
2
- 10.1145/3674805.3686686
- Oct 24, 2024
Background. A smart contract is a computer program enclosing the terms of a legal agreement between two or more parties which is automatically verified and executed via a computer network called blockchain. Once a smart contract transaction is completed the blockchain is updated and the transaction cannot be changed anymore. This implies that any error codified in the smart contract program cannot be rectified. Therefore, it is of vital importance that developers of smart contracts properly exploit error handling to prevent issues during and after the contract execution. Existing programming languages for smart contracts, support developers in this task by providing a set of Error Handling (EH) features. However, it is unclear the extent to which developers effectively use EH in practice. Aims. Our work aims to fill this gap by empirically investigating the state of practice on the adoption of EH features of one of the most popular programming languages for smart contracts, namely Solidity. Method. We empirically analyse the usage of EH features in 283K unique open-source Solidity smart contracts for the Ethereum blockchain. Results. Our analysis of the documentation of the different versions of Solidity coupled with the empirical evaluation of the EH uses and misuses found in real-word smart contracts, indicate that, among other things, Solidity EH features have been changing frequently across versions, and that the adoption of most of the Solidity EH features has been limited in practice. However, we observe an upward trend in the usage of the require EH feature, which is specifically designed for smart contract development. Conclusions. The insights from our study could help developers improve their EH practice as well as designers of smart contract programming languages to equip their language with appropriate EH features.
- Research Article
1
- 10.3390/electronics13234680
- Nov 27, 2024
- Electronics
As one of the technical elements supporting the blockchain to realize decentralized autonomous organizations, smart contracts are crucial for understanding the inherent properties of blockchain systems through formal research. Most existing formal models of smart contracts focus primarily on static properties, lacking the depiction of dynamic processes such as conditional responses and internal state migration during contract execution, which complicates effective supervision. In this paper, a novel formal model of smart contracts, based on finite state automata, named Variable-State-Trigger (VST), is proposed, which presents state migration and conditional response mechanisms during smart contract execution. The VST model is verified to portray both the static and dynamic properties of smart contracts, providing new avenues for effective supervision during contract execution. Moreover, the VST model is used to illustrate the life cycle of a UAV mission smart contract, demonstrating its feasibility. With the growing integration of blockchain and emerging technologies, smart contracts have found applications in various fields, including drone swarm coordination. In this context, smart contracts enable secure, decentralized management and automation of interactions between autonomous drones, ensuring compliance with predefined conditions and enhancing the reliability of complex drone operations. The VST model can be extended to such applications, offering dynamic supervision and enhancing the coordination efficiency in decentralized autonomous drone systems.
- Research Article
523
- 10.1080/00207543.2019.1627439
- Jun 12, 2019
- International Journal of Production Research
Recently, the applications of Blockchain technology have begun to revolutionise different aspects of supply chain (SC) management. Among others, Blockchain is a platform to execute the smart contracts in the SC as transactions. We develop and test a new model for smart contract design in the SC with multiple logistics service providers and show that this problem can be presented as a multi-processor flexible flow shop scheduling. A distinctive feature of our approach is that the execution of physical operations is modelled inside the start and completion of cyber information services. We name this modelling concept ‘virtual operation’. The constructed model and the developed experimental environment constitute an event-driven dynamic approach to task and service composition when designing the smart contract. Our approach is also of value when considering the contract execution stage. The use of state control variables in our model allows for operations status updates in the Blockchain that in turn, feeds automated information feedbacks, disruption detection and control of contract execution. The latter launches the re-scheduling procedure, comprehensively combining planning and adaptation decisions within a unified methodological framework of dynamic control theory. The modelling complex developed can be used to design and control smart contracts in the SC.
- Research Article
- 10.32782/2224-6282/181-13
- Jan 1, 2022
- Economic scope
The emergence of cryptocurrencies and blockchain technology, the development of information technologies and international electronic commerce have led to the formation of a new type of civil law contracts, namely smart contracts. The use of mathematical algorithms in the implementation of smart contracts contributes to reducing the costs of organizing business relations, speeding up the implementation of agreements between business partners and increasing the level of security in the process of their cooperation. Investigating the issue of conclusion and implementation of smart contracts, its key elements are given, namely: the parties to the contract, who, on the basis of an electronic digital signature, agree or reject previous agreements; the subject of the contract and the availability of tools necessary for its implementation; an algorithm that accurately describes the conditions for executing a smart contract; a decentralized platform in which the algorithm of the smart contract itself is written, the algorithm in which the specific conditions for the execution of the smart contract are described. The article highlights the program-coordinating, protective, guarantee and security functions of smart contracts. The comparative characteristics of a smart contract with a civil law contract are given. The main advantages and disadvantages of the formation and implementation of smart contracts in Ukraine are grouped. The conclusion of smart contracts in Ukraine entails certain risks associated with the legal regulation of such contracts, in particular when determining their legal status. A technology for the development and signing of a smart contract as an innovative tool for contractual relations has been formed, which provides for the implementation of the following stages: determining business conditions and requirements for a smart contract, choosing a blockchain platform, selecting tools for developing a smart contract, developing a smart contract and auditing smart contract, deploying and signing a smart contract. Smart contracts are successfully used in various fields, such as: international settlements, securities transactions, banking, real estate, international e-commerce, recruiting, insurance, marketing and logistics, public and administrative services, agricultural sector, energy, medicine, etc.
- Conference Article
32
- 10.1109/icosec51865.2021.9591750
- Oct 7, 2021
Smart Contracts have noninheritable huge prominence within the recent years. After the Ethereum came into existence in 2015, the execution of smart contract had a great development in blockchain technology. The smart contracts execution faces number of issues to name few reliability, scalability, security. Development of Smart Contracts are not followed by standard software development life cycle. This causes the applications with smart contract(s) cannot perform exhaustive testing as well as it is expensive. The most prominent fields like smart contract testing and analysis of the code for vulnerability attracts many researchers. Targeted on reviewing the techniques and approaches discussed in various selected related papers from IEEE, science direct etc. For each of the selected research work identified open challenges that require further research. Hence this literature review on smart contract testing and analysis of smart contract code intends to emphasize the merits and demerits in smart contracts development process.
- Research Article
1
- 10.17072/1995-4190-2022-56-239-267
- Jan 1, 2022
- Вестник Пермского университета. Юридические науки
Introduction: the article is devoted to the analysis of legal regulation of smart contracts, the concept, content, and scope of their application. The author analyzes in detail foreign expe- rience of using smart contracts and suggests possible options for expanding the application area. The article also has a separate section that looks at smart contracts as compared with traditional institutions of civil law. Smart contracts are expected to find application in almost all areas of life in the future. As is often the case with new technologies, the use of smart con- tracts raises a number of civil law issues. Blockchain technology makes it possible not only to create new means of payment but also to autonomously manage almost any process. It can be used for individual contracts and even for the creation of autonomous decentralized systems. Purpose: to provide an insight into the institution of smart contracts and define their role in civ- il law. Methods: empirical methods of comparison, description, interpretation; theoretical me- thods of formal and dialectical logic; special scientific methods such as the legal-dogmatic me- thod, the methods of interpretation of legal norms and comparative legal research. Results: smart contracts are computer programs that perform legally significant actions according to predetermined algorithms set out in the form of a so-called program code. In practice, they are especially important in connection with the development of blockchain technology or (more generally) distributed ledger technology. Conclusions: the term ‘smart contract’ was defined by Nick Szabo in the 1990s as a sequence of commands represented in digital form, including transaction protocols that execute these agreements. Thus, smart contracts formulate rules and sanctions for agreements and execute them automatically. These are not necessarily contracts in the legal sense, but they are capable of controlling, tracking, and documenting legally signif- icant actions. Smart contracts can also be implemented using traditional, for example, mechan- ical technologies (e.g. in a vending machine). However, blockchain and distributed ledger tech- nologies make it possible to implement incomparably more complex rules and enforcement me- chanisms and offer a decentralized environment with an integrated settlement system. From a legal point of view, smart contracts perform two functions. On the one hand, they serve as a functional equivalent of a contract since their technological code can identify the services to be exchanged as well as the conditions under which they must be provided. Being the normative order of the digital, this code formulates the program of obligations of the parties. It resembles the legal order of a contract, without necessarily coinciding with it. On the other hand, smart contracts serve as a tool for the execution of contracts – by controlling, monitoring, and docu- menting the exchange of services. They can also facilitate the execution of conventional con- tracts by translating their provisions into a technical code, verifying the occurrence of agreed- upon events, and enforcing contracts. Smart contracts are suitable for contractual relation- ships, for example, for processing payments or delivering goods without the participation of the parties and an intermediate step in the form of direct execution. Smart contracts are gaining more and more popularity, especially in the financial sector. In addition to the so-called token economy (cryptocurrencies, ICO, etc.), there are also discussed algorithmic ETFs, online plat- forms for loans or project financing. Another important area of application is sharing economy. From a legal point of view, smart contracts can either be the subject of a contractual agreement or generate it on their own. There is sometimes put forward a thesis under the motto ‘Code is law’ that smart contracts give rise to a largely autonomous legal system and/ or are not subject to applicable law. However, this appears to be an erroneous conclusion