> For the complete documentation index, see [llms.txt](https://docs.playnance.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.playnance.com/finality-and-determinism/finality-and-determinism.md).

# Finality & Determinism

Finality and determinism are foundational guarantees in PlayBlock.\
They define when a transaction is considered complete and whether the same inputs will always produce the same result.

In a gaming and financial execution environment, these properties are not optional — they are critical for correctness, fairness, and user trust.

### What Is Finality?

Finality answers a simple question:

In PlayBlock, finality means:

* The transaction is included in a confirmed block
* The state change is irreversible
* All downstream systems can safely act on the result

#### Practical Meaning

Once a bet, payout, or reward is finalized:

* Balances will not roll back
* Game results cannot change
* External systems can safely reconcile state
* Users can trust what they see in their wallet and UI

This is essential for:

* Casino games
* Prediction settlements
* Treasury movements
* Reward distributions

### PlayBlock Finality Model

PlayBlock is built to provide fast, deterministic finality suitable for real-time applications.

#### Key Properties

* **Single authoritative state**
* **No probabilistic settlement**
* **No fork-based ambiguity for execution**

Once a transaction reaches finality:

* It is final for all services
* It is final for all players
* It is final for all partners

There is no concept of “likely final” vs “fully final” inside the application layer.

### Determinism in PlayBlock

In PlayBlock, determinism applies to:

* Game logic
* Bet resolution
* Reward calculations
* Fee handling
* Settlement outcomes

This ensures that execution is:

* Predictable
* Verifiable
* Replay-safe
* Auditable

### Why Determinism Matters for Games

Games are state machines.

If the same game state could resolve differently:

* Fairness breaks
* Audits become impossible
* Disputes cannot be resolved
* Trust collapses

PlayBlock enforces determinism so that:

* A bet resolves exactly once
* Outcomes are mathematically reproducible
* No hidden randomness exists at settlement time
* External observers can independently verify results

### Deterministic Execution Pipeline

PlayBlock separates **decision inputs** from **execution logic**.

#### Inputs

* Game parameters
* Odds
* Player action
* On-chain prices or feeds (snapshotted)
* Predefined rule sets

#### Execution

* Stateless evaluation
* Fixed precision math
* No time-dependent branching
* No external calls mid-execution

#### Output

* Single, deterministic result
* Identical across nodes
* Identical across replays

### No Hidden Side Effects

To preserve determinism, PlayBlock explicitly avoids:

* Floating-point arithmetic
* Clock-based logic during settlement
* External API calls inside execution
* Randomness at finalize time
* Non-idempotent state mutations

All randomness (if required) is:

* Pre-committed
* Verifiable
* Locked before execution

### Finality + Determinism Together

These two guarantees reinforce each other:

| Property    | What it Guarantees      |
| ----------- | ----------------------- |
| Determinism | The result is correct   |
| Finality    | The result is permanent |

Together they ensure:

* One execution
* One outcome
* One source of truth

No retries, no ambiguity, no “eventual correction”.

### Impact on the Ecosystem

Because finality and determinism are enforced at the core:

* Indexers can safely sync without reconciliation logic
* Analytics pipelines never need to “fix” history
* Partners can trust callbacks immediately
* Users never see reversed balances
* Audits are straightforward and reproducible

PlayBlock is designed for:

* High-frequency games
* Financial settlements
* Real money flows
* Multi-partner environments

In this context:

* Fast but weak finality is unacceptable
* Flexible but non-deterministic logic is dangerous

PlayBlock chooses correctness first — and optimizes performance without compromising determinism or finality.

### Summary

* Finality defines when state is immutable
* Determinism defines how outcomes are computed
* PlayBlock enforces both at the protocol and execution level
* This enables trustless games, clean analytics, and safe scaling


---

# 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.playnance.com/finality-and-determinism/finality-and-determinism.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.
