Bitcoin Forum
July 27, 2025, 03:30:37 PM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: problems broadcasting on possibly corruped backup file  (Read 113 times)
troublepk (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
May 11, 2025, 09:11:55 AM
 #1

hey
so i found on an old hard drive of mine an old electrum wallet backup plus written down all the addresses and private keys. opened it with electrum and everything seemed fine at first but when i tried to move some of the funds i got an error saying "The server returned an error when broadcasting the transaction. Consider trying to connect to a different server, or updating Electrum." Script failed an OP_EQUALVERIFY operation" so i went over to block explorer to broadcast raw and there i get an error " sendrawtransaction RPC error -26: mandatory-script-verify-flag-failed (Script failed an OP_EQUALVERIFY operation)".i tried 3 different transactions always the same. But whats weird if i look now in "sent" on electrum two of them are listed unpaid but one is suddenly listed as unconfirmed.so i tried to use the seed on a different wallet but there i get "invalid seed" and when i tried the private keys, for some of them i get a different address every time. meaning i import a private key into my wallet check address, then delete that wallet again and import the same key again, i suddenly get a different address then the time before.
so yeah if anyone could point me into the right direction  as to where to even start to try and fix this clusterfuck, would be greatly appreciated
Abdussamad
Legendary
*
Offline Offline

Activity: 3878
Merit: 1648



View Profile
May 11, 2025, 01:56:29 PM
Merited by ABCbits (1)
 #2

so i tried to use the seed on a different wallet but there i get "invalid seed"

By different wallet do you mean other wallet software? Electrum seeds don't work with other wallet software. Try restoring from seed again in electrum by going to file menu > new/restore, enter a unique filename and click ok. Then proceed with on-screen instructions for the rest of it.
pooya87
Legendary
*
Offline Offline

Activity: 3892
Merit: 11777



View Profile
May 12, 2025, 04:27:16 AM
Merited by hugeblack (4), hosemary (4), ABCbits (3)
 #3

Based on the two information you gave us I can say what you are using is not Electrum software.
That's based on the error message and the fact that you say it is part of your wallet history ("listed as unconfirmed" as you put it). The signature in those transactions has nothing to do with your address based on the error and Electrum would never sign such a tx and even if you had signed it elsewhere and imported it into Electrum, Electrum still shouldn't include it as a valid tx in your history.

Regarding Script failed an OP_EQUALVERIFY operation, basically in P2PKH scheme your signature has to include a signature and a public key (using the same private/public keys that generated your address). Then your output script that starts with OP_DUP OP_HASH160 <your-address-hash160> would first duplicate that public key, hash it then compare it with the 160-bit hash in your output (that encodes your address as well) then checks its equality with OP_EQUALVERIFY operation and fails if the public key had nothing to do with your address. Which is what happened here.

nc50lc
Legendary
*
Offline Offline

Activity: 2856
Merit: 7429


Self-proclaimed Genius


View Profile
May 12, 2025, 08:56:39 AM
Merited by ABCbits (2), hosemary (2), hugeblack (1)
 #4

opened it with electrum and everything seemed fine at first -snip-
Did Electrum showed you any error when you load the backup wallet file and typed its password?
If so, read it.

Because it should be able to detect if the extended (master) private key cannot derive the xpub at least one of the address in its list,
That usually results with the error that you've mentioned.
My reproduction result:


Restoring the seed should be the first step in issues like that. (unless the wallet backup is forged to show txns that it can't spend)
But make sure to install the correct Electrum binary since a lot of fakes are showing in various search engines.
Only download it from: electrum.org/#download
And verify its signature: bitcoinelectrum.com/how-to-verify-your-electrum-download

-snip- and when i tried the private keys, for some of them i get a different address every time. meaning i import a private key into my wallet check address, then delete that wallet again and import the same key again, i suddenly get a different address then the time before.
Whatever wallet that is, do not use it.
Inconsistent import shouldn't happen in any well-written wallet.

BitBastard
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile WWW
July 11, 2025, 10:25:56 PM
 #5

I have this exact problem.

1. Wallet -> Info -> Standard, BIP39, Seed, Master Pub Key visible... Derivation path: m
2. Coins -> Shows 1900 Unspent UTXO's, right-clicking them allows me to see "Fully Spend" / "Freeze" / etc..
3. I can sign the transactions, but they fail on broadcast with the OP_EQUALVERIFY
4. Transaction history is up to date and updating in real-time, and pubkeys are highlighted in green to signifify when they're a part of my wallet.
5. Export Private Keys - exports 101 keys, none of which are for UTXO's unspent and some of them don't even correspond to addresses in my wallet. Other ones are mix-matched, so pubkey 4 and privkey 6 are swapped, etc.
6. I get a "wallet corrupted" error upon opening it.
7. Restoring from seed doesn't do anything as they were imported keys

It appears to me that the encryption module might be corrupted and is therefore not signing with the right kind of keys despite having them associated somewhere in the DB. I've been racking my brain with this for months, if anyone can help, there's significant funds in it and I will gladly give you a fat percent of them if you can help me free them finally (I've wasted hundreds of hours on this frustrating issue.)


nc50lc
Legendary
*
Offline Offline

Activity: 2856
Merit: 7429


Self-proclaimed Genius


View Profile
July 12, 2025, 06:38:20 AM
 #6

It appears to me that the encryption module might be corrupted and is therefore not signing with the right kind of keys despite having them associated somewhere in the DB. I've been racking my brain with this for months, if anyone can help, there's significant funds in it and I will gladly give you a fat percent of them if you can help me free them finally (I've wasted hundreds of hours on this frustrating issue.)
It's actually decrypted master private key that doesn't match with the wallet's master public key,
If there's an issue with the encryption module, this will be an issue of the majority of Electrum users.

If this isn't caused by manual modification of the wallet (which is 90% of the case),
It could be caused by a bug in the old version with some unreliable file systems where an xpub of another wallet might get mixed up with another.
Ref: github.com/spesmilo/electrum/issues/5082

If it's the latter, I'm afraid that there's nothing you can do but to restore the correct seed phrase.

BitBastard
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile WWW
July 20, 2025, 06:44:04 PM
 #7

I ended up opening a GitHub codespaces and directing Claude 4 to rebuild the .dat file. It analyzed it and did a bunch of tests then rebuilt it and it was no longer corrupt.

It said there was JSON injected in it and it could have been done by malware.
nc50lc
Legendary
*
Offline Offline

Activity: 2856
Merit: 7429


Self-proclaimed Genius


View Profile
July 21, 2025, 05:58:32 AM
 #8

I ended up opening a GitHub codespaces and directing Claude 4 to rebuild the .dat file. It analyzed it and did a bunch of tests then rebuilt it and it was no longer corrupt.
Well, it's rather simple to "fix" it by deriving the correct extended (master) public key pair of the extended (master) private key in the wallet.
And replace the fake extended public key with it.

But if the goal is to keep the high-value transactions brought by the fake extended public key:
It's not possible to compute its extended private key pair with traditional computing unless it's just commented out there somewhere in the wallet.
And why would a malware corrupt a wallet that it can decrypt to insert some JSON instead of using the privKey to spend the bitcoins?

1. Wallet -> Info -> Standard, BIP39, Seed, Master Pub Key visible... Derivation path: m
-snip- to rebuild the .dat file.
Interesting...

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!