Reviewed Aug 2026
DE
BA-02 · LESSON 07

Tagged hashes

KEY DEFINITIONS

Terms used in this lesson

BIP340
The Bitcoin Improvement Proposal specifying Schnorr signatures for the secp256k1 curve.
Preimage
The original secret data whose hash equals a previously committed value.
SHA-256
A cryptographic hash function used throughout Bitcoin to produce fixed-size 256-bit digests.
BIP0340 challenge tag
The domain-separation label used by BIP340 when hashing the Schnorr signature challenge.

A tagged hash adds a purpose label before hashing. This stops the same bytes from being mistaken for a message used by a different protocol rule.

55 min Difficulty 1/5 Not started

Loading lesson visuals...

01

Learn the idea

Domain separation makes the same bytes hash differently in different protocol contexts. BIP340 tagged hashing defines H_tag(m) as SHA-256(SHA-256(tag) || SHA-256(tag) || m). The repeated tag digest initializes SHA-256 with a context-specific prefix.

GUIDED EXPLANATION1/5 ideas inspected
1

Name the protocol context

Choose a fixed tag such as BIP0340/challenge that describes one exact use. Tags are part of the specification, not user-selected labels.

Inspect each idea before the worked example.
The worked example follows the explanation

Inspect every idea above to open it.

Important distinctionAdding a human-readable label beside a normal hash provides domain separation.

The context must be part of the bytes fed into the defined cryptographic construction. Documentation alone does not alter the digest.

02
FINISH LEARNING FIRST

The questions unlock after every required learning activity

Inspect every guided idea, open the worked example, rebuild its mechanism, and complete the deterministic lesson tool. Your progress is saved automatically.