# A Novel Decentralized E-Commerce Transaction System Based on Blockchain
## 3 Platform Design
### Reputation Evaluation Scheme
#### 3.4.1. Calculation of Node Reputation Value
#### 4.2.2 Analysis of Time Consumption

This paper takes the time taken by Ethereum blockchain to call smart contract as dependent variable and different block length as independent variable, and compares it with the BC-DRS and BS-EP. The results are shown in Figure 8.

Through analyzing the experimental results, we can draw the following conclusions. 1. The time cost of the three functions of the proposed system increases slightly as the increase in the number of blocks. Smart contracts need to upload information to the blockchain. Therefore, as number of blocks increase, the consumption of the proposed system increases. 2. The proposed system consumes the most time in accepting and evaluation function. The accepting and evaluation function of the system needs to call smart contract to realize accepting in function and upload the information to blockchain. Therefore,

Figure 7: Comparison of gas consumption in smart contract. compared with the information upload and transaction completion functions, it consumes the most time. 3. Compared to storing massive information data into blockchain, we only store fixed size addresses of product information. Therefore the time consumption of the proposed system is low. The amount of information in the confirmation of purchase and the signing and evaluation stages is relatively small. Therefore, the system time consumption is low. Therefore, according to the above results in cost and time cost, we can conclude that the proposed system has good usability for online shopping. ### Reliability and Safety Analysis

The current reputation evaluation systems are mostly based on average score. There are numerous good and malicious comments in the system, which is difficult to resist collusive attacks and unfair attacks. To improve the reliability and security of the system, this paper proposes a reputation evaluation method based on SAW and MCDM, as demonstrated in Section 3.4.1. We randomly generated the transaction records of users a, b, c by Python, including transaction period, transaction completion time and transaction amount. The reputation of users was evaluated. The results are shown in Figure 9.

Figure 8: The time cost of invoking smart contracts: (**a**) Time cost of commodity upload function; (**b**) Identify the time cost of purchasing features; (**c**) Time overhead of sign-in and evaluation functions. Figure 9 suggests that with the increase in the number of transactions, the reputation value of user tends to be stable. That is, the proposed reputation value calculation model could effectively reflect the reputation value of user. Sellers with high reputation value have high priority in the search results and buyers with low reputation value will be supervised by the platform for unreasonable return behavior. In addition, the transaction system with the reputation evaluation scheme is capable of resisting the following attacks:

1. Unfair evaluation attack. The attack means that the malicious evaluator deliberately places an unfair evaluation to reduce the reputation value of transaction partner. In the reputation calculation model proposed in this paper, the reputation value is not only connected with the evaluation, but also related to the completion time of transaction, amount involved and reputation value of counterparty. The single malicious evaluation of malicious attacker has little influence, while the reputation value of malicious attacker will be influenced. When its reputation value is too low, malicious attacker will be subjected to system supervision and sanctions. 2. Reputation accumulation attack. To avoid the node accumulating rights and interests for a long time, the age of currency owned by the node will be limited generally in blockchain system. The proposed system selects transactions in a certain period according to the timeliness to reflect the current reputation value of the node, aiming at avoiding the node accumulating too high reputation value. 3. Collusive attack.