I would like to create a smartcontract which makes sure that only the same person who made specific locking transaction can unlock that same specific transaction or to put it into simpler terms if Bob locks his Ada then smartcontract must ensure that only Bob can unlock his locked Ada.
I think in TxInfo one of the txInfoInputs UTxO should contain information about locking transaction. But from data definition of txInfoInputs :: [TxInInfo]
field:
data TxInInfo = TxInInfo
{ txInInfoOutRef :: TxOutRef
, txInInfoResolved :: TxOut
} deiriving stock (Generic, Haskell.Show, Haskell.Eq)
I can't tell how exactly could I get public key hash of source address or something else which could give me information for validation if unlocking transaction is being made by the same person who made locking transaction.
Another way I can think of is to add sender address into Datum but I can't think of a way how to ensure secure Datum creation process so that for example when Bob is creating transaction to luck funds in smartcontract Alices address as a receiver doesn't appear in Datum
So is it even possible, to create such smartcontract which would take information of locking transaction and by using that information validate if smartcontract funds can be unlocked?