1

I'm looking for a way that a computer could get a rough estimate of the current date and time with a very high confidence level, for example in order to verify the expiry of a contract by means of a computer program.

NTP is a popular protocol for synchronising computer clocks across a network. Despite providing highly accurate time measurements, NTP doesn't sign timestamps, which, in the context of my project, is a lack of reliability in that the nodes are susceptible to DNS spoofing or man-in-the-middle attacks#, which are able to make the victim think it's communicating with someone else than who it's actually talking to, and thereby manipulate the victim's perception of current time.

After some deliberation I realized that the blockchain can be taken as a trustworthy log of past timestamps, the latest of which give a rough estimate of the current time. Thus –I thought– I could write a program that starts a Bitcoin node, requests from its peers the latest blocks and fetches the timestamps from their headers... done! Now, I'm pretty confident this method is robust against the attacks discussed in #, but I don't know how to formalise the method. Here's my idea.

In order for the method to equally apply to old and new users, let's assume that my computer starts a brand new node each time it wants to check the current time. Each time, it will DNS-lookup some node IPs and subsequently request the latest blocks from them, check their validity and, if positive, read the timestamps. This gives raise to the following question.

  • What is the quickest way for my node to know that the blocks received from its peers have been validated by the network? Can it do so without downloading the full 400+GB blockchain nor compromising the robustness against DNS spoofing and MITM attacks?

My guess is that I could verify all the transactions, Merkle roots and headers of the blockchain provided by my peers; but still what would guarantee me that the branch that I'm looking at is backed by the network?


Despite the generic feeling of the question-marked questions, my sole goal is to turn the blockchain into a trustworthy timekeeping log (a "clockchain", if you would), not running a Bitcoin node per se. It would be ideal to find a specific solution to the problem but the only approaches I have come up with are as generic as the questions up there.

1

1 Answer 1

1

the blockchain can be taken as a trustworthy log of past timestamps, the latest of which give a rough estimate of the current time.

Very very rough. Instead of tens of milliseconds with NTP you are talking about errors of the magnitude of hours with Bitcoin block timestamps. It can be five or six orders of magnitude worse!

If you are considering Bitcoin network adjusted time from Bitcoin Version messages, I don't think that has any guarantees about accuracy or even monotonicity? It certainly doesn't take into account latency and jitter. I don't think it does much to counteract timestamp spoofing either. Apart from averaging a handful of sources.

What is the quickest way for my node to know that the blocks received from its peers have been validated by the network?

There is no way to know.

Bitcoin nodes all perform their own validation. They never assume anyone else has performed validation for them. No Bitcoin nodes ever trust any other nodes. Bitcoin nodes effectively assume all other nodes are possible liars and proceed accordingly.

NTP doesn't sign timestamps

NTP isn't a notary but it does have provision for securing reliable time.

https://en.wikipedia.org/wiki/Network_Time_Protocol#Secure_extensions

[NTP?] nodes are susceptible to DNS spoofing or man-in-the-middle attacks

On the other hand, Bitcoin nodes have to counteract possible Eclipse attacks etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.