<p>You are building an incorrect scriptSig.</p>

<p>Notice that, if you check the <code>scriptSig</code> of every input from the transaction you provided, it looks like:</p>

<pre><code>76a914321d6a0077ddadfcce3d68d302d866ce81405eba88ac
</code></pre>

<p>Which has the following structure:</p>

<pre><code>OP_DUP OP_HASH160 &lt;20-byte-hash&gt; OP_EQUALVERIFY OP_CHECKSIG
</code></pre>

<p>However, this is not what is expected to be found in a <code>scriptSig</code>, but what will be expected in the <code>scriptPubKey</code> field.</p>

<p>What you have to do is provide the correct script in the scriptSig field of each input of the transaction, that would correspond to the signature of the transaction if you are creating a <strong>P2PKH</strong> transaction, or the script that matches with the script-hash from the UTXO you are spending, in case you are building a <strong>P2SH</strong> transaction.</p>

CC BY-SA 3.0
2017-03-14T17:15:09.857Z
I did wonder where the answer went :) . Thanks for the answer. Do you have any suggestions of site's that might be able do make this process easier? coinb.in doesn't seem to have the options I need.
James Jackson
CC BY-SA 3.0
2017-03-14T17:20:08.283Z
I messed up a little with the first answer, since the scripts where like switched and something does not seems right. I preferred to refrase it :P. What are you trying to do?
sr_gi
CC BY-SA 3.0
2017-03-14T17:48:57.727Z
I mean, what do you mean with "this process"?
sr_gi
CC BY-SA 3.0
2017-03-15T16:30:29.657Z
The process of creating the correct transaction. I was using coinb.in because it seemed like it would simplify the process but it's "transaction" generator doesn't seem to do what it needs to do to correctly make this transaction.
James Jackson
CC BY-SA 3.0
2017-03-15T21:22:35.610Z
Well, if you need to create a transaction you will need to manage the keys associated with the Bitcoin addresses where the bitcoins are "stored". In order to sign the transactions in P2PKH transactions or to create the proper scripts in P2SH. What I think is that when you used the coinb.in tools, you forgot to sign the transaction (I'm not used to the tool, so I can be wrong). In conclusion, you will need something more similar to a wallet.
sr_gi
CC BY-SA 3.0
2017-03-16T17:20:28.430Z
Think it's coinb.in not doing what I wanted. I was trying to avoid a wallet but oh well. (Luckily, blockchain.info stopped broadcasting my transaction to allow me me to spend it again.) Thanks for your help.
James Jackson
CC BY-SA 3.0
2017-03-16T19:08:14.123Z
Well, you can allways do it by yourself using one of the multiple libraries available (depending on the programing language you prefer), the fact is that if you need to sign transactions, you need to use your private key, and relaying in some website tool to do so, by importing the key is not the best choice when money comes into play (at least from my point of view).
sr_gi
CC BY-SA 3.0
2017-03-19T07:42:27.863Z
can you give us a clear example of scriptSig, and scriptPubKey fields.
Because, I am getting the same error, although i am creating a raw transaction using python.
kaliu
CC BY-SA 3.0
2017-03-20T16:35:41.797Z
@ kaliu For a traditional P2PKH transaction, the structure will be: scriptSig = <signature><pubKey>, and the scriptPubKey will be: OP_DUP OP_HASH160 <hash160_of_pubkey> <OP_EQUALVERIFY><OP_CHECKSIG>. Take into account that the data pushes and the hash_type are not included in this structure, but they are in the serialized representation of the script.  If you need an specific example, I think it's better to ask it as a question, since there is not much space in the comment section, nor correct format to correctly respond it.
sr_gi
CC BY-SA 3.0
2017-03-14T16:41:41.803Z
2017-03-14T17:06:18.600Z
2017-03-14T17:06:18.600Z
sr_gi
<p>I sent a transaction with far too low fee and it's stuck in mempool. </p>

<p>I'm trying to do a double-spend with a higher fee without any luck.</p>

<p>My wallet: <a href="https://blockchain.info/address/15Zz2KP5iA7oVarmtmBvb9ZHUmQaSFL9M8" rel="nofollow noreferrer">15Zz2KP5iA7oVarmtmBvb9ZHUmQaSFL9M8</a></p>

<p>Unconfirmed transaction: <a href="https://blockchain.info/tx/0b0177688485922027b336c24e765fdea8dc03d2ad79f87019705f2ca9fb970a" rel="nofollow noreferrer">0b0177688485922027b336c24e765fdea8dc03d2ad79f87019705f2ca9fb970a</a></p>

<p>I'm using <a href="https://coinb.in" rel="nofollow noreferrer">coinb.in</a> to create, sign and broadcast transaction but I get <strong>Error: 64: scriptsig-not-pushonly</strong>. </p>

<p>The transaction seems to be valid when I <a href="https://coinb.in/?verify=01000000133b832623dad2c74a50cef826276bda4231b05a571b7f176153f83bdd730a192d5d0500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acfffffffff148277ada1bbca71ea260455c89f7a88e99ee59176b93051d7b0cdaee10ffbf7a0500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff0a4f47a8e4877f0e1e35fa80357a5ce0801b85b5666eaca86a6c96819f5f922a6d0500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acfffffffff55c81903c10419e792c8ba3af22e6652a9a092cd8e399136bba3a94d106ded2b70500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff0de6fa290675d19a0a71b6fddf7fe76366de58dd546033fdf254ca5d020735846e0500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff7b626b5eb746b52a5961b874113c3473e655f88247f59626b5dfa08f77d2696ada0500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffffd5b78c1ba5585792d1bdf3f075dd4bbb73478ffd8875055312486dbd729805b8350600001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff197d6a88f3926b3b40f4e6851d54861552c6466634bddad8e66bf07666f95ee1b90500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff8b1f536486437830dfb08e1d20361260be5d105acc6a359f93d09ac11b48261f0b0600001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff30ab06d0b44e9f63d26a0f9a51d9ec7265869a2e540bd352f54334da023ed8de030600001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff1ee7c1c7b4ab64bf188a0f7715a41a9ad223ee1117559129e560bc563635624f520500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff908dc80f9520455154b161bc86eecedfc9c8f5a15c5a5afaebd72b1a4164c3fb960500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff4c484de3a86b67f3d026b6f47eb874c6df98c8f585e54e1d62769ae73ec376beaf0500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffffc7a9da2cf19bac15e2d321e4f389c8c374dc5183c36630e8d87abab911729070130500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff98aadd0050e4c948a43abc4187b553890e62fa2e76a2a2be51b74994c457d22e0b0600001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffffe68a99289f3603af02f480c8926c34eb58f74a6081c9e6a0090f63bd39dd6a0a5e0500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff7aa0e098c6056a85925291a8cfd5c85c8e41e1dd79c17200d783df7c40d53e8e4e0600001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffffc633fd35c92e32b31b284de020f50cb5e82e520d0434ef520f42cb6aab1f2201a60500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff2b0ee1435daaa1973184ac464cd084f774c6502d265457d57917e2a44d5710f5060500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff01a0f019000000000017a91470975ba2f6085c1532546ef5c57d4a8573a8e1d68700000000" rel="nofollow noreferrer">verify</a> it.</p>

<p>Can anyone point my in the right direction for this?</p>

CC BY-SA 3.0
2017-03-14T17:05:25.800Z
I've added an answer to the specific problem, however, I do not recommend to try to double spend the transaction, since I don't think it will work. If first transaction is already in most of the nodes mempool, the new one will be treated as a double spend and be rejected. The best you can do is either wait, or create a transaction spending from you first one (the one with low fees) and adding a higher fee that new transaction (using what is called Child pays for Parent).
sr_gi
<unconfirmed-transactions><raw-transaction>
How to correctly sign a transaction? Error: 64: scriptsig-not-pushonly
James Jackson
# How to correctly sign a transaction? Error: 64: scriptsig-not-pushonly

(Asked by: username_0 on 2017-03-14)

I sent a transaction with far too low fee and it's stuck in mempool.

I'm trying to do a double-spend with a higher fee without any luck.

My wallet: [15Zz2KP5iA7oVarmtmBvb9ZHUmQaSFL9M8](https://blockchain.info/address/15Zz2KP5iA7oVarmtmBvb9ZHUmQaSFL9M8)

Unconfirmed transaction: [0b0177688485922027b336c24e765fdea8dc03d2ad79f87019705f2ca9fb970a](https://blockchain.info/tx/0b0177688485922027b336c24e765fdea8dc03d2ad79f87019705f2ca9fb970a)

I'm using [coinb.in](https://coinb.in) to create, sign and broadcast transaction but I get **Error: 64: scriptsig-not-pushonly**.

The transaction seems to be valid when I [verify](https://coinb.in/?verify=01000000133b832623dad2c74a50cef826276bda4231b05a571b7f176153f83bdd730a192d5d0500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acfffffffff148277ada1bbca71ea260455c89f7a88e99ee59176b93051d7b0cdaee10ffbf7a0500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff0a4f47a8e4877f0e1e35fa80357a5ce0801b85b5666eaca86a6c96819f5f922a6d0500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acfffffffff55c81903c10419e792c8ba3af22e6652a9a092cd8e399136bba3a94d106ded2b70500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff0de6fa290675d19a0a71b6fddf7fe76366de58dd546033fdf254ca5d020735846e0500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff7b626b5eb746b52a5961b874113c3473e655f88247f59626b5dfa08f77d2696ada0500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffffd5b78c1ba5585792d1bdf3f075dd4bbb73478ffd8875055312486dbd729805b8350600001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff197d6a88f3926b3b40f4e6851d54861552c6466634bddad8e66bf07666f95ee1b90500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff8b1f536486437830dfb08e1d20361260be5d105acc6a359f93d09ac11b48261f0b0600001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff30ab06d0b44e9f63d26a0f9a51d9ec7265869a2e540bd352f54334da023ed8de030600001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff1ee7c1c7b4ab64bf188a0f7715a41a9ad223ee1117559129e560bc563635624f520500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff908dc80f9520455154b161bc86eecedfc9c8f5a15c5a5afaebd72b1a4164c3fb960500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff4c484de3a86b67f3d026b6f47eb874c6df98c8f585e54e1d62769ae73ec376beaf0500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffffc7a9da2cf19bac15e2d321e4f389c8c374dc5183c36630e8d87abab911729070130500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff98aadd0050e4c948a43abc4187b553890e62fa2e76a2a2be51b74994c457d22e0b0600001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffffe68a99289f3603af02f480c8926c34eb58f74a6081c9e6a0090f63bd39dd6a0a5e0500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff7aa0e098c6056a85925291a8cfd5c85c8e41e1dd79c17200d783df7c40d53e8e4e0600001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffffc633fd35c92e32b31b284de020f50cb5e82e520d0434ef520f42cb6aab1f2201a60500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff2b0ee1435daaa1973184ac464cd084f774c6502d265457d57917e2a44d5710f5060500001976a914321d6a0077ddadfcce3d68d302d866ce81405eba88acffffffff01a0f019000000000017a91470975ba2f6085c1532546ef5c57d4a8573a8e1d68700000000) it.

Can anyone point my in the right direction for this?

**Tags:** unconfirmed-transactions, raw-transaction

> **Comments:**
> **username_1**: I've added an answer to the specific problem, however, I do not recommend to try to double spend the transaction, since I don't think it will work. If first transaction is already in most of the nodes mempool, the new one will be treated as a double spend and be rejected. The best you can do is either wait, or create a transaction spending from you first one (the one with low fees) and adding a higher fee that new transaction (using what is called Child pays for Parent).  

---

## 1 answers

### Answer by username_1 on 2017-03-14. Score: 0 | Accepted answer

You are building an incorrect scriptSig.

Notice that, if you check the `scriptSig` of every input from the transaction you provided, it looks like:

```
76a914321d6a0077ddadfcce3d68d302d866ce81405eba88ac

```

Which has the following structure:

```
OP_DUP OP_HASH160 <20-byte-hash> OP_EQUALVERIFY OP_CHECKSIG

```

However, this is not what is expected to be found in a `scriptSig`, but what will be expected in the `scriptPubKey` field.

What you have to do is provide the correct script in the scriptSig field of each input of the transaction, that would correspond to the signature of the transaction if you are creating a **P2PKH** transaction, or the script that matches with the script-hash from the UTXO you are spending, in case you are building a **P2SH** transaction.

> **Comments:**
> **username_0**: I did wonder where the answer went :) . Thanks for the answer. Do you have any suggestions of site's that might be able do make this process easier? coinb.in doesn't seem to have the options I need.  
> **username_1**: I messed up a little with the first answer, since the scripts where like switched and something does not seems right. I preferred to refrase it :P. What are you trying to do?  
> **username_1**: I mean, what do you mean with "this process"?  
> **username_0**: The process of creating the correct transaction. I was using coinb.in because it seemed like it would simplify the process but it's "transaction" generator doesn't seem to do what it needs to do to correctly make this transaction.  
> **username_1**: Well, if you need to create a transaction you will need to manage the keys associated with the Bitcoin addresses where the bitcoins are "stored". In order to sign the transactions in P2PKH transactions or to create the proper scripts in P2SH. What I think is that when you used the coinb.in tools, you forgot to sign the transaction (I'm not used to the tool, so I can be wrong). In conclusion, you will need something more similar to a wallet.  
> **username_0**: Think it's coinb.in not doing what I wanted. I was trying to avoid a wallet but oh well. (Luckily, blockchain.info stopped broadcasting my transaction to allow me me to spend it again.) Thanks for your help.  
> **username_1**: Well, you can allways do it by yourself using one of the multiple libraries available (depending on the programing language you prefer), the fact is that if you need to sign transactions, you need to use your private key, and relaying in some website tool to do so, by importing the key is not the best choice when money comes into play (at least from my point of view).  
> **username_2**: can you give us a clear example of scriptSig, and scriptPubKey fields. Because, I am getting the same error, although i am creating a raw transaction using python.  
> **username_1**: @ username_2 For a traditional P2PKH transaction, the structure will be: scriptSig = <signature><pubKey>, and the scriptPubKey will be: OP_DUP OP_HASH160 <hash160_of_pubkey> <OP_EQUALVERIFY><OP_CHECKSIG>. Take into account that the data pushes and the hash_type are not included in this structure, but they are in the serialized representation of the script.  If you need an specific example, I think it's better to ask it as a question, since there is not much space in the comment section, nor correct format to correctly respond it.  

---

