Skip to content
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

sighash problems #402

Open
ellacodecamp opened this issue May 27, 2024 · 3 comments
Open

sighash problems #402

ellacodecamp opened this issue May 27, 2024 · 3 comments
Assignees

Comments

@ellacodecamp
Copy link

  1. In config.py, SIGHASH_ANYONECANPAY should be set to 0x80, not to 80.
  2. sighash_type is not properly reflected in the signature. The last byte in the signature is always set to 01, instead to the value passed Transaction.sign() method.
@mccwdev mccwdev added the bug label May 29, 2024
@mccwdev
Copy link
Member

mccwdev commented May 29, 2024

You are right, will take a look at it

@mccwdev
Copy link
Member

mccwdev commented Jun 3, 2024

This issue is addressed in commit 33dd52d

However hash_types other than SIGHASH_ALL are not supported at the moment. You can create transactions with other hash types but signing is not possible. I will transform this issue in a 'feature request'.

@ellacodecamp
Copy link
Author

It is actually pretty easy to fix. Do not pass hash_type to sign function, the one that comes from keys.py file, just get the signature and append your hash_type to your signature in the sign function that belongs to Transaction object. You would probably need to fix all the other places where 01 is expected to be appended to the signature.

@mccwdev mccwdev self-assigned this Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants