DPoI social activity rate computation: explained in details and in writing
For the video on this topic, please, refer to these links:
U°OS Network YouTube channel: https://www.youtube.com/watch?v=Ft1XlSk1yJ4
For the introductory video on DPoI and U°OS, please, visit here:
U°OS Network YouTube channel: https://youtu.be/bypQl4RlaZg
DPoI Importance score is made up of a sum of three components: user’s stake value, their social activity score and their economic activity score (Pic 1). These components enter the sum with three different weights, that add up to one. The meaning of these weights here is that one can put some larger priority on stake, or any of the two other components. These weights can be regulated by the community via voting. In this article, we focus on the social activity score computation (second component in Pic 1).
Picture 1: DPoI importance rate (Imp = DPoI importance)
Social interactions often serve as a precursor to economic activity in many digital settings and propel network growth. Apart from being a mediator of economic exchange, useful social activity generates a variety of network resources, such as new knowledge, inventions, useful information, opinions, networking resources, friendships, inspirations and ideas.
Quantification of the value that a network participant brings to the digital society is a natural step, that not only allows to return a reward for such activity back to the user, but also helps to builds their unique and transparent reputation on the Web. Therefore, we can conclude that social rate is a valuable component of the overall DPoI importance rate.
It is constructed based on the social activity that a user performs on the network via several types of interactions with other network participants. These interactions are mediated by the decentralized applications (DApps), that can be deployed on U°OS blockchain. U°Community is one of such DApps. It implements a content platform and provides main social action - upvote, that serves as an expression of evaluation of a given content by a user. One can grant an upvote to any post or comment and perform some other actions, such as reposts or downvotes of the content and comments. A single downvote action simply subtracts an upvote for a piece of content, however, you can only cancel your own upvote at the moment, using this action.
As mentioned above, U°OS blockchain can interact with a variety of DApps and registers a defined set of social transactions in the network. Each account issues outgoing activity and receives input from other users. Together these connections form a graph with directed edges between the account nodes. Social rates, obtained by the user, depend on the amount of incoming social activity only, which constitutes the utility of the user to the whole network (Pic 2).
Picture 2: Network account node with incoming social transactions from other accounts (U°Community provides upvotes as the measure of relevance of someone’s content)
Several types of social transactions are being recorded in the blockchain via the U°Community DApp at the moment, but only upvotes serve as an input data for the social rate calculation algorithm.
This is the PageRank algorithm, that gathers blocks of social transactions within a predefined time period W and computes social activity rates (together with the overall DPoI score) every 300 seconds. You can think of this time period W as a sliding window of a fixed height. Transactions that fit within this window are utilized in the computation. Each transaction within this window will be accounted for with a rate of decay defined by several other parameters. Decaying transactional weights help to make any fraudulent activity only temporary. One can notice that their social rate will decrease over time, if they do not receive new uovotes, because the weights of older upvotes decline over time.
Decaying weights (or scores) of individual upvotes are stored in special matrix V. As you can see from Pic 3, this matrix connects user with the content, that this user interacts with.
Picture 3: Weight of each upvote of a post depends on the point in time, when it was registered in the blockchain.
Weights of each transaction from a user towards a content decay after every block of length D in K times.
Next, we introduce matrix P, that denotes that a particular content belongs to a certain user (Pic 4).
Picture 4: Matrix P defines who is the content owner.
And matrix R, that redirects upvotes from reposts to the original author (Pic 5). It is important to understand, that if а user performs a repost of someone’s post and another network participant upvotes this repost, this transaction counts towards the original author of the content.
Picture 5: Matrix R redirects upvotes from the reposts to the original authors.
Given these three matrices: V, P and R we obtain a final matrix V’ that relates content to the users that upvoted it (Pic 6).
Picture 6: Matrix V’ connects content with users, who upvote it. Matrix I is a standard unit matrix with the values of 1’s on the diagonal.
Now we have this content-user relationship via the matrix V’, but we want the relationship user-user. How do we express such a relationship in mathematical terms and what meaning we want to incorporate there?
Pic 7 shows how users are connected through the content. User 1 upvotes multiple posts of User 2. These transactions happen at different points in time. A score that User 1 transmits to User 2 will be the maximal score that it gives to one of the posts 1, 2, and 3 in Pic 7. And obviously, this will be the newest upvote transaction that the user performs.
Picture 7: User 1 transmits the max of scores for posts 1, 2 and 3 to the User 2. This is the value of 0.5 in this picture, and also the score of their most recent upvote.
Why taking the MAX value, instead of a SUM in the matrix U’? (Pic 8) On one hand, sum makes sense, but it opens a gate for the User 2 to build up their social reputation score by simply multiplying their content and having a single other entity, represented by the User 1 (possibly a bot), giving these posts upvotes.
Picture 8: Matrix U’ reflects scores, that one user transmits to another user through the content they upvote.
We need to make sure that all columns of matrix U’ have non-zero elements. But some accounts might not produce any outgoing activity for a period of time, longer than our predefined window W. This will result in columns of zeros, corresponding to those users, and the matrix U’ will not be stochastic anymore. Stochasticity of this matrix is required for the PageRank algorithm to converge. We use a classical PageRank algorithm with a slight modification in the initial vector of user rates. We talk about this modification below.
In order to circumvent the violation of stochasticity, we do two operations:
- add a row of 1’s to the bottom of the matrix U’ (all 1’s except the last diagonal element, it will be equal to 0). This row corresponds to an artificial hidden account, that accepts upvotes from every account in real time (Pic 9).
- divide the weights in the matrix U’ by a total sum, to bring this sum up to 1 (Pic 10)
Picture 9: Hidden account preserves stochasticity of matrix U’
Picture 10: Matrix U is stochastic, it can be used in our PageRank procedure now.
Now the new matrix U, that is obtained from U’ after these two operations, is stochastic and can be used in the PageRank algorithm in Pic 11.
Picture 11: PageRank procedure for social activity score computation
From the equation in Pic 11, one can see that PageRank equation is an iterative procedure, that starts with some initial set of social activity rates and converges towards the final values.
Two matrices U and T are involved in the equation. Matrix U has been described already.
Matrix T (Pic 12) is a priority matrix, that contains priority values for each user. These priorities influence final social rates of each account.
Picture 12: Matrix T reflects priorities in the initial values of social activity scores, and in our procedure depends on stake and validity of the account.
In the classical PageRank these priorities for each node (or each user here) are equal.
But for our computation we modify these priorities to express the fact that they depend on two quantities: user’s stake s and their validity v. This is the change, that we make.
Validity is a number that originates from another important relationship between the network participants, called trust. This relationship will be explained in a separate article and video. For now you need to know that trust is allocated by the network users to each other via a special button, called Trust, on the U°Community DApp.
As you can see from the formula community as a whole can decide to put more or less weight on stake, validity or the vector of equal priorities, depending on their preferences. The algorithm is flexible in this way.
That’s it. A final social activity score is obtained via two extra operations
- subtraction of stake (we do not want a user’s stake to influence their social activity score, it should be defined by incoming social evaluation from other users only).
- standardization (for the scores to sum up to 1)
From the social rates of all users (that you can see on the U°Community DApp platform as well), social rates of each piece of content on the DApp are obtained in a trivial way (Pic 13).
Picture 13: Rates of content obtained from the rates of the owner the content.
These are the rates one sees on the DApp in the right upper corner next to each post.
Additional materials on DPoI and U°OS framework can be found in U°OS Yellow Paper: https://github.com/UOSnetwork/uos.docs/blob/master/yellow_paper/uos_yellow_paper.eng.pdf