Skip to main content

How the Milestone Clock Works

When a grant is funded, the covenant stores:
  • startTime — when the first milestone window begins
  • stepInterval — duration in seconds between milestones
  • stepAmount — on-chain token units per milestone
  • totalReleased — how much has already been released
The CashScript covenant enforces:
elapsed = current_blocktime - lastReleaseTime
milestonesElapsed = elapsed / stepInterval
releasable = milestonesElapsed * stepAmount - totalReleased

Releasing a Milestone

1

Open the grant

In the recipient’s dashboard go to Grants → Receiving and open the grant.
2

Check what is due

The grant detail shows Releasable amount and Milestones due. These update in real time based on the current timestamp.
3

Release

Click Release Milestone. The app calls POST /api/budget-plans/:id/release with your address. Multiple elapsed milestones are batched into one transaction.
4

Sign and confirm

Sign the transaction in your wallet. After broadcast, the app calls POST /api/budget-plans/:id/confirm-release and advances current_milestone.

What Each Release Records

Each released milestone writes a row to the budget_releases table with:
FieldValue
milestone_indexIndex of the milestone released
amountDisplay amount released
released_atUnix timestamp
tx_hashOn-chain transaction hash
The grant panel in the app shows the full release history as a timeline.

Early Release Not Possible

The covenant enforces time. If a milestone has not elapsed, the release call returns 400: Nothing releasable yet. There is no override — the contract itself prevents early release.