---
slug: "StateLock"
name: "StateLock"
type: "Protocols"
layer: "Society"
ref: "StateLock#c9c2"
sema_id: "sema:StateLock#mh:SHA-256:c9c2809bdf97bb6ac17a8ffe428d4aa9a28294b99d64cc8a336a239d26a8afb8"
tags: ["Society","Protocols"]
updated: 2026-11-11
mindscape: "bootstrap"
index_url: https://mindscape.world/scapes/bootstrap.json
url: https://mindscape.world/bootstrap/StateLock/
related: ["Backoff","Cooldown","Actor","Lock","State","CausalBarrier","ContinuousResourceAuction","IdempotentWrite","MonotonicCounter"]
---

# StateLock

Atomic coordination via temporary state fusion

Layer: Society · Category: Protocols

## Mechanism

A coordination pattern where two [Actor](https://mindscape.world/scapes/bootstrap/Actor.md)s temporarily 'fuse' a subset of their writable [State](https://mindscape.world/scapes/bootstrap/State.md). During the [Lock](https://mindscape.world/scapes/bootstrap/Lock.md), changes require a cryptographic signature from both. Contention triggers [Backoff](https://mindscape.world/scapes/bootstrap/Backoff.md) and [Cooldown](https://mindscape.world/scapes/bootstrap/Cooldown.md).

## Invariants

- Both [Actor](https://mindscape.world/scapes/bootstrap/Actor.md)s sign every write to the fused [State](https://mindscape.world/scapes/bootstrap/State.md) subset.
- Exclusive over that subset: no third party writes it while the [Lock](https://mindscape.world/scapes/bootstrap/Lock.md) holds.
- Temporary: the fusion ends on completion or timeout, never implicitly.

## Failure modes

- Deadlock: both parties wait for each other indefinitely.
- Livelock: lock acquired and released rapidly, denying access to others.
- Premature dissolution: state auto-dissolves while legitimate work is in progress.

## Signature

- `Lock(State)`

## Caution

Exclusive state access — misuse enables denial of service via lock starvation.

## Builds on

- [Backoff](https://mindscape.world/scapes/bootstrap/Backoff.md) (Infrastructure; Composes with)
- [Cooldown](https://mindscape.world/scapes/bootstrap/Cooldown.md) (Infrastructure; Composes with)
- [Actor](https://mindscape.world/scapes/bootstrap/Actor.md) (Infrastructure; References)
- [Lock](https://mindscape.world/scapes/bootstrap/Lock.md) (Physics; References)
- [State](https://mindscape.world/scapes/bootstrap/State.md) (Infrastructure; References)

## Used by

- [CausalBarrier](https://mindscape.world/scapes/bootstrap/CausalBarrier.md) (Physics; References)
- [ContinuousResourceAuction](https://mindscape.world/scapes/bootstrap/ContinuousResourceAuction.md) (Society; Composes with)
- [IdempotentWrite](https://mindscape.world/scapes/bootstrap/IdempotentWrite.md) (Infrastructure; References)
- [MonotonicCounter](https://mindscape.world/scapes/bootstrap/MonotonicCounter.md) (Society; References)

## Identity

- Sema ID: `sema:StateLock#mh:SHA-256:c9c2809bdf97bb6ac17a8ffe428d4aa9a28294b99d64cc8a336a239d26a8afb8`
- Ref: `StateLock#c9c2`
- Supersedes:
  - `sema:StateLock#mh:SHA-256:774b674f80993c49b0a348c384397f80027af319faa3440813d9d53b3eaa6a14`
  - `sema:StateLock#mh:SHA-256:b91b68adbca94d80103e153ae63a987cbd7fb3a29463a5c8e6d88132b85cfa9a`
  - `sema:StateLock#mh:SHA-256:7cd86a9de68522b752366ef04de32f743b57ef16232866522ccdafb1f35c6da9`
  - `sema:StateLock#mh:SHA-256:8bde7c49752578e5c76e46d33b995497728f486d69d99ff618b9dbeaa7586c78`

## Links

- [Pattern page](https://mindscape.world/bootstrap/StateLock/)
- [View in the interactive graph](https://mindscape.world/bootstrap/#StateLock)
- [JSON](https://mindscape.world/scapes/bootstrap/StateLock.json)
- [Index of all patterns](https://mindscape.world/scapes/bootstrap.json)
