reject all OP_RETURN outputs tx #6407

pull bitkevin wants to merge 2 commits into bitcoin:master from bitkevin:master changing 2 files +7 −1
  1. bitkevin commented at 10:25 AM on July 9, 2015: contributor
    • reject all OP_RETURN outputs tx
    • print reject tx's hash
  2. print reject tx's hash fb475c2cc7
  3. reject all op-return outputs tx bd9e94768b
  4. jonasschnelli commented at 10:51 AM on July 9, 2015: contributor

    NACK.

  5. luke-jr commented at 10:52 AM on July 9, 2015: member

    @jonasschnelli Read the diff before NACKing. The description sucks, but the code seems reasonable enough. I'd utACK, but I'm not feeling very confident in my judgement right now.

  6. jonasschnelli commented at 10:58 AM on July 9, 2015: contributor

    The code looks like...

         if (nDataOut > 1) {
             reason = "multi-op-return";
             return false;
         }
    +    // all OP_RETURN is not permitted
    +    if (nDataOut == tx.vout.size()) {
    +        reason = "all-op-return";
    +        return false;
    +    }
    

    Do we have problems with a transaction containing 1vin (maybe [to]large) with 1 OP_RETURN vout?

  7. jgarzik commented at 11:33 AM on July 9, 2015: contributor

    I don't see the point. NAK without justification.

    The improved diagnostic output is nice.

  8. laanwj commented at 12:49 PM on July 9, 2015: member

    Why would you want to reject transactions that are all OP_RETURN? From the viewpoint of the UTXO set those transactions are great, entirely provably unspendable - so the inputs are removed and nothing new is added.

    (remember that the alternative, effectively accomplishing the same, is to send to the coin eater address or another address for which no private key is known - with the difference that that pollutes the UTXO set forever)

  9. paveljanik commented at 1:26 PM on July 9, 2015: contributor

    NACK

  10. paveljanik commented at 1:44 PM on July 9, 2015: contributor

    What is the point? You do not like the sender burning the OP_RETURN output value or giving the complete inputs value to miners (in the case OP_RETURN output value is zero)? I do not get it, sorry.

  11. jgarzik commented at 2:29 PM on July 9, 2015: contributor

    +1 @laanwj

  12. luke-jr commented at 6:30 PM on July 9, 2015: member

    @laanwj UTXO set is not the only relevant resource. It would make more sense to limit this special case to OP_RETURN without data. With data encourages spam unnecessarily.

  13. btcdrak commented at 8:26 PM on July 9, 2015: contributor

    What is the reason for this PR?

  14. bitkevin commented at 2:50 AM on July 10, 2015: contributor

    reject tx like this one, https://blockchain.info/tx/9e492bbc6e56f0a7b5369a3d359c82e29e53f25a6d6a9d6d399b772224603b5c

    {
        "hex" : "0100000001d258f657290aa721d0187b8c6ab54f603c1e673648d6375ff528b0d16edf26f90b0000008a473044022062dddfafe6ce1641639af00d76cb9164fa0e91c865c341363b3dcccc5a53914202201e2ad564407e5263c619aa6395919aef4999c7ccc8e8a7d31e6752fdf6c538c0014104334ec322ef674d8a91a5467b78cb12fab3de961aa3d6c2d6afd844526e18c8dd12e9b21d5f9411dfa37689c551d2572465f633df73b0d12015aeb72d423e0d30ffffffff010000000000000000016a00000000",
        "txid" : "9e492bbc6e56f0a7b5369a3d359c82e29e53f25a6d6a9d6d399b772224603b5c",
        "version" : 1,
        "locktime" : 0,
        "vin" : [
            {
                "txid" : "f926df6ed1b028f55f37d64836671e3c604fb56a8c7b18d021a70a2957f658d2",
                "vout" : 11,
                "scriptSig" : {
                    "asm" : "3044022062dddfafe6ce1641639af00d76cb9164fa0e91c865c341363b3dcccc5a53914202201e2ad564407e5263c619aa6395919aef4999c7ccc8e8a7d31e6752fdf6c538c001 04334ec322ef674d8a91a5467b78cb12fab3de961aa3d6c2d6afd844526e18c8dd12e9b21d5f9411dfa37689c551d2572465f633df73b0d12015aeb72d423e0d30",
                    "hex" : "473044022062dddfafe6ce1641639af00d76cb9164fa0e91c865c341363b3dcccc5a53914202201e2ad564407e5263c619aa6395919aef4999c7ccc8e8a7d31e6752fdf6c538c0014104334ec322ef674d8a91a5467b78cb12fab3de961aa3d6c2d6afd844526e18c8dd12e9b21d5f9411dfa37689c551d2572465f633df73b0d12015aeb72d423e0d30"
                },
                "sequence" : 4294967295
            }
        ],
        "vout" : [
            {
                "value" : 0.00000000,
                "n" : 0,
                "scriptPubKey" : {
                    "asm" : "OP_RETURN",
                    "hex" : "6a",
                    "type" : "nulldata"
                }
            }
        ]
    }
    
  15. luke-jr commented at 2:59 AM on July 10, 2015: member

    I don't see a purpose to that one other than cleaning up the UTXO set (inefficiently). Maybe the ideal solution is to provide some easy way to deprioritise these.

  16. bitkevin commented at 3:36 AM on July 10, 2015: contributor
  17. jgarzik commented at 3:43 AM on July 10, 2015: contributor

    Dust has nothing to do with OP_RETURN. Any value sent to OP_RETURN outputs is burned, because these outputs are provably unspendable and thus pruned.

  18. paveljanik commented at 7:22 AM on July 10, 2015: contributor

    @bitkevin So IIUIC you want to reject only empty-data OP_RETURN transactions? By dust you mean they are useless, but their fee is their input value which is 0.00001. As the size is only 199 bytes, this is way above our "dust" limit (as defined in the source code). Can you please highlight in the decoded TX above the line which is the reason for this PR, so it is clearly stated?

    In fact these transactions help clear the UTXO set. As Luke says, inefficiently, yes. They can all be cleared at once, because the input address 1C1r1zMnPFfjQYhW2np6h1vynxrfKK2zHm is Brainwallet with the passphrase "cow" so the private key is known (and this is one of the reasons we see so many transactions related to this address). Or they can be grouped in one bigger output in one transaction etc.

  19. bitkevin commented at 8:25 AM on July 10, 2015: contributor
        BOOST_FOREACH(const CTxOut& txout, tx.vout) {
            if (!::IsStandard(txout.scriptPubKey, whichType)) {
                reason = "scriptpubkey";
                return false;
            }
    
            if (whichType == TX_NULL_DATA)
                nDataOut++;
            else if ((whichType == TX_MULTISIG) && (!fIsBareMultisigStd)) {
                reason = "bare-multisig";
                return false;
            } else if (txout.IsDust(::minRelayTxFee)) {
                reason = "dust";
                return false;
            }
        }
    

    If the only ouput is TX_NULL_DATA, It can avoid dust detection.

  20. laanwj commented at 10:29 AM on July 10, 2015: member

    NACK as this won't actually do anything against storing data in the chain, and all the alternatives to do so are worse.

    Dust filtering should be accomplished some other way, because nothing would stop the spammer from using another kind of transaction if these specific ones were filtered.

    If the only ouput is TX_NULL_DATA, It can avoid dust detection.

    Which is okay - remember, these transactions do not create UTXO entries at all. The reason for dust filtering is to avoid UTXO pollution.

  21. bitkevin closed this on Jul 13, 2015

  22. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 09:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me