user2228: I believe the best way to answer this question would be to give examples of the type of information that the script context could contain.

user1231: Aiming to contribute to the great answer from Mitchell, I'll add this:
Script context can be understood like the summary of the transaction and can be used to validate it. This includes all inputs txInfoInputs and outputs txInfoOutputs (and more!) of the transaction, those inputs and outputs are UTxOs.
Let's take an example from Lesson 06 (on Oracles) of the Plutus Pioneer Program:

In this example we can find two transactions, let's examine the first one:
Tx 1: this transaction contains 3 inputs txInfoInputs and 3 outputs txInfoOutputs

Inputs: UTxOs consumed by the current transaction


UTxO of Oracle script
UTxO of Swap script
UTxO of Buyer


Outputs: UTxOs generated by the current transaction


UTxO of Oracle script
UTxO of Seller
UTxO of Buyer

You can use all of those UTxOs to run any kind of validation from your validator script. So far, that's related to two fields of TxInfo. But there is more to explore: Mitchell answer, as you can also combine your validation with a Minting policy for example.
For more information, you can check following links:

Week 03 - Script Context
Script contexts from Lars Brünjes


user1130: The context includes two parts: TxInfo and ScriptPurpose.
data ScriptContext = ScriptContext{
    scriptContextTxInfo :: TxInfo, 
    scriptContextPurpose :: ScriptPurpose 
}

When people are talking about the script context, they are often referring to the data in TxInfo found here:
data TxInfo = TxInfo
    { txInfoInputs      :: [TxInInfo] -- ^ Transaction inputs
    , txInfoOutputs     :: [TxOut] -- ^ Transaction outputs
    , txInfoFee         :: Value -- ^ The fee paid by this transaction.
    , txInfoMint        :: Value -- ^ The 'Value' minted by this transaction.
    , txInfoDCert       :: [DCert] -- ^ Digests of certificates included in this transaction
    , txInfoWdrl        :: Map StakingCredential Integer -- ^ Withdrawals
    , txInfoValidRange  :: POSIXTimeRange -- ^ The valid range for the transaction.
    , txInfoSignatories :: [PubKeyHash] -- ^ Signatures provided with the transaction, attested that they all signed the tx
    , txInfoRedeemers   :: Map ScriptPurpose Redeemer
    , txInfoData        :: Map DatumHash Datum
    , txInfoId          :: TxId
}

This includes information about the entire transaction. So if you are using multiple scripts you can see what is being spent/minted/burned/etc with all the scripts you are accessing. Many smart contracts are made up of multiple scripts, all accessed at the same time. At the risk of stating the obvious, understanding what information is available for all the scripts in a transaction, i.e. the TxInfo, is fundamental to architecting smart contracts with Plutus.

2228: <p>I believe the best way to answer this question would be to give examples of the type of information that the script context could contain.</p>
 1231: <p>Aiming to contribute to the great answer from Mitchell, I'll add this:</p>
<p><strong>Script context</strong> can be understood like the summary of the transaction and can be used to validate it. This includes all inputs <code>txInfoInputs</code> and outputs <code>txInfoOutputs</code> (<a href="https://staging.plutus.iohkdev.io/doc/haddock/plutus-ledger-api/html/Plutus-V2-Ledger-Contexts.html#v:ScriptContext" rel="nofollow noreferrer">and more!</a>) of the transaction, those inputs and outputs are UTxOs.</p>
<p>Let's take an example from <a href="https://plutus-pioneer-program.readthedocs.io/en/latest/pioneer/week6.html" rel="nofollow noreferrer">Lesson 06</a> (on Oracles) of the Plutus Pioneer Program:</p>
<p><a href="https://i.stack.imgur.com/yQO7P.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yQO7P.jpg" alt="enter image description here" /></a></p>
<p>In this example we can find two transactions, let's examine the first one:</p>
<p><strong>Tx 1</strong>: this transaction contains 3 inputs <code>txInfoInputs</code> and 3 outputs <code>txInfoOutputs</code></p>
<ul>
<li>Inputs: UTxOs consumed by the current transaction</li>
</ul>
<ol>
<li>UTxO of Oracle script</li>
<li>UTxO of Swap script</li>
<li>UTxO of Buyer</li>
</ol>
<ul>
<li>Outputs: UTxOs generated by the current transaction</li>
</ul>
<ol>
<li>UTxO of Oracle script</li>
<li>UTxO of Seller</li>
<li>UTxO of Buyer</li>
</ol>
<p>You can use all of those UTxOs to run any kind of validation from your validator script. So far, that's related to two fields of <code>TxInfo</code>. But there is more to explore: <a href="https://cardano.stackexchange.com/a/4330/1231">Mitchell answer</a>, as you can also combine your validation with a Minting policy for example.</p>
<p>For more information, you can check following links:</p>
<ul>
<li><a href="https://plutus-pioneer-program.readthedocs.io/en/latest/pioneer/week3.html#" rel="nofollow noreferrer">Week 03 - Script Context</a></li>
<li><a href="https://www.youtube.com/watch?v=6_rfCCY9_gY&amp;t=55s" rel="nofollow noreferrer">Script contexts from Lars Brünjes</a></li>
</ul>
 1130: <p>The context includes two parts: <code>TxInfo</code> and <code>ScriptPurpose</code>.</p>
<pre><code>data ScriptContext = ScriptContext{
    scriptContextTxInfo :: TxInfo, 
    scriptContextPurpose :: ScriptPurpose 
}
</code></pre>
<p>When people are talking about the script context, they are often referring to the data in <code>TxInfo</code> found <a href="https://github.com/input-output-hk/plutus/blob/90d76651aea0716e11446c8ac23cd0803c0f0d3a/plutus-ledger-api/src/Plutus/V2/Ledger/Contexts.hs#L78-L91" rel="nofollow noreferrer">here</a>:</p>
<pre><code>data TxInfo = TxInfo
    { txInfoInputs      :: [TxInInfo] -- ^ Transaction inputs
    , txInfoOutputs     :: [TxOut] -- ^ Transaction outputs
    , txInfoFee         :: Value -- ^ The fee paid by this transaction.
    , txInfoMint        :: Value -- ^ The 'Value' minted by this transaction.
    , txInfoDCert       :: [DCert] -- ^ Digests of certificates included in this transaction
    , txInfoWdrl        :: Map StakingCredential Integer -- ^ Withdrawals
    , txInfoValidRange  :: POSIXTimeRange -- ^ The valid range for the transaction.
    , txInfoSignatories :: [PubKeyHash] -- ^ Signatures provided with the transaction, attested that they all signed the tx
    , txInfoRedeemers   :: Map ScriptPurpose Redeemer
    , txInfoData        :: Map DatumHash Datum
    , txInfoId          :: TxId
}
</code></pre>
<p>This includes information about the entire <em>transaction</em>. So if you are using multiple scripts you can see what is being spent/minted/burned/etc with all the scripts you are accessing. Many smart contracts are made up of multiple scripts, all accessed at the same time. At the risk of stating the obvious, understanding what information is available for all the scripts in a transaction, i.e. the <code>TxInfo</code>, is fundamental to architecting smart contracts with Plutus.</p>
