<p>All three inputs in the second transaction of <a href="https://mempool.space/block/00000000b0c5a240b2a61d2e75692224efd4cbecdf6eaf4cc2cf477ca7c270e7" rel="nofollow noreferrer">the 496th block</a> consume <strong>P2PK outputs</strong>, not P2PKH outputs. If they were consuming P2PKH outputs, the scriptSig would be of the format you specified. Since these are <strong>P2PK outputs</strong>, then scriptSig contains only <code>signature</code>.</p>
<p><a href="https://bitcoin.stackexchange.com/a/107873/140802">Here</a> you can find a table with all standard locking scripts (scriptPubKey) and their corresponding unlocking scripts (scriptSig). The first output type (row) in the given table represents P2PK.</p>
<p>When the input provides the correct scriptSig for the scriptPubKey in the referenced output, it unlocks <strong>the entire amount</strong> locked in the output. So, nowhere in the input is it written how much amount it unlocks, that is, it spends, since it is the entire amount. To see exactly what that amount is, you need to look at the referenced transaction and the referenced output in it.</p>

CC BY-SA 4.0
2023-10-23T09:09:43.380Z
thanks for answer, can you explain more on this : ```To see exactly what that amount is, you need to look at the referenced transaction and the referenced output in it.```
thats my script sig that i specified and i get pubkey of destination on tx_out which can be translated to dest address. but all block explorers have the source destination, how they take it?
i'm trying to use bitcoin protocol to take them, not APIs.
Monte Conte
CC BY-SA 4.0
2023-10-23T10:31:13.270Z
@MonteConte The output contains the amount of satoshis that are locked with the scriptPubKey (say 1,000,000). When the input offers the correct scriptSig, all satoshis (all 1,000,000 satoshis) from the referenced output are unlocked. However, that amount **is not written anywhere in the input**. To see how much is being spent, it is necessary to look at the referenced transaction and output. Block explorers do the same when they show how many bitcoins are spent/taken with some input.
dassd
CC BY-SA 4.0
2023-10-22T20:59:45.263Z
2023-10-22T21:39:14.730Z
2023-10-22T21:39:14.730Z
dassd
<p>so i was parsing the block #496 of bitcoin which contains two transactions, first <code>tx</code> in the list is the reward tx and the second tx contains three inputs and one output. i tried to parse each <code>scriptSig</code> but it's completely different bytes array in compare to the a format like</p>
<p><code>OP_DUP OP_HASH160 &lt;pubKeyHash&gt; OP_EQUALVERIFY OP_CHECKSIG</code></p>
<p>which get used when we want to make a transaction. the first input's <code>scriptSig</code> is a 73 byte data which is equal to (each byte is in it's decimal form):</p>
<pre><code>&lt;&lt;72,48,69,2,33,0,203,44,107,52,106,151,138,184,198,27,24,
                    181,233,57,119,85,203,209,125,110,178,254,0,131,239,50,224,
                    103,250,108,120,90,2,32,108,228,78,97,63,49,217,166,176,81,
                    126,70,243,219,21,118,233,129,44,201,141,21,155,253,175,
                    117,154,80,20,8,27,92,1&gt;&gt;
</code></pre>
<p>my first question is how to parse it, and my next question is, in <code>block</code> response we got only the <code>tx value</code>, is there any way to check how much <code>btc</code> was took from each address?</p>
<p>in block #496 there are 3 input and only 1 total tx value.</p>

CC BY-SA 4.0
2023-10-23T08:31:51.940Z
See [How to parse transaction data](https://bitcoin.stackexchange.com/q/117397/13866)
RedGrittyBrick
<transactions><block><script>
processing input tx in bitcoin's block response and obtain transaction value of each input
Monte Conte
# processing input tx in bitcoin's block response and obtain transaction value of each input

(Asked by: username_0 on 2023-10-22)

so i was parsing the block #496 of bitcoin which contains two transactions, first `tx` in the list is the reward tx and the second tx contains three inputs and one output. i tried to parse each `scriptSig` but it's completely different bytes array in compare to the a format like

`OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG`

which get used when we want to make a transaction. the first input's `scriptSig` is a 73 byte data which is equal to (each byte is in it's decimal form):

```
<<72,48,69,2,33,0,203,44,107,52,106,151,138,184,198,27,24,
                    181,233,57,119,85,203,209,125,110,178,254,0,131,239,50,224,
                    103,250,108,120,90,2,32,108,228,78,97,63,49,217,166,176,81,
                    126,70,243,219,21,118,233,129,44,201,141,21,155,253,175,
                    117,154,80,20,8,27,92,1>>

```

my first question is how to parse it, and my next question is, in `block` response we got only the `tx value`, is there any way to check how much `btc` was took from each address?

in block #496 there are 3 input and only 1 total tx value.

**Tags:** transactions, block, script

> **Comments:**
> **username_1**: See [How to parse transaction data](https://bitcoin.stackexchange.com/q/117397/13866)  

---

## 1 answers

### Answer by username_2 on 2023-10-22. Score: 1 | Accepted answer

All three inputs in the second transaction of [the 496th block](https://mempool.space/block/00000000b0c5a240b2a61d2e75692224efd4cbecdf6eaf4cc2cf477ca7c270e7) consume **P2PK outputs**, not P2PKH outputs. If they were consuming P2PKH outputs, the scriptSig would be of the format you specified. Since these are **P2PK outputs**, then scriptSig contains only `signature`.

[Here](https://bitcoin.stackexchange.com/a/107873/140802) you can find a table with all standard locking scripts (scriptPubKey) and their corresponding unlocking scripts (scriptSig). The first output type (row) in the given table represents P2PK.

When the input provides the correct scriptSig for the scriptPubKey in the referenced output, it unlocks **the entire amount** locked in the output. So, nowhere in the input is it written how much amount it unlocks, that is, it spends, since it is the entire amount. To see exactly what that amount is, you need to look at the referenced transaction and the referenced output in it.

> **Comments:**
> **username_0**: thanks for answer, can you explain more on this : ```To see exactly what that amount is, you need to look at the referenced transaction and the referenced output in it.``` thats my script sig that i specified and i get pubkey of destination on tx_out which can be translated to dest address. but all block explorers have the source destination, how they take it? i'm trying to use bitcoin protocol to take them, not APIs.  
> **username_2**: @username_0 The output contains the amount of satoshis that are locked with the scriptPubKey (say 1,000,000). When the input offers the correct scriptSig, all satoshis (all 1,000,000 satoshis) from the referenced output are unlocked. However, that amount **is not written anywhere in the input**. To see how much is being spent, it is necessary to look at the referenced transaction and output. Block explorers do the same when they show how many bitcoins are spent/taken with some input.  

---

