RecurringPaymentCovenant enforces fixed-interval payments to a fixed recipient. The pay() function is permissionless.
Contract path: contracts/core/streaming/RecurringPaymentCovenant.cash
Parameters
| Parameter | Type | Description |
|---|---|---|
vaultId | bytes32 | Links to source vault |
senderHash | bytes20 | Controls pause/cancel |
recipientHash | bytes20 | Fixed payment recipient (immutable) |
amountPerInterval | int | Satoshis or FT per payment |
intervalSeconds | int | Seconds between payments |
totalAmount | int | Total pool cap. 0 = unlimited. |
startTimestamp | int | When first payment can occur. 0 = immediate. |
endTimestamp | int | Hard expiry. 0 = no expiry. |
NFT State (40 bytes)
Functions
pay()
Permissionless. Releases amountPerInterval to recipientHash. Advances next_payment_timestamp by intervalSeconds.
Validates: status == ACTIVE, tx.locktime >= next_payment_timestamp, time window constraints, newTotalPaid <= totalAmount (if capped)
Auto-completes when newTotalPaid >= totalAmount
pause(sig senderSig, pubkey senderPubkey)
Sender-only. Requires FLAG_CANCELABLE. Records pause_start.
resume(sig senderSig, pubkey senderPubkey)
Sender-only. Resets next_payment_timestamp = tx.locktime + intervalSeconds. No backdated intervals.
cancel(sig senderSig, pubkey senderPubkey)
Sender-only. Requires FLAG_CANCELABLE. Returns entire remaining pool to sender.
For unlimited streams (totalAmount == 0), all remaining BCH in the UTXO is returned.
