<blockquote>
<p>What is a &quot;maximum standard weight&quot;?</p>
</blockquote>
<p>It is a property that nodes follow to prevent processing large transactions with number of rules and signatures. It is standardness not consensus. If a node receives a transaction greater than 400,000 WU, it will discard the transaction and not relay it further. I can however, definitely create a transaction greater than 400,000 WU and contact a miner to mine it in a block. The nodes then will be forced to accept that transaction in the block as it is allowed by the consensus rules. So standardness is a subset of validity that nodes use to prevent large processing and DoS attacks.</p>
<p>Now, if I have to close the channel unilaterally and the channel had a bunch of HTLCs, I can't be expected to go looking for a miner every time my transaction size is greater than 400,000 WU. The other alternative will be to run another software other than Bitcoin Core that accepts such transactions, but that would have to also mean the miners also run this software. If miners run only Bitcoin Core they will never receive the transactions and Bitcoin Core nodes in between will not relay it. The best thing is to conform the Bitcoin Core standardness as it is in the interest of all.</p>
<blockquote>
<p>Where does the number 400000 come from?</p>
</blockquote>
<p>Before the activation of SegWit, transactions were limited to 100,000 bytes (since a long time). This was merely extended to 400,000 WU.</p>

CC BY-SA 4.0
2019-10-02T16:32:26.170Z
So is the wording of the specs a bit imprecise in that it should be 400000 _weight units_, not 400000 bytes?
Sergei Tikhomirov
CC BY-SA 4.0
2019-10-02T17:23:42.197Z
@SergeiTikhomirov yes, it should be WU. If you see the specs all the transaction sizes have been calculated using WU. Even the calculation that you have linked includes subtracting weights calculated in the section just above it.
Ugam Kamat
CC BY-SA 4.0
2019-10-02T16:19:14.903Z
2023-02-08T13:00:59.383Z
2023-02-08T13:00:59.383Z
Ugam Kamat
<p>The Bitcoin scripting language allows for a decent variety of transaction constructions, but only a subset of those are considered &quot;standard&quot;. In particular, Bitcoin Core will only relay transactions by default that pass the <a href="https://github.com/bitcoin/bitcoin/blob/de1d1895346ed27f471386011d7ff64508f8b39c/src/policy/policy.cpp#L94" rel="nofollow noreferrer"><code>IsStandardTx()</code></a> check. However, miners are still free to include (valid!) non-standard transactions in their blocks.</p>
<p>Transactions larger than 400,000 weight units (100,000 bytes pre segwit) are non-standard and therefore not relayed by most network participants.</p>

CC BY-SA 4.0
2019-10-02T16:23:42.010Z
2023-02-08T13:01:23.553Z
2023-02-08T13:01:23.553Z
Murch
<p>The Lightning Network specifications <a href="https://github.com/lightningnetwork/lightning-rfc/blob/309e86d471faf90c1f6c531701c16887684badb9/05-onchain.md#penalty-transactions-weight-calculation" rel="nofollow noreferrer">limit</a> the number of (unsettled) HTLCs in a channel to 483 at each side (maximum 967 total). The rationale behind this is that the penalty transaction must be under certain size:</p>

<blockquote>
  <p>With a maximum standard weight of 400000 bytes, the maximum number of HTLCs that can be swept in a single transaction is as follows ...</p>
</blockquote>

<p>What is a "maximum standard weight"? Where does the number 400000 come from?</p>

CC BY-SA 4.0
2019-10-02T16:21:17.823Z
transaction weight: https://bitcoin.stackexchange.com/questions/53623/why-does-bip141-define-both-virtual-transaction-size-and-weight
JBaczuk
<lightning-network><non-standard-transaction><transaction-weight>
What defines the standard Bitcoin transaction size?
Sergei Tikhomirov
# What defines the standard Bitcoin transaction size?

(Asked by: username_0 on 2019-10-02)

The Lightning Network specifications [limit](https://github.com/lightningnetwork/lightning-rfc/blob/309e86d471faf90c1f6c531701c16887684badb9/05-onchain.md#penalty-transactions-weight-calculation) the number of (unsettled) HTLCs in a channel to 483 at each side (maximum 967 total). The rationale behind this is that the penalty transaction must be under certain size:

> With a maximum standard weight of 400000 bytes, the maximum number of HTLCs that can be swept in a single transaction is as follows ...

What is a "maximum standard weight"? Where does the number 400000 come from?

**Tags:** lightning-network, non-standard-transaction, transaction-weight

> **Comments:**
> **username_1**: transaction weight: https://bitcoin.stackexchange.com/questions/53623/why-does-bip141-define-both-virtual-transaction-size-and-weight  

---

## 2 answers

### Answer by username_2 on 2019-10-02. Score: 2 | Accepted answer

> What is a "maximum standard weight"?

It is a property that nodes follow to prevent processing large transactions with number of rules and signatures. It is standardness not consensus. If a node receives a transaction greater than 400,000 WU, it will discard the transaction and not relay it further. I can however, definitely create a transaction greater than 400,000 WU and contact a miner to mine it in a block. The nodes then will be forced to accept that transaction in the block as it is allowed by the consensus rules. So standardness is a subset of validity that nodes use to prevent large processing and DoS attacks.

Now, if I have to close the channel unilaterally and the channel had a bunch of HTLCs, I can't be expected to go looking for a miner every time my transaction size is greater than 400,000 WU. The other alternative will be to run another software other than Bitcoin Core that accepts such transactions, but that would have to also mean the miners also run this software. If miners run only Bitcoin Core they will never receive the transactions and Bitcoin Core nodes in between will not relay it. The best thing is to conform the Bitcoin Core standardness as it is in the interest of all.

> Where does the number 400000 come from?

Before the activation of SegWit, transactions were limited to 100,000 bytes (since a long time). This was merely extended to 400,000 WU.

> **Comments:**
> **username_0**: So is the wording of the specs a bit imprecise in that it should be 400000 _weight units_, not 400000 bytes?  
> **username_2**: @username_0 yes, it should be WU. If you see the specs all the transaction sizes have been calculated using WU. Even the calculation that you have linked includes subtracting weights calculated in the section just above it.  

---

### Answer by username_3 on 2019-10-02. Score: 1

The Bitcoin scripting language allows for a decent variety of transaction constructions, but only a subset of those are considered "standard". In particular, Bitcoin Core will only relay transactions by default that pass the [`IsStandardTx()`](https://github.com/bitcoin/bitcoin/blob/de1d1895346ed27f471386011d7ff64508f8b39c/src/policy/policy.cpp#L94) check. However, miners are still free to include (valid!) non-standard transactions in their blocks.

Transactions larger than 400,000 weight units (100,000 bytes pre segwit) are non-standard and therefore not relayed by most network participants.


---

