Skip to main content
RecurringPaymentCovenant enforces a fixed-interval payment schedule. Each interval, a fixed amountPerInterval is released to a fixed recipientHash. The pay() function is permissionless — anyone can submit it when the interval has elapsed.

How Recurring Payments Work

Key Parameters

ParameterDescription
amountPerIntervalSatoshis or FT units per payment
intervalSecondsSeconds between payments
totalAmountTotal pool cap (0 = unlimited until cancelled)
startTimestampWhen first payment can occur
endTimestampHard expiry (0 = no expiry)
recipientHashImmutable recipient — fixed at deploy time

Permissionless Execution

The pay() function has no signature requirement. Any BCH node, bot, or the FlowGuard executor service can submit it. This means payments execute even if the sender is offline. The only requirement is:
tx.locktime >= next_payment_timestamp
The FlowGuard executor service monitors all active recurring payment covenants and submits pay() transactions as each interval elapses. Anyone else running an executor can do the same.

Unlimited vs Capped Streams

Setting totalAmount = 0 creates an unlimited stream that pays indefinitely until the sender calls cancel() or the UTXO is drained below the minimum amount. Setting a non-zero totalAmount caps the total pool and auto-completes once fully paid.

Pause Behavior

When resumed after a pause, next_payment_timestamp is set to now + intervalSeconds. No backdated payments are made for the pause period. This matches the expected behavior for payroll: if you pause for two weeks, the next payment is due one interval after resuming, not immediately.

NFT State (40 bytes)

[0]:    status
[1]:    flags
[2-9]:  total_paid (uint64)
[10-17]: payment_count (uint64)
[18-22]: next_payment_timestamp (5 bytes)
[23-27]: pause_start (5 bytes, 0 if not paused)
[28-39]: reserved