My goal is: I would like to create a smart contract which would verify if unlocking transaction comes from the same person as the wallet address which is known before hand.
What I have tried: I have went trough https://developers.cardano.org/docs/integrate-cardano/creating-wallet-faucet/ and https://github.com/input-output-hk/Alonzo-testnet/blob/main/Alonzo-solutions/exercise3/e3SampleSolution.md exercises to understand cardano transactions and wallets better. I have also created my own Yoroi wallet and played around a bit with transactions. I have also tried looking for functions which could do verification with wallet addresses in Plutus API, but couldn't find anything.
What I got from all of this is that because cardano wallet is created with a single recovery phrase it should be possible to trace down if different wallet addresses belong to the same person.
How I think solution should work:
- Transaction comes in into smart contract
- Smart contract takes wallet address from which this transaction came
- Smart contract checks if already known wallet address (for sending funds to) belongs to the same person as the owner of unlocking transaction wallet
Things I don't quite get it:
- Can smart contract on-chain code go trough blockchain to check wallets pub-keys for validation and if so how?
- Is the
txSignedBy :: TxInfo -> PubKeyHash -> Boolthe only function which can be used on-chain to check ownership?
- Is it possible to get wallet address from TxInfo in smart contract?
- Can PubKeyHash be retrieved from wallet address on-chain and off-chain?
I don't expect an honest well though out answer to all of these questions, but if anyone could lead me a even a little bit on how to achieve my goal I would be really thankful.