16

I am interested in the possible use of the Bitcoin (or other altcoin) blockchain as a generalized distributed ledger, meaning that it is useful for tracking information other than coin transactions proper. A prerequisite for that would seem to be the ability to pay for transactions whose primary purpose is not moving Bitcoins from one address to another. So, can Bitcoin transactions list no outputs, thus leaving all inputs as a transaction fee reward for the miner?

14

No. If you create one, it won't be relayed or mined by Bitcoin Core. If it gets into a block, it will be rejected. From the source code for Bitcoin Core (tx_verify.cpp:164):

if (tx.vout.empty())
    return state.DoS(10, false, REJECT_INVALID, "bad-txns-vout-empty");

However, you can create a vout with 0 satoshis. That isn't a "standard" transaction, so it will not be mined by the software by default. However, if it gets into a block, it's valid.

  • However if a custom miner puts a 100% transaction fee TX into a block, it would be accepted, and new blocks built on top of it. – goodguys_activate Aug 1 '13 at 5:19
  • 5
    @makerofthings7 That is not correct. It is a hard network rule that transactions have at least one input and at least one output. Putting a transaction without outputs in a block would make that block invalid. However, referring to the advice above, you can indeed have outputs with 0 satoshi. The network will not relay such transactions either, but they are valid inside blocks. – Pieter Wuille Aug 1 '13 at 11:33
  • 1
    @PieterWuille Thank you for the correction – goodguys_activate Aug 1 '13 at 12:20
  • I just looked through tx_verify.cpp to find a rule which would reject any vout value of 0, but couldn't find any. Can anyone point to where Bitcoin Core would reject such a transaction? – Jacob Ford May 30 '18 at 19:31

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.