Skip to content

Fix scripthash subscribe status hash byte order#771

Merged
evoskuil merged 2 commits into
libbitcoin:masterfrom
eynhaender:fix/hash_byte_order
May 18, 2026
Merged

Fix scripthash subscribe status hash byte order#771
evoskuil merged 2 commits into
libbitcoin:masterfrom
eynhaender:fix/hash_byte_order

Conversation

@eynhaender
Copy link
Copy Markdown
Contributor

Fix blockchain.scripthash.subscribe status hash byte order

encode_hash() reverses bytes (Bitcoin txid display format); Electrum protocol requires the SHA256 status in natural byte order. Replace with encode_base16() in complete_scripthash_subscribe and scripthash_notify.

From the Electrum protocol docs:

"The status of the script hash is the sha256() hash of the full string
expressed as a hexadecimal string … in its natural byte order (not reversed)."

@evoskuil evoskuil merged commit a778552 into libbitcoin:master May 18, 2026
1 of 14 checks passed
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