Safex Mining Pools Explained
After reading this article, it is hoped the reader will have a better understanding of the function of mining pools, the terminology used, and the associated mining software they interact with. It has been written in a simplified form, in the hope that the novice and average user can gain a better understanding of the processes involved.
Although the mining of Safex Cash (SFX) can be done as a solo endeavour (eg. using node mining), the vast majority of miners use the convenience and regular payouts that pool mining offers. We have covered how to set up miners for various operating systems in other articles, which can be found in the Safex Cash Mining Knowledge Base.
In modern cryptocurrency, mining pools are a critical component in the mining infrastructure for any Proof of Work (PoW) coin, such as SFX. There are several important reasons why splitting the network hashrate across multiple pools is advantageous:
- In order to enhance the security of the blockchain, no single pool should have more than 50% of the hashrate. Ideally, at least 3 or 4 pools would exist, with an approximately equal share of the total network hashing power (ie. no pool with >33%).
- Of utmost importance, every effort should be made to avoid any pool having over 50% of the mining hash power, as it leaves the blockchain open to what is known as a 51% attack, if that pool entity were to have any malicious intent.
- Additionally, if one pool has a majority of the hashing power, and it drops offline for any reason (eg. pool server dies), then the entire network runs the risk of suffering a long-term stall to blocks being found and transactions being processed, as the remaining hashing power is insufficient to overcome the block difficulty (explained later).
- Ideally, miners should find a pool close to them, as ping times (latency) between mining rigs and the mining pool will be much lower, meaning less wasted hashing, and faster opportunities to win blocks.
Recently, the author has seen an increase in the number of questions being asked in various Safex chat rooms about how different aspects of pool mining works, and so this article looks to provide those answers, in a simple-to-digest format.
We will start with an explanation of the various pages and terms used on the mining pool websites, and then briefly explore the actual process of how pools and mining software interact.
The pages found on mining pool sites normally include:
- Dashboard
- Start mining / Getting Started
- Pool Blocks
- Pool Payments
- Pool Top 10 Miners
- Worker Statistics
- Worker Settings
- Mining Calculator
In this text also find out:
Let's start at the mining pool landing page, aka Dashboard.
Dashboard
Whilst the exact layout and format of the Mining Pool Dashboard may vary from pool to pool, they all tend to deliver much the same information. Here are the Dashboards for pool.safex.org and aus.pool.safex.ninja, as examples.
Pool Hashrate: This represents the spot hashrate from all miners connected to the pool, and is an interpretation of the cumulative shares submitted by those miners. Shares is the mechanism used by mining pool operators to gain an approximation of the hashing power of each mining rig connected to it, and is briefly explained later in this article.
Blocks Found: The total number of blocks found by this mining pool.
Blocks Found Every: Based on the current Pool Hashrate, this is the amount of time it is expected to take to find a block. LAST BLOCK information allows the user to understand when to begin that calculation.
Current Effort: This is the current hashing effort that has been expended by the pool, since it last won a block. The percentage expresses how much hashing power has currently been expended by the pool, compared to the mathematical expectations of that hashing power finding a block at the current [global] network hashrate.
It can also be referred to as Luck (as seen on the Pool Blocks page, for the total average percentage of all blocks found).
Luck is simply a numerical percentage format to express how much faster or slower a certain hashrate finds a block, when compared to the mathematical probability, based on pool hashrate vs network hashrate.
- 100% = in line with the mathematical probability;
- <100% mean faster (lucky) than the expected probability;
- 100% means slower (unlucky).
If the pool hashrate vs network hashrate calculates to the pool finding a block every 10 hours, then that is the figure that equates to 100% luck. If the pool then only takes 5 hours to win a block, then (5 hrs taken/10 hrs expected) that equates to 50% good luck. If it had taken 15 hours to win that block, then (15 hrs taken/10 hrs expected) that would be 150% bad luck.
Network Hashrate: An estimation of the total global hashing power - is simply an interpretation of the current block difficulty. A string of good luck with found blocks will mean the network hashrate gets overestimated (because difficulty will increase, meaning Network Hashrate will be reported as higher than actual), whilst a string of bad luck will be the inverse result.
Difficulty: A very important number. This number represents the degree of difficulty being applied to find the winning hash for the next block of the blockchain. For Safex Blockchain, difficulty retargets every block, based on the last 60 blocks. Difficulty is the mechanism used to try and maintain a block time of 2 minutes.
What this basically means is, if the last 60 blocks:
- Found in < 2 hours, difficulty goes up (gets harder)
- Found in ~2 hours, difficulty remains much the same
- Found in >2 hours, difficulty comes down (gets easier)
In this way, difficulty continually fluctuates as block times change, which is also affected by increases or decreases in actual mining hashrate on the network.
If a bunch of new miners come online, then the increased hashrate vs current difficulty will very likely result in blocks being found faster than the 2 minute average. This will lead to the difficulty increasing, to accommodate the extra hashing power on the network, with a view to retargeting the 2 minute average.
Blockchain Height: The last block found for the blockchain. It increases with every block found.
Last Reward: The mining reward for the most recent block found by this pool. For the current year (2021-2022), the block reward is set at 270 SFX per block. If the last reward >270, then there were also one or more transactions processed on that block, and the extra amount is the combined total of all transaction fees for that block.
Connected Miners / Workers: If a miner has a single mining rig pointed at the pool, his connection contributes 1/1. If another miner has 3 rigs all mining to the same Safex Address, then her contribution would be 1/3. If another miner has their 11 rigs mining towards 3 different Safex addresses, then they would contribute 3/11 to the connection figures. The total mining addresses and rigs used by all miners on the pool give the numbers in this field. Miners with multiple rigs can use software (eg. xmrig-proxy) to hide the actual number of rigs they are mining with, so these numbers aren’t necessarily a true representation of the number of rigs mining to the pool.
Pool Fee: This is the percentage taken by the pool operator to cover server rental fees, etc. Safex.org is a 0% fee pool operated by the Safex Foundation. The SafexNinja pools have a fee of 0.15%, which is only 1.5 SFX per 1000 SFX mined. This is an extremely low pool fee, given that most mining pools for other coins operate at between 0.6% and 3%, with one recently added pool for Ethereum running at a massive (some would say almost criminal) 15% fee (Norton Crypto pool).
Minimum Payout: The smallest amount of SFX you need to accrue via mining to this specific pool before the pool will transfer them to your Wallet address. For people intending to mine SFX in the long term, it is recommended you increase your payout amount (process discussed later), in order to avoid problems with purchasing goods on Safex Market.
Payment Interval: How regularly the pool makes payments to miners.
Start Mining / Getting Started
For new miners looking to configure their rig, the Start Mining or Getting Started page is where you need to go.
This page allows you to generate a miner configuration template, which you can use in the config.json file for the xmrig software installed on your PC.
If you don’t yet have mining software installed on your PC, then the Download button will take you to the Releases page of the xmrig software repository, where you can download the latest release. Guides to install and setup xmrig can be found here in the Safex Knowledge Base.
As a rough guideline, choose a port based on these expected hashrates of your miner:
Port 3311: 0-3kh/s
Port 4411: 3-9kh/s
Port 5511: 9-15kh/s
Port 6611: 15kh/s+
RandomSFX, the mining algorithm used by the Safex Blockchain, is very similar to RandomX (as used by Monero), so you can check your expected hashrate by searching for your miner CPU on monerobenchmarks.info.
The various ports will start your miner at progressively higher difficulties, to better match the expected performance of the rig. Regardless of which port you connect through, the pool will adjust the difficulty to match your miner performance.
If you enter a Fixed Difficulty into your miner configuration, then the Port you use to connect to the pool really doesn't matter. However, when locking in a fixed difficulty, you need to know the hashing power of your specific rig. If you're new to mining, then you would not lock the difficulty to begin with, and therefore should select the most appropriate port for when you initially start your miner.
Once you see your xmrig output on your mining rig, you’ll know what hashrate your rig runs at. You can then use that information to go and modify your miner config.json file and set a fixed difficulty, if you choose to.
There’s much debate on mining forums as to whether any tangible benefit is gained from locking the difficulty, so each user should simply decide for themselves. If you aren’t sure what you should do, just let the pool manage the difficulty, and select the most suitable port for your miner config.
If you decide to lock the difficulty, then simply take your hashrate and multiply it by 30, and round it down to a nice big number.
Example:
Xmrig running on my laptop displays a 15min average hashrate of ~3024 h/s.
30 x 3024 = 90720… 90000 is a nice round number to use for locking the difficulty, if you choose to set it.
You can use the Start Mining Page to see where the information needs to go in the configuration settings.
Then just edit the config.json file in your xmrig folder to replicate the information on those lines.
Pool Blocks
This page displays a history of all blocks found by the pool and graph the blocks found each day for the last 30 days.
Blocks Found: Same as on the Dashboard.
Blocks Found Every: Same as on the Dashboard.
Current Effort: Same as on the Dashboard.
Average Luck: The total average effort for all blocks found by the pool.
In the long-term, all pools tend towards 100% luck overall, simply due to mathematical probability.
Pool Payments
When pools include this page on their website, it displays a record of all past pool payments, showing when payments were made, the transaction hash, the amount paid out, and how many payees were included in the transaction.
It also displays the total payments ever made (and how many miners have ever received a payment), the minimum payout amount, payment interval, and base denomination unit for payments.
Pool Top 10 Miners
Fairly self explanatory - this page lists the Miner addresses with the highest hashrates pointed at the pool.
Worker Statistics
This page shows your mining statistics for the pool, and is divided into various sections. Some pools provide more information than other pools.
It should be noted that if you stop mining for an extended period of time (normally 2 weeks, but depends on the pool), your mining history is cleansed from the pool database as part of regular database maintenance. This includes records of any Pending Balances. So if you stop mining, or change to a different pool, be sure to go into your Worker Settings and change the payout to the pool minimum, in order to get any remaining balances paid out to your Safex wallet address.
In the empty field, enter the Safex wallet address you used in the miner configuration settings on each of your mining rigs.
The following tables will then populate with your mining data.
Hash Rate
- Current Hash Rate: This displays your Spot Hashrate, and fluctuates according to how your Accepted Shares (explained later in this article) are interpreted by the Pool.
- Average 1/6/24-hour Hash Rate: Displays those averages. Most miners use the 24-hour hash rate as a fairly good indicator of their overall mining efforts.
- Last Share Submitted: How long ago you last submitted a Share.
- Total Hashes Submitted: This cumulative value is extrapolated from total Accepted Shares multiplied by the Share Difficulty for each of those shares.
Payments
- Pending Balance: The amount of SFX mining rewards you have sitting in the pool wallet, awaiting payment to your Safex wallet address.
- Total Paid: The amount of SFX already paid into your Safex wallet address
- Last 24h Paid: Self explanatory.
- Last 7d Paid: Self explanatory.
- Round Contribution: Your percentage contributions towards finding the next pool block.
- Current Payout Estimate: The approximate amount of SFX you will win from the next pool block found. It is essentially the current Block Reward (eg 270) multiplied by your Round Contribution, but may be different, depending on the number of transactions processed on that block, due to the possible inclusion of transaction fees in the Block Reward payment.
Workers Statistics
This table shows statistics for every active (or recently inactive) mining rig you have pointed at the pool for this Safex Wallet Address.
Blocks Found
This table shows all blocks found by your rigs.
Payments History
This table lists recent payments made to your Safex Wallet Address.
Worker Settings
Miner Address: The Safex Wallet Address you used in the miner configuration settings on each of your mining rigs.
Miner IP Address: This is NOT your miner’s LAN address. This is the IP address of your home router/modem, as provided by your Internet Service Provider (ISP). Your IP address can be dynamic [it changes, depending on the needs of your ISP] or static [permanently assigned]. If you don’t know what it is, then simply google “What is my IP address”.
Minimum Payout: This is how high you want to let your Pending Balance get before the pool makes a payment to you. As much as it can be exciting to see pool payouts arriving in your Safex wallet address every day, it is much better to have far fewer big payouts, rather than lots of small payouts. For more information on why this matters, please see Why it looks like I can't make this Purchase?
As you can see in the screenshot above, I have my minimum payout figure set to 5000 SFX.
Mining Calculator
Enter your approximate hashrate and the calculator will provide you with an estimate of the amount of SFX you can expect to mine per day (at 100% luck), taking into consideration the current Network hash rate.
This is not a “Set in Stone” amount, and can change for a variety of reasons. You should only take it as an approximation of what to expect at the current point in time.
How Pools and Mining Software Interact?
Caveat: It took the author upwards of 10 hours of research and reading to gain a novice-level knowledge of the more technical aspects of how mining pools and client mining software interact with each other. The explanation of these processes have been heavily simplified, to avoid going down confusing rabbit holes, where terms like Merkle Tree Roots and Keccak functions are used.
When you look at the xmrig window as it mines, you will see certain functions repeating themselves:
- miner
- net
- cpu
Miner
The miner entries show you the rig hashrate speeds, and it appears every minute, updating the details for 10s/60s/15m, along with the max hashrate the rig can currently produce. If you are using the PC for other purposes whilst you mine in the background you will likely see the 10s/60s/15m outputs being somewhat less than the max figure, simply because your cpu is doing other work, and being under a load, will not mine at optimum (max) hashrate.
Net
The net entries appear whenever the pool sends a new job. But what does this job entail? If a miner leaves their rig on auto difficulty, this job will contain a share difficulty parameter, based on the speed at which previous shares from that rig have arrived at the pool. This is how the pool calculates the approximate hashrate of the rig. Share difficulty is completely unrelated to block difficulty.
If you have locked your mining difficulty in the xmrig configuration settings, then the difficulty parameter in the new job will reflect that difficulty (or very close to it).
The new job will also include specific data pertaining to the current block being worked on - your miner will receive a blob of data from the pool, which allows the miner to check its hashes against the information in the blob, with the aim of finding a winning hash. The xmrig software is given sufficient data by the pool to allow it to figure out if it finds a winning block, negating the need to send all hashes back to the pool.
But what is this data?
Whenever a new block is discovered, the blockchain creates a next block template for the next block to be found. Because the target blocktime for Safex blockchain is 2 minutes, the new block template comes with a certain level of difficulty, which is mathematically likely to require 2 minutes to find the block, based on the time taken to find the last 60 blocks.
Difficulty is calculated as follows: Nodes keep track of the timestamps and cumulative difficulties for the last 60 blocks found. Those timestamps are then given a weighting, with recent blocks carrying more weight than the older blocks. The difficulty for the next block is calculated as the total cumulative work of the last 60 blocks multiplied by the 2 minute target blocktime, and divided by the sum of all 60 weighted timestamps.
The pool sends a request to the blockchain to receive this next block template. However, when it sends this request, it also sends the pool’s Safex wallet address as part of the request, and then when it receives a reply from the blockchain, the template includes that pool wallet address, embedded into the data. In this way, miners can’t simply find a winning hash and claim the block for themselves - if a miner finds a potential winning nonce (the specific hash needed to win the current block), they can only send the winning information back to the pool in order for the pool to attempt to win the block.
CPU
The cpu entries reflect a confirmation line that xmrig sent back shares to the pool. The shares system is used to provide pools with an indication of mining rig hashrates, and the cumulative total is displayed as the Pool Hashrate on the pool Dashboard (mentioned above). Due to limitations on how much data can be sent by each mining rig, and then, cumulatively, how much data can be received from all the miners connected to a pool, it isn't feasible for every rig to transmit every hash to the pool, in order to see if it wins the block.
To reduce the load on the pool server, each rig ideally sends 2 shares per minute. If you have left your share difficulty on automatic, the pool will continually adjust your share difficulty, in order to try and receive two shares per minute.
Depending on how quickly you then send back a share at that share difficulty (even if you locked it in the config settings), the pool calculates an approximation of your hashrate. This is why you will see your spot hashrate fluctuate on your pool worker statistics, while your xmrig hashrate remains mostly stable, whilst your 24hr hashrate average on the worker statistics tends to be fairly close to your actual hashrate.
The cpu entry can show accepted, rejected or stale shares (but the author has never seen stale appear for SFX mining).
Accepted
Pool accepted your share. The share includes valid proofs of work, which are randomly selected (but not necessarily winning) hashes. This proves you are actually doing the hashing work. Accepted share count towards your mining contribution for the current mining round.
A mining round lasts from one pool block found, until the next pool block is found.
Rejected
Pool rejected your share, either because it was submitted after the current block being worked was found, or the randomly selected proofs of work submitted were not valid (eg. corrupted data/bad hashes).
The numbers in brackets show your cumulative share totals (accepted/rejected) since you started xmrig. The cpu line then shows a confirmation of the share difficulty registered for that share, and finally, the latency.
Latency is the time it takes for data to pass from one point on a network to another, in this case your rig and mining pool. The lower the number, the better, so always try to connect your rigs to the nearest mining pool (lowest latency).
If you have a latency of 30ms on one pool, and 450ms on another, then for mining on a blockchain with a target 2 minute blocktime, and at 2 shares per minute (4 shares per average block), that represents a latency difference of 120ms vs 1.8 seconds!!! per block.
Rejected shares are often higher when latency is higher.
How Does the Pool Calculate Mining Contributions?
There are various ways in which different pools can calculate your mining rewards. This article isn't meant to provide a comprehensive explanation of all pool types, as only one type is predominantly used for mining SFX - PROP (Proportional) Pools.
As a simple explanation: For each mining round, the pool keeps track of all shares from all miners. The share difficulty allows the pool to give appropriate weighting to shares, based on the difficulty of each accepted share.
In this way, each miner earns a proportional amount of SFX rewards, corresponding to the amount of accepted work they submitted vs the other miners in the pool.
Orphaned Blocks
When a block is found, the node that found the block disseminates that information to all peers it is connected to, and then those nodes spread it to all their peers, and so on, until the entire network is made aware that a new block has been found. This happens globally,via a matter of seconds.
However, if two different pools (or even solo miners) happen to solve for the same block almost simultaneously, then it becomes a race, of sorts, for the found block information to get spread throughout the network.
This is where blockchain consensus becomes important. Only one of the blocks can actually become the newly found block, and whichever of the newly solved blocks gains the majority becomes the winning block, and then all nodes come to agreement - or consensus - on which block wins.
The losing block is termed an orphaned block, as it gets rejected by the blockchain, and no block reward is paid for a block that becomes orphaned.
If you see a block in the mining pool blocks list with no reward, and maybe an ‘x’, then that reflects an orphaned block.
Changing Pools
If you decide to change mining pools, you will most likely have some amount of pending SFX balance on the old pool. You don’t want to leave those coins behind.
So the first thing to check is if your pending balance is above the minimum payout figure for the pool. If it isn’t, then you won’t be able to withdraw them. In this case, keep mining to the pool a little longer, until you can withdraw your SFX, of simply abandon the small amount, and consider it a donation to the pool operator, for providing the pool service.
Depending on the frequency your existing pool has been finding blocks, there may also be an amount of SFX due to you, which hasn’t yet been added to your pending balance. Those SFX don’t add to your balance until they unlock in the pool, after 60 confirmations.
If you look at the Pool Blocks page and no blocks are still locked, your pending balance will be complete. If there are still locked blocks, then after changing pools, you’ll need to wait some hours (>2, but wait 4 to be safe) before you set your payout back to minimum on the old pool. Any SFX from locked blocks will have unlocked by that stage, and your pending balance will reflect the final amount owed to you.
Once you set your payout figure below your pending balance, the pool will process the payout. Occasionally, there may be some small remnant of SFX remaining on the pool. You can either keep mining to the pool until you get a completely empty balance, or simply forget about those few small remnants of SFX and let the pool operator have them. I suggest the latter.
Final thoughts
The pool-miner communication section of this article gives a layman's overview of some very complex information. It was simplified to allow an understanding of the basic functionality of mining pools and how they interact with mining software. It is not intended to provide a complete explanation of all the various complexities of pool mining cryptocurrency.
Pool Safex is one of the mining pools currently operating for the Safex blockchain.