TTL Index serialization format #289
kcalvinalvin
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
In 1. we could consider using only the first 8 bytes (not sure how many bytes would be good here @adiabat) of the txid in the outpoint. There should be almost no collisions here and even if there are, i would assume they don't have a huge impact on the caching. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TTL Index
What is it?
Time-to-live indexes map Spent-Transaction-Outputs to their time-to-live value. Time-to-live values are the value that a STXO lives for. For example, if a TXO was created in block 10 and was spent in block 50, that TXO would have a ttl value of 40.
TTL values are calculated by
Why do we need it?
TTL values are extremely useful when caching UTXOs in the context of the Utreexo project. The Utreexo paper section 5.4 shows the drastic reduction in download when using a ttl based caching. While there has not been any attempts to implement this to the current Bitcoin UTXO set, it may also help with caching UTXOs for the current leveldb based UTXO set.
Serialization
There are two main ways of storing this information. Both use a key-value model with the ttl value as the key. However, they differ in what's used as the key.
1: Outpoint to TTL
2: TXO Block Index to TTL
1 is more straightforward but is a lot more space consuming. 2 is much more space efficient but is more tricky to implement as it is a more invasive change.
I guess the values could also be serialized with the variable length integer serialization format, saving on more space.
Implementation
Implementation is probably done easiest by incorporating it as a indexer in both
utcd
andbitcoind
.Beta Was this translation helpful? Give feedback.
All reactions