Virtual Hash Time Lock Contract (VHTLC) implementation.
VHTLC is a contract that enables atomic swaps and conditional payments in the Ark protocol. It provides multiple spending paths:
const vhtlc = new VHTLC.Script({ sender: alicePubKey, receiver: bobPubKey, server: serverPubKey, preimageHash: hash160(secret), refundLocktime: BigInt(chainTip + 10), unilateralClaimDelay: { type: 'blocks', value: 100n }, unilateralRefundDelay: { type: 'blocks', value: 102n }, unilateralRefundWithoutReceiverDelay: { type: 'blocks', value: 103n }}); Copy
const vhtlc = new VHTLC.Script({ sender: alicePubKey, receiver: bobPubKey, server: serverPubKey, preimageHash: hash160(secret), refundLocktime: BigInt(chainTip + 10), unilateralClaimDelay: { type: 'blocks', value: 100n }, unilateralRefundDelay: { type: 'blocks', value: 102n }, unilateralRefundWithoutReceiverDelay: { type: 'blocks', value: 103n }});
Virtual Hash Time Lock Contract (VHTLC) implementation.
VHTLC is a contract that enables atomic swaps and conditional payments in the Ark protocol. It provides multiple spending paths:
Example