For bitcoin-cli getblock, what's the difference between "time" and "mediantime"?

If i'm looking for a strictly increasing series of timestamps, is one better to choose than the other?


mediantime is better for your purpose. The timestamp is chosen by the miners, and has some restrictions on it such as it can't be too far in the future/past (no more than 2 hours into the future), but it is not strictly increasing. Mediantime, on the other hand, is. Mediantime is the median time of the past 11 block timestamps, and a block must have a timestamp greater than that median time, so the mediantime always increases.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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