$$ \newcommand \Domain[1] {\texttt{#1}} $$
Domain Separation
Before an object is input to some cryptographic function, it is prepended with a multi-character domain-separating prefix.
All domain separators must be “prefix-free” (that is, they must not be concatenated).
The list below specifies each prefix:
-
For cryptographic primitives:
- \( \Domain{OT1} \) and \( \Domain{OT2} \): The first and second layers of keys used for ephemeral signatures.
- \( \Domain{MA} \): An internal node in a Merkle tree.
- \( \Domain{MB} \): A bottom leaf in a vector commitment.
- \( \Domain{KP} \): Is a public key used by the Merkle Signature Scheme
- \( \Domain{spc} \): A coin used as part of the state proofs construction.
- \( \Domain{spp} \): Participant’s information (state proof public key and weight) used for state proofs.
- \( \Domain{sps} \): A signature from a specific participant used for state proofs.
-
In the Algorand Ledger:
- \( \Domain{BH} \): A Block Header.
- \( \Domain{BR} \): A Balance Record.
- \( \Domain{GE} \): A Genesis configuration.
- \( \Domain{MsigProgram} \): A logic signature program delegation by a multisignature account (the delegating account address concatenated with the program bytecode).
- \( \Domain{PQA} \): A post-quantum account address.
- \( \Domain{PQProgram} \): A logic signature program delegation by a post-quantum account (the delegating account address concatenated with the program bytecode).
- \( \Domain{spm} \): A State Proof message.
- \( \Domain{STIB} \): A SignedTxnInBlock that appears as part of the leaf in the Merkle tree of transactions.
- \( \Domain{TG} \): A Transaction Group.
- \( \Domain{TL} \): A leaf in the Merkle tree of transactions.
- \( \Domain{TX} \): A Transaction.
- \( \Domain{SpecialAddr} \): A prefix used to generate designated addresses for specific functions, such as sending state proof transactions.
-
In the Algorand Byzantine Fault Tolerance protocol:
- \( \Domain{AS} \): An Agreement Selector, which is also a VRF input.
- \( \Domain{CR} \): A Credential.
- \( \Domain{SD} \): A Seed.
- \( \Domain{PL} \): A Payload.
- \( \Domain{PS} \): A Proposer Seed.
- \( \Domain{VO} \): A Vote.
-
In other places:
- \( \Domain{arc} \): ARCs-related hashes https://github.com/algorandfoundation/ARCs. The prefix for ARC-XXXX should start with \( \Domain{arcXXXX} \) (where \( \Domain{XXXX} \) is the 0-padded number of the ARC). For example, ARC-0003 can use any prefix starting with \( \Domain{arc0003} \).
- \( \Domain{MX} \): An arbitrary message used to prove ownership of a cryptographic secret.
- \( \Domain{NPR} \): A message that proves a peer’s stake in an Algorand networking implementation.
- \( \Domain{PQK} \): The derivation of a post-quantum signing key seed from master entropy (used by key management tools).
- \( \Domain{TE} \): An arbitrary message reserved for testing purposes.
- \( \Domain{Program} \): A TEAL bytecode program.
- \( \Domain{ProgData} \): Data that is signed within TEAL bytecode programs.
Note
Auctions are deprecated; however, their prefixes are still reserved in code:
- \( \Domain{aB} \): A Bid.
- \( \Domain{aD} \): A Deposit.
- \( \Domain{aO} \): An Outcome.
- \( \Domain{aP} \): Auction parameters.
- \( \Domain{aS} \): A Settlement.