CloakProject / codename-phoenix

New CloakCoin wallet base, Bitcoin fork 0.21.1
MIT License
5 stars 3 forks source link

CPubKey::Verify fails #11

Closed r3rcloak closed 5 years ago

r3rcloak commented 5 years ago

CPubKey::Verify is currently failing for keys created using OpenSSL. This is likely related to the switch to secp256k1 in the new bitcoin codebase.

CPubKey::Verify is currently hard-coded to return [TRUE] until the issue is addressed and resolved.

r3rcloak commented 5 years ago

[secp256k1_ecdsa_verify] is the source of the failure. Verifying block signatures works without issues, but transaction signatures checks fail at present. This lead me to look into the tx signature specific code and my hunch is that the signature hash [SignatureHash()] generated during signature checking is using a slightly different algorithm in the new codebae vs. the old one.

Hopefully this is the source of the problem and a few changes to the hash generator will fix up the issue...

r3rcloak commented 5 years ago

The signature hashing algorithm was indeed the culprit. This has been resolved in the following commit: https://github.com/CloakProject/codename-phoenix/commit/1e9adc2637ddb3ed535fcfc9f086be43b369a3bc