VestingCovenant enforces token or BCH vesting schedules on-chain. Two schedule types are supported: linear (continuous pro-rata release) and step (discrete periodic unlocks).
Schedule Types
Linear Vesting
Tokens vest continuously proportional to elapsed time. At any moment, the claimable amount is
totalAmount × elapsed / duration − alreadyReleased.Step Vesting
Tokens release in discrete chunks every
stepInterval seconds. Claimable = completedSteps × stepAmount − alreadyReleased.Cliff
WhencliffTimestamp > 0, no claims are allowed before that time. The cliff is enforced by the contract via require(tx.locktime >= cliffTimestamp). After the cliff passes, all vested-since-start tokens become claimable at once.
Pause and Resume
When the sender pauses a vesting stream,pause_start is recorded in the NFT commitment. On resume, the cursor advances by (resumeTime - pause_start), effectively excluding the paused duration from all future vested-amount calculations.
Cancel
Cancellation splits the remaining pool at the moment of cancellation:- Vested (unclaimed) → recipient
- Unvested → sender
claim() at the cancellation timestamp.
Transfer
IfFLAG_TRANSFERABLE (0x02) is set, the current recipient can reassign the stream to a new bytes20 recipient hash. The current recipient must sign. The NFT commitment recipient_hash field is updated in place.

