:Block mining NOTE!!! THE BEING BLOCK HAS INDEX = 1, THE SAME AS THE ONE FOLLOWING IT. SO IN THIS BLOCKCHAIN THERE ARE TWO BLOCKS WITH IDENTICAL INDICES, BUT WITH DIFFERENT CONTENT. THIS IS ABSOLUTELY NORMAL AND THIS IS THE FEATURE OF THIS BLOCKCHAIN. A unique mining system is implemented here, which stimulates a smooth increase in the value of the coin, preventing it from falling much with the onset of winter and is resistant to strong volatility, but at the same time the value increases. For mine, you need to go to localhost:8082/, multithreading is automatically turned on there and the number of threads is automatically turned on. Then go back to the menu in the top right corner and click on “Get Locked”, click on the “Start” button and then click on “International Union Corporation”, in the information window you should see “Is Mining Proper”. the update is also correct, which means that the system is loading the blockchain. Nothing will be displayed in the console, because if we display information there, mining will slow down six times for single-threaded and multi-threaded mining. If you want to turn off mining, click the “Stop” button twice, then click on the Corporation Intertation Union inscription, if everything stopped correctly, the information window will disappear. Under no circumstances should you interrupt the mining process by disabling the command line during mining or updating, as at this point the Blockchain and balance will be overwritten. When the information window goes out, mining will stop. A block is valid if the hash matches the target value according to this formula: //************************************************ ************************************************* //mining formula public static BigInteger CalcultTargetV30(long complexity) { BigInteger maxTarget = new BigInteger(Setting.MAX_TARGET_v30, 16); return maxTarget.divide(BigInteger.valueOf(complexity)); //used to select a block } /**You count a random number based on the hash definition and the current one and the higher the number, the higher * originality.*/ /**You count a random number based on the hash definition and the current one and the higher the number, the higher * originality.*/ public static int bigRandomWinner(Actual lock, account miner) { // Concatenation of two hashes String combinedHash = act.getHashBlock(); if (actual == null || fact.getHashBlock() == null || fact.getHashBlock().isBlank() || fact.getHashBlock().isEmpty()) return 0; // Convert concatenated hashes to BigInteger BigInteger hashAsNumber = new BigInteger(combinedHash, 16); if (hashAsNumber == null) { return 0; } // Using BigInteger as a seed for a deterministic random number generator Random deterministicRandom = new Random(hashAsNumber.longValue()); // Generate a random number depending on 0 to 135 int = 135; // Assuming the limit is the largest value + 1 int result = deterministicRandom.nextInt(limit); result = (int) ((int) (result + (actual.getHashCompexity() * 35)) + CalculateScore(miner.getDigitalStakeBalance(), 10)); return result; } public static long calculateScore(double x, double x0) { if(x <= 0){ return 0; } double score = Math.ceil(Math.log(x / x0) / Math.log(2)); return Math.min(400, (long) score); } The mining reward is calculated using the formula (5+coefficient + (difficulty * 0.2)) * multiplier. Where the multiplier is 29, but decreases by one each year until it reaches 1. The coefficient can be 0 or 3; For it to become equal to 3, two conditions must be met. 1. The sum of all transactions in the current block must be greater than in the previous block, excluding the founder's remuneration and the miner's remuneration. 2. The number of different senders in this block must be greater than in the previous block, not counting the base address, which sends the reward to the founder and miner. The current blockchain is the longest and has the largest big random. If big random is the same, then it is determined by complexity, if it is the same then by staking, if it is the same then by the number of transactions. 1. A random number is generated based on the block hash, where the block hash acts as a seed. 2. Difficulty * 35 is also added to this random number. 3. Your staking gives additional points, where the first point costs 10 coin in staking, the second point costs 20 coins, the third point costs 40 coins, etc. that is, if you have 70 coins staked, this is equal to 3 points. Each subsequent ball requires twice as many coins. Every 100 seconds, from all submitted blocks, the blocks are sorted and the block with the longest and largest big random is selected, after which each node is synchronized with other servers using the resolve3 method blocks..