Notice To Anyone Running A Wallet With --enablestakemining

Discussion in 'Technical Support' started by ceejep, Feb 10, 2016.

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

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
    This turns on stake mining for the wallet, meaning that the wallet will automatically buy stake tickets.

    Stake mining is when you purchase a ticket, wait, enter a lottery, and then are randomly chosen to validate a block. For validating a block, you are given a reward. The lottery lasts an average of 29 days and your odds of winning on any given block are approximately equal. Your ticket is ejected from the lottery in 142 days if it is not chosen. The odds of not being chosen in that time frame are less than 1%.


    If you enable stake mining, please be ready to:
    (1) Keep your nodes (both wallet and daemon) online 24/7 for months at a time.
    (2) Secure your wallet.
    (3) Not require these funds to be spent. They are locked until voting, possibly for months.


    Voting begins starting block 4095. Please turn ensure that your daemon/wallet are online at this time and your voting wallet is UNLOCKED.
     
  2. Argonaut

    Argonaut New Member

    Jan 12, 2016
    31
    4
    Male
    When we enable the flag, is there something else we need to do in order to buy said tickets?
     
  3. ceejep

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
    No, it will automatically start purchasing them if online. You can manipulate the purchase parameters as described in the solo mining instructions:
    Code:
    --enablestakemining         Enables stake mining. This enables both auto-voting and stake ticket 
                                  auto-purchase. It must be on to mine.
    --votebits=                 The voting setting for your votes. Default is 1, which votes YES on the 
                                  previous block at all times. For now don't need to change this.
    --balancetomaintain=        The relative minimum balance your wallet should maintain while it 
                                  auto-purchases stake tickets. For example, if you set this to 100.0 
                                  Coins, the wallet will not purchase any more stake tickets while the 
                                  1-conf balance of the wallet is less than 100.0 coins.
    --ticketaddress=            Allows you to give ticket voting rights to another wallet, such as a
                                  hot wallet address.
    --ticketmaxprice=           The maximum price you are willing to pay for an individual ticket. 
                                  The price of the ticket is based on the stake difficulty, and 
                                  there is probably a price which the user thinks is too expensive
                                  to purchase a ticket at.
    
    https://wiki.decred.org/Solo_Stake_Mining
     
  4. David

    David Sr. Member

    Jan 22, 2016
    363
    207
    Male
    USA
    Hi @ceejep , can you elaborate on how voting will work? The underlying point of is a bit unclear to me.

    How will we know whether or not to vote yes or no when we don't know when our tickets will be called to vote? Will there be something here in the community that says "vote yes on this block # __ regarding issue XYZ"?
    I understand that the act of casting a vote will return a PoS mining reward which may be the only thing some members care about (and that's totally fine)... but I know there are some of us who are determined to maintain a higher level of involvement with this project and would like to participate in decision making when the time comes.

    Also, I would think that keeping the wallet online AND unlocked is probably the least secure state your wallet can be in. Do you have any suggestions for security during this online and unlocked state (other than physical security to the machine running the wallet)?

    Thanks.
     
    sambiohazard likes this.
  5. ceejep

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
    #5 ceejep, Feb 10, 2016
    Last edited: Feb 10, 2016
    The wallet is alerted to the need to vote by a message from from the daemon over websocket when a block comes in. This is why the daemon also needs to be turned on. The winners of the lottery are select by a hash-based pseudorandom number generator which is fed the block header of that block. There were many more complicated designs discussed and even implemented, but this was the simplest and guaranteed an equal chance for each ticket winner each block that came in. A PRNG based around a hash function is unusual, but should be secure under the random oracle model given that proof of work at the tip of the chain is very difficult to grind.

    There are suggestions for different ways to secure your tickets in the wiki. The easiest is to create two wallets, a voting wallet and a wallet to store funds. You would get an address from the voting wallet and send funds to it using either the wallet argument for the funds wallet:

    Code:
    --ticketaddress=DsVotingWalletXsGvResChtEwD4Fe2Ad
    or purchasing tickets with the funds wallet with this command:

    Code:
    purchaseticket "fromaccount" spendlimit 0 DsVotingWalletXsGvResChtEwD4Fe2Ad
    "fromaccount" is usually "default", spendlimit is the maximum you want to pay for a ticket.

    The voting wallet you can leave online 24/7 unlocked. No one can steal the funds used to purchase the ticket. At worst with the voting keys, the attacker can vote in a way which you don't agree with. This could still be very bad for the network, but is less catastrophic than losing all your money.
     
  6. Reynold

    Reynold Member

    Jan 28, 2016
    198
    70
    Male
    Programmer
  7. ceejep

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
    Use --create, but specify a different directory with --datadir. Then open that wallet with --datadir.
     
    chappjc, Blizzy and Reynold like this.
  8. David

    David Sr. Member

    Jan 22, 2016
    363
    207
    Male
    USA
    Thanks ceejep!
     
  9. Lee Sharp

    Lee Sharp Sr. Member

    Dec 28, 2015
    308
    217
    Male
    Independent Consultant
    Houston, Texas
    Virtualbox is one way... But, once you start with small purpose built VMs, you will never quit!
     
    sw1, jy-p and Reynold like this.
  10. jrick

    jrick Member
    Developer

    Jan 4, 2016
    88
    81
    Male
    Since I don't see it mentioned in this thread, the way to keep your wallet perpetually unlocked is to use 0 as the timeout.

    Code:
    > walletpassphrase supersekritpassphrase 0
    Once done, wallet will log that it has been unlocked without timeout. It is important that you do not make any other calls to walletpassphrase with a non-zero timeout, as this will reinstate the timer.
     
    David and Blizzy like this.
  11. drunkenmugsy

    drunkenmugsy Sr. Member
    Advocate (Reddit)

    Dec 28, 2015
    405
    218
    Male
    It is fairly trivial to get a PoS wallet running on a Raspberry Pi 2. There is a thread around here about it. Mine is running at about 3% load with RPi2 and wifi router on a small UPS. This UPS has lasted almost 2 hours in an outage several months ago.

    I have also kept my spendable balance low on my testnet PoS wallet, around 5dcr depending on stake cost. Just enough to buy 1 stake is enough. You could even keep it at 0 and it would save enough to lock another stake and go close to 0 again. This worked well. All other coins will be locked for stake voting. I am not concerned about anything being stolen out of it.
     
    ClokworkGremlin likes this.
  12. ClokworkGremlin

    ClokworkGremlin Sr. Member

    Jan 10, 2016
    535
    381
    Male
    Whatever I want.
    I think I once calculated that if my Pi is able to generate $0.50/month(0.5 DCR at this moment) that it's paying for the electricity to run it, and since I'm running a Mumble server on it, anyway...
     
  13. Dyrk

    Dyrk Sr. Member
    Developer

    Jan 7, 2016
    518
    376
    Male
    Wonderland
    I am using cheap VPS for my PoS-wallet.
    I just run there:

    Code:
    nohup dcrd &
    nohup dcrwallet --enablestakemining --balancetomaintain=0 --ticketmaxprice=2 &
    
    And the only security stuff I did is:
    - disabled root ssh authorization
    - disabled plaintext password ssh auth

    Don't you think it's secure enough?
     
    Blizzy and jy-p like this.
  14. jy-p

    jy-p Sr. Member
    Organizer

    Jan 2, 2016
    133
    340
    Male
    While the default settings have both dcrd and dcrwallet listening for RPC only on loopback (127.0.0.1), I do recommend you make certain your firewall rejects all inbound traffic besides ssh and port 9108 (Decred daemon traffic). Additionally, I suggest filtering your outbound (egress) traffic as well, only allowing ports 9108 and ntp (port 123). You may already have this setup, of course :).
     
    Blizzy likes this.
  15. Blizzy

    Blizzy Full Member

    Jan 4, 2016
    225
    109
    Male

    cant use the command nohup in consolle..any suggestion?
     
  16. Blizzy

    Blizzy Full Member

    Jan 4, 2016
    225
    109
    Male
    Can you please specify the port we have to protect? I'm also in VPS pos mining but i'm a firewall noob can you please explain like you explain to a noob the port i have to close? i'm on win 7Thanks a lot
     
  17. sambiohazard

    sambiohazard Sr. Member

    Jan 21, 2016
    844
    372
    Are you considering tx fee of 0.05DCR for buying every ticket? you might burn through your balance soon. Also if i am correct our profit on PoS will be PoS reward - tx fee.

    Also currently voting is set such that you can only vote yes/no on block mined by miners but can't choose any condition for voting yes or no. So its very basic only for users just enough that n/w keeps working. To vote on any serious issue you have to move to a PoS pool. Whole concept of voting depends on if users/holders get involved from draft stage of a proposal or we will end up have chioces that devs decide. ANyways its better than having no choice like in bitcoin right now.

    Am i right in saying all of the above? please correct me if i am wrong.
     
  18. Argonaut

    Argonaut New Member

    Jan 12, 2016
    31
    4
    Male
    In other words, you would want to block all other ports other than 9108, 22(if using default for ssh) and 123. So all other ports are protected, assuming you aren't using the vps for other things that require use of other ports. Less open ports mean you have less vulnerabilities open to attack.
     
  19. Lee Sharp

    Lee Sharp Sr. Member

    Dec 28, 2015
    308
    217
    Male
    Independent Consultant
    Houston, Texas
    To attack your system, you need both a route to it, and open doors. If you are on virtualbox, you are nated, and there is no route to your host. If you are hosted, they have you on open IPs and you need to lock everything down. You can even lock down to your IP address. (Or subnet if you are on DHCP from your ISP)

    Also, use good passwords and store them in something like keepass.
     
  20. davecgh

    davecgh Hero Member
    Developer Organizer

    Dec 31, 2015
    642
    788
    Male
    United States
    I HIGHLY recommend people familiarize themselves with the new stake pool described here https://forum.decred.org/threads/testnet-stake-pool-is-live.626/ and use the mainnet version once it's out instead of solo staking

    The linked pool works in the same way as solo staking in that you get all of the rewards when your ticket wins and it's impossible for the pool to steal funds, but instead of you needing to keep your wallet online 24/7 to vote, the pool will vote on your behalf. Since the pool will have redundant servers in multiple locations with automatic failover, it's much less likely for you to miss out on a vote due to your wallet being offline.
     
    Argonaut likes this.

Share This Page