arkProvider, indexerProvider, serverPubkey, exitTimelock, serverUnrollScript, and hex from Set Up Your Project.
The exit refund waits longer than the exit claim, so the receiver always has time to claim first.
Build the HTLC
The conditionHASH160 <hash> EQUAL checks that the preimage hashes to hash160(preimage), which is RIPEMD160(SHA256(preimage)). Each helper adds VERIFY and the signature checks after it.
Claim with the preimage
claimWithPreimageIdentity signs as the receiver and attaches the preimage to each input. The operator rejects the spend if the preimage does not match the hash.
refundAt, pass refundLeaf to findLeaf and sign with sender. The SDK sets the transaction’s locktime from the path.
The SDK’s VHTLC.Script builds a six-path HTLC with the same structure. It adds refund paths that the sender and receiver sign together, so they can cancel before the deadline.