<p>In the serialization format, the input and output script are introduced by announcing the length of the script.</p>
<p>So that <code>0x19</code> indicates that the length of the scriptPubKey is <code>76a914b58515a69527c806fd404d3d4aa490d56692310b88ac</code> is 25 bytes, and <code>0x8b</code> indicates that <code>483045022100a8205f5879952c6a931affae66519c4a4bda0d912dd166d89e7b671efddfd01e022071a6cf9f3f72c61395ea98c5b23606b9a7d4d5aac97b84a3622beeded49ee40a014104f6209daa9543327eb5b7b2ac0b63089af69abad5b14f4b6cfec5c18279848fa214933decd49c1ca1efe03af8f44b5584b1af8eae6a31a95921bba07e5bf78f90</code> is a 139 bytes.</p>

CC BY-SA 4.0
2023-05-16T14:39:37.290Z
2023-05-16T14:39:37.290Z
Murch
<p>In some educational materials on bitcoin P2PKH transactions, I'll see 2 digits included in the front of what would be considered the ScriptSig. For example, what is the <code>8b</code> in the front of the ScriptSig below representing?</p>
<pre><code>8b483045022100a8205f5879952c6a931affae66519c4a4bda0d912dd166d89e7b671efddfd01e022071a6cf9f3f72c61395ea98c5b23606b9a7d4d5aac97b84a3622beeded49ee40a014104f6209daa9543327eb5b7b2ac0b63089af69abad5b14f4b6cfec5c18279848fa214933decd49c1ca1efe03af8f44b5584b1af8eae6a31a95921bba07e5bf78f90
</code></pre>
<p>The same with the format of the ScriptPubKey...what is the <code>19</code> representing in the front of the ScriptPubKey below?</p>
<pre><code>1976a914b58515a69527c806fd404d3d4aa490d56692310b88ac
</code></pre>

<raw-transaction><p2pkh><input-script><serialization>
What is prepended to the front of a ScriptSig and ScriptPubKey of a P2PKH transction?
jiamijiang
# What is prepended to the front of a ScriptSig and ScriptPubKey of a P2PKH transction?

(Asked by: username_0 on 2023-05-16)

In some educational materials on bitcoin P2PKH transactions, I'll see 2 digits included in the front of what would be considered the ScriptSig. For example, what is the 8b in the front of the ScriptSig below representing?
8b483045022100a8205f5879952c6a931affae66519c4a4bda0d912dd166d89e7b671efddfd01e022071a6cf9f3f72c61395ea98c5b23606b9a7d4d5aac97b84a3622beeded49ee40a014104f6209daa9543327eb5b7b2ac0b63089af69abad5b14f4b6cfec5c18279848fa214933decd49c1ca1efe03af8f44b5584b1af8eae6a31a95921bba07e5bf78f90

The same with the format of the ScriptPubKey...what is the 19 representing in the front of the ScriptPubKey below?
1976a914b58515a69527c806fd404d3d4aa490d56692310b88ac

**Tags:** raw-transaction, p2pkh, input-script, serialization


---

## 1 answers

### Answer by username_1 on 2023-05-16. Score: 3 | Accepted answer

In the serialization format, the input and output script are introduced by announcing the length of the script.

So that `0x19` indicates that the length of the scriptPubKey is `76a914b58515a69527c806fd404d3d4aa490d56692310b88ac` is 25 bytes, and `0x8b` indicates that `483045022100a8205f5879952c6a931affae66519c4a4bda0d912dd166d89e7b671efddfd01e022071a6cf9f3f72c61395ea98c5b23606b9a7d4d5aac97b84a3622beeded49ee40a014104f6209daa9543327eb5b7b2ac0b63089af69abad5b14f4b6cfec5c18279848fa214933decd49c1ca1efe03af8f44b5584b1af8eae6a31a95921bba07e5bf78f90` is a 139 bytes.


---

