-
Notifications
You must be signed in to change notification settings - Fork 5.7k
clarify message serialization and add test vectors to BIP-322 #1279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6c82ed6
to
aeeda30
Compare
Wasn't able to find any problems with my tagged hashes, @kallewoof are you sure yours are correct? |
@benthecarman Will investigate. I assume your tagged hashes / BIP 340 stuff passes the test vectors in https://github.com/bitcoin/bips/blob/master/bip-0340/test-vectors.csv ? |
Yes |
I realize the Edit: this is how it is done in Core: /**
* string
*/
template<typename Stream, typename C>
void Serialize(Stream& os, const std::basic_string<C>& str)
{
WriteCompactSize(os, str.size());
if (!str.empty())
os.write((char*)str.data(), str.size() * sizeof(C));
} So for the empty string case, it would result in |
aeeda30
to
aa92d9c
Compare
Updated BIP to clarify that the message serialization is done without length prefix and without null terminator. |
I mistakenly thought the signatures were the same but looking closer they aren't. So, hashes are now identical but the signatures are different (and only mine pass the verifymessage call). |
I added a clarification to the If the spent destination turns out to have locktimes and/or such, they need to use FULL format. (Half-hearted ping @apoelstra who's probably too busy to look at this.) |
…o_sign transaction
d06762b
to
f52e047
Compare
Since it's all guess-work for SIMPLE format, I've changed the spec to require version, locktime, and sequence to all be 0 for the |
ack f52e047 |
This
to_sign
transaction must have version, locktime, and sequence all set to 0 for the SIMPLE format (signature only)