<p>It seems that there is no sighash type at the end of the signature data in witness.</p>

CC BY-SA 4.0
2021-05-01T17:04:13.993Z
Thank you for showing me the right direction. I've just missed that I have to add a flag (01) at the end of the signature for P2WPKH. Though blockcypher API documentation is missing that part or maybe hidden somewhere.
vatzcar
CC BY-SA 4.0
2021-05-01T13:40:23.337Z
2021-05-01T13:40:23.337Z
Shigeyuki Azuchi
<p>I have a similar problem, so I am posting my question here, hoping somebody can come to the rescue. I am not a coder, just a simple user of a hardware wallet (Ledger Nano S) , that has served me well for a year or so. Since a couple of days however, I have the isse that Litecoin transactions are not going through. For days they are stuck. On the Blockchair Explorer I see &quot;Transaction status: Waiting for confirmations 0 of 24 Queue: 89 of 93 Est. time to 1 confirmation:  in 2 minutes&quot;. The Queue message changes all the time, but there is never a single confirmation. After I had this with the first transaction I tried it with a couple of other ones, and those are stuck as well. Another observation is that some of the transactions are recognized by one blockchain explorer, eg Blockchair, but not by another, eg Blockcypher. I read that you can &quot;unstuck&quot;a non-confirmed transaction by connecing your HW wallet to Electrum and then re-broadcast the transaction with a higher fee. But these recent transactions did not show up in the Electrum history. So there you have it, I am stuck in limbo. If someone can help me, that would be much appreciated.</p>

CC BY-SA 4.0
2023-03-26T10:10:05.497Z
2023-03-26T10:10:05.497Z
Jock12
<p>I've created a testnet transaction using blockcypher API (<a href="https://api.blockcypher.com/v1/btc/test3/txs/new" rel="nofollow noreferrer">https://api.blockcypher.com/v1/btc/test3/txs/new</a>) and then signed the transaction using the signer (go lang). And then sent signed transaction to blockcypher (<a href="https://api.blockcypher.com/v1/btc/test3/txs/send" rel="nofollow noreferrer">https://api.blockcypher.com/v1/btc/test3/txs/send</a>)</p>
<p>But it's returning error:</p>
<pre><code>Error validating generated transaction: Error running script for input 0 referencing e41a5ceca53f2cd6076f3a100137d6182d0bd567d91e508f4171712b9c67f429 at 0: Script was NOT verified successfully.
</code></pre>
<p>The response I'm receiving:</p>
<pre><code>{
  &quot;errors&quot;: [
    {
      &quot;error&quot;: &quot;Error validating generated transaction: Error running script for input 0 referencing e41a5ceca53f2cd6076f3a100137d6182d0bd567d91e508f4171712b9c67f429 at 0: Script was NOT verified successfully.&quot;
    }
  ],
  &quot;tx&quot;: {
    &quot;block_height&quot;: -1,
    &quot;block_index&quot;: -1,
    &quot;hash&quot;: &quot;c514900d8ed184c37bd795c30f24d56508c40ca5f65c2bf8d724162fd8976353&quot;,
    &quot;addresses&quot;: [
      &quot;tb1qy0jm6vmy2vmndpzzj34z6h6xnelta98d0ukf6s&quot;,
      &quot;tb1qwchaysp9wfukq54yee8uye20f2c5zkpl97elvx&quot;
    ],
    &quot;total&quot;: 3996400,
    &quot;fees&quot;: 3600,
    &quot;size&quot;: 222,
    &quot;vsize&quot;: 141,
    &quot;preference&quot;: &quot;low&quot;,
    &quot;relayed_by&quot;: &quot;2a01:4f8:192:6027::2&quot;,
    &quot;received&quot;: &quot;2021-05-01T09:34:02.926591638Z&quot;,
    &quot;ver&quot;: 1,
    &quot;double_spend&quot;: false,
    &quot;vin_sz&quot;: 1,
    &quot;vout_sz&quot;: 2,
    &quot;confirmations&quot;: 0,
    &quot;inputs&quot;: [
      {
        &quot;prev_hash&quot;: &quot;e41a5ceca53f2cd6076f3a100137d6182d0bd567d91e508f4171712b9c67f429&quot;,
        &quot;output_index&quot;: 0,
        &quot;output_value&quot;: 4000000,
        &quot;sequence&quot;: 4294967295,
        &quot;addresses&quot;: [
          &quot;tb1qwchaysp9wfukq54yee8uye20f2c5zkpl97elvx&quot;
        ],
        &quot;script_type&quot;: &quot;pay-to-witness-pubkey-hash&quot;,
        &quot;age&quot;: 1973087,
        &quot;witness&quot;: [
          &quot;3045022100a4a53cc0eaae807e5c3500af2132a8e575823fc0ff7ceb92de94b739920810ba0220339aa4128967654977b6afb8be9a8897c5e822e2cb5659fe987c106bec44101e&quot;,
          &quot;03f2cfd459014d4f19f36e28dcae329ca4f6b263d4d7c13ca7317a75b1a130f0f6&quot;
        ]
      }
    ],
    &quot;outputs&quot;: [
      {
        &quot;value&quot;: 2000000,
        &quot;script&quot;: &quot;001423e5bd33645337368442946a2d5f469e7ebe94ed&quot;,
        &quot;addresses&quot;: [
          &quot;tb1qy0jm6vmy2vmndpzzj34z6h6xnelta98d0ukf6s&quot;
        ],
        &quot;script_type&quot;: &quot;pay-to-witness-pubkey-hash&quot;
      },
      {
        &quot;value&quot;: 1996400,
        &quot;script&quot;: &quot;0014762fd2402572796052a4ce4fc2654f4ab141583f&quot;,
        &quot;addresses&quot;: [
          &quot;tb1qwchaysp9wfukq54yee8uye20f2c5zkpl97elvx&quot;
        ],
        &quot;script_type&quot;: &quot;pay-to-witness-pubkey-hash&quot;
      }
    ]
  },
  &quot;tosign&quot;: [
    &quot;&quot;
  ]
}
</code></pre>
<p>Any help would be greatly appreciated. Thank you all.</p>

<raw-transaction><transaction-verification><blockcypher>
Error validating a transaction with blockcypher
vatzcar
# Error validating a transaction with blockcypher

(Asked by: username_0 on 2021-05-01)

I've created a testnet transaction using blockcypher API (<https://api.blockcypher.com/v1/btc/test3/txs/new>) and then signed the transaction using the signer (go lang). And then sent signed transaction to blockcypher (<https://api.blockcypher.com/v1/btc/test3/txs/send>)

But it's returning error:

```
Error validating generated transaction: Error running script for input 0 referencing e41a5ceca53f2cd6076f3a100137d6182d0bd567d91e508f4171712b9c67f429 at 0: Script was NOT verified successfully.

```

The response I'm receiving:

```
{
  "errors": [
    {
      "error": "Error validating generated transaction: Error running script for input 0 referencing e41a5ceca53f2cd6076f3a100137d6182d0bd567d91e508f4171712b9c67f429 at 0: Script was NOT verified successfully."
    }
  ],
  "tx": {
    "block_height": -1,
    "block_index": -1,
    "hash": "c514900d8ed184c37bd795c30f24d56508c40ca5f65c2bf8d724162fd8976353",
    "addresses": [
      "tb1qy0jm6vmy2vmndpzzj34z6h6xnelta98d0ukf6s",
      "tb1qwchaysp9wfukq54yee8uye20f2c5zkpl97elvx"
    ],
    "total": 3996400,
    "fees": 3600,
    "size": 222,
    "vsize": 141,
    "preference": "low",
    "relayed_by": "2a01:4f8:192:6027::2",
    "received": "2021-05-01T09:34:02.926591638Z",
    "ver": 1,
    "double_spend": false,
    "vin_sz": 1,
    "vout_sz": 2,
    "confirmations": 0,
    "inputs": [
      {
        "prev_hash": "e41a5ceca53f2cd6076f3a100137d6182d0bd567d91e508f4171712b9c67f429",
        "output_index": 0,
        "output_value": 4000000,
        "sequence": 4294967295,
        "addresses": [
          "tb1qwchaysp9wfukq54yee8uye20f2c5zkpl97elvx"
        ],
        "script_type": "pay-to-witness-pubkey-hash",
        "age": 1973087,
        "witness": [
          "3045022100a4a53cc0eaae807e5c3500af2132a8e575823fc0ff7ceb92de94b739920810ba0220339aa4128967654977b6afb8be9a8897c5e822e2cb5659fe987c106bec44101e",
          "03f2cfd459014d4f19f36e28dcae329ca4f6b263d4d7c13ca7317a75b1a130f0f6"
        ]
      }
    ],
    "outputs": [
      {
        "value": 2000000,
        "script": "001423e5bd33645337368442946a2d5f469e7ebe94ed",
        "addresses": [
          "tb1qy0jm6vmy2vmndpzzj34z6h6xnelta98d0ukf6s"
        ],
        "script_type": "pay-to-witness-pubkey-hash"
      },
      {
        "value": 1996400,
        "script": "0014762fd2402572796052a4ce4fc2654f4ab141583f",
        "addresses": [
          "tb1qwchaysp9wfukq54yee8uye20f2c5zkpl97elvx"
        ],
        "script_type": "pay-to-witness-pubkey-hash"
      }
    ]
  },
  "tosign": [
    ""
  ]
}

```

Any help would be greatly appreciated. Thank you all.

**Tags:** raw-transaction, transaction-verification, blockcypher


---

## 2 answers

### Answer by username_1 on 2021-05-01. Score: 0 | Accepted answer

It seems that there is no sighash type at the end of the signature data in witness.

> **Comments:**
> **username_0**: Thank you for showing me the right direction. I've just missed that I have to add a flag (01) at the end of the signature for P2WPKH. Though blockcypher API documentation is missing that part or maybe hidden somewhere.  

---

### Answer by username_2 on 2023-03-26. Score: 0

I have a similar problem, so I am posting my question here, hoping somebody can come to the rescue. I am not a coder, just a simple user of a hardware wallet (Ledger Nano S) , that has served me well for a year or so. Since a couple of days however, I have the isse that Litecoin transactions are not going through. For days they are stuck. On the Blockchair Explorer I see "Transaction status: Waiting for confirmations 0 of 24 Queue: 89 of 93 Est. time to 1 confirmation: in 2 minutes". The Queue message changes all the time, but there is never a single confirmation. After I had this with the first transaction I tried it with a couple of other ones, and those are stuck as well. Another observation is that some of the transactions are recognized by one blockchain explorer, eg Blockchair, but not by another, eg Blockcypher. I read that you can "unstuck"a non-confirmed transaction by connecing your HW wallet to Electrum and then re-broadcast the transaction with a higher fee. But these recent transactions did not show up in the Electrum history. So there you have it, I am stuck in limbo. If someone can help me, that would be much appreciated.


---

