Savings holds the output. The owner signs stage, and that signature is the authorization. The output moves to SavingsStage. release pays recipientScript once the emulator clock reaches unlockAt. Before that clock, release fails. The reset key signs reset and returns the output to ownerScript. That stops a payment the owner did not mean to authorize.
Your first contract builds the simpler one-contract SavingsVault without a reset key.
ownerScript and recipientScript are 32-byte witness programs. Spend outputs use pkScript. serverExitDelay is not a parameter. The client binds it (CSV delays).
savings.ark
savings_stage.ark
Constructor
SavingsStage takes the same parameters. stage copies them onto that output.
Functions
Savings.stage spends this output into one SavingsStage output of at least the same value.
SavingsStage.release pays recipientScript the output. The emulator clock must be at or past unlockAt.
SavingsStage.reset pays ownerScript the output. The reset key signs, and the emulator clock is still before unlockAt.
unilateral on each output is the exit if the operator is unavailable: after serverExitDelay, the owner signs.