This document defines how to compute unique identifiers.
The transaction ID (also called transaction hash) of a transaction is computed as the hash of the serialized transaction with fields zeroed out for signing (see different inputs and outputs for which fields are set to zero).
For a transaction of type TransactionType.Create
, tx
, the contract ID is sha256(0x4655454C ++ tx.data.salt ++ root(tx.data.witnesses[bytecodeWitnessIndex].data))
, where root
is the Merkle root of the binary Merkle tree with each leaf being an 8-byte word of bytecode. If the bytecode is not a multiple of 8 bytes (i.e. if there are an odd number of instructions), the last opcode is padded with 4-byte zero.
The UTXO ID of a transaction's output (i.e. a coin) is computed as the hash of the concatenation of the transaction ID and the output index as a uint8
.
The UTXO ID of a deposit is computed as the hash of TODO.
The UTXO ID of collected fees in a block is the block height as a 32-byte big-endian unsigned integer (i.e. the first byte of the 32-byte array is the most significant byte, and so on).