<p>Seg-Wit or Segregated Witness term can literally be explained, that we are segregating (separating) Witness (Signature Data) from something.</p>

<p><strong>Now What is Witness?</strong></p>

<p>For spending a unspent bitcoin output, one has to create and sign a transaction. The signature along with public key is included in <a href="https://bitcoin.org/en/developer-reference#raw-transaction-format" rel="nofollow noreferrer">scriptSig</a> field,which is used to validate the transaction.
This validation content (scriptSig) is referred to here as witness.
(If multiple outputs are spent, there will be multiple scriptSig fields for corresponding inputs).  </p>

<p><strong>Why are we segregating (separating) it and from where?</strong></p>

<p>Under SegWit contents of scriptSig fields are removed from transaction inputs [txins] and placed separately under witness field.
So, format of transaction now changed from:</p>

<p><strong>[nVersion][txins][txouts][nLockTime]</strong></p>

<p>to </p>

<p><strong>[nVersion][marker][flag][txins][txouts][witness][nLockTime]</strong></p>

<p><strong>Why it was necessary?</strong></p>

<p>Transaction ID generated in bitcoin system is double SHA256 of the serialized transaction structure.
Generation of txid in Non-SegWit transaction structure had a annoying bug known as <a href="https://en.bitcoin.it/wiki/Transaction_malleability" rel="nofollow noreferrer">transaction malleability</a>, after broadcasting transaction with TXID1, any node in network could slightly alter content of scriptSig field still maintaining transaction validity, changes Transaction ID TXID1 to TXID2. Now for same transaction system has two txid's.</p>

<p><strong>Other Benefits</strong></p>

<p>Block Capacity Increase, as transactions are clubbed in blocks, current size limit being 1MB, separating scriptSig content from [txin] to new witness field, results in inclusion of more number of transactions. </p>

<p><strong>Further Reading:</strong></p>

<p>A good &amp; simple explanation of SegWit : <a href="http://learnmeabitcoin.com/faq/segregated-witness" rel="nofollow noreferrer">http://learnmeabitcoin.com/faq/segregated-witness</a></p>

<p>Benefits of SegWit :
<a href="https://bitcoincore.org/en/2016/01/26/segwit-benefits/" rel="nofollow noreferrer">https://bitcoincore.org/en/2016/01/26/segwit-benefits/</a></p>

<p>BIP 141: <a href="https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki" rel="nofollow noreferrer">https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki</a>   </p>

CC BY-SA 3.0
2018-03-30T11:03:37.787Z
2018-03-30T11:03:37.787Z
kherwa
<p>What's the difference? What is the definition of these two terms?</p>

CC BY-SA 3.0
2017-12-26T11:05:28.817Z
Well Greg, That's a bit of a longer explanation for me to do, but you can check this link: https://bitcointalk.org/index.php?topic=2251039.0 I think it will help you understand the whole thing better! Hope it helps! Cheers
David
<segregated-witness><terminology>
What is the difference between Segwit and non-segwit?
Greg Wisor
# What is the difference between Segwit and non-segwit?

(Asked by: username_0 on 2017-12-26)

What's the difference? What is the definition of these two terms?

**Tags:** segregated-witness, terminology

> **Comments:**
> **username_1**: Well username_0, That's a bit of a longer explanation for me to do, but you can check this link: https://bitcointalk.org/index.php?topic=2251039.0 I think it will help you understand the whole thing better! Hope it helps! Cheers  

---

## 1 answers

### Answer by username_2 on 2018-03-30. Score: 2

Seg-Wit or Segregated Witness term can literally be explained, that we are segregating (separating) Witness (Signature Data) from something.

**Now What is Witness?**

For spending a unspent bitcoin output, one has to create and sign a transaction. The signature along with public key is included in [scriptSig](https://bitcoin.org/en/developer-reference#raw-transaction-format) field,which is used to validate the transaction.
This validation content (scriptSig) is referred to here as witness.
(If multiple outputs are spent, there will be multiple scriptSig fields for corresponding inputs).

**Why are we segregating (separating) it and from where?**

Under SegWit contents of scriptSig fields are removed from transaction inputs [txins] and placed separately under witness field.
So, format of transaction now changed from:

**[nVersion][txins][txouts][nLockTime]**

to

**[nVersion][marker][flag][txins][txouts][witness][nLockTime]**

**Why it was necessary?**

Transaction ID generated in bitcoin system is double SHA256 of the serialized transaction structure.
Generation of txid in Non-SegWit transaction structure had a annoying bug known as [transaction malleability](https://en.bitcoin.it/wiki/Transaction_malleability), after broadcasting transaction with TXID1, any node in network could slightly alter content of scriptSig field still maintaining transaction validity, changes Transaction ID TXID1 to TXID2. Now for same transaction system has two txid's.

**Other Benefits**

Block Capacity Increase, as transactions are clubbed in blocks, current size limit being 1MB, separating scriptSig content from [txin] to new witness field, results in inclusion of more number of transactions.

**Further Reading:**

A good & simple explanation of SegWit : <http://learnmeabitcoin.com/faq/segregated-witness>

Benefits of SegWit :
<https://bitcoincore.org/en/2016/01/26/segwit-benefits/>

BIP 141: <https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki>


---

