-
Notifications
You must be signed in to change notification settings - Fork 334
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
WIP: Add fork id to defend replay attack #55
Conversation
The sighash type is altered to include a 24-bit fork id in its most significant bits. ref. https://github.com/Bitcoin-UAHF/spec/blob/master/replay-protected-sighash.md
// check IsValidSignatureEncoding()'s comment for vchSig format | ||
return vchSig[vchSig.size() - 1]; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return (vchSig.size() == 0) ? 0 : vchSig[vchSig.size() - 1]
is less code to maintain, just a suggestion 😺
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a nice start to 2way replay, great to see
Drop the signature in scripts when SIGHASH_FORKID is not used
The sighash type is altered to include a 24-bit fork id in its most
significant bits.
ref. https://github.com/Bitcoin-UAHF/spec/blob/master/replay-protected-sighash.md