# Segregated Witness (SegWit) Upgrade

Bitcoin transactions were originally comprised of two primary data elements: outputs and inputs.&#x20;

Outputs create new coins and set the conditions that must be met to spend those coins, such as specifying a public key that must sign the spending transaction.&#x20;

Inputs reference previous outputs and provide data satisfying their spending requirements, like a signature matching the specified public key.&#x20;

To prevent coins from being created out of thin air, the total value of all inputs must be greater than or equal to the total value of all outputs.

However, in 2017, the [Segregated Witness (SegWit) protocol upgrade](https://bitcoincore.org/en/2016/01/26/segwit-benefits/) introduced a third data element, the "witness."&#x20;

SegWit restructured Bitcoin transactions by separating them into two distinct components: the transaction data (input and output) and the witness data.&#x20;

This change introduced the concept of [block weight](https://bitcoinwiki.org/wiki/block-weight#:~:text=non%2DSegWit%20addresses.-,Definition%20of%20block%20weight,1%20byte%20of%20block%20weight.), which altered the way block size is measured.&#x20;

Under this system, the weight of the witness data is only 25% of the weight of the transaction data. This means Bitcoin's effective block size increased thanks to SegWit, making it more efficient and cost-effective to store data in the witness portion of the transaction.&#x20;

In essence, SegWit allowed Bitcoin's maximum block size to grow from 1MB to 4MB, comprising 1MB of transaction data and 3MB of witness data. This improvement enabled more transactions to be processed within each block, enhancing Bitcoin's overall scalability and transaction throughput.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://book.runesterminal.io/2.-origins/segregated-witness-segwit-upgrade.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
