Why Contractless Uses the Earliest Timestamp Instead of the Longest Chain

7Tm2...y5MR
23 Jul 2026
103


Most Proof-of-Work blockchains follow some version of the longest-chain rule.

Technically, many of them select the chain containing the greatest amount of accumulated work rather than simply counting which chain has the most blocks.

However, the basic idea is the same.

When two valid versions of the blockchain exist, the network usually waits to see which version grows longer or accumulates more work. The losing blocks are eventually discarded, and the network reorganizes around the winning chain.

Contractless handles this differently.

When two valid blocks compete for the same position, Contractless does not wait for one branch to become substantially longer.

It compares the competing blocks and gives priority to the valid block with the earliest timestamp.

This is an important part of Fair Proof of Work and one of the reasons Contractless requires such an active orphan-correction process.

⛓️ How Competing Blocks Are Created


Blockchain mining happens across many computers at once.

Every miner is attempting to produce the next valid block.

Sometimes two miners succeed at nearly the same time.

For example:

Block 5,000
     |
     |---- Block 5,001 mined by Node A
     |
     |---- Block 5,001 mined by Node B


Both blocks may be valid.

They may both:

  • Reference block 5,000
  • Use the correct difficulty
  • Contain valid transactions
  • Include an eligible miner
  • Have a valid proof and miner signature
  • Follow the Fair Proof of Work distribution rules


The problem is that only one of them can remain in the final blockchain.

This temporary disagreement is commonly called a fork or orphan condition.
It does not necessarily mean anyone cheated.

It may simply mean two miners found valid blocks before either one received the other miner’s announcement.


πŸ“ How Longest-Chain Selection Usually Works


In a traditional longest-chain system, different parts of the network may temporarily build on different blocks.

One group may build on Node A’s block:

5,000 β†’ 5,001A β†’ 5,002A


Another group may build on Node B’s block:

5,000 β†’ 5,001B β†’ 5,002B


The network continues until one branch accumulates more accepted work.

The shorter or weaker branch is then abandoned.

Its blocks become orphans, and nodes following that branch reorganize onto the winning chain.

This approach has been used successfully by major Proof-of-Work blockchains.

However, it also means a temporary fork may continue growing before the network settles on a winner.

More blocks can be mined on top of the disagreement. More transactions can be included on both sides. The eventual correction becomes larger because the network waited longer to decide.


⏱️ The Contractless Approach


Contractless attempts to settle the disagreement at the first competing block.

Suppose two candidates exist for block 5,001:

Block 5,001A timestamp: 12:00:15
Block 5,001B timestamp: 12:00:17


If both blocks are otherwise valid and share the same parent, block 5,001A wins because it has the earlier timestamp.

The decision does not depend on which block reached one particular node first.

It also does not depend on which branch happened to mine another block first.

Every node can examine the same candidate information and apply the same deterministic comparison.

The intended result is:

Block 5,000 β†’ Block 5,001A


Block 5,001B is rejected as the losing candidate.

πŸ₯‡ What Happens When Timestamps Match?


Two blocks can occasionally contain the same timestamp because Contractless timestamps use whole seconds.

The timestamp therefore cannot be the only comparison.

When two valid candidates have the same timestamp, Contractless applies additional deterministic comparisons:

  1. The earliest timestamp wins.
  2. If timestamps match, the lower nonce wins.
  3. If both timestamp and nonce match, the lower VRF value wins.


This means nodes do not have to make a random decision.

The same valid candidates presented to different nodes should produce the same ordering.

The timestamp is the primary rule. The nonce and VRF provide deterministic tie-breakers when the timestamp alone cannot identify one winner.

πŸ” Finding the Actual Point of Disagreement


A node may not discover the competing block immediately.

It might first notice the problem when block 5,002, 5,003, or another later block arrives with a parent that does not match its local chain.

Contractless therefore checks backward through its recent orphan window.

It does not simply compare the latest block and assume that is where the problem began.
The node looks for the earliest height where its local block and the competing candidate differ.

For example:

Local:     5,000 β†’ 5,001A β†’ 5,002A β†’ 5,003A
Competing: 5,000 β†’ 5,001B β†’ 5,002B β†’ 5,003B


The real disagreement began at block 5,001.

That is the height where the winner must be determined.

Contractless examines the competing candidates at that point and applies the timestamp, nonce, and VRF ordering rules.

If the competing block wins, the node can roll back to the divergence point and replay the winning branch.

🧩 A Torrent Announcement Is Not Enough


A node does not reorganize its blockchain merely because another node announces a torrent with an earlier timestamp.

That would place far too much trust in network metadata.

Before rollback begins, Contractless must obtain the competing block data and prove that the candidate can attach to the existing chain.

The node checks that:

  • The torrent metadata is correctly formed
  • The expected number of pieces exists
  • Every downloaded piece matches its hash
  • The reconstructed block matches the full torrent hash
  • The block header matches the advertised header hash
  • The previous block hash matches the shared parent
  • The miner is registered and eligible
  • The difficulty is correct
  • The miner proof is valid
  • The transactions and reward are valid
  • The block follows the remaining consensus rules


Only a proven block candidate can cause the local chain to be rolled back.

An earlier timestamp does not rescue an invalid block.

The candidate must be both earlier and valid.

πŸ•°οΈ Can a Miner Simply Lie About the Time?


A blockchain timestamp is not a perfect measurement from a trusted global clock.

It is a value placed into the block by the miner.

Contractless constrains that value through several rules.

A block timestamp must be at least two seconds after its parent block’s timestamp. A received block also cannot be more than three seconds ahead of the validating node’s current time.

Node handshakes additionally require closely synchronized system clocks. This is why Contractless operators are instructed to use NTP or another reliable time-synchronization service.

The timestamp is also part of the block header used to create the miner’s proof. A dishonest node cannot alter the timestamp after mining without changing the header and invalidating the resulting proof.

These rules limit timestamp manipulation, but they should not be described as turning timestamps into perfect external proof of when an event happened.

The timestamp is a consensus value operating within defined boundaries.

That is why Contractless still requires full block verification and deterministic tie-breakers instead of trusting the timestamp by itself.


⚑ Why Decide at the First Competing Block?


Waiting for one branch to become longer allows the disagreement to grow.

Contractless instead tries to answer a simpler question:

Which valid candidate should have occupied this block height in the first place?


Once that winner is known, later blocks should be built on top of it.

The purpose is not to pretend forks never happen.

Fast blockchains are especially likely to produce occasional competing blocks because miners have less time to receive each new block before attempting the next one.

Contractless targets an average block time of approximately 15 seconds.

At that speed, temporary disagreements are expected network behavior.

The important question is how quickly and consistently the network corrects them.

Selecting the earliest valid candidate gives Contractless a deterministic answer without deliberately waiting for several additional blocks.


🌐 Why Arrival Order Is Not Good Enough


The first block received by one node may not be the first block received by another.
Internet routes are not equal.

A miner in one location may reach nearby nodes faster, while another miner reaches a different part of the network first.

If arrival order permanently determined the winner, geography and network connectivity could influence consensus too heavily.

Contractless may initially save the first valid block it receives because the node cannot compare it against a candidate it has not seen yet.

However, the decision is not necessarily permanent.

When the competing torrent arrives, the node stages it and can perform an orphan check.

The deterministic candidate rules then decide which block should remain.

This separates temporary arrival order from final candidate selection.


πŸ”„ Why Orphan Correction Is So Important


The earliest-timestamp rule depends on nodes preserving and examining competing candidates.

A node cannot correct to a better block if it discarded all evidence that the block existed.

This is why Contractless stages competing torrents and keeps recent orphan information available.

When a disagreement is detected, the node can:

  1. Locate the first competing height.
  2. Compare the local and staged candidates.
  3. Download the competing block pieces.
  4. Reconstruct and verify the complete block.
  5. Determine which valid candidate wins.
  6. Undo the losing branch when necessary.
  7. Replay the winning blocks in order.
  8. Restore or remove affected mempool transactions.


Orphan correction is not an emergency feature that should almost never run.

It is part of normal operation for a fast decentralized blockchain.

The network should expect occasional disagreements and have a reliable process for resolving them.


πŸ›‘οΈ Recent Forks and Older Chain History


Contractless handles recent competing blocks differently from deep chain disagreements.

Near the current tip, nodes compare staged candidates within the orphan window and apply the deterministic winner rules.

Older chain history is protected through delayed snapshots.

Contractless periodically records a block hash from safely behind the current tip after connected peers reach the required agreement. The snapshot remains behind recent blocks so normal orphan correction still has room to operate.

This creates two different areas:

  • A recent area where competing blocks can still be compared and corrected
  • An older area where agreed chain history becomes increasingly stable


If a newly syncing node discovers a deeper mismatch, it must find a shared ancestor before continuing forward.

The network does not simply allow an arbitrary recent candidate to rewrite established history.

βš–οΈ Earliest Does Not Mean Easiest


The earliest candidate does not win merely because it claims a smaller timestamp.

It still has to satisfy the difficulty that the chain requires.

It still needs a valid miner proof.

It still needs an eligible miner.

It still needs valid transactions.

It still needs the correct parent.

It still needs to survive full reconstruction and block validation.

The timestamp determines priority between candidates that have already met the underlying rules.

It does not replace Proof of Work.


🧠 A Different Answer to a Familiar Problem


The longest-chain model asks:

Which branch eventually accumulated the most work?


Contractless asks:

At the first point of disagreement, which valid block had the earliest timestamp?


Neither question eliminates the possibility of temporary forks.

They represent different ways of deciding how those forks should be resolved.

Contractless chose the earliest-timestamp method because its design prioritizes:

  • Fast block production
  • Rapid correction of competing blocks
  • Deterministic candidate selection
  • Reduced dependence on continued branch growth
  • Correction at the original point of disagreement
  • Consistent decisions across independent nodes


This makes orphan correction a central part of consensus rather than an occasional cleanup process.


πŸ–₯️ Why Independent Testnet Nodes Matter


A chain-selection rule cannot be tested properly with several nodes running on one developer’s computer.

Real testing requires:

  • Different Internet providers
  • Different geographic locations
  • Unequal network latency
  • Temporary disconnections
  • Nodes restarting at different heights
  • Competing blocks arriving in different orders
  • Slow and fast peer connections


Every independent Contractless testnet node creates more realistic conditions for testing earliest-timestamp selection and orphan correction.

A node may appear to be operating normally while connected to only part of the network. It may receive a competing block several seconds later than another node. It may temporarily build on a candidate that eventually loses.

Those are exactly the situations the testnet needs to expose.

Contractless can now operate on inexpensive hardware, including entry-level VPS plans, older computers, mini PCs, and many Linux-capable Chromebooks.

Running a node helps determine whether this different approach to chain selection remains reliable outside controlled development environments.

That is how Fair Proof of Work, earliest-timestamp selection, and Contractless orphan correction become more than ideas written in source code.

Support Us by Running a Contractless Testnet Node

Contractless Releases

Enjoy this blog? Subscribe to brucebates

0 Comments