<blockquote>
  <p>Why is it that miners have the freedom to construct non-standard transactions, but everyone else is limited to standard transactions?</p>
</blockquote>

<ul>
<li>You are not limited to patch your code and relay non-standard
transactions</li>
<li>You are not limited to promote your client and its source code</li>
<li>You are not limited to be a miner</li>
</ul>

CC BY-SA 3.0
2018-04-11T04:27:25.383Z
2018-04-11T04:27:25.383Z
amaclin
<blockquote>
  <p>doesn't this just leave miners with the ability to perform an attack whilst leaving everyone else restricted?</p>
</blockquote>

<p>Not necessarily. Many of the attacks that the standardness rules protect against require large and many transactions that are expensive to verify. If a node is sent a lot of expensive to verify transactions, it can effectively go down as it spends time verifying those transactions instead of verifying and relaying other "normal" transactions and blocks.</p>

<p>However by virtue of mining, a miner can only create transactions that are limited in size, and they are limited in the number of transactions that can be sent in a block. So non-standard transactions that are large and expensive to verify can be included in blocks (and they have been before), but because there are few of them and they happen, at worst, infrequently, it isn't that big of a problem. The problem is only when there are a lot of such transactions which can only happen via normal transaction broadcast, and then standardness rules will prevent those from being verified (standardness is checked before any expensive verifications happen) and relayed.</p>

CC BY-SA 3.0
2018-04-11T11:33:29.710Z
Thank you. So the mempool would have no limit to the number of expensive to verify transactions it could receive, which could be used as an attack. Whereas blocks can hold a limited number of transactions (delivered every 10 minutes), so any expensive to verify transactions are less of a problem?
inersha
CC BY-SA 3.0
2018-04-11T16:15:29.663Z
Basically yes. The mempool does have a limited size, but that limit is pretty large is there is effectively no limit.
Ava Chow
CC BY-SA 3.0
2018-04-10T20:26:35.913Z
2018-04-10T20:26:35.913Z
Ava Chow
<p>As far as I understand, a non-standard transaction can be mined in to a block (and this block will be accepted by all nodes), but <strong>nodes will not relay a non-standard transaction to other nodes</strong>.</p>

<p>Why is it that miners have the freedom to construct non-standard transactions, but everyone else is limited to standard transactions?</p>

<p>I've heard that limiting the types of transactions that get relayed is some form of protection (against unusual script types that could cause problems). However, if this is the reason, <strong>doesn't this just leave miners with the ability to perform an attack whilst leaving everyone else restricted?</strong></p>

<p>I'm not against standard transactions. I'm just not sure how this situation came to be.</p>

<non-standard-transaction>
Why can non-standard transactions be mined but not relayed?
inersha
# Why can non-standard transactions be mined but not relayed?

(Asked by: username_0 on 2018-04-10)

As far as I understand, a non-standard transaction can be mined in to a block (and this block will be accepted by all nodes), but **nodes will not relay a non-standard transaction to other nodes**.

Why is it that miners have the freedom to construct non-standard transactions, but everyone else is limited to standard transactions?

I've heard that limiting the types of transactions that get relayed is some form of protection (against unusual script types that could cause problems). However, if this is the reason, **doesn't this just leave miners with the ability to perform an attack whilst leaving everyone else restricted?**

I'm not against standard transactions. I'm just not sure how this situation came to be.

**Tags:** non-standard-transaction


---

## 2 answers

### Answer by username_2 on 2018-04-10. Score: 6 | Accepted answer

> doesn't this just leave miners with the ability to perform an attack whilst leaving everyone else restricted?

Not necessarily. Many of the attacks that the standardness rules protect against require large and many transactions that are expensive to verify. If a node is sent a lot of expensive to verify transactions, it can effectively go down as it spends time verifying those transactions instead of verifying and relaying other "normal" transactions and blocks.

However by virtue of mining, a miner can only create transactions that are limited in size, and they are limited in the number of transactions that can be sent in a block. So non-standard transactions that are large and expensive to verify can be included in blocks (and they have been before), but because there are few of them and they happen, at worst, infrequently, it isn't that big of a problem. The problem is only when there are a lot of such transactions which can only happen via normal transaction broadcast, and then standardness rules will prevent those from being verified (standardness is checked before any expensive verifications happen) and relayed.

> **Comments:**
> **username_0**: Thank you. So the mempool would have no limit to the number of expensive to verify transactions it could receive, which could be used as an attack. Whereas blocks can hold a limited number of transactions (delivered every 10 minutes), so any expensive to verify transactions are less of a problem?  
> **username_2**: Basically yes. The mempool does have a limited size, but that limit is pretty large is there is effectively no limit.  

---

### Answer by username_1 on 2018-04-11. Score: 1

> Why is it that miners have the freedom to construct non-standard transactions, but everyone else is limited to standard transactions?

* You are not limited to patch your code and relay non-standard
  transactions
* You are not limited to promote your client and its source code
* You are not limited to be a miner


---

