Interesting, was the P2SH upgrade confiscatory? https://bitcoin.stackexchange.com/questions/115803/did-the-p2sh-bip-0016-make-some-bitcoin-unspendable/115804

Reply to this note

Please Login to reply.

Discussion

On the contrary, it's not applied to UTXOs before activation in order to keep them spendable.

Perhaps whoever posted that should be corrected, then. Also noteworthy: there are transactions from before bip16 with outputs that match the bip16 template, like this one: https://mempool.space/tx/9c08a4d78931342b37fd5f72900fb9983087e6f46c4a097d8a1f52c74e28eaf6

And some of them were spent, including that one: https://mempool.space/tx/6a26d2ecb67f27d1fa5524763b49029d7106e91e3cc05743073461a719776192

Per BIP16, I think they should be treated as simple hashlocks, i.e. if they have a redeemscript, it should not be evaluated, as bip16 wasn't active yet. But block explorers like mempoolspace display these txs as if they are P2SH spends, i.e. they DO evaluate their redeemscript. (See screenshot.) I suspect that's a bug.

I looked into it further, and it looks like the codebase actually does confiscate those outputs. For the sale of "simplicity," it applies the p2sh rules to all transactions in all blocks (including pre-P2SH blocks) except ones occurring in one specific block that they made a single exception for. Thus, the other exceptional outputs are now unspendable.

Source: https://github.com/bitcoin/bitcoin/blob/13891a8a685d255cb13dd5018e3d5ccc18b07c34/src/validation.cpp#L2305

Interesting, I think you're right, but it goes against the BIP16 definition.

So, it seems bip16 is NON confiscatory but the code implementation IS.

But I wasn't always like that, it seems Gavin started with a timestamp:

https://github.com/bitcoin/bitcoin/commit/8f188ece3c82c4cf5d52a3363e7643c23169c0ff#diff-34d21af3c614ea3cee120df276c9c4ae95053830d7f1d3deaf009a4625409ad2R1282

But that variable (nBIP16SwitchTime) is now gone from the code.

Interesting, I would like to have the time to investigate this further.

Even bip16 seems to create a confiscation deadline. It says all txs created after the deadline should have the new rules applied to them. So the ~5 people who previously used hash160 hashlocks would have to move those utxos before the deadline or else their outputs would become unspendable. Which is exactly what happened; one such output was already moved, the rest did not move and became unspendable.

Seems like it sets a precedent for setting confiscation deadlines in new bips