Pos Mining Faq

Discussion in 'Proof-of-stake Mining' started by drunkenmugsy, Mar 13, 2016.

Tags:
  1. 2017/12/15 - Decred v1.1.2 released! → Release Notes  → Downloads
  1. drunkenmugsy

    drunkenmugsy Sr. Member
    Advocate (Reddit)

    Dec 28, 2015
    405
    218
    Male
    #1 drunkenmugsy, Mar 13, 2016
    Last edited: May 27, 2016
    This is also available now - https://docs.decred.org/

    Since nobody has really done this yet I am going to start a PoS FAQ thread. Ask a question, PoS related, and I will post it to the OP. Once it is answered sufficiently I will add it to the FAQ. I will start with a few common ones.
    Please post your answer including the original question #(3, 5.2 etc etc). I imagine this thread will get quite long. That will help get the right answer to the right question.

    1. How do I start PoS mining? ANSWERED
    2. What hardware do I need to PoS mine? ANSWERED
    3. How much DCR do I get for PoS mining? ANSWERED
      1. How long does it take to get the PoS DCR reward? ANSWERED
      2. How long does it take to get my stake ticket DCR back?
      3. Missed/revoked ticket DCR return?
    4. How much does a stake ticket cost? ANSWERED
      1. Do I get my stake back or do I lose it? ANSWERED
    5. How long does it take to vote my stake ticket?
      1. How long is the mature time when I buy a ticket?
      2. Do I have to rebuy a stake or can I keep the reward?
      3. How often does the stake ticket price adjust or change? ANSWERED
    6. How much DCR do I need to PoS? ANSWERED
    7. What are the commands for PoS?
      1. How can I connect DCRD to more nodes? ANSWERED
    8. How do I know if I have voted? ANSWERED
    9. How do I know if I bought a stake vote ticket? ANSWERED
    10. Should I raise my txfee to buy a stake vote faster?
    11. How do I set up a backup (hot/cold) wallet?
    12. How do I know if I have a missed / revoked ticket? ANSWERED
      1. Why does my missed and revoke vote count not match. How do I fix?
    13. My DCR balances for all, locked, spend dont match/cant use spend and other account balance issues.
    14. What should I set my txfee to? ANSWERED
      1. How many tickets are available during each period between changes? ANSWERED
      2. How does my txfee amount influence ticket buys? ANSWERED
    Post your questions up!
     
    chappjc, Scott Briggs, David and 4 others like this.
  2. drunkenmugsy

    drunkenmugsy Sr. Member
    Advocate (Reddit)

    Dec 28, 2015
    405
    218
    Male
    #2 drunkenmugsy, Mar 13, 2016
    Last edited: Apr 4, 2016
    1. How do I start PoS mining?
    Answer - There are several great guides on the forum. Here are a few.
    https://forum.decred.org/threads/tu...ain-server-set-up-on-your-raspberry-pi-2.379/
    https://forum.decred.org/posts/14293/ PoS guide any OS
    https://forum.decred.org/posts/13869/ Solo AWS Windows PoS

    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.

    3.2 Need answer

    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.1 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. Need answer

    5.1 Need answer

    5.2 Need answer

    5.3 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:
    You can also see current tickets held by using the getstakeinfo command.
    9. How do I know if I bought a stake vote ticket?
    Answer - You will see something like this in your dcrwallet screen:
    You can also see how many stake tickets you currently have by using the getstakeinfo command.
    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. Need answer

    12. How do I know if I have a missed / revoked ticket?
    Answer - You will see something like this is your dcrwallet screen:
    You can also use the getstakeinfo command.
    12.1 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.
    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.
    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.(14.1 and 14.2)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.

    I have to laugh at the people paying .15 txfee to get their sstx 5 or 7 blocks before I get mine in for .01 txfee 30 mins later. I think I even saw some as high as .3?!? WTF? Come on. Really?
     
    chappjc, Scott Briggs, David and 7 others like this.
  3. ClokworkGremlin

    ClokworkGremlin Sr. Member

    Jan 10, 2016
    535
    381
    Male
    Whatever I want.
    Good info, well-written, and a nice place to point people when they start asking PoS questions.

    Wouldn't hurt to have this added to the Wiki, @Shadowlance .
     
  4. root

    root Member

    Feb 3, 2016
    381
    76
    #4 root, Mar 14, 2016
    Last edited: Mar 15, 2016
    3.2
    (a) Ticket missed - revoked : your DCR's minus fee to buy are back in 5 minutes.
    (b) There is a 50 % chance your ticket votes in 28 days. See 3.1.
    (c) There is 100 % chance your ticket either voted already or is returned in 142 days.

    edit : numbers more in detail
     
  5. dave

    dave New Member

    Jan 11, 2016
    27
    10
    11. How do i configure a second wallet? I want to have a backup to ensure that my votes are always transmitted (especially while upgrading). If i created the wallets from the same seed, is there any risk to having them both configured to auto buy tickets?
     
  6. Shadowlance

    Shadowlance Full Member

    Jan 9, 2016
    220
    155
    Male
    Yeah, I'm planning to do an FAQ once I get the guides done. I'll add this post to my notes. Thanks for letting me know.

    I'll add a bit too:

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

    The above answer is mostly correct, although there is a user settable fee for each ticket purchase which, by default is 0.05DCR. This is non-refundable no matter what happens to the ticket

    How long does it take to get my stake ticket DCR back?
    The average time to vote is 28 days. Not sure if this is random distribution though I expect it is. I might take a look through the source one day and find out. The maximum time is about 142 days at which time the ticket is cancelled and your stake returned minus fee. There is a 99.9% chance the ticket will be voted by this time. If your ticket votes, your stake and reward (minus fee) are returned in 256 blocks (about a day).

    How long is the mature time when I buy a ticket?
    256 blocks. During this time the stake fee is available and the ticket will not vote.

    Do I have to rebuy a stake or can I keep the reward?
    Not really sure what this means. If your ticket votes you keep the reward, if not, your stake is returned to you (again minus fee).
     
    ClokworkGremlin likes this.
  7. eshriek

    eshriek New Member

    Jan 16, 2016
    45
    12
    Male
    How do I stake with my wallet offline (cold wallet)?

    From https://wiki.decred.org/Solo_Stake_Mining#Simple_Full_Node -
    Slightly modified:

     
  8. David

    David Sr. Member

    Jan 22, 2016
    364
    207
    Male
    USA
    How is the ticket price calculated? If the target ticket poolsize is 40960, one would think the price would go up when the poolsize is higher than that value, and the price would lower when the poolsize is below that value. We haven't seen the poolsize come close to that value yet the price is fluctuating greatly.
     
  9. MarSas

    MarSas New Member

    Feb 12, 2016
    54
    14
    Male
    Current POS pool size is 41 692.
     
  10. drunkenmugsy

    drunkenmugsy Sr. Member
    Advocate (Reddit)

    Dec 28, 2015
    405
    218
    Male
    This was discussed in more detail somewhere else. I will have to find it and add it to #4. There is a secondary influence of how many tickets are purchased in the 144 blocks between price changes. It was something to the effect of 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 is still above the target 40960 sstx in the pool. If the amount of sstx tickets is <720 then the sstx price goes up.
     
    sambiohazard and David like this.
  11. Shadowlance

    Shadowlance Full Member

    Jan 9, 2016
    220
    155
    Male
    This is correct. It uses an exponential moving average of the number of tickets in the pool over the last 20 windows where a window is 144 blocks. So the blocks in each window are averaged then an EMA is applied to those windows which is weighted towards the newer blocks (i.e. the newer the block the greater the effect on sstx price). The price is then further modified according to the ticket delta (the rate of tickets being added to the pool each block). This acts as a brake on the price as if it wasn't there the ticket price would probably be closer to 100DCR.

    This effect can be seen right now. Starting at block 12 960, the ticket price dropped below average. People have their scripts set to buy when the price drops below average. We're now at block 13 039 and every block between has had 20 tickets added to the pool. The current estimate for the next change is almost 18DCR. It will probably break 20 before the end of the cycle. At that time tickets will no longer be bought and the price will slowly fall back until we hit the average again and more tickets are bought.

    The interesting thing to note is that this will cause the average price to increase over time. Some people probably think that 20DCR/ticket is expensive. I expect later in the year this will be seen as cheap. The average won't begin to come down until people think that even the 'below average' price is too expensive. Given that the current return on DCR is extremely high for a low risk investment, I wouldn't be surprised to see around 50-100DCR per ticket in the future. This level will not be sustainable however, as the block reward will decrease over time thus lowering the return from that side too. The price of DCR on the market will also affect the long term price of tickets.
     
    David likes this.
  12. drunkenmugsy

    drunkenmugsy Sr. Member
    Advocate (Reddit)

    Dec 28, 2015
    405
    218
    Male
    Is anyone aware of a way to increase the number of nodes you connect to? Why only 8?
     
    chappjc likes this.
  13. chappjc

    chappjc Full Member
    Developer Pool Operator (PoS)

    I believe you can use this, although it implies both inbound and outbound.
    Code:
    maxpeers:          Max number of inbound and outbound peers (125)
    It's applied in server.go to the outbound limit here:
    https://github.com/decred/dcrd/blob/5e0163fdeeb40ce3ee639c9574b86c3a746a2a72/server.go#L671

    The default inbound limit was initially 3, then increased to 8 in 0.0.4:
    https://github.com/decred/dcrd/commit/5e0163fdeeb40ce3ee639c9574b86c3a746a2a72
     
  14. drunkenmugsy

    drunkenmugsy Sr. Member
    Advocate (Reddit)

    Dec 28, 2015
    405
    218
    Male
    #14 drunkenmugsy, Mar 27, 2016
    Last edited: Mar 28, 2016
    I am speculating that if you connect to more peers you may get better vote visibility? Can anyone confirm/deny this? It would seem the more peers you connect to the faster you would see a call to vote. I dont know the exact process of the vote system and how a vote request is propagated through the system though. This would probably get diminishing returns after a large number is set but I would think increasing it a bit would not hurt.

    Update: Dont mess with this. It works best as is!
     
  15. chappjc

    chappjc Full Member
    Developer Pool Operator (PoS)

    #15 chappjc, Apr 1, 2016
    Last edited: Apr 1, 2016
    Note that most of the questions were answered in the first 6 posts by @drunkenmugsy and @Shadowlance.

    The mempool was probably small at that point or others' fees were low if it made it into the same block. It is not at all uncommon for there to be several hundred in the mempool waiting to be mined.

    Also, unless you have debug level logging you don't actually see when those SSTx were actually mined into a block, you just see when they're inserted into the mempool.

    When you might want to raise your fees:
    1. Price is about to adjust in the next few blocks (presumably up).
    2. The mempool is large and not all can get in before the adjustment.
    3. The fees in the mempool are high
    You can get all this information from https://dcrstats.com/
     
  16. chappjc

    chappjc Full Member
    Developer Pool Operator (PoS)

    #16 chappjc, Apr 1, 2016
    Last edited: Apr 1, 2016
    Should probably cite @davecgh for this information. EDIT: That came our wrong. Your info is excellent, and much appreciated! I just think a link would be helpful and is probably warranted for direct quotes.
     
  17. drunkenmugsy

    drunkenmugsy Sr. Member
    Advocate (Reddit)

    Dec 28, 2015
    405
    218
    Male
    If I cite everyone it will be all cite and no info. Do I also have to keep track of who said it first? What if I cite someone who was just repeating something from someone else?
    I think it is understood that the PoS FAQ is an effort of the community. I am just trying to put some of the more useful stuff all in one place. If you really feel strongly about it I can ad something to the OP about it being a community effort. However I am pretty sure that people know by know I am not as smart as I look and could never have possibly expressed the entire FAQ all by myself. I am just the lowly maintainer.
     
    Lee Sharp likes this.
  18. Ayush

    Ayush Full Member
    Advocate (Facebook)

    Jan 9, 2016
    512
    100
    Male
    .
    .
    Sorry for that post.
    And I checked the dcrwallet log. They were inserted in the same block. I used the dcrctl wallet command in quick succession. And I did this on two separate days. Each time putting 4tickets.
    After that I got A not enough to purchase error. I merely waited for the next block and then I ran the command. Successfully purchasing a ticket.
    Did I understand something wrong?
     
  19. chappjc

    chappjc Full Member
    Developer Pool Operator (PoS)

    @drunkenmugsy Sorry if I came across as scolding or anything. :) My bad. What you do here is GREAT. Just a link would be helpful, even for people who want to read more. But direct quotes generally call for a reference.
     
    drunkenmugsy likes this.
  20. Ayush

    Ayush Full Member
    Advocate (Facebook)

    Jan 9, 2016
    512
    100
    Male
    .
    .
    @drunkenmugsy
    U need to update the first post. I think u have answered all the questions mentioned in it.
     

Share This Page