Tuesday 12 April 2016

Decred - Proof of Stake mining [FAQ]

1. How do I start PoS mining?

Answer - Check This Out!

2. What hardware do I need to PoS mine?

Answer - The hardware doesnt really matter. You can use a laptop, desktop, VPS, Amazon AWS or even a Raspberry Pi 2 or other newer SoC. It simply needs to be online and connected to the internet 24x7x365. If your PoS wallet is unable to reach the internet you will miss calls to stake vote, your ticket will be revoked and you will not get the stake vote reward.

3. How much DCR do I get for PoS voting / mining?

Answer - The current PoS reward is 1.853DCR per vote. The reward will change over time. It will slowly get lower and lower. As of 13MAR16, block 10035, the total block reward is 30.88. This is broken down into 60% PoW reward, 18.532DCR. 30% PoS reward, 1.853DCR X 5 votes or 9.265DCR and 10% developer funds reward 3.088DCR.

3.1 How long does it take to get the PoS reward?
Answer - It takes 256 blocks (~1 day) for your stake reward to be returned and spendable.

4. How much does a stake ticket cost?
Answer - The price changes every 144 blocks. The amount of sstx purchased in the 144 blocks between price changes influences sstx price moreso than the target 40960 pool number. 144 blocks * 5 votes/block = 720. If less than 720 sstx are purchased in 144 blocks then the overall direction is down in price. Even if the total amount of sstx is still above the target 40960 sstx in the pool. If the amount of sstx tickets is <720 then the sstx price goes up. If there are more or less than 40960 stakes in the pool this will also affect the price direction of movement. Currently at block 10035 13MAR16 1 stake vote ticket requires you pledge or lock 14.39DCR. Previous stake ticket costs have been in the range of 5DCR-30DCR based on demand as above. The average sstx price at this time is 9dcr.

4. Do I get my stake back or do I lose it?

Answer - Buying a stake vote is really not the correct term. What you are really doing is pledging an amount of DCR to have the right to vote. There are 3 outcomes after you purchase a stake ticket. 1 - Your ticket is voted. You get your stake pledge 14.39DCR + reward 1.853DCR currently. 2.Your stake vote is called and you miss the vote. Your ticket is revoked. Your stake pledge 14.39DCR currently is returned. No reward given. 3.Your ticket is not voted for 142 days(approximately) and your stake pledge is returned at the end of 142 days. No reward given.

5. How often does the stake ticket price adjust or change?

Answer - The stake ticket price or pledge adjusts every 144 blocks or about 12 hours.

6. How much DCR do I need to PoS?

Answer - You can start with any amount as long as you have enough to purchase a stake vote ticket. How much is that? It changes. It can be anywhere from 2DCR to 1000DCR. Currently 13MAR16 at block 10035 a stake vote costs 14.39DCR and will return 1.853DCR reward. Knowing that it will probably take 28 days to get the stake pledge and the reward back you can calculate how much you want to vote each day. For example - 2 votes per day X 28 days = 56 stake tickets * 14.39 = 805DCR. The 56 votes will return 107.3DCR reward after about 28 days.

7. What are the commands to PoS?

Answer - There are quite a few commands related to PoS. We have started to flesh them out here:
Useful PoS commands

7.1 How can I connect DCRD to more nodes?

Answer - add the --maxpeers=X switch to your dcrd config or at start. 1-? is the range for X. Why would I want to do this? Outbound connections are HARD SET to 8. This has been extensively tested to be the ideal amount and cannot be changed. Inbound connections are good for the network. If you are running a public node you can up the amount of allowed inbound connections to whatever your system will handle. The default max is 125. You can raise it higher if you like but do not adjust lower. This can result in missed tickets as your hop count, in effect latency, increases. There are also bandwidth considerations. If you pay for data $/per MB raising this can increase the data you use.
For a concrete example, assume that at some point in the future there are a million nodes on the network. You would be able to reach any given node on the network with a maximum of ceil(log8(1000000)) = 7 hops. In practice, it works out to be even less than that on average because there are inbound nodes too which are notified and thus the net effect is that it raises the base of the logarithm which of course in turn reduces the hops.

8. How do I know if I have voted?

Answer - You will see something like this in your dcrwallet screen:

13:28:35 2016-01-25 [INF] WLLT: Voted on block 0034dafbc7969fd5f1c5a3cbbf1ddd48ec78109d103457b3bb5b101c71db3657 (height 4143) using ticket 2030e3978322bac2466146ccf955c32afd86ccf85f1356ab54cd091513b6f9ad (vote hash: cb8c498f1c6fb9255076655b21394733a4d1f078687c751860d8dd93e7599d57)

You can also see current tickets held by using the getstakeinfo command.


dcrctl -u -P --wallet getstakeinfo
{
"poolsize": 41768,
"difficulty": 8.49962772,
"allmempooltix": 6,
"ownmempooltix": 0,
"immature": 6,
"live": 241,
"proportionlive": 0.005769967439187895,
"voted": 151, <--Total number of votes you have cast
"totalsubsidy": 280.91069628, <-- Total reward subsidy you have received for votes
"missed": 12,
"proportionmissed": 0.0002872187649593107,
"revoked": 12
}


9. How do I know if I bought a stake vote ticket?

Answer - You will see something like this in your dcrwallet screen:

14:51:09 2016-03-13 [INF] TMGR: Inserting unconfirmed transaction b06cfe0a13f6e62c095b71308d310a6a63c18ad52f9b6650a3d6e469a4894699
14:51:09 2016-03-13 [INF] WLLT: Successfully sent SStx purchase transaction b06cfe0a13f6e62c095b71308d310a6a63c18ad52f9b6650a3d6e469a4894699

You can also see how many stake tickets you currently have by using the getstakeinfo command.


dcrctl -u -P --wallet getstakeinfo
{
"poolsize": 41768,
"difficulty": 8.49962772, <-- Current stake ticket price
"allmempooltix": 6, <-- All tickets waiting to be included in next block
"ownmempooltix": 0, <--Your tickets waiting to be included in next block
"immature": 6, <--Purchased tickets not ready to vote yet.
"live": 241, <--Tickets waiting to vote
"proportionlive": 0.005769967439187895, <--Your % of tickets in PoS (poolsize: 41768 above) % chance to vote? .576%
"voted": 151,
"totalsubsidy": 280.91069628,
"missed": 12,
"proportionmissed": 0.0002872187649593107,
"revoked": 12
}


10. Should I raise my txfee to buy stake votes faster?

Answer - See also #14. This is more opinion than fact so here goes - No you should not. You have 144 blocks to purchase a stake vote before the next change. Several thousand stake votes( up to 2880 stakes I think?) can be purchased in that amount of blocks. The only reason to adjust your txfee higher would be to make sure your stake purchase gets put in to the last few blocks before an adjustment is made. To adjust your txfee above .5 or even .025 right after a stake price adjustment is wasting DCR.


11. How do I know if I have a missed / revoked ticket?
Answer - You will see something like this is your dcrwallet screen:

19:24:56 2016-02-24 [INF] WLLT: Voted on block 0000000000000624cd8375a6889a3ef2eda66b58d29029f2d69111cd687102c2 (height 5001) using ticket c20113ebc1a7c1bf875a60fcdd71baf86c007c8603cf34cac33377badbdf7420 (vote hash: acad50383933a19d63d6e3a5d6c8f05e45e6b934b299a934c3795c8b5cff7e9f)
19:25:51 2016-02-24 [INF] WLLT: Connecting block 0000000000001226676a67f5ccbf1ba8f063e1a4016e50e5822934acb0f7f78f, height 5002
19:25:54 2016-02-24 [INF] WLLT: Revoked missed ticket c20113ebc1a7c1bf875a60fcdd71baf86c007c8603cf34cac33377badbdf7420 (tx hash: 003f7c81c92bbc2a4999b783c6188e76dbf6c359e6b1c19b212a55006d216cc8)

You can also use the getstakeinfo command.


dcrctl -u -P --wallet getstakeinfo
{
"poolsize": 41768,
"difficulty": 8.49962772,
"allmempooltix": 6,
"ownmempooltix": 0,
"immature": 6,
"live": 241,
"proportionlive": 0.005769967439187895,
"voted": 151,
"totalsubsidy": 280.91069628,
"missed": 12, <-- Total votes you missed
"proportionmissed": 0.0002872187649593107, <-- Total % of overall(?) voted tickets you missed
"revoked": 12 <-- Total votes you had revoked
}


12. Why does my missed and revoke vote count not match. How do I fix?
Answer - Why? Something is out of sync. It happens. Use the command rebroadcastmissed. It will not post any output. After running it rerun getstakeinfo and missed / revoked should sync up.

dcrctl -u -P --wallet rebroadcastmissed


13.My DCR balances for all, locked, spend dont match/cant use spend and other account balance issues.

Answer - I have found that most of these issues can be resolved buy A)restarting DCRD then B)restarting DCRWALLET with the --prunetickets --reuseaddresses flags set.
You can also try running the consolidate command below. Beware this will cost you some DCR as it creates transactions. Typically not more than a few transaction fees. The last time I did it cost 1.2dcr and consolidated about 25 transactions. This should help clear up any stuck funds where you dont have enough to purchase any sstx.


dcrctl -u "dcrwallet_username" -P "dcrwallet_password" --wallet consolidate 99999 default

After this completes you should see a transaction insert(if any were needed) and also something similar to 'Successfully consolidated funds' along with a transaction ID you can check at https://mainnet.decred.org to see what actually happened and exactly how much it cost.

14.What should I set my txfee to? How many tickets are available during each period between changes? How does my txfee amount influence ticket buys?

Answer - See also #10. There are 20 slots per block to insert/buy a stake ticket(sstx). If there are more than 20 pending sstx in the mempool it will take mulitple blocks to clear the mempool. Stake ticket purchases are also placed in order of txfee. For example - There are 30 tickets in the mempool all with txfee of .025, requiring 2 blocks to complete. Block 1 with 20 sstx, block 2 with 10 sstx. You insert/buy another sstx into the mempool with a txfee of .026 before block 1 is processed. Your sstx now goes to the front of the line and is processed in block 1. Block 2 will now have 11 sstx in it. But your sstx was placed at the front of the line because it had a higher txfee. The reverse is also true. If you do not specify a high enough txfee your sstx will keep getting pushed to the end of the line. This is no big deal when there are 2800 slots available until the next sstx price change. It is a big deal when there are only a few blocks left, maybe 60-80 slots and there are 200 sstx in the mempool. If the sstx price goes from say 10 to 15 then those who had lower txfees set will not get sstx at 10 because they kept getting pushed back to the end of the line.

Now that this has been clearly (I hope) explained lets not go crazy and start doing .5 txfees! .01 to maybe .075 should be more than enough to get everyone in that wants in. Remember you have 144 blocks or 2880 slots over the next 12 hours to get your sstx. You dont have to have them in right after the price change. You have time, relax. Have a beer. We have yet to see all 2880 slots filled. There is room for everyone so far.

No comments:

Post a Comment