ERC-8316 Programmable Settlement Lock (Programmable Settlement Locks)

Draft · Vaults & DeFi · created 2026-06-25

A common interface that lets contracts using different asset models, such as transparent tokens versus privacy-preserving tokens, coordinate atomic settlement through a single lock with pre-committed spend and cancel paths.

Why it is needed

Contracts increasingly need to store and coordinate value across systems that use a growing variety of visibility and verification models. Unlike transparent tokens such as ERC-20, which expose public balances and transfer history directly, privacy-preserving assets like shielded tokens leave only opaque evidence such as commitments, proofs, encrypted values, and nullifiers. Existing settlement patterns such as approvals, escrow, and hashed timelocks (HTLC) rely on the assumption that state is public and ownership can be transferred, so they do not fit well on the leg of a settlement where shielded balances, private recipients, encrypted amounts, or off-chain verification are involved. Custom coordination logic can be built per contract type, but without a standard it is hard to reason about finality guarantees or build general-purpose solutions that span multiple contract types.

What to implement

In depth

Lock lifecycle and state

A lock is either active or inactive. The active state further splits into two cases: in the undelegated state the owner directly controls the lock and can update, spend, cancel, or delegate it, while in the delegated state only the spender, not the owner, can spend, cancel, or re-delegate, and spendCommitment and cancelCommitment can no longer be changed. A lock that does not exist, or has already been spent or cancelled, is inactive, and an inactive lock cannot be spent, cancelled, updated, or delegated. createLock must create a lock that is active, spendLock or cancelLock must transition the lock to inactive on success, and once a lock becomes inactive it can never become active again.

Authority model: owner and spender

Each lock has an owner, the creator of the lock, and a spender, the address currently authorized to control the lock. At creation, owner == spender == msg.sender, and while the lock is active there is always exactly one current spender. Only the current spender can delegate via delegateLock, spend via spendLock, or cancel via cancelLock.

Commitment immutability guarantee

A lock's execution conditions are defined by spendCommitment and cancelCommitment. These commitments can only be updated while spender == owner, and cannot be modified once spender != owner. In other words, from the moment control is delegated to a spender other than the owner, neither the owner nor the delegated spender can change the lock's structure, and updates become possible again only once authority returns to the owner.

Execution guarantee: the current spender must not be blocked

If a lock is active and msg.sender is the current spender, an implementation must not block the success of spendLock or cancelLock beyond validating the provided arguments against the relevant commitment. Expiration, timeouts, owner or admin overrides, pausing, cancellation rights, upgrades, or changes to verification policy must not be imposed as additional conditions unless they are uniquely bound to spendCommitment or cancelCommitment and evaluated only as part of validating that commitment. Execution conditions must be captured in the lock's commitments, or enforced externally by the current spender, which may be a coordination smart contract.

Requirements for creation, update, and delegation

createLock must create a new lock with a unique lockId, set owner and spender to msg.sender, initialize it with the given commitments, and emit LockCreated. updateLock must revert with LockNotActive if the lock is inactive, with LockUnauthorized if the caller is not the current spender, and with LockImmutable if spender != owner; if these conditions are satisfied, it updates the commitments and emits LockUpdated. delegateLock must revert under the same conditions, or with LockInvalidSpender if newSpender is the zero address; on success it replaces the current spender and emits LockDelegated. After delegation, the previous spender loses all authority and the new spender becomes the sole current spender.

Spend and cancel: two finality paths

spendLock must revert with LockNotActive if the lock is inactive and with LockUnauthorized if the caller is not the current spender; if the lock is active, the caller is the current spender, and the provided spendArgs satisfy implementation-specific validation against spendCommitment, it must succeed, transition the lock to inactive, and emit LockSpent. cancelLock follows the same structure, validating cancelArgs against cancelCommitment, and on success deactivates the lock and emits LockCancelled. Both paths finalize the lock into a state where it cannot be reused.

View functions and implementation-specific details

getLock must return the active lock information for a lockId, and revert with LockNotActive if it is inactive. isLockActive must return true only if the lock is active. By contrast, the structure and encoding of createArgs, updateArgs, delegateArgs, spendArgs, and cancelArgs, how spendCommitment and cancelCommitment are constructed, the logic for validating execution arguments against commitments, and the meaning of the underlying operation a lock represents are all implementation-specific details that each implementation must define.

A proposal that has not yet been finalized

This standard is currently in Draft status, and its provisions may change or the proposal may be abandoned based on further discussion or implementation experience.

Things to watch out for

Original ERC · ← ERCs