Electron-cash: transaction rejected by network rules" 16 mandatory script verify flag failed - signature must be zero for failed check-(multi)sig operation

Created on 2 Aug 2017  Â·  77Comments  Â·  Source: Electron-Cash/Electron-Cash

after imported an electrum btc wallet with 2fa into electron cash wallet

and sending bitcoincash coins to another electron cash address.

the bitcoin cash coins are correctly seen but im unable to send them

Most helpful comment

Line 730 of lib/transaction.py should be changed:

scriptCode = push_script(self.get_preimage_script(txin))

to

preimage_script = self.get_preimage_script(txin)
scriptCode = var_int(len(preimage_script)/2) + preimage_script

This will allow multisig redeemscripts over 75 bytes to be properly signed. (PUSHOPs and VARINTS are the same bytes up to lengths of 75, then PUSHOPS change to multibytes where VARINT can go up to 252 before going multibyte.)

All 77 comments

i have the exact same issue. see my screenshot below:
http://imgur.com/a/KR8cV

here is what I've tried so far( none of it works):

  1. I restored and created a new 2fa wallet with seed. disabled the 2fa. it did not ask for the 2fa but still get same error message after i tried to send coins to another address.
  2. i manually connected to a bunch of different electron cash servers. still get same error message.

please fix this asap..please!

I am also experiencing this problem.

I noticed that when you import the seed it creates 3xx addresses, so maybe not obeying the enable/disable 2FA?

Maybe this is separate but would be nice if you could atleast send the coins you have in a 2FA...

Please fix this ASAP.

having the same problem transaction rejected by network rules" 16 mandatory script verify flag failed - signature must be zero for failed check-(multi)sig operation transaction rejected by network rules"my wallet is also 2fa

getting this problem too
PLEASE WARN PEOPLE ABOUT THIS! :eagle:

can it be solved or not?

this is not dieselgate - it's software, of course it can be fixed

from reddit: "I have to see if non hardware multisigs will be supported on Electrum Cash. Let's let Kyuupichan verify this." https://www.reddit.com/r/btc/comments/6pnv29/i_will_be_maintaining_the_electrum_cash_wallet_ama/

before you confirm that you have the same issue, please make sure that you have disabled 2FA, and that you are connected to a BCC server, and not a BTC server.

OK, I guess I understand why this is broken.
The problem is with b3081759c250c0f17f758074c27485551f55f7b8
Electron Cash uses Electrum's segwit code for the serialization of transaction preimages.
The problem is that support for segwit+multisig has never been added to the original Electrum code.

what does that mean?we can withdraw our bcc from elctron cash wallet or not?

@dare2win2 no you cannot, it is broken.
this is what happens when people copy code without understanding what it does.
they have to fix it now..

hi @ecdsa thanks for your helpful input-- does this suggest the coins are only _temporarily lost_

@alsaine The coins are not lost. The software is just incapable of creating a transaction spending them, for now.

thanks @SomberNight
peace of mind for us worried noobs :+1:

[23:33] kyuupichan: If the code base were better. I would like to help but I don't have much time. And I'm away for 2 weeks now. It will solve itself.

@kyuupichan
@fyookball

I might be out of context...
I just caught onto the fact that MUtibit HD is really outdated and doesn't have support anymore. I ran into a nice tutorial they made 5 days ago about transitioning to an Electrum wallet, Now, I am wondering how to transition safely to make sure I don't lose my Bitcoin cash (BCC). I just bought more before the fork. I have my seed words.

Here is what I was thinking trying:

Upload my seeds to my new electrum wallet.

Transfer the Bitcoins (BTC) to a different Electrum wallet ( on another computer)

Then use my MULtibit HD seeds ( same as my new electrum right?) to upload my BCC on the Bitcoin cash wallet.

Thanks a million for any help, tips or inputs.

QUESTION: Should I even bother uploading my seeds from Multibit to Electrum or I could just transfer directly my BTC to a different Electrum wallet ?

Can one not construct the multi-sig transaction using Bitcoin ABC? If so, how does one extract the two necessary private keys from the 2-of-3 addresses that Electrum uses?

hi @adamkrellenstein

you might want to read this
https://bitcoin.stackexchange.com/questions/57441/how-to-transfer-bitcoin-cash-from-a-multi-sig-vault

however I am not technically proficient enough to instruct you further

It happened to me too. No 2FA. I tried to send a tiny amount - 0.9mBCC and got the same error about network rules 16. I didn't open a multisig wallet though. I guess I will have to wait for the coders to patch it.

OK, Looks we lost our BCC because we tried importing the private key before the Electron Cash Wallet was fully synced. Now when we try to sweep the private key we get an error similar to the one in this thread.

But I did it in the last few minutes. I can still see my balance of the princely sum of 1.23319BCC. I only transferred a small amount as a test. But I still get the same error, mandatory script verify flag failed (signature hash type missing or not understood)...

So if I transfer the rest in a day or two, are you suggesting @adsactly that it might work? Or do we need to create a new wallet from seed after that time?

Another thing. All the guides I have read say to create a new wallet in electrum, transfer BTC to that, then use the seed from the old, now empty, wallet. I tried this both within electrum and using the seed fell a Blockchain wallet. All it does is display a zero balance of BCC and the transactions that led to that (emptying). But when Intried it from an electrum wallet with a tiny balance, the same balance appeared in electron, while the original BTC balance was unaffected. Except that I cannot transact in BCC as above.

Our Transaction is still unconfirmed. Is there any way anybody can manually verify a transaction?

https://github.com/fyookball/electrum/commit/b3081759c250c0f17f758074c27485551f55f7b8#commitcomment-23438589

I found the fix, if anyone wants to Pull Request it or make some builds.

@ecdsa (You should prolly merge this fix into Electrum as well)

@fyookball

Line 730 of lib/transaction.py should be changed:

scriptCode = push_script(self.get_preimage_script(txin))

to

preimage_script = self.get_preimage_script(txin)
scriptCode = var_int(len(preimage_script)/2) + preimage_script

This will allow multisig redeemscripts over 75 bytes to be properly signed. (PUSHOPs and VARINTS are the same bytes up to lengths of 75, then PUSHOPS change to multibytes where VARINT can go up to 252 before going multibyte.)

@dabura667

This did not fix anything for me; error is still occurring, coins still unmovable.

As I understand this, if you were using 2FA on Electrum, you are not able to send BCH coins using the same wallet in Electron Cash. Is that correct?

The 2FA support in Electrum seems to be reliant on the services provided by trustedcoin.com. I have not seen any communication from trustedcoin.com that they are, or will, support Bitcoin Cash.

Oops, len() / 2

@dabura667

You're a life saver! Or at least a coin saver. :-) Can confirm this works fine; transaction sent and waiting on confirmations.

@SiriusStarr great news. thank you @dabura667

@adsactly your tx cf057c3d642207b90ba56a513b86e307f59931480fcdfd611782e5e153e993be has now been included in a block. I am assuming your issues are resolved.

@staffnsnake please can you check you are on the right chain. See https://steemit.com/bitcoin/@electroncash/electron-cash-how-to-check-you-are-on-the-bitcoin-cash-chain

As I understand this, if you were using 2FA on Electrum, you are not able to send BCH coins using the same wallet in Electron Cash. Is that correct?

The 2FA support in Electrum seems to be reliant on the services provided by trustedcoin.com. I have not seen any communication from trustedcoin.com that they are, or will, support Bitcoin Cash.

My understanding is that if you "recover" your 2fa Electrum (Cash) wallet from the seed, then you no longer need to rely on trustedcoin.com to sign the tx---you have two keys locally.

So if I take an Electrum 2fa wallet and use its seed to recover it into Electrum Cash with the above patch, will I be able to send BCH?

@adamkrellenstein

Correct, that is what I did, and it has worked fine and been confirmed.

@dabura667 thanks!

@adamkrellenstein @SiriusStarr yes we've been receiving reports that this works correctly

I have merged this in, can someone please test it?
@ecdsa , you guys are the pros. Lmk when you wanna take over the show here.

How do we test it?

would this explain why I can't sign a transaction or view seed(pin error) on the android apk version?

How do we get this fixed? I can't send anything!

@therealninza i dont have any problem viewing the seed on android. Signing a tx doesnt work for the moment, thats already a reported issue.

To test the fix you need to clone the repo again (or just git pull) and run again from source.

I have zero programming knowledge, so I have no idea what that means.

@ronosa then you can wait for the next release or try the workaround mentioned above.

It seems to be working now.
I was able to send payment.
Here is what I did:
I compiled the new merged source code in Ubuntu.
remember to select the correct server: bcc.arihanc.com
don't use electrum server.
recover my 2fa wallet from seed.
disabled 2fa.
send payment. error is now gone.
unfortunately, it seems to take forever to get payment to be verified.
that's another issue i need to raise.

Am I able to do this through the github desktop? I have it open in github desktop but don't know what to do now :(

This affect me too
Please fix in the next release

I recieve a pin error when trying to decrypt. Even after changing the pin.

K

On Aug 2, 2017 5:20 PM, "fyookball" notifications@github.com wrote:

@therealninza https://github.com/therealninza i dont have any problem
viewing the seed on android. Signing a tx doesnt work for the moment, thats
already a reported issue.

To test the fix you need to clone the repo again (or just git pull) and
run again from source.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/fyookball/electrum/issues/6#issuecomment-319833427,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AP20UnI4QRmWWrjHVvuqZlxWSJ0sOyt3ks5sURI8gaJpZM4Oqo_d
.

@ronosa command line is not that hard...

git clone http://github.com/fyookball/electrum.git

@charleshsu168 great! Sounds like its working and great work @dabura667 . i am going to close this issue now.

@ronosa please open another ticket if you want help with git.
@therealninza please open another ticket for the pin issue.

Note this fix only work as follows:
compiled the new merged source code in Ubuntu.
remember to select the correct server: bcc.arihanc.com
don't use electrum server.
recover my 2fa wallet from seed.
disabled 2fa.
send payment. error is now gone.

if 2fa is enabled, you've got an open issue https://github.com/fyookball/electrum/issues/41

someone please help!!!! I keep getting transaction rejected because of multisig how do I send Bitcoin Cash with a 2FA electron cash wallet?

best to remove the photo @ajfeinman

removed. just flipping out a little....any ideas?

I found it easier on Linux. Just go to a pawn store and pick up a cheap old netbook for less than $50, then install a lightweight linux distribution on it like Xubuntu. I used Mint. Then follow the directions further up in the discussion to install Fyookball's clone of electron-cash. I am a newbie and that is what I did.

And AFAIK you cannot do it with 2FA yet

@dabura667 could you please compile a new binary for osx with the fix??

Is there any estimated time for releasing 2.9.2?

Thanks

@dabura667

Line 730 of lib/transaction.py should be changed:
scriptCode = push_script(self.get_preimage_script(txin))

to

preimage_script = self.get_preimage_script(txin)
scriptCode = var_int(len(preimage_script)/2) + preimage_script

This will allow multisig redeemscripts over 75 bytes to be properly signed. (PUSHOPs and VARINTS are the same bytes up to lengths of 75, then PUSHOPS change to multibytes where VARINT can go up to 252 before going multibyte.)

This produce me

Traceback (most recent call last):
  File "electron-cash", line 95, in <module>
    imp.load_module('electrum', *imp.find_module('lib'))
  File "C:\Documents and Settings\Admin\Desktop\Electron Cash-2.9.0\lib\__init__
.py", line 3, in <module>
    from wallet import Synchronizer, Wallet, Imported_Wallet
  File "C:\Documents and Settings\Admin\Desktop\Electron Cash-2.9.0\lib\wallet.p
y", line 55, in <module>
    import transaction
  File "C:\Documents and Settings\Admin\Desktop\Electron Cash-2.9.0\lib\transact
ion.py", line 726
    preimage_script = self.get_preimage_script(txin)
    ^
IndentationError: unexpected indent

Seems that's a Text editor error -_-

Trying to edit with Python IDLE and success
Notepad++ seems to show different indentation

@Maxradice I don't own a Mac.......... so I can't compile. Sorry.

I got the new version for mac. 2.9.2, downloaded installed and cant send my bcc Im getting this error
"error: The transaction was rejected by network rules. (16: mandatory-script-verify-flag-failed (Signature must use SIGHASH_FORKID))"

My electrum wallet had 2fa, so im asked every time I do a transaction for google auth numbers, If i dont get the numbers, transaction is not correctly signed and it is missing 1 of the 2 steps..

If I set the Google Auth numbers, it gives me the error...

This build was intended to fix the signing issue right? I'm doing something wrong?

Thanks!

yes you are doing it wrong.
you have to disable 2FA in the BCC version (for that you must restore wallet from seed)

It worked...

Anyways, I was able to send Part of my BCC... I did a few test transactions and the I sent a large part of my balance.. what is left Im not able to send it, as it says I have insufficient funds.

As an example,

I sent 1 to test out of 10 Balance was 9 (minus fees)
Then I sent 1 more (balance was 8 (minus fees)
I sent 5 Balance was 3 (minus fees)
I tried to sent the balance left... I can only send 30% of what is left... something seems to be wrong with Balance and is not allowing me to send the complete balance.

It may be related to unconfirmed transactions?

Any idea? I can see the correct balance on the history, I cant send more than 30% of it.

Thanks

there's an option to allow electrum to send unconfirmed coins

Worked,

Thanks guys... regards!

I’ve downloaded 2.9.2 (OSX) and am still having trouble.

history: using 2.9.0
wallet showed my BCC coins, but unable to send with the same error as OP

using 2.9.2
Initial attempt: simply opened up my previous wallet, which shows my BCC coins, attempted to send but received this new error:
_The transaction was rejected by network rules. (Safe mode: Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.)_

notes
The above wallet was still in 2FA mode, but when clicking on TrustedCoin icon I got this: This wallet is was restored from seed, and it contains two master private keys. Therefore, two-factor authentication is disabled. (which is why I thought I’d try sending before restoring to a new wallet)
Also, my public addresses in this wallet all start with ‘3’

So, restoring my wallet into a new wallet without 2FA had problems. Here’s what I’ve tried:

  • I created a new ‘standard’ wallet, using my seed.

    • 1st attempt: when pasting my seed Electron said that it was a 2FA seed. Assuming the new wallet being created will not be, as I’d previously selected ’standard’ wallet, I selected OK. Electron window showed ‘please wait’…. eternally. I waited for 30min and assumed something wrong.


    • 2nd attempt: When pasting my seed in this time I clicked ‘options’ next to where it displayed that my seed was 2FA and then selected the BIP39 checkbox to make the 2FA notification go away. I don’t know what ‘wallet derivation’ means, but the code in there was: m/44’/0’/0’ I left that alone. This created a new wallet successfully. However the addresses it imported were not like my original addresses starting with ‘3’. These were starting with ‘1’ and displayed no coin balance, so obviously couldn’t send anything.


    • 3rd attempt: into that new wallet I tried sweeping my BCC holding private keys. This gave a ’no inputs found’ error. I’m assuming because it’s only attempting to sweep from the addresses starting with ‘1’, and not the ‘3’ addresses where my BCC is displaying correctly.

ANY help would be greatly appreciated. I don’t know any code, or even how to compile source into binaries, so you’re talking to a relative noob. I’m just trying to use my BCC. :)

@devilbond not sure why you are checking bip39. unless its a bip39 seed, dont do that. Electron Cash doesnt support 2fa but you should be following the instructions to restore from seed. i havent done this myself as i dont use 2fa but it seems to have worked for others.

devilbond: had same issue as your 1st attempt. I type in the seed after previously selecting standard wallet, then click next and it just says please wait

Screenshot: https://gyazo.com/9c8483681674f0935c747b6ab963275c

@ftwonka Yup, that's the screen I get.

@fyookball I only checked that BIP39 box as an experiment on my 2nd attempt because Electron just hung on 'please wait' the previous attempt. It was just something I tried.

It is possible that restoring from seed may/may not work depending on what wallet the seed is originally from? i.e. does it only work on wallets that were not multisig wallets, etc?

@fyookball for me and anyone else trying to do this, please can you (or anyone) confirm that the below are the correct instructions to restore from seed:

  1. Select 'New/Restore Wallet' from File Menu
  2. Select 'standard wallet' (not multisig, not 2fa)
  3. Select Restore from Seed
  4. Paste seed.
    4.1. If seed is from a 2FA wallet, that fact is displayed.
    4.2. If seed is not from a 2FA wallet, that fact will not be displayed.
  5. Don't click any of the options, just OK

Following the above does not work for me, the new wallet doesn't open, it just hangs on 'please wait' so if I'm missing anything, or doing any thing wrong above, do let me know.

Questions I have:

  • If the above works for some people, could they please advise what kind of wallet they were restoring. Was it a multisig wallet?, did it originally have 2FA? Did your original wallet's public addresses start with a '1' or a '3' and what number do they begin with now?, etc
  • if the above did NOT work for some people, could they please do the same and advise what kind of wallet they were attempting to restore.

Thanks all in advance,
db

im not that familiar with 2fa , sorry i cannot be more helpful here.

It might all be moot anyway. After all the fiddling to get access to my BCC via this program, my deposit on Bittrex is only up to 7/20 confirmations after 12 hours. By the time it reaches 20, I'll be lucky to get even one MicroBit for it.

@staffnsnake Same. Just going to hold I guess.

@staffnsnake I just did restore then did normal wallet, can't remember the name but the top option. Then asked if I wanted to disable 2FA later, and I said yeah. I did the same steps you did above and it worked.

ShapeShift

@ronosa I think you mean "if I wanted to enable 2FA later", but happy you got your BCC, even if it is as illiquid AF. I'm up to 10/20 confirmations - half-way!

Can anyone with it working confirm/deny they have multisig wallets/addresses please? Yes if your public address starts with 3. No if it starts with 1.

Thanks.

On Aug 4, 2017, at 21:39, staffnsnake notifications@github.com wrote:

@ronosa I think you mean "if I wanted to enable 2FA later", but happy you got your BCC, even if it is as illiquid AF. I'm up to 10/20 confirmations - half-way!

―
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

hi i have been holding my BCC in electron cash 2.9.3 and now i found out that prior to 2.9.4 electron cash is not supported by network rules, but when i try to open my 2fa disabled wallet, the 2.9.4 software just crashes, what can i do please i have been stuck on this all day?

Was this page helpful?
0 / 5 - 0 ratings