# Storing data in a Merkle tree

I had the idea of storing large amounts of data in a small space using a Merkle tree. But from what I understand about Merkle trees is you cannot extract the data from the Merkle root (since hashes are not reversible). Though I wonder, is there a way to use an encryption algorithm that gives a fixed output length like how we use hashes in Merkle trees? I know my question is hard to understand but looking at this diagram may give you a better idea of what I am trying to do here:

If I understand you right, you are asking if there was a way to take the $$n$$-bit Merkle tree root, and use it to extract the multiple files that are the leaves.
Obviously, if the information within the files is more than $$n$$ bits, you can't - if there are $$2^n$$ possible roots, then no procedure can extract more than $$2^n$$ different values from it, and it doesn't matter what function you use as the "hash"
• @Apollo11: the root of the Merkle tree will be some value, and we usually represent that value as a serial of bits (or bytes, where each byte consists of 8 bits - in crypto, we more often count bits rather than bytes). By $n$-bit tree root, we mean that $n$ bits are used. Aug 30, 2021 at 15:08