I am playing with bitcoin transaction a bit now.

I have a question. Normally, the output script looks like

OP_DUP OP_HASH160 (hash) OP_EQUALVERIFY OP_CHECKSIG

Now that is understandable. However, when I slightly change the script with an outgoing translation to

OP_DUP OP_DROP OP_DUP OP_HASH160 (hash) OP_EQUALVERIFY OP_CHECKSIG

this transaction is never relayed (as far as I can say) and never reaches any miner, even when it's 100% legal.

What is going on? Why is it not relayed? I even added quite large fee on it.

And a second question - if my suspicion is correct and it is actually never relayed - what would happen if some miner actually accepted it and this transaction ended in the blockchain? Would it be a valid transaction? Would the client be able to "see it" when he is not able to relay it?

  • How did you change the script? I've been trying to figure out how to do that – imichaelmiers Aug 31 '12 at 19:22
  • with playing with the source code. – Karel Bílek Sep 1 '12 at 0:48
up vote 15 down vote accepted

The standard client will not relay non-standard transactions. However, if you get them directly to a miner that accepts them, clients will process them correctly and the transaction will work.

You can send your transactions to 173.242.112.53. This is a server run by Eligius that will relay all valid transactions and they will include even non-standard transactions in the blocks they mine. Others who are willing to relay or include free and non-standard transactions also tend to link to this node, so it can get your transaction included in blocks mined by other pools as well.

  • 1
    OK, this is interesting. Thanks! What is the reason for this client behaviour? – Karel Bílek Aug 20 '12 at 8:23
  • 2
    It's a way to prevent the network from being flooded with a large number of very small nuisance transactions. Someone could move the same coins back and forth over and over, bloating the block chain and flooding out legitimate transactions. The decision not to relay "non-standard" transactions is kind of mysterious and I'm not sure what the thinking is. – David Schwartz Aug 20 '12 at 8:29
  • 5
    If you're testing, you might want to consider running on a test network rather than the real one. – David Schwartz Aug 20 '12 at 8:31
  • 2
    Hm, I have never heard about "test network", it seems interesting, I am probably going to use that. How do I get "test bitcoins"? – Karel Bílek Aug 20 '12 at 8:34
  • 3
    From the test faucet of course. – David Schwartz Aug 20 '12 at 8:41

This is for sending transactions directly to Eligius: http://eligius.st/~wizkid057/newstats/pushtxn.php

  • In fact this should be a comment to David's answer instead of a new answer. Also, you are not meant to include a footer with a tip address in an answer. – Steven Roose Jan 5 '14 at 12:40

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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