I am having trouble locating where this byte prefix "0x18" is used and defined in the Bitcoin sorce code.
This is what I found so far:
src/main.cpp#L80const string strMessageMagic = "Bitcoin Signed Message:\n";
And where that gets used when signing/verifying a message:
src/rpcmisc.cpp#L367 and
src/wallet/rpcwallet.cpp#L496CHashWriter ss(SER_GETHASH, 0);
ss << strMessageMagic;
ss << strMessage;
But I do not see anything indicating that that byte prefix is being utilized.
Okay, figured it out with the help of this source code comment:
bitcoinj/core/Utils.java#L510.
It's the message length for the line.
0x18 being decimal value 24, for 24 characters in this "Bitcoin Signed Message:\n".
0x19 being decimal value 25, for 25 characters in this "Zetacoin Signed Message:\n".
Where is this officially documented?