# A Novel Decentralized E-Commerce Transaction System Based on Blockchain
## 3 Platform Design
### Reputation Evaluation Scheme
#### 3.4.1. Calculation of Node Reputation Value  
After completing the transaction, the buyer and the seller can evaluate mutually according to smart contract. However, it is unreasonable to calculate the node reputation value by only relying on this evaluation. In the process of transaction, in addition to the subjective feelings of the buyer, time of transaction, amount of transaction and reputation score of both parties also play important roles. Therefore, this paper proposes a method based on SAW and MCDM. The proposed method calculates the node reputation value according to the difference between period of node transaction and time of transaction completion, amount involved in transaction, reputation value of transaction partner and the evaluation of buyers [28]. Obviously, the earlier the transaction is completed, the higher reputation value of participating users. The more transaction amount, the higher reputation value of transaction user. In addition, the reputation of transaction partners is also a positive evaluation standard. Figure 4: The UML Sequence diagram of e-commerce transaction system. For a cluster with n* nodes (\(y_{1},y_{2},y_{3},\dots\ y_{n}\)), each node has a\({}_{i}\) (\(i\in{1,2,3,\dots}\)) transactions. For transaction \(j\) record of \(y_{i}\) has the time interval \(t_{ij}\) and the transaction amount \(c\) (the difference between the transaction period and the actual transaction time, \(t_{1}\) is the deadline of each transaction, \(t_{2}\) is the sign-off time of the transaction, \(t_{ij}=t_{1}-t_{2}\)), which can be normalized by:  
\[t^{\prime}_{ij}=\frac{t_{ij}-t^{\text{min}}_{ij}}{t^{\text{max}}_{ij}-t^{\text {min}}_{ij}} \tag{1}\]  
\[w^{\prime}_{ij}=\frac{w_{ij}-w^{\text{min}}_{ij}}{w^{\text{max}}_{ij}-w^{\text {min}}_{ij}} \tag{2}\]  
where \(t^{\text{max}}_{ij}\) and \(t^{\text{min}}_{ij}\) represent the maximum and minimum value of the historical transaction time difference of node \(y_{i}\) in the cycle period, respectively; \(w^{\text{max}}_{ij}\) and \(w^{\text{min}}_{ij}\) represent the maximum and minimum value of historical transaction amount of node \(y_{i}\) in the cycle period, respectively. If the transaction time exceeds the time limit, the transaction is cancelled and the deposit is returned to each account, meaning that \(t^{\prime}_{ij}\) cannot be negative. Recording \(c_{ij}\) as the reputation value of the other party node in the \(j\)th transaction, we perform the normalization operation by:  
\[c^{\prime}_{ij}=\frac{c_{ij}}{c_{\text{max}}} \tag{3}\]  
where \(c_{\text{max}}\) is the historical maximum reputation value of a node. If there is no historical maximum reputation value with node of transaction partner, then \(c^{\prime}_{ij}\) is recorded as 1. Recording s as the score of the other party node in the \(j\)th transaction (the score value is within 0-10), we have:  
\[s^{\prime}_{ij}=\frac{s_{ij}}{10} \tag{4}\]  
Recording the reputation value of node as \(R_{i}\), and \(\varphi_{ij}\) as the influence of a single transaction on reputation value of the node, we have:  
\[R_{i}=\sum_{j=1}^{a_{i}}\varphi_{ij} \tag{5}\]  
\[\varphi_{ij}=(\alpha C^{\prime}_{ij}+\beta w^{\prime}_{ij}+\gamma t^{\prime}_ {ij}+\delta s^{\prime}_{ij})T_{ij} \tag{6}\]  
where \(\alpha\), \(\beta\), \(\gamma\) and \(\delta\) are the weights that are adjusted according to the actual needs, which satisfies \(\alpha+\beta+\gamma+\delta=1\); \(T_{ij}\) is a collision factor, whose function is to prevent excess influence on the reputation of transaction partners from one node, and to prevent two nodes from colluding with each other to update a higher reputation. Therefore:  
\[T_{ij}=(\frac{1}{num_{ij}})^{\theta} \tag{7}\]  
where \(\theta\) is the adjustment coefficient, and \(num_{ij}\) is the same transaction number of node \(i\) in the \(j\)th transaction in the cycle period. If the two parties have the same transaction users and the same transaction commodity, it will be judged as the same transaction.