Claim or Refund Functionality Implementation in Bitcoin

I was reading the paper written by Kuramesan and Bentov with title “How to use Bitcoin to Design Fair Protocols”. Source: Specifically, the sender creates a transaction which can be redeemed the following way: 1) By providing the Sender’s signature AND the Receiver’s signature 2) By Receiver’s signature and a witness/proof which will make a circuit/function valid

Whichever of the conditions comes claims the transaction. My problem in understanding is what this circuit/function should be. Can it a random secret chosen by so if we pass through a hash function that is the circuit it can easily be verified since the receiver has to reveal this secret through it’s claim transaction? Is my assumption correct?

Recent Questions – Bitcoin Stack Exchange