Author

Topic: code -26 mandatory script verify flag failed (Read 211 times)

legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
August 17, 2021, 03:22:07 AM
#11
how can i upload images here ? i'll  upload the images

Since your rank is newbie, you can't post image directly. However, you can upload the image and share the link instead.

-snip-
 when i go to settings and private key i can sweep but when i type my private key the sweep button also goes grey and i cant procceed.
Do not do that while using a watch-only wallet, because the entire balance of the address derived from the swept private key will be sent to that wallet.
In your case, use the import option in the new wallet creation window.

OP, if you're confused, check this guide https://bitcoinelectrum.com/importing-your-private-keys-into-electrum/.
HCP
legendary
Activity: 2086
Merit: 4361
it looks exactly like that, but when i type in the private key in electrum  the "next" button becomes grey and i cant click on it anymore.
it only accept the public key .
That only happens when there's at least one wrong character in the private key.
It has a checksum so that if you've typed it wrong, the inputted private key will be invalid. With that, look for possible typos.
By the way, it's case-sensitive.
This. You need to double check every character you are typing in. You also might want to check that the private key is actually in one of the following formats:
For private keys associated with uncompressed public keys, they are 51 characters and always start with the number 5 on mainnet (9 on testnet). Private keys associated with compressed public keys are 52 characters and start with a capital L or K on mainnet (c on testnet).

refer: https://en.bitcoin.it/wiki/Private_key#Base58_Wallet_Import_format


What character does the private key start with? 5, L or K? or does it start with something completely different? Huh

As mentioned earlier: DO NOT post your full private key anywhere or send it to anyone!
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
-snip-
 when i go to settings and private key i can sweep but when i type my private key the sweep button also goes grey and i cant procceed.
Do not do that while using a watch-only wallet, because the entire balance of the address derived from the swept private key will be sent to that wallet.
In your case, use the import option in the new wallet creation window.

it looks exactly like that, but when i type in the private key in electrum  the "next" button becomes grey and i cant click on it anymore.
it only accept the public key .
That only happens when there's at least one wrong character in the private key.
It has a checksum so that if you've typed it wrong, the inputted private key will be invalid. With that, look for possible typos.
By the way, it's case-sensitive.

But based from the blurred image in the appstore and ETF's post, it looks like it's longer than a "WIF PrvKey" which is what Electrum supports.
Maybe it's in a different format? Can you tell the first character and total number of characters? (please do not share the actual prvKey to anyone)
And also, the lock icon beside it seems important; Is it displayed as locked/unlocked in your app?
newbie
Activity: 3
Merit: 1
So i just downloaded electrum but in the installing proces when i get to the wallet import i cant type the private key?
when i type the public key i can still click  the next button but when i also type the private key it goes grey and i cant continue.
so i just entered the public key and proceeded to the wallet and it says that its a watching only wallet and i cant transfer anything..

What you should type is the private key. I don't have iOS device, so i can't help you directly, but you should find this menu/page which contain the private key. On the example image, the private key is blurred, but on your iOS device you should see it without blur.

https://is5-ssl.mzstatic.com/image/thumb/Purple123/v4/9c/4d/db/9c4ddbbd-fd57-b8ba-4a5f-a593477a96de/pr_source.png/300x0w.jpg
Source: https://apps.apple.com/us/app/bitwallet/id777634714


 it looks exactly like that, but when i type in the private key in electrum  the "next" button becomes grey and i cant click on it anymore.
it only accept the public key .
how can i upload images here ? i'll  upload the images
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
So i just downloaded electrum but in the installing proces when i get to the wallet import i cant type the private key?
when i type the public key i can still click  the next button but when i also type the private key it goes grey and i cant continue.
so i just entered the public key and proceeded to the wallet and it says that its a watching only wallet and i cant transfer anything..

What you should type is the private key. I don't have iOS device, so i can't help you directly, but you should find this menu/page which contain the private key. On the example image, the private key is blurred, but on your iOS device you should see it without blur.


Source: https://apps.apple.com/us/app/bitwallet/id777634714
newbie
Activity: 3
Merit: 1
hello everybody,
First off all thank you very much for your help.
the App that you tagged is correct BitWallet, but because its a mobile app i cant see the hex or enter any other page then the window that shows the error code.
 So i just downloaded electrum but in the installing proces when i get to the wallet import i cant type the private key?
when i type the public key i can still click  the next button but when i also type the private key it goes grey and i cant continue.
so i just entered the public key and proceeded to the wallet and it says that its a watching only wallet and i cant transfer anything..
 when i go to settings and private key i can sweep but when i type my private key the sweep button also goes grey and i cant procceed.
this is the public adress ; 1FYMZEHnszCHKTBdFZ2DLrUuk3dGwYKQxh
if anyone can help me further we can connect trough email and i can send all the screenshots.
legendary
Activity: 3472
Merit: 10611
"Mandatory script verify flag failed" error can be thrown for many different reasons, when it is followed by more information (that is the "public key is neither compressed or uncompressed" string) it narrows down the reason to one or some smaller number of reasons. In this case it has nothing to do with hashing because the evaluator either didn't hash anything or has already passed it. The error is for evaluating the public key.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
According to https://bitcoin.stackexchange.com/a/49911/112589:

Quote
The hash of the public key must match a certain value. (A failure here means you have the wrong key, or no key.)

Since you mentioned you recovered your wallet, perhaps you are trying to import an old transaction that was valid for some addresses, and maybe the recovery gave you a different set of addresses  Huh

That's the only way I can explain why it would be complaining about a "wrong key" error.

Or maybe (more plausible) you only recovered the private keys of the wallet but whatever you used to recover them did not contain the public keys?
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
If you want to share the "signed raw transaction" hex, it will be easy to tell what's wrong with the transaction just by looking at the inputs.
Note: that will enable the public to see what address(es) you're trying to spend from and to; as well as the inputs' public key. But they wont be able to spend from it.

Like this for example: Issue: mandatory-script-verify-flag-failed (Public key is neither compressed or uncompressed) #21098
Where the inputs' ScriptSig doesn't contain the public key, the signature is followed by 0x00 instead of the pubic key.

Could anybody please help me understand what the problem exactly is and if there is  a solution to transfer my funds?
-snip-
Seems like your wallet is having trouble constructing the transaction correctly.
If you can export the address(es)' private key(s) and import it to a reputable wallet, you can try to create the transaction there.
According to the IOS link of the app (is this the right app?), it's a non-custodial wallet and the private key is written in plain sight in one of the screenshot.

If it is.
You can download Electrum for PC (electrum.org), verify its signature (instructions) for safety:
  • Install/Launch it and during wallet creation, use the option: "Import bitcoin address or private key".
  • Paste the private key(s) of your address(es) and create the wallet, one prvKey per line if there's more than one.
  • Wait for a few minutes to download the blockheaders and the balance should update.
  • Then you can create a new transaction in the send tab.

Please take your time to verify your downloaded electrum's signature and make sure that the PC where you'll install it is secure.
If the amount is quite high, you can use the "cold-storage" option which requires a few more steps.
legendary
Activity: 3472
Merit: 10611
The only time I could find when you get the SCRIPT_ERR_PUBKEYTYPE error is when
- The starting byte ins unknown
- The length is invalid
- The pubkey is using hybrid encoding
https://github.com/bitcoin/bitcoin/blob/a3791da0e80ab35e862989373f033e5be4dff26b/src/script/interpreter.cpp#L63-L83

Could you share the address you are trying to spend from or the transaction you sent that was rejected?

the wallet is on a BitWallet ios mobile app .
You should never use unpopular wallets.
newbie
Activity: 3
Merit: 1
Hello there

 Now the thing is I recently recovered my btc wallet that i bought a long time ago anno 2012 and im trying to transfer my funds in to my current Binance account.
But each time i try to transfer i  keep getting this message; code -26, Error:mandatory-script-verify-flag-failed ( public key is neither compressed or uncompressed)

Could anybody please help me understand what the problem exactly is and if there is  a solution to transfer my funds?
i read on other forums that i should download bitcoin core but unfortunately im not highly skilled in blockchain and crypto programming.
the wallet is on a BitWallet ios mobile app .


contact me through Pm if you can help me kind regards
Jump to: