zawy12 / difficulty-algorithms

See the Issues for difficulty algorithms
MIT License
107 stars 25 forks source link

Self-Hashing Transactions to Generate Coin #56

Open zawy12 opened 4 years ago

zawy12 commented 4 years ago

The POW for tx consensus should be different from the POW for coin generation.

POW for tx consensus Theory and observation show POW consensus must be done by a POW that requires non-repurposable CAPEX in equipment (if a secure consensus is desired). Ideally the equipment would not get outdated by Moore's law or algorithmic or hardware optimizations. This way, miners can maximize their speculative stake in the coin by purchasing more equipment that can't be used elsewhere. The solvetimes should be random over a range of time that is much greater than network delays to reduce orphans.

POW for coin generation Coin generation should be done by a POW that is good at wasting electricity (or at least OPEX), the opposite of POW for consensus. Ideally, if constant value is desired, there should be an inability for Moore's law or optimizations to reduce the cost per hash. It would be helpful if the POW inherently counted the number of hashes instead of the solvetime being random. In the self-hashing txs I'll describe, this would allow a consistent reward per hash, eliminating the need for pools. I'm not talking about VDFs. Here's a method dating back to 2007: An (Almost) Constant-Effort Solution-Verification Proof-of-Work Protocol based on Merkle Trees

To summarize:

image

Electricity as the basis of a coin With coin generation based at least roughly on electrical waste, the coins can be denominated in "joules destroyed". This is not a new idea: energy has a long history of being the foundation of a currency. Electrical costs are an ideal basis because it has been incredibly stable in the U.S. for at least 6 decades. It would be a lot better if coin rewards could be based on proof of supplying electrical energy to the world in exchange for the coin, but I do not see a way to do it and have decentralization at the same time (unless the block chain is on an electrical grid where they already send digital signals in addition to the electricity).

But electrical waste is not a deep requirement. The more fundamental requirement is that the equipment should be easily rentable (which implies it is easily repurposable) so that there is a competitive market for anyone to get a fair quantity of coin.

Complaints about using electricity to generate coin:

Breaking Up the POW if Coin Generation is on a Schedule If the coin generation rate is to be kept on a time-based schedule, there may not be any reason to break the POW up into coin generation and tx consensus in exchange for fees. It would require two difficulty algorithms. It's interesting that the difficulty for the consensus could be based on the amount of fees in the block, but this would result in low-fee blocks coming faster if the equipment is non-repurposable. More likely, for higher security in small coins, a miner credit system could be used to identify and credit dedicated miners who are willing to suffer through low fee blocks. In exchange for not getting as many fees they would have more credit for winning tip races. The coin generation POW, being based on rentable equipment would not affect the consensus, but merely distribute coin more fairly. In this context, pools would be needed and the random solvetime characteristic would need to be kept.

Self-Hashing Transactions for Coin Generation Finally I've made it to the purpose of this article. What I'll describe appears useful only if we are not basing the coin emission rate on time (in which case the current method seems correct; see previous section). Assuming we have a secure consensus mechanism for txs that can live off fees, miners could send "self-hashing txs" to the chain without pools to obtain new coins. The txs would specify the amount of coin they want, a destination address, and a nonce. Validators would hash the nonce to see if the result is below target/2^256 / coin. A 2nd nBits field would supply the target where target = 2^256 * coin/hash. A design goal and mechanism is needed to determine the value of hashes/coin.

If we do not have a POW that inherently counts the number of hashes as part of the result, miners would have submit more than 100 txs of small-valued coin generation txs to typically have less than +/- 10% variation in the amount of hashing required to get the amount of coin they select. This means pools would still be useful.

Setting hashes per coin for constant-value without a fiat peg If the POW for coin generation is perfect, where it would always require the same amount of electricity per hash despite equipment advances, the hashes per coin reward could be a constant. We could do this if we knew the heat generated from each hash because that is equal to the electrical energy spent.

Assuming this is not possible, the fees that pay for consensus could also be used to dictate the hashes per coin, weighted by the amount of fees. If the txs are being used mostly to buy goods and services, senders of the coin may want constant value. Another possibility is that the miners doing consensus could vote to increase or decrease the hashes per coin by about 0.001% per block. They may see the highest fees over the long term will result from stable value. A third option is to set the difficulty to a parent coin's difficulty in a Cross Notarization.

If the "GDP" of the market place using the coin is stable and the mechanism setting the hashes per coin value is trying to achieve stable value, the setting will be slightly more expensive than buying the coin on an exchange, and the coin generation capability is not typically used. If the GDP is increasing, the coin value on exchanges will go up and more new entrants will choose to rent mining instead of paying the higher price. If the GDP drops, the coin loses value, as it should.