0

Suppose i have a Bitcoin address for the first time and Alice sends me 1 Bitcoin using P2SH. As far as I know, Bitcoin browsers will scan the entire blockchain. In this case, my public key is not present in the network, it is only present in the locking script and it is hashed. So when i check my balance in Bitcoin browser, can i get a result?

1 Answer 1

1

P2SH Bitcoin addresses are just Base58Check encoded script hashes. A P2SH transaction output will mention this same script hash. So if we're just interested in the balance of the P2SH address, we just Base58Check decode the P2SH Bitcoin address to the script hash it encodes, and look for UTXOs that have that same script hash.

You don't need the script or any public keys until you're trying to spend.

2
  • In some cases, the locking script will be complex and contain not only my public key, but possibly other public keys (multi-signature). And the browser doesn't seem to be able to match my public key with the script hash. Jan 18, 2022 at 14:11
  • 2
    @KHJUAF403456ZS3K564WAEF Right, but addresses aren't identifiers of your public key. They identify the entire locking condition. If you have a multisig script that involves your key, that is a distinct address from a single-key script with just key, and they will be counted separately. Block explorers in general give a weird address-centric view of the chain, because they cannot do better. Your own actual wallet can tell you the balance if the actual funds you can access, regardless of how things are split into addresses. Feb 17, 2022 at 20:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.