9d34bb8b2e
RFC 9420 Section 7.9 tree hash input includes a type discriminant byte: - Leaf: H(uint8(1) || uint32(leaf_index) || optional<LeafNode>) - Parent: H(uint8(2) || optional<ParentNode> || opaque left<V> || opaque right<V>) Also fixed RatchetTree leaf count computation to use the rightmost non-blank node position instead of total serialized node count, since trees may be serialized with trailing blank nodes. Test results: 35/41 passing (85%). https://claude.ai/code/session_01NocQDWj2Y92FugjfgazzL3