<p>From the relevant section in BIP 68:</p>
<blockquote>
<p>When the relative lock-time is block-based, it is interpreted as a minimum block-height constraint over the input's age. A relative block-based lock-time of zero indicates an input which can be included in any block. More generally, a relative block lock-time n can be included n blocks after the mining date of the output it is spending, or any block thereafter.</p>
</blockquote>
<p>So an nSequence value of 0 means the transaction can be included in <em>the same</em> block as the transaction whose output it is spending.</p>
<p>In the Bitcoin Core software, transactions can be relayed under the condition that they can be included in the next block. For nSequence=0 transactions that implies they can be relayed before their parents are confirmed.</p>

CC BY-SA 4.0
2021-06-13T17:50:41.660Z
`In the Bitcoin Core software, transactions can be relayed under the condition that they can be included in the next block.`


Does it mean an input whose nSequence is 0x00000001, but prevout is zero-conf, can be relayed because age will be “1” the moment it's included in the next block?
Burak
CC BY-SA 4.0
2021-06-13T17:51:58.093Z
I would think not, because the prevout transactions needs to confirm firm, and then only the block _after_ that its nSequence=1 spend can confirm, but I'd need to go check the code to be sure.
Pieter Wuille
CC BY-SA 4.0
2021-06-13T17:25:57.007Z
2021-06-13T17:25:57.007Z
Pieter Wuille
<p>I know setting nSequence <code>0x00000001</code> means the transaction is not valid until 1 block has elapsed since its's prevout confirms. At most one spend per two blocks.</p>
<p>What happens if it's set to <code>0x00000000</code>? I think it means that the transaction is valid and can be relayed <strong>as soon as</strong> it's prevout is confirmed. At most one spend per block.</p>
<p>..Or does it mean prevout can be zero-conf? Unconfirmed transaction chain limit applies.</p>

<transactions><script><mempool><relay>
What happens if nSequence is set to 0x00000000?
Burak
# What happens if nSequence is set to 0x00000000?

(Asked by: username_0 on 2021-06-13)

I know setting nSequence `0x00000001` means the transaction is not valid until 1 block has elapsed since its's prevout confirms. At most one spend per two blocks.

What happens if it's set to `0x00000000`? I think it means that the transaction is valid and can be relayed **as soon as** it's prevout is confirmed. At most one spend per block.

..Or does it mean prevout can be zero-conf? Unconfirmed transaction chain limit applies.

**Tags:** transactions, script, mempool, relay


---

## 1 answers

### Answer by username_1 on 2021-06-13. Score: 3 | Accepted answer

From the relevant section in BIP 68:

> When the relative lock-time is block-based, it is interpreted as a minimum block-height constraint over the input's age. A relative block-based lock-time of zero indicates an input which can be included in any block. More generally, a relative block lock-time n can be included n blocks after the mining date of the output it is spending, or any block thereafter.

So an nSequence value of 0 means the transaction can be included in *the same* block as the transaction whose output it is spending.

In the Bitcoin Core software, transactions can be relayed under the condition that they can be included in the next block. For nSequence=0 transactions that implies they can be relayed before their parents are confirmed.

> **Comments:**
> **username_0**: `In the Bitcoin Core software, transactions can be relayed under the condition that they can be included in the next block.`   Does it mean an input whose nSequence is 0x00000001, but prevout is zero-conf, can be relayed because age will be “1” the moment it's included in the next block?  
> **username_1**: I would think not, because the prevout transactions needs to confirm firm, and then only the block _after_ that its nSequence=1 spend can confirm, but I'd need to go check the code to be sure.  

---

