The idea is that right now in rsmt2d we always copy the data that goes into leaves, we do that, because for extended square we replace the first namespaceSize bytes of the leaf with parity namespace (for ODS we use the data as is). If we split the parameters (i.e. namespace and data), we could actually not copy the leaf and just take the same byte pointer from rsmt2d. I tried doing this in a branch and this is the best option of all performance-wise (it is better than copy the data, even if we reuse the buffers in which we are copying).