I understand that SegWit makes transaction blockdata smaller, by not storing the signature in the Block, so that can fit more transactions in 1MB. This is because the signature is not anymore stored in the blockchain. The Signature makes nearly 70% of the data weight of the Block. So in a SegWit transaction it is 70% less stored in the Blockchain. But where are the signature stored if not in the Blockchain ?


That's not accurate. The witness is stored in the blockchain.

In the segwit format, the signature is part of the witness, the witness is part of the transaction and the transaction is written to the block in full. Nodes that understand segwit will download and store the complete transaction including the signature.

However, segwit is constructed in a forwards compatible manner. It's made so that it is possible to produce a "stripped version" of a segwit transaction that omits the "witness". This stripped version is a non-standard valid transaction according to pre-segwit rules. This means that pre-segwit nodes will not propagate it when it is unconfirmed, but accept it when it is included in a block. Segwit-enabled nodes would consider the stripped version incomplete and therefore depend on receiving the complete version of the transaction from another segwit-enabled node.

Since the transaction outputs are part of the stripped transaction (because they are not part of the witness), pre-segwit nodes will come to the same conclusion regarding the ownership of funds by following the stripped blocks as segwit-capable nodes that read the complete blocks.

Part of the criticism of segwit is that pre-segwit nodes will not verify the signature of segwit transactions, as they do not receive the witness and wouldn't know what to do with it. This means that a legacy node might accept an segwit-invalid block until that block is no longer part of the most-work chain-tip. However, such a block would not propagate well on the network, as about 89% of the nodes on the network are segwit-capable. If you're receiving a significant amount of funds from a segwit transaction and are running a segwit-incapable node, you might want to wait for additional confirmations before taking it at face value. However, for significant amounts that would be a great idea regardless.

  • Thank you for this thorough explanation, however I'm not sure to understand the very last sentence Oct 2 '17 at 0:31
  • @EricLavault: If you're receiving a large amount of money, it can become interesting for people to try to trick you. If you wait for more than one confirmation, it'll be more costly and harder for them.
    – Murch
    Oct 2 '17 at 2:17
  • 1
    This is not a answer to my question ... my question was ; where is the signature stored when its seperated from the transaction ( SegWit Format ) ? in the blockchain or outside the blockchain ?
    – laizess
    Oct 2 '17 at 18:48
  • @laizess: In the blockchain. See my second sentence: "In the segwit transaction format, the signature is part of the witness, the witness is part of the transaction, and the transaction is part of the block." Really, the signature is not separated from the transaction, but it is just separate from the rest of the input script but still inside the same transaction.
    – Murch
    Oct 2 '17 at 19:56
  • 1
    @Murch That's confusing. If the witness is in the block, then why doesn't it count towards the block size? Assume the possibility that it's not part of the block, and instead comes in from a separate channel. In that case, it's clear that there's less data being stored on the blockchain for each transaction. What you're describing puts exactly the same amount of data onto the blockchain; so I don't see how it resolves the problem.
    – ogogmad
    Dec 7 '18 at 10:04

It's still kept in the blockchain. It's just kept in a way that non-segwit clients never see or store the signature.

  • 1
    If the Signiture its still in the blockchain, how is then possible to save 70% of the blockspace to put more transactions without the signature in the same block ?. independently if non-segwit clients can see them or not ? If the Signiture is still in the Blockchain, seperated from the transaction, how the signiture can be identifed at any time, that the transactions where valid ( signiture ) ? if transaction and signiture are seperated but both saved in the blockchain, why seperate them in the first place ?
    – laizess
    Oct 2 '17 at 18:44
  • 3
    Segwit doesn't really 'save' blockspace. It's an accounting trick. It moves bytes from the area counted against block size to an area not counted by (presegwit) block size. A non-segwit node never sees and cannot validate segwit signatures. There are two major reasons to do this. 1) Effective block size can be increased without a hard fork. 2) It's nice to have an identifier for the transaction which can't be changed without re-signing the transaction.
    – Nick ODell
    Oct 2 '17 at 18:48
  • 1
    @laizess: Also see Is SegWit a blocksize increase or more efficient use of blockspace?
    – Murch
    Oct 3 '17 at 3:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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