Byte prefix
The single byte placed before data when Truestamp hashes it with SHA-256 for domain separation; thirteen are assigned, one per construction, from 0x00 and 0x01 for Merkle leaves and nodes through 0x10 claims, 0x31 blocks, 0x40 epochs and 0x50 proofs to the 0x6_ key bytes.
Overview
A byte prefix is the single byte Truestamp places in front of data before hashing it with SHA-256, so every preimage is prefix || data and the same bytes hashed under two prefixes give unrelated hashes; that is what implements domain separation. Thirteen bytes are assigned, one per construction, and every other byte is unassigned:
| Byte | Construction | Hashed after the byte |
|---|---|---|
0x00 |
Merkle leaf | the 32 bytes of the leaf value |
0x01 |
Merkle node | the 32 bytes of the left child, then of the right |
0x10 |
claims_hash |
JCS of the claims |
0x11 |
item_hash |
JCS of the item record |
0x20 |
entropy_hash |
JCS of the entropy object |
0x21 |
observation_hash |
JCS of the observation record |
0x30 |
genesis previous_block_hash |
JCS of the genesis object |
0x31 |
block_hash |
JCS of the block record |
0x40 |
epoch_hash |
JCS of the epoch record |
0x50 |
proof_hash |
JCS of the proof |
0x60 |
key_id |
the 32 key bytes, the hash cut to 4 bytes |
0x61 |
prerotation_commitment |
the 32 bytes of the next key |
0x62 |
handover | JCS of the rotation event without its handover signature |
The high nibble names the family, in the order Truestamp builds the values from the leaves up: items and entropy, then blocks, epochs and proofs, with keys last. Three of the thirteen are signed: the block hash, the proof hash and the handover. A byte never moves and is never pointed at another construction, and a proof never carries a prefix as data, so a verifier takes each byte from the byte-prefix registry, never from a document; the mechanism is explained in domain-separated hashing.