0

The bitcoin opcode seems to have a flat rate, is that correct? Or, if bitcoin has a price per opcode, please give me the link. If it is a flat rate, please tell me why bitcoin does not have a mechanism like ethereum.

1
  • Are you asking about the transaction fees that are paid to miners? Dec 6 '20 at 23:25
3

If by "flat rate" you mean that each opcode costs the same amount in transaction fees, then yes, Bitcoin does have a "flat rate". Opcodes don't have a direct fee themselves, the fee is based on the size of the transaction, and since each opcode is one byte, they have the same cost.

It is unnecessary to have an opcode cost scheme like Ethereum because opcodes are not very computationally expensive and do not have the same effects as Ethereum opcodes do. Bitcoin script is not Turing complete so it is impossible to loop. Each opcode can only be run a single time.

Furthermore, the more computationally expensive signature verification opcodes do have an additional cost in the form of the "signature operations" (sigops) limit. Sigops are factored into the calculation of a transactions weight which will then effect the transaction fee, but this effect is only present in extreme cases where there are a lot of sigops in a single transaction. Blocks are limited in the number of sigops that they can include.

2
  • Thank you. The same thing happened at bitcoin.stackexchange.com/questions/100331/…. I had MESSAGE_LIMIT = 80 set here, but can I think of this as the actual weight for the "op_return" opcode? If you like, please answer. Dec 7 '20 at 3:55
  • @groundclown No. OP_RETURN isn't special. That is just how that particularly library is creating OP_RETURN outputs.
    – Andrew Chow
    Dec 7 '20 at 16:39

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.