Unwriter, the prolific cryptocurrency developer, has been hard at work this week, introducing a series of new functions under the BitDB umbrella to make accessing data more easier. He started with the announcement of his new Genesis project, an exclusive BitDB node that runs on Bitcoin SV (BSV) and which allows expanded query capabilities, and then followed that up a mere 24 hours later with Babel, a data-only, condensed query application. Now, adding to the mix, is Chronos, a BitDB node that “breaks all the rules of BitDB.”
Chronos, according to unwriter’s Medium post on the topic, is “An ephemeral BitDB for dealing with time” and was designed to provide results that include a timestamp. Each transaction provides the timestamp of when it was discovered – not when it was mined – and the feature is also included for Mempool transactions. Unwriter points out that these latter transactions don’t provide a timestamp in other BitDB nodes.
Additional features of Chronos include a 24-hour sliding window of transaction storage, a single chronological ordering of transactions (whether they’re confirmed or unconfirmed) and a “dynamically-computed virtual attributed named ‘timeago.’”
Unwriter points out that Chronos is an important addition to the Bitcoin ecosystem because it allows for better understanding of how transactions transpire. He states, “Just because a transaction appears later within the blockchain than another transaction, doesn’t mean that transaction was sent later. It could have just propagated slowly, or may have stayed in the mempool for a long time before finally getting mined.”
The developer adds, “One thing to remember is that EVERY transaction in the same block has EXACTLY the same blk attribute.
“This means you can’t tell which transaction in a block was SENT earlier than another transaction in the same block. You can’t even tell which was DISCOVERED earlier through BitDB because they all have the same timestamp.”
“Timeago” won’t be an attribute that can be used to create a query since, logically, it refers to the amount of time that has elapsed between the transaction and the query. It is based on the “timestamp” attribute that is now included and which is a Unix timestamp recorded at the time of the transaction’s discovery.
Previously, all BitDB nodes distinguished between confirmed (block) and unconfirmed (Mempool) transactions using either, respectively, “c” or “u.” This is where unwriter decided to break the rules. Chronos includes a single collection that is called “t,” which covers both confirmed and unconfirmed (or block and Mempool) transactions. He explains, “At first, incoming mempool transactions get inserted into the database. And when the same transaction gets added to a block, the entry gets updated to have the blk property (the block info). So when you see a transaction without a blk attribute, you know it’s in the mempool.”
Chronos was not designed to be used as a standalone platform but, rather, as a complement to other BitDB nodes, which is why all transactions “get wiped out after 24 hours have passed.” However, it can be useful in helping to sort and display transactions by timestamp in order to develop a more accurate timeline.
In summing up his latest creation, unwriter states, “Chronos is a new type of BitDB node that makes an interesting tradeoff to provide a feature that can be helpful for many developers when used with care… Regardless, being able to use real world timestamps is a really nifty feature and have been one of the most frequently requested features since the beginning of BitDB, so I’m sure many of you will get it.”
“Chronos” by @_unwriter this is one of the most useful things to come out for Bitcoin in a long time. With it I think we set the foundations for probabilistic instant transactions. https://t.co/c1QH1qbu3r
— Jerry David Chan (@digitsu) January 17, 2019
New to Bitcoin? Check out CoinGeek’s Bitcoin for Beginners section, the ultimate resource guide to learn more about Bitcoin—as originally envisioned by Satoshi Nakamoto—and blockchain.