Overview
This pr introduces additional conditionals into IsUnspendable()
to remove provably unspendable P2PK and P2MS tx outpoints from the UTXO set. This is done by using IsFullyValid()
to check that the public key(s) for the outpoints script are valid. This trims nearly 20K outpoints from the UTXO set at height 805618. https://gist.github.com/russeree/85fb9519e0a1fc166177a6d5e0e15be2
A side effect of this PR is it removes the use case for uncompressed public keys through standard tx types to store arbitrary data in the UTXO set.
P2PK
P2PK outpoints with a single pubkey that is invalid can by flagged as unspendable becuase the public key does not exist on the SECP256K1 curve and thus no private key exists to make OP_CHECKSIG evaluate to true.
Script must be in the format of OP_PUSHBBYTES PUBKEY OP_CHECKSIG(VERIFY)
P2MS
P2MS outpoints that do not have enough valid public keys to meet the threshold. where (n-k < m) where k is the number of invalid public keys.
Script must be in the format of OP_(N) PUBKEY1 .... OP_(N) OP_CHECKMULTISIG(VERIFY)