> For the complete documentation index, see [llms.txt](https://docs.origintrail.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.origintrail.io/general/random-sampling.md).

# Random Sampling

**Random Sampling** is the DKG's **Proof-of-Knowledge (PoK)** system: the mechanism that continuously verifies Core Nodes are actually storing the knowledge they claim to host, and that drives how network rewards are distributed.

Random Sampling is Core-only. A node must run with `nodeRole: "core"`, have a non-zero on-chain node profile (`identityId`), **and be admitted to the active sharding table** before the prover can bind. A profile by itself is not enough: staking or admission may still be incomplete. The node rechecks startup eligibility in the background, so the prover can start after admission without a daemon restart. See [Core Node Profile Registration](/use-dkg/run-node.md#core-node-profile-registration) for setup and recovery.

## Why it exists

In a decentralized network, data availability can't be assumed — it has to be proven. Core Nodes host and serve Knowledge Assets, and Random Sampling lets the network constantly and randomly challenge them to prove they still hold specific data. The system:

* ensures knowledge remains available over time,
* rewards nodes that are consistently online and serving data, and
* provides a fair, automated way to distribute network rewards.

It is lightweight by design — nodes prove small slices of data rather than the whole graph — so it scales to billions of Knowledge Assets.

## How it works (high level)

1. **Challenge** — at the start of each *proof period*, an on-chain contract randomly selects a chunk of a Knowledge Collection for each Core Node to prove.
2. **Proof** — the node computes a Merkle proof for that chunk and submits it on-chain, where the contract verifies it.
3. **Score** — valid proofs accumulate into a node's score over each *epoch* (a longer reward cycle), reflecting uptime and the knowledge it serves.
4. **Rewards** — at the end of the epoch, rewards are distributed based on those scores.

Time is coordinated by two on-chain layers: **epochs** (long reward cycles) and **proof periods** (short, frequent challenge windows within each epoch).

## In V10

Random Sampling remains the core availability-proof system in V10. Staking and rewards are governed by the V10 **conviction** model — see [Conviction & Economics](/how-dkg-works/conviction-and-economics.md) for how staking, publishing, and rewards fit together.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.origintrail.io/general/random-sampling.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
