Compact proof encoding
The binary wire form of a Merkle inclusion proof used in proof bundle ip and ep fields, packing a depth byte, a left/right direction bitfield, and raw 32-byte sibling hashes into unpadded base64url, mapping losslessly to and from the JSON direction:hash form.
Overview
The compact proof encoding is the binary wire form of a Merkle inclusion proof, used for the ip and ep fields of a proof bundle. It packs the proof into three parts: a depth byte, a bitfield of ceil(depth / 8) bytes holding one left/right direction bit per step, and the raw 32-byte sibling hashes in bottom-to-top order, then wraps the binary in base64url without padding so it can travel inside JSON, a URL, or a header. The encoding is lossless and total: it maps one-to-one to and from the human-readable JSON direction:hash list, decode rejects any depth above 64 steps, and the empty proof encodes to the single byte 0x00 (the string "AA" in base64url). The full byte layout is specified in the compact Merkle proof encoding, and the bundle fields that carry it are defined in the proof bundle wire format.