Append a new key at position size, returning the new root hash.
Append a new key at position size, returning the new root hash.
Uses a combined single-pass algorithm: verifies the slot is empty AND computes the new root in one recursive walk. This saves D recursive calls, D sliceByteString, D modInteger, and D quotientInteger operations compared to two separate merkleUp calls.
Walk from a leaf up to the root using an interleaved proof.
Walk from a leaf up to the root using an interleaved proof.
proof is a flat ByteString of D * 33 bytes: D repetitions of (direction[1] + sibling[32]). direction is 0 (left child) or 1 (right child).
Uses path-byte encoding (indexByteString) instead of BigInt modInteger/quotientInteger to determine left/right at each level, and offset tracking (offset increments by 33).