What is user scoring?
This thread is about scoring and how it affects the user and the balance. Scoring a user means the script will determine how much credits have been sent and received by the user so far. The relation between the total amount of sent transactions and received transactions is the score. Scoring is only done for the main asset, but not for other fungible and non-fungible tokens.
The scoring follows 5 simple rules:
-
Every day the score of the user is increased by the payout
-
After creation of a transaction the score of the sender is immediately reduced by the transaction amount
-
Once the transaction has enough confirmations, the score of the sender will be increased by the original transaction amount
-
The score cannot be lower than 0
-
The score cannot be higher than the users balance
Why is scoring being done?
Scoring ensures that a user cannot collect infinite credits from other users and immediately spend them. Instead more and more credits of the balance will be unlocked over time. If a user has not enough balance to buy something, it’s impossible for him to bypass this by creating multiple other accounts and collecting the payouts as he is not able to send them at once.
Example without scoring:
-
Account A has balance 5 UCC
-
Account A wants to buy something with price 10 UCC
-
Account A creates accounts B, C, D, E and waits 1 day for first payout
-
Next day account A has balance 6 UCC, accounts B,C,D and E have balance 1 UCC each
-
Accounts B, C, D, E send 1 UCC each to account A increasing the balance from 6 UCC to 10 UCC
In this example without scoring account A has now 10 UCC and could buy the item.
Example with scoring:
-
Account A has balance 5 UCC and score 5 UCC
-
Account A wants to buy something with price 10 UCC
-
Account A creates accounts B, C, D, E and waits 1 day for first payout
-
Next day account A has balance 6 UCC, accounts B,C,D and E have balance 1 UCC each
-
Accounts B, C, D, E send 1 UCC each to account A increasing the balance from 6 UCC to 10 UCC
A has now balance 10 UCC, but because of the scoring (balance is equal to the score, so the score is not touched) only 6 UCC (the initial 5 UCC + 1 UCC payout the day he waited) are unlocked and can be spend. Spending the 6 UCC will unlock the rest of the balance. So with scoring a user can spend the daily payouts without limit and has to unlock the credits he received.
In the example without scoring account A can spend the whole amount in one transaction while with scoring account A cannot spend the whole amount. It is very important to only accept the whole amount in one transaction if you cannot trust the sender. This will guarantee that users are not able to collect balances from a potentially infinite number of accounts they have created. This precaution and the process of scoring protects you from fraudulent users.
What means “whole amount”?
Whole amount simply means the whole price. If something has a price of 10 UCC, the user must transfer 10 UCC in one transaction to pay. Not two Transactions having 5 UCC each, or 5 transactions having 2 UCC each; the amount shall be send in 1 transaction. Of course this only applies for senders you don’t know and you cannot trust like e.g. the walk-in customers of a shop. If for example a shop has multiple branches in other locations and they need to transfer credits between these branches there is no need to send the whole amount in one transaction.