Starting from this text at https://en.bitcoin.it/wiki/Script:
"The script for a typical Bitcoin transfer to destination Bitcoin address D simply encumbers future spending of the bitcoins with two things: the spender must provide 1. a public key that, when hashed, yields destination address D embedded in the script ..."
and then looking at the HTLC script:
OP_IF
[HASHOP] <digest> OP_EQUALVERIFY OP_DUP OP_HASH160 <seller pubkey hash>
OP_ELSE
<num> [TIMEOUTOP] OP_DROP OP_DUP OP_HASH160 <buyer pubkey hash>
OP_ENDIF
OP_EQUALVERIFY
OP_CHECKSIG
My original thought was that the HTLC could only be redeemed to the address behind <seller pubkey hash>
or <buyer pubkey hash>
: they are the only data relating to addresses embedded in the script so must be the "destination address" referred to above. I understand this to be wrong.
Am I now correct in thinking:
- That the two pubkey hashes merely establish the right of the redeemer to take the respective branch;
- There is in fact no "destination address D embedded in the script" for an HTLC;
- That the seller or buyer may redeem to any address they like;
- And that address can remain undecided through the funding and life of the HTLC until the moments before redemption?