Skip to content

fix: remove double hash in SIGN_BLOCK handler - #19

Open
milenkojankoski wants to merge 1 commit into
KeetaNetwork:mainfrom
milenkojankoski:fix/sign-block-double-hash
Open

fix: remove double hash in SIGN_BLOCK handler#19
milenkojankoski wants to merge 1 commit into
KeetaNetwork:mainfrom
milenkojankoski:fix/sign-block-double-hash

Conversation

@milenkojankoski

Copy link
Copy Markdown

Summary

  • SIGN_BLOCK was signing SHA3(blockHash) instead of blockHash directly
  • The KeetaNet client verifies block signatures over the block hash (SHA3(canonical block bytes)) without re-hashing, so the extra SHA3 produced an invalid signature
  • Updated test to match the corrected verification logic

Related

Companion SDK fix: https://github.com/KeetaNetwork/ledger-js-sdk/pull/new (PR incoming)

SIGN_BLOCK was signing SHA3(blockHash) instead of blockHash directly.
The KeetaNet client verifies block signatures over the block hash
(SHA3 of canonical block bytes) without re-hashing, so the extra
SHA3 produced an invalid signature.

Remove the second hash so the device signs blockHash = SHA3(block_bytes)
directly, matching what the client expects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants