Cancelling the best block when a duplicate stake is received

I’ve made 2 pull requests on the development branch of Peercoin.

The 1st one removes the top block when a duplicate stake is received: https://github.com/ppcoin/ppcoin/pull/75

The 2nd one adds a functional tests system and some tests for the above change : https://github.com/ppcoin/ppcoin/pull/76

These changes have been approved by Sunny so I’ll certainly merge them in the coming days.

Please don’t mind me asking:

Is #1 going to prevent consecutive minting from one address?

No, a duplicate stake is a duplicate output. Multiple outputs on the same address are not considered as duplicates.

Huge change in such neat pr, congrats.

[quote=“willywithcoinnode, post:2, topic:2947”]Please don’t mind me asking:

Is #1 going to prevent consecutive minting from one address?[/quote]

Excuse my ignorance. How is it possible in the first place to mint consecutively on your stake deposited into 1 single address?

If you received funds to a single address in multiple transactions, you have multiple “unspent transaction outputs”. You mint with these outputs, not the address itself.

Congratulations!

Can we claim that Peercoin is free from potential threat of the “nothing-at-stake problem” after this update? The threat was exaggerated in the first place as no one of the several dozen proof-of-stake coins has ever reported to have been harmed by it.

I take this opportunity to ask and not create separate topic:
@sigmike what’s your/Sunny’s position on jgarzik’s “Relay OP_RETURN data TxOut as standard transaction type” pr? I believe it was included in btc 0.9 but would it be possible to use it in incoming release?
Here is a cherry pick on ppcoin/develop branch, w/ minor conflicts 0b4b1e3. It allows 80 bytes, imo 40 bytes (i.e. 8 bytes for ID and 32 for hash) is enough though.

If you received funds to a single address in multiple transactions, you have multiple "unspent transaction outputs". You mint with these outputs, not the address itself.

Tks for the explanation. Is it possible to mint several times on one of those multiple unspent transaction outputs and if yes what would be the difference with the typical case of duplicate stake minting?

is this a first step to repeal the “sinful” checkpoints in the future?

If you’re talking about this quote from http://www.reddit.com/r/Bitcoin/comments/1oi7su/criticisms_of_proofofstake/ccsd6rm:

The trouble with proof-of-stake is there is no natural incentive stopping a miner from assigning their stake to multiple, competing chains.

Then indeed there’s now an incentive stopping users from minting on multiple chains: they would delay their reward and lose compound interest.

Note that for several reasons the incentive to mint on multiple chains was already very small, if not negative (the only potential gain is compound interest, the network won’t propagate your transactions, you may decrease the value of your own coins, there’s always a clear winner when multiple chains are competing, etc.)

We discussed that while talking about Open Transactions. Sentinelrv reported the discussion here: Cryptoblog - notícias sobre bitcoin e criptomoedas!

It will probably be included in Peercoin 0.5.

[quote=“cryptog1, post:9, topic:2947”]

If you received funds to a single address in multiple transactions, you have multiple “unspent transaction outputs”. You mint with these outputs, not the address itself.

Is it possible to mint several times on one of those multiple unspent transaction outputs and if yes what would be the difference with the typical case of duplicate stake minting?[/quote]

When you mint, you spend the output so you can’t mint with it later. But you create another output from which you’ll be able to mint in 30 days. This is the standard process and there’s no duplicate stake here.

If you generate multiple blocks from the same output then you trigger the duplicate stake detection and all the blocks may be rejected. There are only 2 ways this can happen: either you modify the source code to do that, or you mint with the same wallet from multiple clients.

Peercoin 0.5 will have opt-out synchronized checkpoints already.
I guess we will switch to opt-in when we’re confident the network is decentralized enough because enough people are minting.
I don’t think this change will help decentralize the network (apart from the confidence it may bring to the network).

[quote=“sigmike, post:14, topic:2947”]Peercoin 0.5 will have opt-out synchronized checkpoints already.
[…][/quote]

This and removing the top block when a duplicate stake is received are huge improvements!
Both changes address concerns that might have kept some people away from Peercoin.
From 0.5 on it will be even harder to criticise the Peercoin protocol.
Thank you!

…I can’t wait to have cold locked minting, though :wink:

If you’re talking about this quote from http://www.reddit.com/r/Bitcoin/comments/1oi7su/criticisms_of_proofofstake/ccsd6rm:

The trouble with proof-of-stake is there is no natural incentive stopping a miner from assigning their stake to multiple, competing chains.

Then indeed there’s now an incentive stopping users from minting on multiple chains: they would delay their reward and lose compound interest.

Note that for several reasons the incentive to mint on multiple chains was already very small, if not negative (the only potential gain is compound interest, the network won’t propagate your transactions, you may decrease the value of your own coins, there’s always a clear winner when multiple chains are competing, etc.)[/quote]

You are exactly right. The nothing-at-stake claim was much ado about not-much-motivation. Only those who wants to do it for the sake of doing it or for sabotaging Peercoin would try it. Now doing it is not technically possible. We should actively let people know about it.

I have played a little on duplicate stake on Nu system, which shows us that Mike’s work is great and the system found duplicate stake and the block was orphaned.

The usual orphaned blocks are followed a log “REORGANIZE…”, but there are additional log “ERROR: ProcessBlock() : duplicate proof-of-stake (COutPoint(***, **), ***) for block ***” if I minted on two computers at the same time.

We discussed that while talking about Open Transactions. Sentinelrv reported the discussion here: Cryptoblog - notícias sobre bitcoin e criptomoedas!

It will probably be included in Peercoin 0.5.[/quote]
TY, sidechains are pleased :slight_smile:

I merged the pull requests.

[quote=“sigmike, post:13, topic:2947”][quote=“cryptog1, post:9, topic:2947”]

If you received funds to a single address in multiple transactions, you have multiple “unspent transaction outputs”. You mint with these outputs, not the address itself.

Is it possible to mint several times on one of those multiple unspent transaction outputs and if yes what would be the difference with the typical case of duplicate stake minting?[/quote]

When you mint, you spend the output so you can’t mint with it later. But you create another output from which you’ll be able to mint in 30 days. This is the standard process and there’s no duplicate stake here.

If you generate multiple blocks from the same output then you trigger the duplicate stake detection and all the blocks may be rejected. There are only 2 ways this can happen: either you modify the source code to do that, or you mint with the same wallet from multiple clients.[/quote]

Tks for the clarification.