Author

Topic: A NTP like system in blockchain form, has this been thought of before? (Read 76 times)

newbie
Activity: 12
Merit: 0
My thoughts are as follows.

TimeCoin

Provide quality distributed timing system through a cryptocurrency and blockchain system. Possibly to be used as a marketplace or micropayment system for accurate low load NTP like services. Perhaps provide easy systems for other blockchains to reference the TimeCoin blockchain to allow difficulty adjustments with minimal block latency.

Main Chain
A standard blockchain with PoW system, along with the ability to lock a batch of coins under an address in order to become a Time Provider.

Clock Chain DAG

This is a sort of graph built between main chain blocks and summarized in the next block that records information about the propagation of the previous main chain block and the current Time Provider clocks.

Each time a Time Provider with a TimeCoin stake receives a new top main chain block, they immediately create a timestamp of when they received it. They then sign a message and sends it out to each of their Time Provider Peers, that peer immediately signs it and sends it back with their own timestamp included. The originator again signs it with a third timestamp when it returns. They can then submit this as an entry on the Clock Chain.

Only the lowest value for time a block is seen in the DAG is valid, normally DAG miners should not include new entries from a Time Provider if there is one in the DAG with a lower initial value, but a DAG block with such an entry with a valid proof of work will be valid, but only the valid minimum block time will be considered valid for future computations.

By taking these entries, one can build a directed graph that shows the links between the different time providers, and the latency between them and follow the block’s path through the providers. Lets consider the timestamp when a provider name Alice received a block as 1A, a remote client, Bob’s response timestamp as 2B, and finally the return time as 3A. While one way latency could be an issue, Timestamp B2 should be created about half way between A1 and A3. That can be used to calculate a clock offset between the two parties. Starting with the transaction with the lowest timestamp for receiving the block, one can step through all the nodes and calculate their average offset from all the nodes they are connected to. I am sure there is a lot of analysis you could do here beyond my immediate thoughts, but experementation would likely be required to find an ideal system, but the general idea is to find the median clock time a block was found weighted by the reputation of the Time Providers.

Ideally highly accurate offsets could be calculated along with a confidence +- for propogation times could be used to get times under a millisecond.

Finally, the reputation reward is calculated for the Time Providers and distributed based on their standard deviation from this median and their stake size and a summary is produced referencing the top block of this DAG. Larger total visible stake entries in the DAG means greater total reputation increase. The total stake of the entries, weighted by the reputation, along with the total amount of work shown in the DAG summary included with the block reduces it’s difficulty to incentivze miners to include the largest DAG in their blocks even if it means having to regenerate the block header.

The DAG proof of work is a very low difficulty, and the DAG is expected to grow quickly, each group of timing entries are passed to the peers and there is a rush to combine them into a larger graph, but the more total entries in that graph, the more work needs to be done to combine them. A miner can take two graphs that partially intersect and join them together, or add any number of other entries to the graph. When another main block is found summarizing the DAG, a proportion of the block reward is split among all DAG miners based on how much weighted entries they added to the graph. Nothing but work nodes are accepted as work, but are not rewarded. All the time providers are also rewarded for the entries they made and how close to the median time they were.

The full DAG information can be discarded after some number of blocks as long as the summary or database of Time Provider clock offsets and reputation remains valid.

A minimal client could be used that keeps only the last few blocks of the blockchain, and uses the time a peer reports a new top block and the time that block being reported seen by time providers on the DAG to set system time and pacing, perhaps as an NTP plugin.

Time Providers and the Start

The idea behind this is that as the blockchain grows, time providers will gain reputation for consistent accurate time. They could then present a message on the block chain listing their hostname or IP address for more traditional NTP service. There are several ways the system is protected against attack. First the Time Providers must have a stake. This limits their number to some extent, and they grow in reputation as long as their time is accurate. There is a lot of stake needed along with computing power to control the DAG, and since a small DAG means difficult main chain block, miners or pools will have difficulty hiding blocks or building up a private chain as they need the staked high reputation time providers to provide them DAG entries needed to reduce difficulty, and the network could reject blocks with timestamps more than a minute or so off the current time. Another thing is that if a high reputation time server is hacked and the private key stolen, if someone attempts to use that server to steer the network away from the proper time, if a backup of the key could be found it could blacklist itself making that private key unusable as a Time Provider (the coins would have to be sent to another address with no reputation to be used as a time provider again).

The difficulty adjustment function would be a lot faster and a lot more complex than other chains, incorporating the average timing entries in the DAG and the DAG hashrate which drives down the main chain difficulty, along with an estimate of main chain hashrate considering that hash power may switch between them depending on the payoff. Another thing is that with fairly accurate time estimate of when the last block was found, it could be left to pay the base block reward based on the DAG summary that includes when it was seen on the network meaning you could pay out exactly 24 TimeCoins a day or whatever for the emission curve you desire, and use some sort of PID function to control the longer term emission rate. Transaction fees for transferring TimeCoins would be paid out immediately such that block times would shorten as fees rose.

Scalability is a concern and would likely require testing and experementation. With large numbers of Time Providers connecting to each other, the number of DAG entries could be quite large, and even the summary could be large. Short main chain times could cause the full blockchain to grow very large very quickly, but that's a problem that's not stopping a lot of other coins. Individual Time Providers may be able to tag themselves in peer lists as private, which means that they should not be expected to be listening for connections and they may not relay blocks or other notices to the network in order to reduce load and latency to provide a more stable time by selectively choosing fast nodes in the system.

As for starting the system. There could be a few genesis nodes which are hard coded to be equivalent to high reputation medium stake nodes which are specifically created for getting the system started. These make sure that while the quantity of TimeCoin is low and reputations are low that the coin can have an accurate base to start with.

Economics

I have no idea of the economics behind the coin itself. Theororetically this sort of blockchain could be used to buy access to premium time sources, perhaps through creating a lightning network like payment channel and then paying for individual NTP queries to high performance servers, or of course more generally be traded on exchanges and the like. I know that many other utility blockchains like NameCoin never really went anywhere, (err. I must have mixed it up with something else, but NameCoin is doing decently at some 60 million market cap, but there is less demand for decentralization of NTP since it's more about providing accuracy than the rules and regulations around it). I also know that well configured NTP clients communicating with centralized NTP servers are highly accurate these days, the blockchain would create a self selecting self correcting time system that could be used as a reference for distributed systems like other blockchains that need a good decentralized time system.

Anyways, any thoughts on this would be appreciated.
Jump to: