3

The raw transaction below is being rejected by bitcoind 0.9.1 (error: {"code":-22,"message":"TX rejected"})

01000000015594a8c1f84b926e84d70c3a3d5e517e0c12dc07cb1a774b587121fef08f91b8000000006a47304402203ea43861e1e22603873f49e73c6ace08d32ef024e1feaca5a6242f74bf152810022044aeee3231e81d927accf20b0b0106ec327728b6a61aedd75596c5c12e5d9999012102add59262e234c0045d1f6a3d40a144b47ea0b4214916f55fb6029a079cc0b3cbffffffff0358020000000000001976a9140f763005e063382f8f4138f75cdc64d14f8ec16f88ac0000000000000000196a054f4101000111753d687474703a2f2f7265642e70696c6cd8720000000000001976a9140f763005e063382f8f4138f75cdc64d14f8ec16f88ac00000000

And the following error appears in the logs:

ERROR: AcceptToMemoryPool : nonstandard transaction: scriptpubkey

The decoded transaction uses OP_RETURN and looks like this:

{
   "lock_time":0,
   "inputs":[
      {
         "prev_out":{
            "index":0,
            "hash":"b8918ff0fe2171584b771acb07dc120c7e515e3d3a0cd7846e924bf8c1a89455"
         },
         "script":"47304402203ea43861e1e22603873f49e73c6ace08d32ef024e1feaca5a6242f74bf152810022044aeee3231e81d927accf20b0b0106ec327728b6a61aedd75596c5c12e5d9999012102add59262e234c0045d1f6a3d40a144b47ea0b4214916f55fb6029a079cc0b3cb"
      }
   ],
   "vout_sz":3,
   "hash":"4dd1b7130045f84e7dd75a03dc802063f76687812cf877dacff2a645a1b0991b",
   "vin_sz":1,
   "out":[
      {
         "address":"12QkihKUyE1hAkv7wmaMj6V3QiN8FfMvpv",
         "script_string":"OP_DUP OP_HASH160 0f763005e063382f8f4138f75cdc64d14f8ec16f OP_EQUALVERIFY OP_CHECKSIG",
         "value":600,
         "script":"76a9140f763005e063382f8f4138f75cdc64d14f8ec16f88ac"
      },
      {
         "script_string":"OP_RETURN 4f41010001 753d687474703a2f2f7265642e70696c6c",
         "value":0,
         "script":"6a054f4101000111753d687474703a2f2f7265642e70696c6c"
      },
      {
         "address":"12QkihKUyE1hAkv7wmaMj6V3QiN8FfMvpv",
         "script_string":"OP_DUP OP_HASH160 0f763005e063382f8f4138f75cdc64d14f8ec16f OP_EQUALVERIFY OP_CHECKSIG",
         "value":29400,
         "script":"76a9140f763005e063382f8f4138f75cdc64d14f8ec16f88ac"
      }
   ],
   "size":259,
   "version":1
}

However OP_RETURN is standard in Bitcoin 0.9, so why is this being rejected?

Note: This works in testnet.

  • 1
    Given that bitcoin-qt is the reference implementation, if it thinks your transaction is nonstandard, then it's nonstandard. (Note that nonstandard transactions are allowed on testnet.) – Nate Eldredge May 3 '14 at 15:00
  • @NateEldredge Please post this as an answer, not a comment :) . – Jori May 3 '14 at 16:34
  • 1
    Please elaborate on why it is not standard... – Flavien May 3 '14 at 17:00
  • @Flavien: I would have to single-step through the source code and see exactly why the check for standardness fails. I don't have the time or inclination to do that at present, but I encourage you to do so. – Nate Eldredge May 3 '14 at 23:25
7

I suspect that the second output is being rejected because it contains an OP_RETURN with two data pushes. From browsing the code, "Solver" in script.cpp only categorizes output scripts as "standard" if they meet one of a limited set of templates.

All such templates containing OP_RETURN:

  1. OP_RETURN, by itself
  2. OP_RETURN, followed by a data push operation that pushes not more than 40 bytes onto the stack.

Since your script is "OP_RETURN, followed by a data push operation that pushes not more than 40 bytes onto the stack, followed by another data push operation", it looks like it wouldn't meet either of those templates.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.