<p>Bitcoin Knots aims to default to reasonable node policies. The reason datacarrier is enabled by default, is that it's impractical to prevent 32-byte spam from abusing p2*h outputs which is much more harmful. So to that end, turning a blind eye to small spam isn't terrible.</p>
<p>The reason it was originally 42 bytes is because there was a possibility back in 2014 that it could be useful for committing to external data, and that data might need a tag of some sort. Since that time, there have been developments to make such usage unnecessary (eg, paytocontract and Taproot). But there hasn't been much rationale to change it either.</p>
<p>Reducing the size to 35 should be perfectly fine.</p>
<p>P.S. Since you specifically mention low-value transactions, you may be interested in testing out the new dustdynamic option: <a href="https://github.com/bitcoinknots/bitcoin/issues/74" rel="nofollow noreferrer">https://github.com/bitcoinknots/bitcoin/issues/74</a></p>

CC BY-SA 4.0
2024-03-30T19:27:17.690Z
Thank you for your answer. I am definitely interested in testing the new `dustdynamic` option. I've set it to `dustdynamic=target:1008` while doubling the default `dustrelayfee` to `0.00006`.
John Smith
CC BY-SA 4.0
2024-03-30T17:45:26.683Z
2024-03-30T17:45:26.683Z
Luke Dashjr
<p>Having run <a href="https://bitcoin.stackexchange.com/a/122294/112354">Bitcoin Core with Luke's patch</a> and with <code>permitbaremultisig=0 and datacarrier=0</code> in <code>bitcoin.conf</code> for a couple of weeks I finally decided to make a switch to Bitcoin Knots.
<a href="https://github.com/bitcoinknots/bitcoin/blob/26.x-knots/share/examples/bitcoin.conf" rel="nofollow noreferrer">The following options seem to be relevant</a> to the matter of limiting spam (inscriptions not applicable to finance, BRC-20, ordinals and the like).</p>
<pre><code>
# Relay and mine non-OP_RETURN datacarrier injection (default: 0)
#acceptnonstddatacarrier=1

# Relay and mine &quot;non-standard&quot; transactions (default: 0)
#acceptnonstdtxn=1

# Equivalent bytes per sigop in transactions for relay and mining
# (default: 20)
#bytespersigop=1

# Minimum bytes per sigop in transactions we relay and mine (default: 20)
#bytespersigopstrict=1

# Relay and mine data carrier transactions (default: 1)
#datacarrier=1

# Treat extra data in transactions as at least N vbytes per actual byte
# (default: 1)
#datacarriercost=1

# Maximum size of data in data carrier transactions we relay and mine
# (default: 42)
#datacarriersize=1

# Maximum size of scripts we relay and mine (default: 1650)
#maxscriptsize=1

# Relay non-P2SH multisig (default: 0)
#permitbaremultisig=1

# Relay legacy pubkey outputs (default: 0)
#permitbarepubkey=1

</code></pre>
<p>How might I set up the above parameters in order to stop or limit spam?</p>
<p>I noticed that <code>datacarrier</code> is set to <code>1</code> by default. Why is that so? Is it because of other, more effective settings such as <code>acceptnonstdtxn</code> and <code>acceptnonstddatacarrier</code>  being set to <code>0</code> by default?</p>
<p>If I want to lower the maximum size of data in datacarrier transaction to less than 42 bytes, lets say to 35 bytes, should I apply <code>datacarriersize=35</code>? What are the pros and cons of lowering this parameter below the current default of 42 bytes?</p>

<mempool><ordinals><spam><tokens><bitcoin-knots>
How do I set up bitcoin.conf in Bitcoin Knots to stop spam and low value transactions?
John Smith
# How do I set up bitcoin.conf in Bitcoin Knots to stop spam and low value transactions?

(Asked by: username_0 on 2024-03-30)

Having run [Bitcoin Core with username_1's patch](https://bitcoin.stackexchange.com/a/122294/112354) and with `permitbaremultisig=0 and datacarrier=0` in `bitcoin.conf` for a couple of weeks I finally decided to make a switch to Bitcoin Knots.
[The following options seem to be relevant](https://github.com/bitcoinknots/bitcoin/blob/26.x-knots/share/examples/bitcoin.conf) to the matter of limiting spam (inscriptions not applicable to finance, BRC-20, ordinals and the like).

```

# Relay and mine non-OP_RETURN datacarrier injection (default: 0)
#acceptnonstddatacarrier=1

# Relay and mine "non-standard" transactions (default: 0)
#acceptnonstdtxn=1

# Equivalent bytes per sigop in transactions for relay and mining
# (default: 20)
#bytespersigop=1

# Minimum bytes per sigop in transactions we relay and mine (default: 20)
#bytespersigopstrict=1

# Relay and mine data carrier transactions (default: 1)
#datacarrier=1

# Treat extra data in transactions as at least N vbytes per actual byte
# (default: 1)
#datacarriercost=1

# Maximum size of data in data carrier transactions we relay and mine
# (default: 42)
#datacarriersize=1

# Maximum size of scripts we relay and mine (default: 1650)
#maxscriptsize=1

# Relay non-P2SH multisig (default: 0)
#permitbaremultisig=1

# Relay legacy pubkey outputs (default: 0)
#permitbarepubkey=1

```

How might I set up the above parameters in order to stop or limit spam?

I noticed that `datacarrier` is set to `1` by default. Why is that so? Is it because of other, more effective settings such as `acceptnonstdtxn` and `acceptnonstddatacarrier` being set to `0` by default?

If I want to lower the maximum size of data in datacarrier transaction to less than 42 bytes, lets say to 35 bytes, should I apply `datacarriersize=35`? What are the pros and cons of lowering this parameter below the current default of 42 bytes?

**Tags:** mempool, ordinals, spam, tokens, bitcoin-knots


---

## 1 answers

### Answer by username_1 on 2024-03-30. Score: 4 | Accepted answer

Bitcoin Knots aims to default to reasonable node policies. The reason datacarrier is enabled by default, is that it's impractical to prevent 32-byte spam from abusing p2\*h outputs which is much more harmful. So to that end, turning a blind eye to small spam isn't terrible.

The reason it was originally 42 bytes is because there was a possibility back in 2014 that it could be useful for committing to external data, and that data might need a tag of some sort. Since that time, there have been developments to make such usage unnecessary (eg, paytocontract and Taproot). But there hasn't been much rationale to change it either.

Reducing the size to 35 should be perfectly fine.

P.S. Since you specifically mention low-value transactions, you may be interested in testing out the new dustdynamic option: <https://github.com/bitcoinknots/bitcoin/issues/74>

> **Comments:**
> **username_0**: Thank you for your answer. I am definitely interested in testing the new `dustdynamic` option. I've set it to `dustdynamic=target:1008` while doubling the default `dustrelayfee` to `0.00006`.  

---

