What is POS and How to Stake
Staking experiment done by Girls in crypto
Since we are talking about crypto projects and they attract new investors, we thought we should pay a little attention to the basics. The path of each crypto-investor begins differently, whether it is as a Miner(PoW) or a Staker(PoS). How can investors get the maximum profit, if they do not know how it works? With the arrival of new investors, it turns out that many are just learning about the PoS protocol. Many repetitive questions began to appear about how staking works and how to get maximum revenue.
Today I will tell you, as simply and easily as possible, using as an example based on the Trittium coin. The developers of the Trittium project kindly agreed to provide me with 75,000 coins so this article’s findings would be based on actual results. We had the opportunity to conduct this experiment and find out in no uncertain terms the best practice get the maximum rewards from staking. To set up this experiment, I divided the 75,000 Trittium coins into three equal parts (25,000 each) and sent them to three different wallets. Next I split each amount into different UTXO sizes.
Before we dive further into the actual experiment, let’s have a cover look at Proof-of-Stake(PoS).
What is PoS and why is it?
In case a new cryptocurrency investor happens across this, let’s begin at the very start. The blockchain. It is a large ledger, simple enough. It consists of blocks of data that stores information about every transaction for a specific coin and every owner of those coins (in the form of wallet addresses). In general, the entire history of each coin from its launch to the present moment can be found in the blockchain. However, in the block, you can record information as well, not just coin locations and transactions. Coins, in general are a means of encouraging, rewarding the creators and keepers of that set of data-blocks to continue to support the blockchain in which information is stored. The strength of the blockchain is that it is decentralized, that its copy is stored on the computer of every participant of the network. This means that in order to hack the database and make changes to it, you cannot just hack one computer where the blockchain is stored. Because it is decentralized and stored on every users’ computers, it would require hacking 51% of the computers. This is not an easy task and is the core strength of blockchain technology.
For the most part, everyone is already familiar with the Proof-of-Work(PoW) algorithm. Bitcoin, the first cryptocurrency uses PoW to release new coins into circulation. However, in order to be thorough, we need to mention it. In general, the essence of the Proof-of-Work protocol is to create new data blocks and make entries in them. In return, miners will receive rewards for their work. Who exactly is rewarded for a specific block is determined by who solves a complex cryptographic task first. The more your computing power you utilize, the more likely you are able to obtain a reward. This is why many invest in large, costly mining rigs. It would seem like it is a good thing, but over time there have been some noticeable issues with PoW. Firstly, the high cost of equipment. Mining through PoW requires expensive GPU processors and cooling systems. Secondly, high energy consumption. In most parts of the world, electricity is not cheap and mining through PoW can drain electrical grids. Thirdly, wear and upkeep on the equipment. This includes: significant heat generation, noisy while running, gathers dust, and the sheer size of some mining farm spaces. All this added up is not environmentally friendly and detrimental to power grids for utility over-usage. It is these problems that led to the appearance of the Proof-of-Stake(PoS) protocol. So what is the difference between PoW and PoS?
The primary difference is when creating new data blocks, there is no need to solve complex cryptographic tasks like with the PoW algorithm. Because of this, there is no need for large amounts of computing power. In order to become the creator of a new block, it is enough to have a certain number of coins in your wallet. Your wallet has a portion (or stake) of the total number of coins in the system. Who will be the creator of the new block is decided by the system in a pseudo-random way. It chooses from the pool of participants who hold coins in their wallet on the network. The more coins you have, the more likely the system will choose you as the creator for the new block. The remaining functions for PoS are the same, including the storage and confirmation of information on the blockchain.
In order to understand what kind of profit we can expect, we must first understand some of the details. Let’s start with a look at the technical characteristics of the coin. Again, we are using Trittium as our example in this article.
1 — Coin Type — PoW/PoS/Masternode.
This means that the Trittium network is supported by the nodes, and also allows active storage to be used — PoS. Excellent! That’s what we need!
2 — Masternode collateral — 50,000 TRTT
The minimum deposit for running the Masternode is 50,000 TRTT coins. For the experiment here, we do not have enough coins for a masternode (25,000 in each wallet). Therefore, we are interested in the minimum amount that is required to activate PoS. For Trittium, this amount is 10,000 coins
3 — Coin Emission Per Day
Let’s take a look at how many coins are generated by the system per day. To find this out, we need to know a few things. First, what is the number of the last generated block and the total rewards for that block. You can do this one of two ways: look in the official explorer which can be found at (https://explorer.trittium.cc/), or by opening the wallet -> “Tools” -> “Debug console” -> type “getmininginfo”. For the experiment here, the last generated block was Block 140,282. According to the table, the reward for the block is 350 coins. A new block is generated by the system every minute (Block time — 60 sec). There are 1,440 blocks generated each day so we simply multiply 350 coins by 1440 blocks and we get 504,000 coins. This is the amount generated by the system per day.
4–80% — Masternode rewards from block, 20% — POS rewards from block
This means the Masternode holders will receive 80% of the block reward, and 20% of the reward are given to PoS. In our experiment with Trittium, this is 280 and 70 coins respectively (20% of 350 = 70, 80% of 350 = 280). In total, there are 100,800 coins rewarded to POS daily and 403,200 coins rewarded to Masternode holders daily. next I want to calculate approximately how many coins one masternode will receive per day. For this I have to divide the total rewards by the total number of Masternodes on the network. Information about the number of nodes on the network can also be found in the explorer or in the wallet -> “Tools” -> “Information” tab. During this experiment, there were 1,010 Masternodes on the network. Dividing 403,200 by 1,010, we get 399.21 coins. This is the approximately how many coins a masternode will receive daily.
In practice, this amount will change daily with a change in the number of nodes on the network. And also on one day you can get 1 reward and on others you can receive 2 or 3 or none. It is randomized but on average over time, the yield will match the estimated amount.
Estimating the staking profitability is much more complicated. This is due to the fact that we don’t know how the other coins on the network are participating in the reward distribution process. With masternodes, they are all 50,000 coins; it is uniformed. With staking each wallet can have different sized UTXOs which affect staking rewards. We know that 100,800 coins are rewarded to PoS daily, but we do not know the number of participants and how rewards are shared. However, it is very important to know that the reward is not rewarded based on the wallets, but based on the transactions (or UTXOs) in the wallet. This means that the more UTXOs of 10,000 coins or more we have, the higher our chances of getting a reward. At the same time, the UTXO amounts should not be too small in comparison with the overall “network weight” or it will not receive any rewards.
What does the “Network Weight” mean?
The total weight of the network is the total weight of all the coins in the network that are waiting for a reward. Each block is confirmed and each coin gains a confirmation with each passing block. Once a coin ‘matures’ to a certain number of confirmations, they are added to the network weight. If we divide our 25,000 coins by the number of blocks per day (1,440), we would get 17 coins. This will be the weight that our transaction will gain per minute. Accordingly, the longer our transaction waits for its turn to receive a reward, the more weight it will gain and more likely it will receive a reward. Here it should be noted, that for the reward to be received, coins must reach a minimum maturation time. This is also indicated in the table above (Minimum staking age = 12 hours). This means that within 12 hours of the transaction, we will not be able to receive a reward. After 12 hours, our weight by this time will be equal to 12,240. It is important to note that it does not mean we will receive it exactly after 12 hours. Once mature, the coins are eligible to be randomly selected by the network. Most likely, there are coins with a longer maturation time than ours that may be chosen at that time.
Another important thing to note is that the weight of the network changes every minute. Hundreds of transactions are made every minute, new coins are generated, and coins receive rewards. These coins go back to the 12-hour maturation time, leaving the network weight and queue for rewards.
As you can see, everything is very complicated here. It’s almost impossible to make approximate calculations for rewards with staking. Therefore, the essence of our experiment will be to find out what will bring us more profit — the size of the transaction inputs (UTXOs) or their numbers.
Practical Part: Setting up a Wallet.
1. Let’s start with the most important thing, the Trittium wallet. First, we need to backup the wallet. But in advance, just in case, create a backup copy of the wallet.dat file. If you installed the wallet in the default folder, then it should be stored on the “C” drive (if Windows is installed on the “C” drive, of course), with: UsersYour user nameAppDataRoamingTrittium2. If you specified a different folder when installing a wallet, then go your way.
In this folder, you will find a wallet.dat file and you need to copy it into a safe, secure location. A USB flash drive for example, which you never give to anyone. This will be your backup.
2. In order to participate in the process of obtaining PoS rewards, your wallet needs to be constantly running. There is a danger that someone will penetrate your computer and steal your coins. In order for this not to happen, you need to set the password for the wallet. Go to the “Settings” menu and select the “Encrypt Wallet” option. Only do this after the wallet is done syncing. Come up with a fairly complex password for security purposes. Enter it two times then click the “OK” button. The process of encryption of the wallet file will begin, it may take some time during which the client will not respond. It may seem like it is frozen but just be patient and wait for the process to finish. At the end of the process, you will see a window which I advise you to carefully read. After that you can confirm the action of closing the wallet.
3. Start the wallet again, and check to make sure it syncs and everything is okay. To do this open the “Settings” menu again and select “Unlock Wallet” and enter your password. If everything is in order, in the lower right corner you will see the unlocked lock icon. When you hover over it, the message will appear: “Wallet is encrypted and currently unlocked”. After that you can make a backup copy of the already encrypted wallet (as described in item 1) replacing the old wallet.dat file with the new one.
4. Now, the reason we’re here and the part that is most interesting to us: staking activation and splitting of one transaction into different UTXO sizes. The first rule that we need to fulfill for the staking activation in the Trittium wallet is to have at least 10 000 coins in one address. We currently have 25,000 coins in each. Now we will break our 25,000 coins into the number of entrances that we need. To do this, we need to enable the “Coin control” function. Open up “Settings” -> “Options”, go to the Wallet tab and check the “Enable coin control features” box. If you want the wallet to start when Windows starts up, you can make that in the “Main” tab by checking up the “Start Trittium on system login” option.
5. Now when switching to the Send tab, we have new functions enabled, We will return to their description a little bit later but let’s first do what we need. First, create a new address and call it ‘PoS’. It is not necessary, but for convenience of use and control, it is better to label your addresses. Open the “File” menu -> “Receiving addresses”, in the window that appears, click the “New” button and enter the name for the new address (for me it will be ‘PoS’). Click “OK”. Now select your new address and click “Copy” then close this window.
Now, go to the “Send” tab and in the “Pay to:” field right click and paste the address into that box. In the lower field “Label:” the name for that address, ‘PoS’, should be displayed.
Now we’ll enter the number of coins that we want to send to our POS address. Please note that for this transaction, you will also be charged a transaction fee, albeit a very small one.
And now, most importantly select the “Split UTXO” field. In the field that is now activated, enter the number of UTXOs that you would like to break your transaction up into. In the first wallet, I split 25,000 coins into 100 UTXOs of 250 coins each. In the second wallet, 25 UTXOs of 1,000 coins each. In the third wallet, 10 UTXOs of 2,500 coins each.
Once you’ve chosen your UTXO amounts and sizes, you can click “Send”. In the window that appears, enter your password, do NOT check “For anonymization and staking only” field. Then click “OK”. To the question “Do you really want to send?”, answer “Yes” having checked everything beforehand.
To check your transaction, go back to the “Send” tab, and click on the “Open Coin Control …” button. Here you can see how many UTXOs you have and their priority in the obtaining rewards process. For example, if you need to send a certain number of coins and you want to use only those with the shortest maturity time (confirmations), you can mark the required inputs so only these coins will be used when the transaction is executed.
That’s all. Now we wait for the coins to mature. Again it will take 12 hours. After that, you will need to restart your wallet again and check whether the stacking is activated. In the meantime, so that your money is secure, you can lock your wallet. “Settings” -> “Lock Wallet”.
How to check whether the stacking is activated?
After 12 hours, the coins will be ready to participate in the reward distribution process. Restart the wallet and wait until the synchronization process ends. Unlock the wallet: “Settings” -> “Lock Wallet”. Do not forget to select “For anonimization and staking only” when you will enter your password.
If everything is in order and the stacking is activated, after one or two minutes you will see that the arrow in the lower right corner turn green. When you hover over it you can see the words “Stacking is active”. If staking is still not activated after some time, go to the “Tools” menu and open the “Debug Console”. In the console, run the “getstakingstatus” command. Stacking is not activated until all 6 conditions are met. If at least one of the parameters you see says “false” as it’s status, you will not get staking rewards.
“validtime” — responsible for checking the time on your computer (if false — check the clock)
“haveconnections” — checks if there is a connection to the network (if false — try to disable your firewall)
“walletunlocked” – whether the wallet is unlocked (if false — Settings -> Unlock Wallet)
“mintablecoins” – checks coins for maturity (if false — coins are not yet mature)
“enoughcoins” – checks if enough coins are available to activate the stacking
“mnsync” – synchronization check (if false — try to restart the wallet or run the “mnsync reset” command)
“staking status” – is stacking active (if false, check if all the previous conditions are met, if yes, then in Settings -> Options -> Network, try turning on the option “Map port using uPnP.” Go to Tools -> Open Wallet Configuration File, add staking = 1, close with saving changes, and restart the wallet. After restarting, wait until the synchronization is complete and unlock the wallet again.)
It’s time for the most important part, the results of our experiment. As already mentioned, I sent 25,000 Trittium coins to three different addresses. In the first wallet, I split 25,000 coins into 100 UTXOs of 250 coins each. In the second wallet, 25 UTXOs of 1,000 coins each. In the third wallet, 10 UTXOs of 2,500 coins each. The experiment lasted 14 days and this is what happened:
Just in case, here are the addresses of the wallets to which the coins were sent:
https://explorer.trittium.cc/address/TWdSgd2Zt8uTEccAPMpTYYetfwNn4QBCVN — inputs of 250 coins https://explorer.trittium.cc/address/TJFuJprSrE5jyKFZJoaeFCdUFxPVeaUmTK — inputs of 1000 coins https://explorer.trittium.cc/address/TEyaxMrNAu3WBQSAYPdEgJ8bDkPJhjyBov — inputs of 2500 coins
Note that the number of rewards per day, in the explorer, may not correspond to the table due to the difference in time zones.
As you can see, the higher number of UTXOs, not the higher number of coins, has a better chance of receiving rewards over time. In this case, during the first week there was no difference between the UTXO sizes of 250 and 1000 coins. But a difference appears over a longer period of time. And the inputs of 2500 lagged far behind throughout the experiment. Conclusions? I think they are obvious but as always, DYOR. Do your own research. 🙂
I hope that this article will help many people or at least will be interesting. Thank you for your attention and good luck!
Originally published at medium.com on August 30, 2018.