Peter Todd's MMR (
https://petertodd.org/2016/delayed-txo-commitments ) allows near limitless storage of values in a merkle hash tree.
In SQL terms. you get INSERT and UPDATE. but no SELECT or DELETE. You must keep track of the MMR proofs, that show your entry is valid ( your version of SELECT).
Keeping track of spent outputs normally involves storing the outputs in an ever growing un-pruneable accumulator. ZCash is the most prominent coin that uses something like this.
-------------------------------
I present a way of checking whether a
special value is valid as it has never been used.
1) The user creates a public/private key.
2) User sends a special transaction to the network, which includes his public key, requesting a value/address.
3) The network adds that transaction to a block, and then creates an value/address that is equal to Hash ( Public Key | Block Hash | Transaction_num_in_block ).
4) The network adds this
Globally Unique address to the MMR, and it is currently unused. Every entry into this MMR is always unique.
5) When the user wishes to use this value (could be an output), he provides the MMR proof and a signature for the original Public key (using his private key), and the MMR is then updated to show that this value is used ( output is spent ).
6) You will NEVER get 2 MMR values with the same value, so once you have used it, you can never re-use it, and all you can do is request another value/address, which will always be different. You can't add the same value again.
That's it. You only need to store the MMR, and you can use that to make sure no one ever uses the same address/value twice.
[edit]
To be more informative - An MMR Database is 1 32 byte hash. They are very tiny.
( ..and at most to initialise an MMR you need the tree peaks, which for 2
256 values is 8K )