---
slug: "MonotonicCounter"
name: "MonotonicCounter"
type: "Protocols"
layer: "Society"
ref: "MonotonicCounter#d0d3"
sema_id: "sema:MonotonicCounter#mh:SHA-256:d0d3ce256be4bc080a29eab7fda36381a4352a280d9a12d59179c60e71cf9bd0"
tags: ["Society","Protocols"]
updated: 2026-11-11
mindscape: "bootstrap"
index_url: https://mindscape.pages.dev/bootstrap/index.json
url: https://mindscape.pages.dev/bootstrap/MonotonicCounter/
related: ["StateLock","Value","AuditTrail","Ballot","TimeWarpLog"]
---

# MonotonicCounter

Value that never decreases

Layer: Society · Category: Protocols

## Mechanism

A distributed coordination primitive where a value (clock, version, balance) never decreases. This simplifies consensus: a node seeing a higher value knows it is seeing later state, without needing to compare histories. It is the foundation of logical clocks and CRDTs, and relies on a [StateLock](https://mindscape.pages.dev/bootstrap/StateLock.md) (or CRDT logic) to ensure the value never regresses.

## Invariants

- [Value](https://mindscape.pages.dev/bootstrap/Value.md)(T+1) >= [Value](https://mindscape.pages.dev/bootstrap/Value.md)(T).
- A merge yields at least each of its inputs: Merge(A, B) >= A and >= B.

## Preconditions

- Initial value defined

## Postconditions

- Order preserved

## Failure modes

- Counter overflow (finite integer space).

## Builds on

- [StateLock](https://mindscape.pages.dev/bootstrap/StateLock.md) (Society; References)
- [Value](https://mindscape.pages.dev/bootstrap/Value.md) (Infrastructure; References)

## Used by

- [AuditTrail](https://mindscape.pages.dev/bootstrap/AuditTrail.md) (Infrastructure; References)
- [Ballot](https://mindscape.pages.dev/bootstrap/Ballot.md) (Infrastructure; References)
- [TimeWarpLog](https://mindscape.pages.dev/bootstrap/TimeWarpLog.md) (Infrastructure; References)

## Identity

- Sema ID: `sema:MonotonicCounter#mh:SHA-256:d0d3ce256be4bc080a29eab7fda36381a4352a280d9a12d59179c60e71cf9bd0`
- Ref: `MonotonicCounter#d0d3`
- Supersedes:
  - `sema:MonotonicCounter#mh:SHA-256:f5a36a7775fe69757b2ab6fbf2dc66eab6689a1487b65005ae7ddef04dbd8235`
  - `sema:MonotonicCounter#mh:SHA-256:40968470b9f8326f0171ebdc2ca7253982dc677e69aedfec61957a4ea5489131`
  - `sema:MonotonicCounter#mh:SHA-256:33824eaaf148d996cbc3ccd7521b62dbba087070d23b5421918a446df3f01c8b`
  - `sema:MonotonicCounter#mh:SHA-256:21c63e6bc594106fb6bd773e2d91a2ecb0aebb43e550d55cfbe901e6a38628a3`

## Links

- [Pattern page](https://mindscape.pages.dev/bootstrap/MonotonicCounter/)
- [View in the interactive graph](https://mindscape.pages.dev/bootstrap/#MonotonicCounter)
- [JSON](https://mindscape.pages.dev/bootstrap/MonotonicCounter.json)
- [Index of all patterns](https://mindscape.pages.dev/bootstrap/index.json)
