# Checkpoints mechanism

## <mark style="color:red;">Problem</mark>

### PoS/BFT blockchains are vulnerable to so-called <mark style="color:red;">long-range attack</mark>

Its essence is that when you start synchronizing your node with the current state of the blockchain, you have to start checking blocks 0,1,2,... and so on. At the same time, you need to take these blocks from somewhere and here is the problem - **how to make sure which block is valid?**

If, say, block 1337th was generated and confirmed by the network more than 3 years ago, then with a high degree of probability those old validators are no longer active and may have even removed their shares from staking. A problem arises - you cannot clearly determine which block with index 1337 was correct - anyone can offer you any valid fork.

## What are hostchains ?

**Hostchains** are independent L0-L1 blockchains that rely on their own security, fault tolerance and decentralization.

> ### We use their <mark style="color:red;">TOTAL POWER</mark> as the maximum source of liquidity and decentralization

## Solution

{% hint style="info" %}
In order for you to be able to check the relevance of your copy of the blockchain, the current quorum (current validators who have frozen their stake and who can be trusted because they have something to risk) makes "checkpoints" to other blockchains once per epoch (or with other frequency)
{% endhint %}

A checkpoint is a fact that looks like this, for example:

```json
{ 
    epoch: 167,
    lastLeader: 27,
    lastBlockIndexByLeader: 56,
    lastBlockHashByLeader: 'aaaa...'
}
```

If such a message is saved on many blockchains, then even after many years it can be trusted, because in order to potentially change it, attackers would need to compromise most of the blockchains.

{% hint style="success" %} <mark style="color:red;">**TLDR**</mark> - having found such a message in 2/3 of the blockchains that we will use to maintain checkpoints, you can be confident about the validity of your own copy of the state and blockchain.
{% endhint %}

## How to find checkpoints ?

{% hint style="info" %}
The same is here ⇒ [Hostchain checkpoints](/build-core-and-join-network/explorers-and-how-to-use-them/usage-guide/network-info/hostchain-checkpoints.md#solution)
{% endhint %}

In explorer visit the page about checkpoints'

<figure><img src="/files/fOaR3INRrgFr0dvSt3z8" alt=""><figcaption></figcaption></figure>

Here for each epoch, a list of checkpoints and links to the corresponding transactions in other blockchains is available.

Here **Bitcoin**, **Ethereum** and **Solana** are used as examples

In many cases, it is recommended to trust the validity of the epoch data where 2/3N checkpoints are available. This is a guarantee that the checkpoint is made forever

Long story short you can trust this

<figure><img src="/files/dNH9Jo8drOZpysKjuNRV" alt=""><figcaption></figcaption></figure>

And this:

<figure><img src="/files/4ht3zwKQixyN0y2U00vk" alt=""><figcaption></figcaption></figure>

But doubt this:

<figure><img src="/files/p69tiasAXIvA5PIaFpdb" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.klyntar.org/project-litepaper-and-main-features/checkpoints-mechanism.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
