<p>OP_RETURN doesn't have any special fee rules. This looks like a result of the specific implementation in this library.</p>
<p>It looks like the library always pads out messages to 80 bytes. So when it does the fee calculation, it always uses the 80 byte maximum because that is how large the output will be when it is serialized.</p>

CC BY-SA 4.0
2020-12-07T16:38:53.910Z
2020-12-07T16:38:53.910Z
Ava Chow
<p>In python bit (<a href="https://github.com/ofek/bit/" rel="nofollow noreferrer">https://github.com/ofek/bit/</a>), when sending a message, it is properly 80 bytes or less (<a href="https://developer.bitcoin.org/devguide/transactions.html" rel="nofollow noreferrer">https://developer.bitcoin.org/devguide/transactions.html</a>) fee is If it is a 4-byte character string, it is about 0.03 $ / 140 = 21428 satoshi (<a href="https://mempool.space/ja/testnet" rel="nofollow noreferrer">https://mempool.space/ja/testnet</a>), but it is often 80,000 or more.
Why is the source_code fee calculation result always higher than the actual testnet?</p>
<p>I thought about the cause as follows.
1: There is a possibility that the calculation method of source_code is wrong. (Target + min_change + estimated_fee is the calculation method of fee, but I don't understand why the limit(default 80) is multiplied in the next code part. )</p>
<pre><code>output_size = [len(address_to_scriptpubkey(o[0])) + 9 for o in outputs]
    output_size.append(len(messages) * (MESSAGE_LIMIT + 9))
    output_size.append(len(address_to_scriptpubkey(leftover)) + 9)
    sum_outputs = sum(out[1] for out in outputs)
  (by transaction.py) ```
</code></pre>
<p>How can I send a transaction to testnet with the fee properly set below 80000?</p>

<transaction-fees><testnet><op-return><message>
Why is the source code fee calculated higher than the current bitcoin fee amount?
ground clown
# Why is the source code fee calculated higher than the current bitcoin fee amount?

(Asked by: username_0 on 2020-12-03)

In python bit (<https://github.com/ofek/bit/>), when sending a message, it is properly 80 bytes or less (<https://developer.bitcoin.org/devguide/transactions.html>) fee is If it is a 4-byte character string, it is about 0.03 $ / 140 = 21428 satoshi (<https://mempool.space/ja/testnet>), but it is often 80,000 or more.
Why is the source\_code fee calculation result always higher than the actual testnet?

I thought about the cause as follows.
1: There is a possibility that the calculation method of source\_code is wrong. (Target + min\_change + estimated\_fee is the calculation method of fee, but I don't understand why the limit(default 80) is multiplied in the next code part. )

```
output_size = [len(address_to_scriptpubkey(o[0])) + 9 for o in outputs]
    output_size.append(len(messages) * (MESSAGE_LIMIT + 9))
    output_size.append(len(address_to_scriptpubkey(leftover)) + 9)
    sum_outputs = sum(out[1] for out in outputs)
  (by transaction.py) ```

```

How can I send a transaction to testnet with the fee properly set below 80000?

**Tags:** transaction-fees, testnet, op-return, message


---

## 1 answers

### Answer by username_1 on 2020-12-07. Score: 0 | Accepted answer

OP\_RETURN doesn't have any special fee rules. This looks like a result of the specific implementation in this library.

It looks like the library always pads out messages to 80 bytes. So when it does the fee calculation, it always uses the 80 byte maximum because that is how large the output will be when it is serialized.


---

