0

Normally, p2pkh address is generate by Base58(Prefix+ PublicKeyHash + Checksum), and prefix is set 0x00.

What if by accidently, prefix is set 0x05, then the address prefix becomes 3, which becomes a p2sh address.

And unfortunately some btc already sends to the 3 prefixed address, would I am able to spent the balance provided that I own the private key?

The very bad thing here is that I created a too special type pay to script:
to be specific, <OP_HASH160> <ScriptHash> <OP_EQUAL> the ScriptHash is hash160(public key). Is there a way to sign this kind of script?

2

What if by accidently, prefix is set 0x05, then the address prefix becomes 3, which becomes a p2sh address.

Then coins sent to that address would be lost forever.

would I am able to spent the balance provided that I own the private key?

No because the semantics for verifying a spend of a P2SH output are different from those for P2PKH outputs. The private key that you have is unrelated to the P2SH output.

Is there a way to sign this kind of script?

No. The public key would be interpreted as a script itself, not as a public key. So the private key you have for that would be useless. You would have to satisfy whatever script the bytes of the public key represents. This is likely to just be garbage and be a script that cannot actually execute.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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