Tool · Hashing
Tagged hash
SHA-256 with a label, so a hash made for one job can't be reused for another
What it does
Choose one of the tags Taproot and Schnorr signatures use, or type your own, and a message in hex or text. The
tool builds the tagged hash in three visible steps and checks the result against the library’s own
taggedHash().
How to read it
- Hash the tag: t = SHA256(tag). The tag is plain text, like
TapTweak. - Glue it on twice: t ‖ t ‖ message. The two copies fill exactly one 64-byte SHA-256 block, so software can precompute that block once per tag.
- Hash everything once more. That’s the tagged hash.
Open Same message, other tags to see the same bytes give an unrelated result under every other tag. That is the point of tagging: a hash computed for one purpose can never be passed off as another.
The default message is the x-only public key of private key 1. With the TapTweak tag, the result is exactly
the tweak the Key forge tool shows for key 1.
Pearl specifics
Pearl keeps Bitcoin’s tags and their rules unchanged: TapTweak for the Taproot tweak, TapLeaf and
TapBranch for script trees (including P2MR’s), TapSighash for the digest a Taproot signature signs, and
BIP0340/challenge inside every Schnorr signature.
Under the hood
Runs entirely in your browser: nothing you type is sent anywhere. Steps 1 and 3 call SHA-256 from
src/lib/hash.ts; the check calls its taggedHash(), which unit tests verify against the BIP-340/341 tag
prefixes and the research test vectors.