# Research on Architecture of Digital Bond Trading Contract System Based on Blockchain Technology

Authors: Zheng Xu; Ji Liu
Journal: Mobile Information Systems
 (2022)

---

## Abstract

The traditional identification method of the digital bond trading contract system is single chain identification. Due to a large number of digital bond trading users, single chain identification will affect the performance of the system in the trading process. Therefore, we aim to propose a digital bond trading contract system based on blockchain technology and study the system architecture. In this paper, the architecture of the bond trading system is optimized by using the technology of blockchain, and the software architecture is developed by using the technology of blockchain. Through the performance test of the system, the advantages of the system architecture in practical application are verified. Firstly, the overall hardware architecture of the system is designed, and the internal structure of the controller in the control layer is redeployed. Combining the Mork tree and Patricia tree, the data structure based on blockchain and the block header data structure of the transaction contract system are optimized. By analyzing the operation process of the smart contract, the process of the smart contract consensus algorithm is optimized. The system performance test results show that the performance of the designed system in system transaction throughput, transaction delay, and system security is better than the traditional system, which verifies the effectiveness and reliability of the designed system.


---

## Body

## 1. Introduction

With the rapid development of the network, computer, and mobile terminal technology, the information release and trading process of China’s digital bond market have begun to be managed by a centralized platform, and centralized approval and supervision also play a positive role in preventing the emergence of debt risk [1]. The highly digitized and networked securities trading information system reduces the production cost and intermediary links for securities companies, thus reducing the probability of errors in transactions [2, 3]. The application scope of digital bonds is more extensive. Because its form is electronic information, it is easier to use and query. In the process of remote trading, its advantages can also be reflected. In recent years, China’s bond market has grown rapidly and the number of trading subjects is huge. The overall process and transaction contract are relatively perfect, and the comprehensive scale has also been significantly improved. At present, China’s bond market has become an important part of finance [4–6]. This kind of digital bond cannot be separated from the trading contract system in the process of circulation and trading. However, most of these systems are established by financial institutions alone, and there is no unified specification and guarantee for users. There is also a risk of tampering with the electronic database, resulting in malignant events such as the loss of users’ digital bonds.The advent of blockchain technology has aroused the research enthusiasm of financial scholars. Blockchain mainly adopts the consensus mechanism of workload proof to create a digital cryptocurrency system [7]. By optimizing the data structure in the system, bond trading will be closely combined with blockchain. At this time, the intelligent contract can be used to broadcast through the point-to-point network in the system [8]. Since the data in the blockchain will be divided into different blocks, each block will have specific information connected with the previous block to form a chain structure [9, 10]. In the process of blockchain operation, if you want to modify the data in the blockchain, you need to modify the data of all subsequent blocks. For attacks, this is almost impossible to achieve. The application of blockchain technology to the trading contract system has a strong protection ability. In the traditional digital bond trading contract system, the recognition method is generally single chain recognition. Because the trading contract system of digital bonds is generally traded through mobile terminals, and the number of users is relatively large, in the case of single chain identification, it will affect the system performance in the trading process and reduce the maximum throughput of the system.Therefore, this paper proposes a digital bond trading contract system based on blockchain technology and studies the system architecture in detail. We introduced our hardware architecture design and optimized the data structure based on blockchain. And, we did a comprehensive system test to verify the system performance.


## 2. Research on Architecture of Digital Bond Trading Contract System Based on Blockchain Technology

### 2.1. Hardware Architecture Design

Before establishing the digital bond trading contract system, we should first clarify some requirements and functions of the system for users and managers. The roles in the system are mainly divided into three types: super administrator, organization administrator, and ordinary user [11, 12]. First of all, the functional requirements of the three roles should be designed according to the actual situation. For example, the super administrator needs to upload and deploy the contract. For the institutional administrator, it needs to be able to recharge the user’s assets and query the history. For ordinary users, they need to be able to complete the normal registration and login of users, as well as the compliance transaction and query of digital bonds [13]. In view of the above system use requirements, this paper involves a transaction contract system architecture based on blockchain technology. The overall layout is shown in Figure 1.Figure 1
System structure.The control layer in the figure above is mainly responsible for receiving the service requests of the presentation layer. It mainly uses each module controller to receive and forward services. The internal structure of each module controller in the control layer is deeply designed. The architecture of the module controller is shown in Figure2.Figure 2
Architecture diagram of digital bond trading contract system based on blockchain technology.As can be seen from Figure2, the whole control layer mainly includes member services, blockchain services, and chain code services. The above-given modules are managed in the above-given control layer modules. It realizes point-to-point communication and data consensus between system nodes and provides a guarantee for the environmental security of system operation.


### 2.2. Design Data Structure Based on Blockchain

The digital bond trading contract system designed in this paper mainly takes blockchain technology as the core. In general blockchain technology, the data mainly adopts the murk tree structure and obtains the murk root through traversal [14]. The data structure can quickly locate abnormal nodes. However, in practical application, the status data will remain the same as the transaction goes on. For the system, it needs to rebuild a data structure and waste computing resources. Therefore, this paper optimizes the data structure. Combining the Mork tree and Patricia tree, the data structure is shown in Figure 3.Figure 3
System data structure.The improved data structure constructed in the figure above mainly includes three types of nodes: expansion node, branch node, and leaf node. This system mainly uses three improved murk-Patricia tree data structure trees to store bond transaction information, receipt information, and status information. Among the block data, the block header structure is the key optimization object [15]. In the working process of blockchain technology, the block header is designed as the input function of the consensus mechanism. Therefore, the relevant fields and explanations of the block header are shown in the following Table 1.Table 1
Block header data structure of trading contract system.
FieldNumber of bytesFunctionVersion16Update and sign the transaction contract of tracking systemPrevious hash32Block header identification value of adjacent blocksMerkle root64Hash value of the root of the murk-Patricia tree in the blockTime32Timestamp generated by the blockTarget16Bond trading target settingNonce8Random number generated during transaction calculationThe above-given data structure can prove that the workload can be calculated during the operation of the system. In the process of transaction contract, the value of each data structure in the block header is constantly updated to update the workload proof. It ensures that the roles in the system have the right to change the corresponding blocks. So far, the design of the data structure in the system is completed.


### 2.3. Intelligent Contract Consensus Algorithm Optimization

The consensus algorithm for smart contracts in the blockchain system mainly refers to the common calculation method of ledger between nodes in the blockchain system. There is no intermediate node in this process, so the identification of the whole system network can be obtained. The main purpose of a smart contract is to create smart assets that can be flexibly controlled, enrich the property logic of blockchain, and enhance its complexity. Smart contract mainly exists in the form of digital code. The specific operation process in the system is shown in the following Figure4.Figure 4
Operation process of smart contract.In the operation process of a smart contract, it is first necessary to set trigger conditions, such as specific time and events. And, predetermined response rules, such as specific transactions and actions. The trigger condition is combined with a smart contract, and the response rule is combined with the state of the system. The corresponding conditions and responses can be obtained under the action of external verification data sources. Apply the above-given operation process to a block in the blockchain and call it through the set conditions and API interface. In order to realize that the smart contract can be recognized by each node in the whole system, we also need to introduce the consensus algorithm. The architecture of the digital bond trading contract system based on blockchain technology designed in this paper belongs to a distributed system. In the case of node errors, the consensus algorithm can agree with the input of the correct nodes.In the intelligent contract consensus algorithm used in this paper, it can be seen from its operation process that its accounting method adopts turn accounting, so it can improve the consensus efficiency. It reduces the competition in the calculation process, effectively avoids the waste of resources, and has a certain effect in shortening the time delay. In the consensus algorithm based on a smart contract, the nodes in the system will be divided into two types: primary node and secondary node. In addition, the client will be set to send transaction requests to the system. The basic process of the consensus algorithm is shown in Figure5.Figure 5
Intelligent contract consensus algorithm flow.Under the above-given algorithm flow, the algorithm is introduced into the design system of this paper through the stages of submitting the request, preprocessing, preparation, and confirmation. Integrate the digital bond trading contract project with the consensus algorithm. Through the pairwise interaction between nodes, the interaction load between user nodes in the system is reduced, and the consensus efficiency in the system is improved. So far, the research on the architecture of digital bond trading systems based on block chain technology has been completed.


## 2.1. Hardware Architecture Design

Before establishing the digital bond trading contract system, we should first clarify some requirements and functions of the system for users and managers. The roles in the system are mainly divided into three types: super administrator, organization administrator, and ordinary user [11, 12]. First of all, the functional requirements of the three roles should be designed according to the actual situation. For example, the super administrator needs to upload and deploy the contract. For the institutional administrator, it needs to be able to recharge the user’s assets and query the history. For ordinary users, they need to be able to complete the normal registration and login of users, as well as the compliance transaction and query of digital bonds [13]. In view of the above system use requirements, this paper involves a transaction contract system architecture based on blockchain technology. The overall layout is shown in Figure 1.Figure 1
System structure.The control layer in the figure above is mainly responsible for receiving the service requests of the presentation layer. It mainly uses each module controller to receive and forward services. The internal structure of each module controller in the control layer is deeply designed. The architecture of the module controller is shown in Figure2.Figure 2
Architecture diagram of digital bond trading contract system based on blockchain technology.As can be seen from Figure2, the whole control layer mainly includes member services, blockchain services, and chain code services. The above-given modules are managed in the above-given control layer modules. It realizes point-to-point communication and data consensus between system nodes and provides a guarantee for the environmental security of system operation.


## 2.2. Design Data Structure Based on Blockchain

The digital bond trading contract system designed in this paper mainly takes blockchain technology as the core. In general blockchain technology, the data mainly adopts the murk tree structure and obtains the murk root through traversal [14]. The data structure can quickly locate abnormal nodes. However, in practical application, the status data will remain the same as the transaction goes on. For the system, it needs to rebuild a data structure and waste computing resources. Therefore, this paper optimizes the data structure. Combining the Mork tree and Patricia tree, the data structure is shown in Figure 3.Figure 3
System data structure.The improved data structure constructed in the figure above mainly includes three types of nodes: expansion node, branch node, and leaf node. This system mainly uses three improved murk-Patricia tree data structure trees to store bond transaction information, receipt information, and status information. Among the block data, the block header structure is the key optimization object [15]. In the working process of blockchain technology, the block header is designed as the input function of the consensus mechanism. Therefore, the relevant fields and explanations of the block header are shown in the following Table 1.Table 1
Block header data structure of trading contract system.
FieldNumber of bytesFunctionVersion16Update and sign the transaction contract of tracking systemPrevious hash32Block header identification value of adjacent blocksMerkle root64Hash value of the root of the murk-Patricia tree in the blockTime32Timestamp generated by the blockTarget16Bond trading target settingNonce8Random number generated during transaction calculationThe above-given data structure can prove that the workload can be calculated during the operation of the system. In the process of transaction contract, the value of each data structure in the block header is constantly updated to update the workload proof. It ensures that the roles in the system have the right to change the corresponding blocks. So far, the design of the data structure in the system is completed.


## 2.3. Intelligent Contract Consensus Algorithm Optimization

The consensus algorithm for smart contracts in the blockchain system mainly refers to the common calculation method of ledger between nodes in the blockchain system. There is no intermediate node in this process, so the identification of the whole system network can be obtained. The main purpose of a smart contract is to create smart assets that can be flexibly controlled, enrich the property logic of blockchain, and enhance its complexity. Smart contract mainly exists in the form of digital code. The specific operation process in the system is shown in the following Figure4.Figure 4
Operation process of smart contract.In the operation process of a smart contract, it is first necessary to set trigger conditions, such as specific time and events. And, predetermined response rules, such as specific transactions and actions. The trigger condition is combined with a smart contract, and the response rule is combined with the state of the system. The corresponding conditions and responses can be obtained under the action of external verification data sources. Apply the above-given operation process to a block in the blockchain and call it through the set conditions and API interface. In order to realize that the smart contract can be recognized by each node in the whole system, we also need to introduce the consensus algorithm. The architecture of the digital bond trading contract system based on blockchain technology designed in this paper belongs to a distributed system. In the case of node errors, the consensus algorithm can agree with the input of the correct nodes.In the intelligent contract consensus algorithm used in this paper, it can be seen from its operation process that its accounting method adopts turn accounting, so it can improve the consensus efficiency. It reduces the competition in the calculation process, effectively avoids the waste of resources, and has a certain effect in shortening the time delay. In the consensus algorithm based on a smart contract, the nodes in the system will be divided into two types: primary node and secondary node. In addition, the client will be set to send transaction requests to the system. The basic process of the consensus algorithm is shown in Figure5.Figure 5
Intelligent contract consensus algorithm flow.Under the above-given algorithm flow, the algorithm is introduced into the design system of this paper through the stages of submitting the request, preprocessing, preparation, and confirmation. Integrate the digital bond trading contract project with the consensus algorithm. Through the pairwise interaction between nodes, the interaction load between user nodes in the system is reduced, and the consensus efficiency in the system is improved. So far, the research on the architecture of digital bond trading systems based on block chain technology has been completed.


## 3. System Test Results and Discussion

### 3.1. System Test Environment Design

In order to verify the performance of the digital bond trading contract system based on blockchain technology designed in this paper, the similar account management model of Ethereum and the smart contract execution model of digital bond trading are established in the relevant smart contract modules. In the process of testing the system, firstly, Remix, a trading contract development, and debugging tool, is used to debug the digital trading contract system. The page during debugging is shown in Figure6.Figure 6
Remix debugging interface.In the above-given debugging interface, the system and its framework designed in this paper are built and run in Tianyi virtual machine. The test environment and equipment functions are shown in the following Table2.Table 2
Description of experimental environment.
Name of test environment equipmentFunctionDescribeTianyi virtual machineEstablish a minimum blockchain network and act as a consensus node4 setsSimulate the regulator as the accounting node of the blockchain1 setDeploy tomcat to provide web services1 setOperating systemCentOS7.38-Core, 16G memoryVP0Blockchain test environmentIp:10.58.11.203VP1Ip:10.5.11.204VP2Ip:10.23.11.205VP3Ip:10.73.11.206Server1Trading background test environmentIp:10.43.11.183Server2Ip:10.23.11.190In the above-mentioned experimental environment, the system uses the legal securities entrustment unit to record and verify the data ownership and changes in the whole securities trading activities. At the same time, the above-given data are processed through MySQL and LevelDB in the system. In the system architecture designed in this paper, the digital bond market transaction report database is shown in Figure7.Figure 7
Construction of transaction report base based on blockchain transaction.In the system performance test, according to the data sharing characteristics of digital bond trading, add as many trading users as possible in the experiment. In the experiment, 500000 new client clients were built for digital bond trading. The amount of data generated in each transaction is about 2-3M, and the transaction request is initiated within the same time period. And, complete the contract transaction of digital bonds in the fastest time and take the transaction throughput and transaction delay as the evaluation index of system performance.


### 3.2. System Transaction Throughput Test

The throughput during system operation mainly refers to the total number of orders that can successfully complete transactions within a certain period of time. The relevant calculation formula is as follows:(1)Hc=NdTb.In formula (1), Hc represents the throughput during system operation, Nd represents the number of transactions processed, and Tb represents the interval time. The interval time is fixed, which is generally set according to the actual situation of the system. The performance test of this system is mainly carried out in the network body. Under the condition of a blockchain private chain, data with a block size between 100 and 500 m is selected as transaction data. And record the relevant parameters during the operation of the system. After many experiments, take the average value as the result.In order to reflect the performance advantages of the system architecture in this paper, the traditional single chain identification digital bond trading contract system is selected in the performance test. The transaction throughput of the two systems in the actual operation process is compared. According to the throughput calculation formula, compare the digital bond trading contract system based on blockchain technology designed in this paper with the traditional single chain to identify the parameters in the operation process of the digital bond trading contract system. Take the different values in the above formula in the fixed time period for testing, and the changes of the digital bond trading volume of the two systems are shown in Table3.Table 3
Changes of digital bond trading volume of the two systems at different times.
Time interval (s)The system designed in this paper/MSingle chain identification digital bond trading contract system/M112.37.3215.68.6318.559.5520.814.11022.218.01523.320.12028.124.23030.428.25043.029.58075.232.510098.348.5150112.653.4200136.186.0300205.2146.2400317.4253.5500736.5571.6According to the test data of the two systems in the above table and the calculation method of the above formula, the throughput data in different time intervals can be obtained. The throughput during the test of the two systems is solved. The change of throughput is shown in Figure8.Figure 8
Comparison results of throughput of two systems.As can be seen from Figure8, the throughput of the digital bond trading contract system based on blockchain technology proposed in this paper is significantly improved compared with the traditional trading contract system based on single chain identification. In the case of blockchain technology, there will be no bifurcation problem in the process of trading contracts.


### 3.3. Transaction Delay Test

In the design part of the article, it is mentioned that in the data sharing calculation of the actual digital bond trading contract system, users need to build an optimized Merkel hash tree in the system and obtain the root of the Merkel tree. The running time of Merkel’s contract can be divided into two parts: the running time of Merkel’s contract and the running time of Merkel’s contract. In the stage of the transaction, all groups in the system are building blockchains as much as possible to simulate the smart contract in the process of bond transaction through private chains. In the process of transaction processing, the system mainly involves three communications. After the smart contract, intragroup signature verification, and Merk sign verification, the transaction is completed. In the performance test of transaction delay, the delay of data sharing is taken as the comparison index. In the transaction time delay, the time interval from the user submitting the request for digital bond purchase to the final determination of the success of the transaction. The calculation formula of average transaction delayT¯d is as follows:(2)T¯d=TdNt,where Td represents the total delay in the transaction process, and Nt represents the total number of transactions. Trading delay mainly describes the sharing ability of the system for digital bond trading contract, so it can be used as an important index to judge the performance of the trading contract system. The lower the transaction delay during the operation of the system, the shorter the waiting time of the user node, and the smaller the probability of being attacked in the transaction process, which can improve the user experience to a certain extent. In the performance test of transaction delay, multiple nodes are set to test the delay in the transaction process. The results obtained are shown in Figure 9:Figure 9
Comparison of delay between two trading contract systems under multinode.It can be seen from the results above that with the increase in the number of users of the digital bond trading contract system, the delay in the traditional system gradually increases. In this paper, the average delay of the community system is relatively stable. However, when the number of nodes is less than 500, the time consumption of the traditional system is less, but with the increase of the number of nodes, the advantages of this system are highlighted.


### 3.4. System Security Test

During the operation of the digital creditor’s rights trading contract system, the more important thing is the security of the system. Therefore, the security of the system is tested on this. In the experimental design, an attacker is set up in the blockchain network to act as a bad node and forge blocks that need to be connected to the blockchain. At this time, the calculation formula of the probability of a successful attack is(3)PZ=1−∑k=0zλke−λk!,λ=Zqp.In formula (3), p represents the proportion that the honest node of the system user can accurately generate blockchains, q represents the probability that the attack blocks generated by the attacker node match the system, and Z represents the total number of blockchains in the system. According to formula (3), we can get the result that the attack success probability of the two systems changes with the number of blockchains, as shown in Figure 10.Figure 10
Comparison of attack security.It can be seen from the results in Figure10 that when the number of blockchains is the same, the probability of a successful attack in this system is much lower than that in the traditional system. Therefore, it can be proved that the digital bond trading contract system based on blockchain technology designed in this paper has certain effectiveness and reliability.


## 3.1. System Test Environment Design

In order to verify the performance of the digital bond trading contract system based on blockchain technology designed in this paper, the similar account management model of Ethereum and the smart contract execution model of digital bond trading are established in the relevant smart contract modules. In the process of testing the system, firstly, Remix, a trading contract development, and debugging tool, is used to debug the digital trading contract system. The page during debugging is shown in Figure6.Figure 6
Remix debugging interface.In the above-given debugging interface, the system and its framework designed in this paper are built and run in Tianyi virtual machine. The test environment and equipment functions are shown in the following Table2.Table 2
Description of experimental environment.
Name of test environment equipmentFunctionDescribeTianyi virtual machineEstablish a minimum blockchain network and act as a consensus node4 setsSimulate the regulator as the accounting node of the blockchain1 setDeploy tomcat to provide web services1 setOperating systemCentOS7.38-Core, 16G memoryVP0Blockchain test environmentIp:10.58.11.203VP1Ip:10.5.11.204VP2Ip:10.23.11.205VP3Ip:10.73.11.206Server1Trading background test environmentIp:10.43.11.183Server2Ip:10.23.11.190In the above-mentioned experimental environment, the system uses the legal securities entrustment unit to record and verify the data ownership and changes in the whole securities trading activities. At the same time, the above-given data are processed through MySQL and LevelDB in the system. In the system architecture designed in this paper, the digital bond market transaction report database is shown in Figure7.Figure 7
Construction of transaction report base based on blockchain transaction.In the system performance test, according to the data sharing characteristics of digital bond trading, add as many trading users as possible in the experiment. In the experiment, 500000 new client clients were built for digital bond trading. The amount of data generated in each transaction is about 2-3M, and the transaction request is initiated within the same time period. And, complete the contract transaction of digital bonds in the fastest time and take the transaction throughput and transaction delay as the evaluation index of system performance.


## 3.2. System Transaction Throughput Test

The throughput during system operation mainly refers to the total number of orders that can successfully complete transactions within a certain period of time. The relevant calculation formula is as follows:(1)Hc=NdTb.In formula (1), Hc represents the throughput during system operation, Nd represents the number of transactions processed, and Tb represents the interval time. The interval time is fixed, which is generally set according to the actual situation of the system. The performance test of this system is mainly carried out in the network body. Under the condition of a blockchain private chain, data with a block size between 100 and 500 m is selected as transaction data. And record the relevant parameters during the operation of the system. After many experiments, take the average value as the result.In order to reflect the performance advantages of the system architecture in this paper, the traditional single chain identification digital bond trading contract system is selected in the performance test. The transaction throughput of the two systems in the actual operation process is compared. According to the throughput calculation formula, compare the digital bond trading contract system based on blockchain technology designed in this paper with the traditional single chain to identify the parameters in the operation process of the digital bond trading contract system. Take the different values in the above formula in the fixed time period for testing, and the changes of the digital bond trading volume of the two systems are shown in Table3.Table 3
Changes of digital bond trading volume of the two systems at different times.
Time interval (s)The system designed in this paper/MSingle chain identification digital bond trading contract system/M112.37.3215.68.6318.559.5520.814.11022.218.01523.320.12028.124.23030.428.25043.029.58075.232.510098.348.5150112.653.4200136.186.0300205.2146.2400317.4253.5500736.5571.6According to the test data of the two systems in the above table and the calculation method of the above formula, the throughput data in different time intervals can be obtained. The throughput during the test of the two systems is solved. The change of throughput is shown in Figure8.Figure 8
Comparison results of throughput of two systems.As can be seen from Figure8, the throughput of the digital bond trading contract system based on blockchain technology proposed in this paper is significantly improved compared with the traditional trading contract system based on single chain identification. In the case of blockchain technology, there will be no bifurcation problem in the process of trading contracts.


## 3.3. Transaction Delay Test

In the design part of the article, it is mentioned that in the data sharing calculation of the actual digital bond trading contract system, users need to build an optimized Merkel hash tree in the system and obtain the root of the Merkel tree. The running time of Merkel’s contract can be divided into two parts: the running time of Merkel’s contract and the running time of Merkel’s contract. In the stage of the transaction, all groups in the system are building blockchains as much as possible to simulate the smart contract in the process of bond transaction through private chains. In the process of transaction processing, the system mainly involves three communications. After the smart contract, intragroup signature verification, and Merk sign verification, the transaction is completed. In the performance test of transaction delay, the delay of data sharing is taken as the comparison index. In the transaction time delay, the time interval from the user submitting the request for digital bond purchase to the final determination of the success of the transaction. The calculation formula of average transaction delayT¯d is as follows:(2)T¯d=TdNt,where Td represents the total delay in the transaction process, and Nt represents the total number of transactions. Trading delay mainly describes the sharing ability of the system for digital bond trading contract, so it can be used as an important index to judge the performance of the trading contract system. The lower the transaction delay during the operation of the system, the shorter the waiting time of the user node, and the smaller the probability of being attacked in the transaction process, which can improve the user experience to a certain extent. In the performance test of transaction delay, multiple nodes are set to test the delay in the transaction process. The results obtained are shown in Figure 9:Figure 9
Comparison of delay between two trading contract systems under multinode.It can be seen from the results above that with the increase in the number of users of the digital bond trading contract system, the delay in the traditional system gradually increases. In this paper, the average delay of the community system is relatively stable. However, when the number of nodes is less than 500, the time consumption of the traditional system is less, but with the increase of the number of nodes, the advantages of this system are highlighted.


## 3.4. System Security Test

During the operation of the digital creditor’s rights trading contract system, the more important thing is the security of the system. Therefore, the security of the system is tested on this. In the experimental design, an attacker is set up in the blockchain network to act as a bad node and forge blocks that need to be connected to the blockchain. At this time, the calculation formula of the probability of a successful attack is(3)PZ=1−∑k=0zλke−λk!,λ=Zqp.In formula (3), p represents the proportion that the honest node of the system user can accurately generate blockchains, q represents the probability that the attack blocks generated by the attacker node match the system, and Z represents the total number of blockchains in the system. According to formula (3), we can get the result that the attack success probability of the two systems changes with the number of blockchains, as shown in Figure 10.Figure 10
Comparison of attack security.It can be seen from the results in Figure10 that when the number of blockchains is the same, the probability of a successful attack in this system is much lower than that in the traditional system. Therefore, it can be proved that the digital bond trading contract system based on blockchain technology designed in this paper has certain effectiveness and reliability.


## 4. Conclusion

Blockchain technology has the characteristics of distributed and strong confidentiality, so it has been widely used in digital currency transactions. This paper designs the overall hardware architecture of the system and redeploys the internal structure of the controller in the control layer. Combining the Mork tree and Patricia tree, the data structure based on blockchain and the block header data structure of the transaction contract system are optimized. By analyzing the operation process of the smart contract, the process of the smart contract consensus algorithm is optimized. The performance of this system has been verified, which shows that it has certain practical significance for the management of the digital bond trading contract. However, due to the lack of experience, the current system architecture still has some deficiencies. For example, the architecture design of blockchain can be further optimized, and the throughput needs to be improved. The application and implementation of this system are relatively simple. In the subsequent optimization, complex business requirements and contents need to be further added.



---

*Source: 4606902-2022-08-29.xml*