As suggested on the mailinglist by @petertodd:
This turns STRICTENC turn into a softforking change, and as a result guarantee that using it for mempool validation only results in consensus-valid transactions in the mempool.
As suggested on the mailinglist by @petertodd:
This turns STRICTENC turn into a softforking change, and as a result guarantee that using it for mempool validation only results in consensus-valid transactions in the mempool.
While this is an improvement over the existing definition of STRICTENC, I think we need to decide what’s our actual goal here.
Are we trying to simplify the consensus critical codebase? If so we could achieve the same goal by causing all pubkeys that aren’t known to be accepted by OpenSSL to bypass the OpenSSL verify routine and be treated as though the signature failed. This would be a “almost certainly not a fork, unless there’s a weird SSL bug” change. Hybrid keys are the one exception, and my understanding is they’re already supported by your secp256k1 library.
Are we pissed off at embedded consensus systems? Well some of them already implement code to make their data appear as valid pubkeys, so this change does no harm to them, and prevents their users from being able to spend the outputs created and reduce the size of the UTXO set. Equally this change may render some users’ funds unspendable, potentially even funds locked in P2SH outputs.
I’m simply trying to clean up the semantics of an existing standardness rule, as you yourself found out that they can lead to accepting invalid transactions in the mempool. A second validation with just consensus rules is definitely possible, but having every flag be a softforking change certainly simplifies reasoning a lot.
This is however not a consensus rule change, and AFAIK does not change anything for tx acceptance except in weird checksig+not cases. I don’t believe it should affect any system in production, as hybrid pubkeys have been non-standard since v0.8.
@sipa Well maybe we should just say something about how the STRICTENC rules may not be appropriate as an actual soft-fork and leave it at that? I agree that as an IsStandard() rule they’re fine.
I noticed that many of the hybrid-using addresses I generated haven’t been spent, with the one exception of 33xWKkEzGaABRopJBYtGWgSHGRpHYwJ2Sy, 1 2 CHECKMULTISIG, which I constructed such that existing broken STRICTENC implementation validates the signature against the normal version of the pubkey, and once it’s in a block the actual consensus rules validate against the hybrid version.
754- "0x47 0x304402207592427de20e315d644839754f2a5cca5b978b983a15e6da82109ede01722baa022032ceaf78590faa3f7743821e1b47b897ed1a57f6ee1c8a7519d23774d8de3c4401",
755- "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT",
756+ "0 0x47 0x304402203b269b9fbc0936877bf855b5fb41757218d9548b246370d991442a5f5bd1c3440220235268a4eaa8c67e543c6e37da81dd36d3b1be2de6b4fef04113389ca6ddc04501",
757+ "1 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG",
758+ "",
759+ "1-of-2 with the second 1 hybrid pubkey and no STRICTENC"
761+[
762+ "0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501",
763+ "1 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG",
764 "STRICTENC",
765- "P2PK NOT with invalid hybrid pubkey"
766+ "1-of-2 with the second 1 hybrid pubkey"
Interestingly it looks like most ‘invalid pubkey’ users do things the wrong way around, with the invalid pubkeys second, so they would be affected by this implementation of STRICTENC when they don’t need to be: http://webbtc.com/scripts/multisig
edit: Of course, the best thing to do is encrypt your data and turn it into an apparently-valid pubkey by brute-forcing a nonce unless you for some reason really need to be able to prove the pubkey isn’t valid in your protocol.
This turns STRICTENC turn into a softforking-safe change (even though it
is not intended as a consensus rule), and as a result guarantee that using
it for mempool validation only results in consensus-valid transactions in
the mempool.
Possible with STRICTENC
sipa
petertodd
btcdrak
TheBlueMatt
Milestone
0.10.0