<p>A transaction (that is not a coinbase transaction) will have specified inputs and outputs. The inputs must be comprised of valid, existing UTXOs (referenced by transaction ID and output index number, called the 'outpoint'), which will be 'consumed' to create the outputs (newly created UTXOs).</p>
<p>To spend any UTXO, you need to satisfy the conditions of the locking script placed on it.</p>
<blockquote>
<p>I presume that its inclusion here is a reference to the Output of the originating transaction i.e. the Input of the current transaction includes a part of the Output of the previous transaction to provide extra information to the user.</p>
</blockquote>
<p>If we look under the hood at how transactions work:</p>
<p>The transaction input will include an outpoint, as well as an unlocking script that will satisfy the scriptPubKey, and a sequence number (which is not relevant to the question at hand). The scriptPubKey for an input isn't explicitly included in the transaction data, as that would be redundant. Instead, the scriptPubKey can be looked up via the outpoint.</p>
<p>The outputs created by a transaction will each include a value (amount of BTC), and a scriptPubKey.</p>
<p>A block explorer will likely just display all of this info together for ease of use though. So if you look up a transaction ID, the scriptPubKey of the inputs may be listed, despite the fact that the actual serialized transaction data doesn't explicitly include this data (it just includes the outpoint, which is used as reference to look up the relevant data).</p>
<hr />
<p>You can think of the outpoint as the information about <em>which</em> UTXO is to be spent, the scriptPubKey as the 'lock' which must be opened in order to spend it, and the scriptsig as the 'key' which will open the lock.</p>

CC BY-SA 4.0
2020-06-22T22:08:59.710Z
Thanks. I understand how Txs work. I just wanted to confirm that this is a quirk of blockchain.com, and not some sort of special Tx type that replicates scriptPubKey in the input.
Garreth McDaid
CC BY-SA 4.0
2020-06-23T00:01:29.803Z
@GarrethMcDaid right, blockchain explorers will show a lot of info that is an abstraction of the actual serialized transactions/blocks transmitted across the network. Many of the human-friendly interfaces we are used to are as such.
chytrik
CC BY-SA 4.0
2020-06-22T20:53:38.783Z
2020-06-22T20:53:38.783Z
chytrik
<p>I'm pretty sure this is just a quirk of Blochchain.com.</p>
<p>For comparison, here is the same transaction in Sochain.com</p>
<p><a href="https://sochain.com/tx/BTC/7da0823ebf7a002a15b6bd11c676c6c213c349c982a9c454539e3ad63e9d57ee" rel="nofollow noreferrer">https://sochain.com/tx/BTC/7da0823ebf7a002a15b6bd11c676c6c213c349c982a9c454539e3ad63e9d57ee</a></p>
<p>This show the standard Public Key + Signature scriptSig in the Input and the 2 x P2PKH scriptPubKey locks for the 2 Outputs.</p>

CC BY-SA 4.0
2020-06-22T22:13:05.370Z
2020-06-22T22:13:05.370Z
Garreth McDaid
<p>I'm query the BTC blockchain using blockchain.com to understand my own transactions a bit better.</p>
<p>One thing that confuses me in the inclusion of the Pkscript (scriptPubKey) under &quot;Inputs&quot; in the transaction manifest. My understanding is that this script is part of the <code>Output</code> of a transaction.</p>
<p>I presume that its inclusion here is a reference to the <code>Output</code> of the originating transaction i.e. the <code>Input</code> of the current transaction includes a part of the <code>Output</code> of the previous transaction to provide extra information to the user.</p>
<p>ie it is <strong>not</strong> suggesting that the scriptPubKey is actually part of the <code>Input</code> of the current transaction.</p>
<p>e.g
<a href="https://www.blockchain.com/btc/tx/7da0823ebf7a002a15b6bd11c676c6c213c349c982a9c454539e3ad63e9d57ee" rel="nofollow noreferrer">https://www.blockchain.com/btc/tx/7da0823ebf7a002a15b6bd11c676c6c213c349c982a9c454539e3ad63e9d57ee</a></p>

<transactions>
Blockchain.com transaction explanation
Garreth McDaid
# Blockchain.com transaction explanation

(Asked by: username_0 on 2020-06-22)

I'm query the BTC blockchain using blockchain.com to understand my own transactions a bit better.

One thing that confuses me in the inclusion of the Pkscript (scriptPubKey) under "Inputs" in the transaction manifest. My understanding is that this script is part of the `Output` of a transaction.

I presume that its inclusion here is a reference to the `Output` of the originating transaction i.e. the `Input` of the current transaction includes a part of the `Output` of the previous transaction to provide extra information to the user.

ie it is **not** suggesting that the scriptPubKey is actually part of the `Input` of the current transaction.

e.g
<https://www.blockchain.com/btc/tx/7da0823ebf7a002a15b6bd11c676c6c213c349c982a9c454539e3ad63e9d57ee>

**Tags:** transactions


---

## 2 answers

### Answer by username_1 on 2020-06-22. Score: 1

A transaction (that is not a coinbase transaction) will have specified inputs and outputs. The inputs must be comprised of valid, existing UTXOs (referenced by transaction ID and output index number, called the 'outpoint'), which will be 'consumed' to create the outputs (newly created UTXOs).

To spend any UTXO, you need to satisfy the conditions of the locking script placed on it.

> I presume that its inclusion here is a reference to the Output of the originating transaction i.e. the Input of the current transaction includes a part of the Output of the previous transaction to provide extra information to the user.

If we look under the hood at how transactions work:

The transaction input will include an outpoint, as well as an unlocking script that will satisfy the scriptPubKey, and a sequence number (which is not relevant to the question at hand). The scriptPubKey for an input isn't explicitly included in the transaction data, as that would be redundant. Instead, the scriptPubKey can be looked up via the outpoint.

The outputs created by a transaction will each include a value (amount of BTC), and a scriptPubKey.

A block explorer will likely just display all of this info together for ease of use though. So if you look up a transaction ID, the scriptPubKey of the inputs may be listed, despite the fact that the actual serialized transaction data doesn't explicitly include this data (it just includes the outpoint, which is used as reference to look up the relevant data).

---

You can think of the outpoint as the information about *which* UTXO is to be spent, the scriptPubKey as the 'lock' which must be opened in order to spend it, and the scriptsig as the 'key' which will open the lock.

> **Comments:**
> **username_0**: Thanks. I understand how Txs work. I just wanted to confirm that this is a quirk of blockchain.com, and not some sort of special Tx type that replicates scriptPubKey in the input.  
> **username_1**: @username_0 right, blockchain explorers will show a lot of info that is an abstraction of the actual serialized transactions/blocks transmitted across the network. Many of the human-friendly interfaces we are used to are as such.  

---

### Answer by username_0 on 2020-06-22. Score: 0

I'm pretty sure this is just a quirk of Blochchain.com.

For comparison, here is the same transaction in Sochain.com

<https://sochain.com/tx/BTC/7da0823ebf7a002a15b6bd11c676c6c213c349c982a9c454539e3ad63e9d57ee>

This show the standard Public Key + Signature scriptSig in the Input and the 2 x P2PKH scriptPubKey locks for the 2 Outputs.


---

