Kaspa x402

Server Runtime Lock Contract

ChannelLockManager serializes work that can otherwise execute protected handlers or competing settlement transitions concurrently. The in-memory implementation is for a single server process. Production deployments that run more than one server process for the same trust domain need a shared lock manager.

Required Guarantees

Required Scopes

The direct-mode server uses the lock manager for:

All access paths that can mutate one Alpha.10 batch lane must resolve to the same stable lineage key. The rotating current outpoint is persisted and compared, but must not be used as the only lock key because claim and top-up transactions replace it.

Durable State Still Decides

The post-verification exact lock is the handler-safety lock. Durable stores still need unique transaction-id replay records because locks can expire, fail, or be lost during process shutdown.

The same rule applies to batch lanes. A lock does not prove which transaction won an outpoint race and does not recover a KIP-20 head. Claim, top-up, and refund must reserve durable crash-safe attempts, compare the expected current outpoint and A/S/T/V snapshot atomically, and reconcile uncertain broadcasts before the lane is unlocked for more work. Standard RPC has no covenant-id-to-current-UTXO reverse lookup, so recovery follows persisted transaction lineage.

Source: /docs/server-runtime-lock-contract.md