Status: scaffolded
A stateful milestone escrow scaffold where work progresses across a fixed number of milestones before final seller release.
Actors:
- buyer funds the deal
- seller completes work
- arbiter approves milestones or resolves disputes
Paths:
approve_milestoneadvances milestone state by onefinal_releasereleases only after all milestones are completedispute_refundlets arbiter refund the buyertimeout_reclaimlets buyer recover after timeout
- Milestone progression is monotonic:
completed_milestonescan only increase by one. final_releaserequires full completion and now constrains a single seller P2PK payout on output 0 withinput_value - minerFeeconservation.- Refund requires arbiter plus buyer participation and now constrains a single buyer P2PK payout on output 0 with
input_value - minerFeeconservation. - Timeout reclaim remains a buyer-protection path and now constrains the same buyer payout shape.
approve_milestonenow constrains the authenticated continuation output count to one and preservesinput_value - minerFeeon that continuation output.- This scaffold still does not encode per-milestone payout accounting or partial withdrawals.
This is the first escrow scaffold in the repo that actually depends on stateful continuation. Milestone progression is intended to stay in a singleton covenant lineage, making it the bridge from the bilateral terminal escrow to more complete stateful payment flows.
init_buyer: buyer pubkey.init_seller: seller pubkey.init_arbiter: arbiter identifier stored asblake2b(pubkey).init_total_milestones: total milestone count.init_completed_milestones: starting completed count, normally0.init_timeout: buyer timeout reclaim threshold.
Use this for freelance contracts, grant disbursements, or delivery agreements that need multiple checkpoints before final release.
Benchmarking not yet recorded.
Not audited. Compiler-validated scaffold only.
- Do not use this when all funds should release in one shot; bilateral escrow is simpler.
- Do not use this when payout amounts differ per milestone unless the accounting layer is added.
- Do not treat this scaffold as production-ready until it has output constraints, value accounting, and testnet exercise.