Blockchain is an innovative application of distributed storage, consensus algorithm, encryption algorithm, and other computer technologies. The consensus algorithm is the key to keep consistent among blockchain nodes. In most existing consensus algorithms, the leader node is responsible for proposing new block and communicating with other nodes. The leader node is easy to be the target of malicious attackers. With the increase of the number of nodes, the throughput and scalability of the blockchain system are also unsatisfactory. To address such issues, we propose the AnonymousFox consensus algorithm, which is suitable for the consortium blockchain and private blockchain. First, we design an anonymous leader node sorting algorithm, which hides the identity of the leader node through a variety of encryption algorithms. It periodically changes the ordered leader list to hide the target of malicious attackers. In addition, we design a consensus algorithm based on the anonymous identity of the leader node. Through one-to-many message communication, the amount of messages is greatly reduced. The complexity of the algorithm is $O(n)$ . It solves the problem of ordered replication of state machines when the leader node is anonymous. We analyze the algorithm, it ensures safety and liveness when the fault nodes are less than one-third of the total. We evaluate the throughput, latency, scalability, resource consumption, exception processing, smart contract, and blockchain network through experiments. The throughput of the proposed algorithm is 49.3% higher than that of the practical Byzantine fault tolerance (PBFT) algorithm. The experimental results show that the proposed algorithm has high performance and scalability.
The close integration of blockchain and smart contract technology has become an important foundation for current trusted applications. High-quality, high-efficiency and high-security codes have become basic requirements for smart contract applications because they are not easy to be modified after being deployed on blockchain. This paper proposes a function-level dynamic monitoring and analysis method for smart contract, and implements a prototype system. The method adds a “shadow stack” and related data structures to virtual machine of testing blockchain platform by analyzing the principle of function management with original stack, then monitors the bytecode after code instrumentation, records the function calling relationships as well as the relevant metrics of time, instruction number and gas consumption. The prototype system identifies contract inefficient behaviors using visualization and intelligent analysis methods, then forms a smart contract optimization closed loop through iterative improvement. Finally, the paper verified the high feasibility and applicability of the monitoring and analyzing method as well as prototype system’s performance through experiments.
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.
14 October 2022 in Wireless Communications and Mobile Computing
The practical Byzantine Fault Tolerance (PBFT) is a classical consensus algorithm that has been widely applied in an alliance blockchain system to make all nodes agree to certain transactions under the assumption that the proportion of Byzantine nodes is no more than 1/3. It is prevalent due to its performance, simplicity, and claimed correctness. However, any vulnerability of the consensus algorithm can lead to a significant loss in finance because no one can change the transaction results after execution. This paper proposes a formal development method of the PBFT algorithm by horizontal refinement in Event-B, which allows us to manage the complexity of the proof process by factoring the proof of correctness into several refinement steps. During the development of PBFT, we have specified the core mechanism like parameterized message types, primary node change, and water-mark interval. Furthermore, we present a mechanical verification of the safety and liveness properties of the model in Rodin, which can be partially and widely used to check the blockchain consensus algorithm vulnerability using a refinement tree of algorithms.
1 October 2024 in Journal of King Saud University Computer and Information Sciences
A composite smart contract can execute smart contracts that may belong to other owners or companies through external calls, bringing more security challenges to blockchain applications. Traditional static verification methods are inadequate for analyzing the dynamic execution of these contracts, resulting in misjudgment and omission issues. Therefore, this paper proposes a model checking approach based on dynamic behavior that verifies the security and business logic of composite smart contracts. Utilizing automata, the method models contracts, users, attackers, and extracts properties, focusing on six types of common security vulnerabilities. A thorough case study and experimental evaluation demonstrate the method’s efficiency in identifying vulnerabilities and ensuring alignment with business requirements. The UPPAAL tool is employed for comprehensive verification, proving its effectiveness in enhancing smart contract security.