Author

Topic: Check bitcoin version byte in OP_CHECKSIG (Read 489 times)

staff
Activity: 4326
Merit: 8951
February 05, 2014, 06:23:22 PM
#2
Addresses and version bytes don't exist inside the bitcoin protocol, they're user facing things only.
newbie
Activity: 7
Merit: 0
February 05, 2014, 06:15:39 PM
#1
Is there a way to check what is the version byte of the address associated with the public key current on the stack?

The idea is this: During the execution of OP_CHECKSIG, I want to check if the version byte of the address associated with the public key current on the stack is, let's say 0xCB, and if it is, I want to do some pre-processing on the public key before proceeding with the validation.

Because the way I see it, during OP_CHECKSIG I'll have access (normally) to the public key and a signature. But only from the public key I can't construct the address, I can only construct the HASH160 (which is lacking the checksum and the first version byte). Of course I could only append this two, but I can't do that because I don't know the version byte beforehand, I can only know the version byte by looking at the address.

I hope I made it clear...

Anyone has an insight on this?

Cheers,
Jump to: