Author

Topic: Different balance in electrum and blockchain??? (Read 126 times)

legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
When you query a command to an electrum server, whether if you're using a watch-only wallet or not, you're sending the address, not the public key. Electrum nodes fetch the transactions related to that script hash and only those. If you search Hal's address' script hash among all those transactions you'll see that it has received 0.0159762. But if along with the hash, you search the public key you'll see that it's 50.0159762.
You're actually searching the hash of the scriptpubkey.

Back in 2009, you were locking your funds to a compressed ECDSA public key as shown:
There's no compressed public keys back in 2009 and the payments should've been in P2PKH as well; P2PK was predominantly used for the mining rewards and payment through the IP(CMIIW).


Electrum did have plans to make descriptors a thing and thus allowing for P2PK transactions as well. I don't think this is implemented yet but its no big deal as well. The difference between P2PK and P2PKH is also the way the  scriptsig is arranged which I doubt Electrum is compatible with as well.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
So if I have the private key then would I be able to see the actual balance and would be able to spend using Electrum? I guess I would?
No, it doesn't have to do with that.

When you query a command to an electrum server, whether if you're using a watch-only wallet or not, you're sending the address, not the public key. Electrum nodes fetch the transactions related to that script hash and only those. If you search Hal's address' script hash among all those transactions you'll see that it has received 0.0159762. But if along with the hash, you search the public key you'll see that it's 50.0159762.

A better picture of the subject. Nowdays, when you sign a transaction and broadcast it, you're locking your funds to a 160-bit hash.

Example:
Code:
403556352dc1060df7abc73a7ecfbaeedf99fa20

Back in 2009, you were locking your funds to a compressed ECDSA public key as shown:
Code:
0345baa5126ef28873efb402ca1c0a45ea9f6acfd59858252f5d28d3a6d116373c

I hope I made it clear to you.
legendary
Activity: 3612
Merit: 5297
https://merel.mobi => buy facemasks with BTC/LTC
--snip--
I was totally ignorant about this phenomenon LOL

So if I have the private key then would I be able to see the actual balance and would be able to spend using Electrum? I guess I would?

Electrum doesn't fetch the unspent output from the electrum node... So, no, if you had the private key you wouldn't be able to spend the coinbase reward using electrum's gui...
That being said, you could theoretically use electrum to sign an unsigned raw transaction spending the coinbase reward if you used a different tool to create said transaction... At least, i guess this would work... Never tried it tough... Maybe somebody else did try this and could weigh in?
legendary
Activity: 2800
Merit: 2736
Farewell LEO: o_e_l_e_o
Yes, that's because electrum doesn't display P2PK transactions and Hal's rewarded bitcoins were paid to his public key. For an unknown reason, electrum looks only for the transactions that are related through through the derived script hash from the address. Pay-to-public-key transactions aren't related to that script hash and that's why it doesn't return you the proper amount.

That was firstly answered by @ranochigo. You can find out more here: Electrum doesn't show rewarded coins.
I was totally ignorant about this phenomenon LOL

So if I have the private key then would I be able to see the actual balance and would be able to spend using Electrum? I guess I would?
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Yes, that's because electrum doesn't display P2PK transactions and Hal's rewarded bitcoins were paid to his public key. For an unknown reason, electrum looks only for the transactions that are related through through the derived script hash from the address. Pay-to-public-key transactions aren't related to that script hash and that's why it doesn't return you the proper amount.

That was firstly answered by @ranochigo. You can find out more here: Electrum doesn't show rewarded coins.
legendary
Activity: 2800
Merit: 2736
Farewell LEO: o_e_l_e_o
The address has 50+ btc which means you are getting some error information from your Electrum. Maybe you did not set it up well.

Update:
Strange and I see what you mean. I just added this address and figured out that the Coinbase transaction has not added to it which had50BTC reward.



We will see what others have to tell here.
full member
Activity: 209
Merit: 148
When checking the balance of 1HLoD9E4SDFFPDiYfNYnkBLQ85Y51J3Zb1 in Electrum console

I get "0.0159762"

Code:
getaddressbalance('1HLoD9E4SDFFPDiYfNYnkBLQ85Y51J3Zb1') 

Whereas blockchain.com shows 50.0159762

https://www.blockchain.com/btc/address/1HLoD9E4SDFFPDiYfNYnkBLQ85Y51J3Zb1


Who is correct?
Jump to: