Open Dmdv opened 2 months ago
Hi! Thanks for using the library and providing feedbacks.
From the Bitcoin source code of Merkle Tree and this GitHub issue, seems like the standard solution is to make the solo node the root of the tree.
I thought it was meaningless and lack of use cases to construct a Merkle Tree with only one leaf so I enforced the number of leaves to be at least 2.
Why merkle tree can't be from 1 node?
https://github.com/txaty/go-merkletree/blob/ccfc3d24289d9c28111edc02f688b8bef9f45fb7/merkle_tree.go#L104
Even if there's just one mode, we still can compute 1 node merkle tree. What is the standard solution?