Index of the first node in layer, counting the root as layer 0. (1 << layer) - 1. From merkle_layer_start.
layer
(1 << layer) - 1
merkle_layer_start