3

If I'm understanding segwit correctly, miners have to verify signatures in order to include a transaction into a block that they are mining. However, miners are not required to verify signatures in order to decide that a block a different miner mined is valid. Is this correct? It sounds to me like most do still verify though?

Are signatures discarded eventually?

Should a mining pool temporarily gain 51% control of the blockchain, can they insert transactions, and not include the segwit for a block or two because, by the time other miners are allowed to mine, those signatures will have expired?

1 Answer 1

6

If I'm understanding segwit correctly, miners have to verify signatures in order to include a transaction into a block that they are mining. However, miners are not required to verify signatures in order to decide that a block a different miner mined is valid. Is this correct?

Miners can do what they want to construct blocks, including creating blocks with invalid signatures. They can even try construct blocks by just creating random data, and hoping it's valid.

However, blocks without valid signatures (or other validity problems) will not be accepted by the network. All full nodes verify all signatures in all blocks, so if a miner constructs a block with an invalid signature, they've just wasted a enormous amount of effort to produce something everyone will just ignore, and forgone the ability to be paid for that block. The same is true for building on top of an invalid block; thus miners are incentivized to validate the blocks they build on top of too - but they don't have if they like losing money.

None of this has anything to do with segwit. Segwit moved signatures to a different place, where they don't affect txids, and can be stripped cleanly so pre-segwit nodes can ignore them, but doesn't mean nodes don't validate anything less (except old nodes, which don't care about the segregated area).

It sounds to me like most do still verify though?

Definitely.

Are signatures discarded eventually?

Not in any current full node implementation that I know of.

Bitcoin Core supports pruning old block data, which deletes both witness and non-witness data equally. That also means other nodes can't synchronize off a pruned node anymore.

In theory it's possible to implement a pruning mode that deletes just the witnesses. That would also prevent other (post-segwit) nodes from synchronizing off them, but they could still serve some light clients. This is not implemented.

Should a mining pool temporarily gain 51% control of the blockchain, can they insert transactions, and not include the segwit for a block or two because, by the time other miners are allowed to mine, those signatures will have expired?

I don't understand what you mean here, but signatures don't "expire".

3
  • So how can you trim away the signatures if you still need them and how can segwit improve transaction bandwidth if all of the same data still needs to be sent every block. Or am I missing the whole point of segwit, because I thought that was it?
    – mczarnek
    Commented Jan 28, 2021 at 23:07
  • 2
    You can trim signatures away because segwit outputs look like "anyone can spend" to old nodes. New nodes need the signatures. It doesn't improve bandwidth, it's a block size increase from the perspective of new nodes, but one with better incentive alignment as it makes the data that doesn't go into the UTXO set (which all nodes need to maintain) relatively cheaper. It was combined with other changes that make validation relative cheaper in some worst case situations, and introduce non-malleable transaction identifiers, which do contribute to scalability. Commented Jan 28, 2021 at 23:14
  • 1
    Got it, read multiple articles about this.. that explanation actually made sense. Short and concise, thanks.
    – mczarnek
    Commented Jan 28, 2021 at 23:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.