31

I know and understand the concept of proof-of-stake. Instead of requiring users to do a certain amount of power-intensive hashing "work", it requires you to own a certain stake of the currency in order for you to mine new coins.

But how does the actual mining process work? In PoW mining, people "find" blocks by generating a hash that fulfills a certain condition. How can one mine a PoS block? Is a miner required? Or does just anyone holding coins get their share after a certain amount of time?

In Peercoin specifically, is PoW and PoS mining done independently or do they interfere or influence one another?

3 Answers 3

24

In Nextcoin, proof of stake is used. So the "mining" process there is just about holding coins and leaving your computer on. It doesn't involve powerful CPUs.

Each block (every 60 seconds), a random Nextcoin is selected to be the next "miner". There are 1 billion coins so the odds of a single wallet being selected is the number of Nxt in that wallet divided by 1 billion. (Also, it's possible to calculate and agree on who that node is so the transactions need only be sent to that particular wallet.)

If a node with the selected wallet is running, it will collect the transactions, make a block, and send it to the rest of the network and collect the fees. If the computer is turned off, however, then the entire network will have to select a different nextcoin to make the transaction. This time, the unresponsive wallet will be ignored. The network would suffer in that the time to make a block is decreased, but the thought is that people wouldn't leave their computers off if they have a lot of NXT because they're missing out on all the fees that they could have collected.

If you only have a few NXT, you can leave your computer off: You probably wouldn't have collected much fees anyway. But, your odds of being selected were low so it probably won't decrease transaction times much.

4
  • 17
    How can a network with different incentives agree on a random number in a way that can't be manipulated?
    – ike
    Commented Dec 22, 2014 at 22:44
  • 3
    also, couldn't i build a chain where i'm the only miner because i was the only person online at those moments? wouldn't my chain win against the current chain? Commented Jul 24, 2015 at 11:29
  • so as I understand, a node with lesser stake coin will have less probability to be a miner right ?
    – hqt
    Commented Mar 17, 2018 at 15:15
  • 1
    The best explanation I found [until now] Commented Mar 19, 2018 at 7:36
9

For Peercoin specifically, PoW and PoS blocks are independent. Just as you're betting your consumed electricity and CPU-time vs. the possible PoW-blok's reward, in the PoS blocks you're betting your coin-age: the amount oF PPC you own multiplied by the number of days they've sitted idly at your wallet. It must be a minimum of 30 and a maximum of 90 days for your coins to start generating tickets for the PoS raffle.

Should your ticket win, you earn 1% interest and lose all your coin-age, so your coins are, from the network POV, as though you had just received them. I.e. you'll need to wait another 30 days for them to be able to pay you interest again. Over time, though, you're just supposed to earn about 1% annually.

Since code for PoS and PoW are independent of each other and the concept of PoS so new, there have been a couple bugs to be fixed plus a kind of attack was found that allowed users to generate a lot of PoS raffle-tickets for "free" - fortunately Sunny King has been able to fix such problems quickly.

1
  • What is included in the hash for a PoS raffle ticket?
    – morsecoder
    Commented Dec 23, 2014 at 20:15
3

Proof of Stake uses fundamentally the same process as Proof of Work, but with a few key differences.

In Proof of Work miners are searching for a hash of the transactions in mempool + data from the last blockheader, and that hash must be below a certain target value to be accepted by the network. The target is the inverse of difficulty, essentially the new hash must have a number of leading zeros, the more leading zeros, the less likely it is to find a hash by chance. PoW uses the nonce (number once) and the mempool transactions and previous blockheader data, and iterates over as many random nonces as it can per second to output hashes hoping to find a hash with an amount of leading zeros that will be accepted by the network. So in PoW the more nonces and hashes per second you can create, the better chance you have of finding a hash that meets the target.

Proof of Stake varies in that there is no nonce that can be iterated over, rather the unspent transaction outputs (UTXO) in the nodes local wallet are iterated over. The main variable then becomes time, the time of each hash attempt is part of the hashing, and thus allows 1 hash, per UTXO, per second. So a wallet with 100 UTXOs can only create 100 unique hashes per second (the node could create more hashes but that would be pointless as they would just repeat). Some coins mask the bottom bits of the epoch time, to limit the amount of hashing further, often to hashes every 8 or 16 seconds. To prevent users creating many tiny UTXOs there is a lower limit of coins that are viable for staking in a UTXO (often around 0.01 coins) and the difficulty is modified by the number of coins in a UTXO; a UTXO with 2 coins has a hash target that is twice as easy as a UTXO with 1 coin. In this way then we can see that every coin staking has a roughly equal chance of creating a block, and a user with a large number of coins will be likely to make more blocks and earn more transaction fees than a user with less coins.

There are variants of PoS, but they all basically work in this same way, and by doing so prevent the need for massive quantities of computing power to spew out zillions of nonces and hashes to secure a block-chain.

1

Not the answer you're looking for? Browse other questions tagged or ask your own question.