Closed nopara73 closed 6 years ago
Yes. P2SH-P2WPKH can be differentiated from normal P2SH before signing. The address cannot be differentiated but the input can be.
The address by itself can't be differentiated, since it's just a hash. However, you can also demand the person (software) registering provide the redeemScript, which will be identifiable as using the BIP141 structure; see https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#P2WSH_nested_in_BIP16_P2SH
Thank you! Then no change to the design is needed.
Actually in my implementation I only require a txid and an output index so that the Tumbler must check everything else anyway.
While I conveniently postphoned adding p2sh wrapped segwit to the tumbler, I think another issue came up here.
Since the proof must be provided at input registration that the owner can spend the input he registers and p2sh wrapped segwit address apparently cannot do that we have a problem: https://github.com/bitcoin/bitcoin/issues/10542
I didn't have the time yet to look through that issue, if there is a clever trick around it, but this issue must be reopened. https://github.com/bitcoin/bitcoin/issues/10542
This can be done with p2sh wrapped segwit since the script format is known beforehand (as opposed to other p2sh). Pubkey is recovered from signature and used to derive p2sh-p2wpkh address.
The spendability proof can be a correctly-signed transaction that is either invalid or won't-be-valid-for-a-very-long-time. E.g., the transaction can spend 22 million BTC or it can have it's nLocktime set to 499,999,999 indicating it won't be valid until just before block height 500 million---just under 10,000 years from now.
The trick works like charm: https://github.com/MetacoSA/NBitcoin/pull/403
ZeroLink don't allow traditional addresses to be registered for CoinJoin, so the transaction won't be malleated.
The paper states:
Can P2SH over P2WPKH (wrapped segwit) be differentiated from normal P2SH before signing? If not, then only P2WPKH (native segwit) should be allowed to be registered.