Disclaimer: Products and services referred in here may not be available in your region.
Binance will select a specific date during the event and use the last 9 digits of the last TON Blockchain block hash at 23:59 (UTC) on that date as the winning sequence.
For example:
If the last TON Blockchain block hash on the reward calculation day is: 0hVwGb09xU6rhZhs9JMHU29KuqYATsVwd+96R8X6wF4=
Binance will use multiplicative hash formula (similar to Java’s `hashCode()`) “h = 31 * h + value[i]” to determine the winning user(s)’ wallet address.
Calculation:
1. Convert the string “0x22eEC85ba6a5cD97eAd4728eA1c69e1D9c6fa778” to lowercase to get “0x22eec85ba6a5cd97ead4728ea1c69e1d9c6fa778”, then calculate the hash code.
2. Each character’s value is determined by its ASCII code:
3. Initialize the hash value: h = 0
4. Process the first character '0':
5. Process the second character 'x':
6. Process the third character '2':
7. Process the fourth character '2':
8. Process the fifth character 'e':
9. Process the sixth character 'e':
10. Process the seventh character 'c':
11. Simplified processing of the remaining characters
Continue processing the remaining characters following the steps outlined above, until all characters are processed. The final hash value, h, will be an integer.
12. To ensure the hash value is non-negative, we apply a bitwise and with “0x7fffffff”: “h & 0x7fffffff”.
13. Using this algorithm, the TON address hash value will be a number between 0 and 2147483647.
Each user's wallet address is converted to a hash value to calculate their lottery sequence:
[Winning Sequence - Address Hash] = User’s Lottery Sequence
Binance will sort each user's lottery sequence in ascending order and select a certain number of sequences as winners depending on the campaign rules.
In case of a tie (e.g., two or more users have the same lottery sequence), Binance will use the task completion time to determine users’ rankings. The earlier a user completes the task, the higher their ranking.
After that, the absolute difference between users’ address hash and the winning sequence is calculated. Binance will sort each user's lottery sequence in ascending order, and the smaller lottery sequence(s) will win.
For example:
How to determine the winner:
Since 491842543 is smaller, User B wins.