Skip to main content
A Reusable Bonding Primitive for Substrate Runtimes

pallet‑commitment

frame_suite::commitment

Raw balance locks are blunt instruments. Commitment gives assets meaning - bonded to a reason, anchored to a digest, adjusted dynamically, and resolved with full accounting fidelity.

Polkadot SDKSubstrateFRAME

Bond with Purpose. Resolve with Precision.

The only commitment primitive your runtime will ever need.

Semantic BondsLazy EvaluationThree ModelsPosition VariantsFungible-AgnosticExplicit ImbalancePlugin BalanceMulti-InstanceVirtualReceiptReusable PrimitiveSemantic BondsLazy EvaluationThree ModelsPosition VariantsFungible-AgnosticExplicit ImbalancePlugin BalanceMulti-InstanceVirtualReceiptReusable Primitive
State Machine

Commitment Lifecycle

A commitment travels through a well-defined lifecycle - from pre-reservation through active bonding, lazy adjustment, and final resolution with explicit imbalance handling.

01
Pre-Reserve

Funds are moved from the proprietor's free balance into the PrepareForCommit hold - a reusable reserve shared across commitment operations. The reserved balance can be consumed by any consumer pallet using this commitment instance.

02
Place

A commitment is created under a (reason, digest) pair. The digest defines how value is applied - Direct, Index, or Pool. A VirtualReceipt is issued as a claim over the committed value.

place(reason, digest, value)
03
Raise

Existing commitments can be increased by adding additional value under the same (proprietor, reason, digest) scope. Each increase creates a new CommitInstance while preserving independent resolution history.

raise(reason, digest, extra_value)
04
Adjust

The digest state changes through lazy balance operations.Mint increases value for rewards, while Reap reduces value for penalties. Existing commitments automatically reflect the updated digest state during resolution.

mint_digest(digest, amount)reap_digest(digest, amount)
05
Resolve

A commitment is evaluated using its VirtualReceipt against the current digest state. The final resolved value includes all previous digest-level adjustments, with any difference handled through explicit imbalance reconciliation.

resolve(proprietor, reason, digest)
06
Withdraw

The proprietor receives the final settled amount after resolution. The outcome reflects every mint, reap, and redistribution applied since placement - it may be more, less, or equal to the original deposit. The VirtualReceipt is consumed and the economic position closes.

Commitment lifecycle - six stages from pre-reserve through withdraw
Commitment Architecture

The Three Models

Choose the right commitment model for your use case. Each model represents a different level of structure, delegation, and value distribution.

Direct commitment model - one proprietor bonded to a single digest
Model - 1

Direct

  • One proprietor bonded straight to a single digest under a given reason - no intermediaries, no delegation.
  • Optional position variants (Long / Short, Affirmative / Contrary) per digest with independent lazy balances.
  • Ideal for escrow, collateral, single-target staking, and any direct one-to-one bonding use case.
Index commitment model - value fans out across entries by share weight
Model - 2

Index

  • Commit once to an index - value fans out proportionally across all entries by share weight automatically.
  • Fully permissionless and unmanaged. No manager required; share weights define the distribution.
  • Ideal for nomination baskets, delegation spreads, and multi-target proportional bonding.
Pool commitment model - manager controls slot allocation non-custodially
Model - 3

Pool

  • A manager controls slot allocation and rebalances dynamically - earning commission on resolution.
  • Non-custodial architecture: the manager steers the pool without ever holding user funds.
  • Ideal for staking pools, yield vaults, and any managed delegation with dynamic rebalancing.
Commitment models mascot
Capabilities

Key Features

Everything you need to build structured, adjustable, and resolvable asset bonding into your runtime - without writing the infrastructure from scratch.

Mascot explaining reusable bonding

Reusable Bonding Primitive

One pallet, shared across your entire runtime. Staking, escrow, governance, and pools all bond through the same infrastructure, eliminating duplicated locking logic across pallets.

Mascot explaining semantic structure

Semantic Structure

Assets are bound under a reason and a digest, giving every commitment purposeful identity. No more raw opaque locks - every bond carries context.

Mascot explaining dynamic value adjustment

Dynamic Value Adjustment

Digest-level rewards and penalties are applied lazily; value adjustments propagate to all committed proprietors without requiring eager recalculation on every block.

Mascot explaining three commitment models

Three Commitment Models

Choose from Direct, Index, or Pool commitment models - each with progressive levels of grouping, delegation, and management built in out of the box.

Mascot explaining positional variants

Positional Variants

Long/short, affirmative/contrary, positive/negative - commitments can carry a semantic position, enabling directional staking, prediction markets, and multi-sided governance.

Mascot explaining fungible-agnostic design

Fungible-Agnostic

Works with any asset implementing the Substrate fungible traits, no coupling to a specific token. Plug into your runtime's existing asset infrastructure without modification.

Under the Hood

Lazy Balance Engine

Values stored as virtual types - materialised only at the moment of resolution. Zero per-block computation. Fully pluggable balance semantics via a runtime-supplied plugin family.

Mascot explaining Virtual Types
Concept 01

Virtual Types

"I hold state, not value. Every adjustment reaches the holder lazily - precisely at the moment of truth."

VirtualBalance

Live lazy accumulator at the digest level. Acts as the shared source of truth for every receipt bound to that digest. Never recomputed per block - queried only on demand.

VirtualReceipt

Issued at commit time. Acts like a claim ticket - it carries no concrete amount, only a reference. When redeemed at resolution, it reflects every mint and reap since deposit.

VirtualSnapshot

A point-in-time capture of the balance state. Used for proportional and time-weighted calculations - enabling fair distribution across receipts committed at different moments.

VirtualBalanceVirtualReceiptVirtualSnapshot
Concept 02

Plugin Dispatch

"The pallet does not know the math. It only speaks LazyInput - the BalanceFamily answers in LazyOutput."

BalanceFamily

The runtime-supplied plugin anchor. Defines the complete semantics of every balance operation - deposit, mint, reap, withdraw. Swappable without touching any commitment logic.

LazyInput

Tagged operation carrier. Each call is wrapped into a typed input - discriminated by a root tag - and dispatched into the plugin family for execution.

LazyOutput

Result boundary returned by the plugin. Carries computed values, issued receipts, or explicit error outcomes. No silent failures - every result is typed and handled.

BalanceFamilyLazyInputLazyOutput
Mascot explaining Plugin Dispatch
Mascot explaining Lazy Operations
Concept 03

Lazy Operations

"Four operations. One promise - your balance is always right when you need it, never computed when you don't."

Deposit

The entry operation. Accepts value into the VirtualBalance and returns a VirtualReceipt - the immutable claim ticket stored alongside the CommitInfo.

Mint

Grows the digest VirtualBalance - distributing rewards to all receipt holders proportionally. No per-receipt update. Every holder benefits lazily at withdrawal time.

Reap

Shrinks the digest VirtualBalance - penalising all holders proportionally. Returns an explicit imbalance to the caller. No silent burns - full accounting.

Withdraw

The exit operation. Redeems the VirtualReceipt against the current digest state. The final value is materialised here - reflecting every mint and reap since deposit.

deposit()mint()reap()withdraw()

Zero Per-Block Cost

No eager recomputation. Balances materialise only at the moment of resolution - keeping runtime overhead minimal.

Fully Pluggable

The runtime supplies a BalanceFamily plugin defining all balance semantics - swap it without touching any commitment logic.

Explicit Imbalance

Every reap returns an explicit imbalance to the caller - no silent mints or burns. Full accounting fidelity on every resolution.

Applications

Use Cases

pallet-commitment is not built for one use case. Any runtime need that requires structured, adjustable, and resolvable asset bonding fits naturally - from staking to escrow to prediction markets.

Mascot · Staking
01

Staking

  • Bond stake under a staking reason. Direct model for validators, Index for nominators.
  • Era rewards lazily minted into the digest - distributed proportionally to all receipts at resolution.
Mascot · Governance
02

Governance

  • Commit voting power with Affirmative / Contrary position variants per proposal digest.
  • Reward correct predictions via mint. Slash manipulation via reap on resolution.
Mascot · Staking Pools
03

Staking Pools

  • Manager rebalances slots across validators non-custodially. Commission collected on resolution.
  • Delegators commit once to the pool - rewards fan out automatically through digest adjustments.
Mascot · Escrow
04

Escrow

  • Bond under a contract digest. Release on condition fulfilment. Slash on breach via reap.
  • Explicit imbalance returned to the consumer pallet - no silent mint or burn ever.
Mascot · Bonds
05

Bonds

  • Issue structured on-chain bonds backed by committed assets under a reason and digest.
  • Adjust coupon value via mint, handle defaults via reap - all resolved with full accounting.
Mascot · Prediction Markets
06

Prediction Markets

  • Long / Short variants on market digests. Participants commit to positions against an oracle.
  • Oracle settlement mints the winning side - losing side is reaped proportionally on resolve.
For Builders

Ready to Build

pallet-commitment ships with full documentation, a pre-configured runtime template, and example pallets - everything you need to drop it into your Substrate runtime today.

  • Reusable by designOne pallet, shared across every consumer in your runtime.
  • Three commitment modelsDirect, Index, and Pool - each with progressive levels of structure.
  • No std assumptionsno_std + WASM compatible out of the box.
  • Lazy evaluationZero per-block recomputation - balances materialise on demand.
  • Fully on-chainNo oracles, no bridges. Pure on-chain commitment logic.
Get Started

Ready to build with pallet-commitment?

Pre-configured template & runtime, example pallet, and full documentation included.

02Follow the Installation Guide
03Build your own commitment-powered Runtime
  • Fungible-agnosticWorks with any asset implementing Substrate fungible traits.
  • Positional variantsLong/Short, Affirmative/Contrary - semantic positions per digest.
  • Explicit imbalanceEvery reap returns an imbalance. No silent mint or burn, ever.
  • Pluggable balance modelSwap the BalanceFamily plugin without touching commitment logic.
  • Multiple instancesInstantiate independently per use case via I: 'static.
For Builders

Ready to Build

pallet-commitment ships with full documentation, a pre-configured runtime template, and example pallets - everything you need to drop it into your Substrate runtime today.

  • Reusable by designOne pallet, shared across every consumer in your runtime.
  • Three commitment modelsDirect, Index, and Pool - each with progressive levels of structure.
  • No std assumptionsno_std + WASM compatible out of the box.
  • Lazy evaluationZero per-block recomputation - balances materialise on demand.
  • Fully on-chainNo oracles, no bridges. Pure on-chain commitment logic.
  • Fungible-agnosticWorks with any asset implementing Substrate fungible traits.
  • Positional variantsLong/Short, Affirmative/Contrary - semantic positions per digest.
  • Explicit imbalanceEvery reap returns an imbalance. No silent mint or burn, ever.
  • Pluggable balance modelSwap the BalanceFamily plugin without touching commitment logic.
  • Multiple instancesInstantiate independently per use case via I: 'static.
Get Started

Ready to build with pallet-commitment?

Pre-configured template & runtime, example pallet, and full documentation included.

02Follow the Installation Guide
03Build your own commitment-powered Runtime
Mascot - ready to build
For Builders

Ready to Build

pallet-commitment ships with full documentation, a pre-configured runtime template, and example pallets.

  • Reusable by designOne pallet, shared across every consumer in your runtime.
  • Three commitment modelsDirect, Index, and Pool - each with progressive levels of structure.
  • No std assumptionsno_std + WASM compatible out of the box.
  • Lazy evaluationZero per-block recomputation - balances materialise on demand.
  • Fully on-chainNo oracles, no bridges. Pure on-chain commitment logic.
Get Started

Ready to build with pallet-commitment?

Pre-configured template & runtime, example pallet, and full documentation included.

02Follow the Installation Guide
03Build your own commitment-powered Runtime
  • Fungible-agnosticWorks with any asset implementing Substrate fungible traits.
  • Positional variantsLong/Short, Affirmative/Contrary - semantic positions per digest.
  • Explicit imbalanceEvery reap returns an imbalance. No silent mint or burn, ever.
  • Pluggable balance modelSwap the BalanceFamily plugin without touching commitment logic.
  • Multiple instancesInstantiate independently per use case via I: 'static.