The current on-disk format is that each KV is stored in the tree file as
<<$t,TreeId:22/binary,$s,Segment:64/integer,Key/binary>>
TreeId
is 22 bytes (20 bytes from the vnode id, and 2 bytes for N value). The implementation in hashtree uses 1M segments, and the Segment
is stored in a 64 bit unsiged. Finally, the Key
is usually term_to_binary({Bucket,Key})
.