# A Model for Deriving Trust and Reputation on Blockchain-Based e-Payment System +
## 2 Related Work
### Time Adaptive EWMA with Personal Evaluation Criteria  
To model the personal transaction evaluation criteria that changes over time, we introduce four key metrics: time difference weight (TDW), personal evaluation criteria (PEC), normalized evaluation (NE), and average received normalized evaluation (ARNE). **Time Difference Weight (TDW):** The concept of '1 time\" takes an important role in human life. Our thoughts and behaviors change over time as well. Thus, it is important to trace the changes of a person's personality (evaluation criteria in our case) and to weigh the latest value more while making sure that the past data is not overwhelmed by a small number of recent transactions. In order to trace the changes of each individual's evaluation tendency, we define a time-adaptive EWMA weighting parameter \(\alpha(td(t))\) as,  
\[\alpha\big{(}td(t)\big{)}= \begin{cases}0.05,&td(t)\leq 7\\ 0.1,&td(t)\leq 30\\ 0.15,&td(t)\leq 180\\ 0.2,&td(t)\leq 365\\ 0.25,&td(t)>365\end{cases}  \tag{1}\]  
according to the time difference \(td(t)\) between previous and current transaction evaluation times as illustrated in Figure 2. The threshold values for the evaluation time differences are one week (\(\leq\)7), one month (\(\leq\)30), six months (\(\leq\)180), one year (\(\leq\)365), and over a year (\(>\)365). As stated in the Equation (1), the longer the time-interval between transactions is, higher weight is applied on the latest transaction. This is to balance the influence of several recent transactions dominating the rating and aggregated long term statistics. **Personal Evaluation Criteria (PEC):** Naturally, each individual has different evaluation tendency. For example, someone might be more generous or strict in evaluation, and some might have high or low variation in grades than others. To trace individual's evaluation tendency, we propose a personal evaluation criteria (PEC) metric based on the average and deviation of each user's evaluation scores. Our model updates these values for every new transaction, and store them in a local cache which can be verified at anytime by parsing the transaction history in the blockchain. By maintaining these values, the system can normalize evaluations in constant time, and it becomes unnecessary to look up all transactions of a user to find out her evaluation tendency. \[PECavg_{A.tx}(t)= \begin{cases}e(t),&t=init\\ \alpha_{A.tx}\big{(}td(t)\big{)}\cdot e(t)+\Big{(}1-\alpha_{A.tx}\big{(}td(t) \big{)}\Big{)}\cdot PECavg_{A.tx}(t-1),&t\
eq init\\ \end{cases}  \tag{2}\]  
\[PECdev_{A.tx}(t)= \begin{cases}0,&t=init\\ |\,e(t)-PECavg_{A.tx}(t)\mid,&t=init+1\\ \alpha_{A.tx}\big{(}td(t)\big{)}\cdot|\,e(t)-PECavg_{A.tx}(t)\mid+\Big{(}1- \alpha_{A.tx}\big{(}td(t)\big{)}\Big{)}\cdot PECdev_{A.tx}(t-1),&t\
eq init+ 1\\ \end{cases}  \tag{3}\]  
Figure 2: Time difference between transactions. \[NE_{A.tx}(t)= \begin{cases}\frac{e(t)}{10},&td(t)=init\\ 0.5,&PECdev_{A.tx}(t)=0\\ \frac{1}{1+e^{-\frac{|(t)-PE_{A.tx}S_{A.tx}}{PE_{A.tx}}}},&td(t)\
eq init\\ \end{cases}  \tag{4}\]  
\[ARNE_{B.rx}(t)= \begin{cases}NE_{A.tx}(t),&t=init\\ \alpha_{B.rx}(td(t))\cdot NE_{A.tx}(t)+\left(1-\alpha_{B.rx}(td(t))\right)\cdot ARNE _{B.rx}(t-1),&t\
eq init\\ \end{cases}  \tag{5}\]  
Equation (2) is used to update the average of \(PEC\) upon every new transaction, where \(e(t)\) is the latest \"raw\" evaluation value, \(PECavg\) is the long-term average up till now, and \(\alpha_{A.tx}\) is the time-adaptive EWMA parameter for transactions made by user A. If the user evaluated a product/service for the first time, \(PECavg\) is initialized to \(e(t)\). Otherwise, \(PECavg\) is calculated using EWMA with new evaluation \(e(t)\) and \(\alpha\left(td(t)\right)\) derived from the inter-grading times. Equation (3) calculates the latest deviation of \(PEC\) which represent the degree of variation on rating scores. \(PECdev\) is set to 0 if a user evaluates a transaction for the first time as there is no previous evaluation to compare with.