Bitcoin Forum
July 02, 2024, 02:20:42 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Check bitcoin version byte in OP_CHECKSIG  (Read 486 times)
marley (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
February 05, 2014, 11: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,
gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4200
Merit: 8441



View Profile WWW
February 05, 2014, 11:23:22 PM
 #2

Addresses and version bytes don't exist inside the bitcoin protocol, they're user facing things only.
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!