Wallet validator
The spending validator is a Plutus script that validates spending from a wallet after it has been activated. It can be found here.
The script receives two parameters:
- Currency symbol of the minting script (the activation script);
- Stake validation script hash.
The reason why a withdrawal script is used is for efficiency purposes. If a wallet has 10 UTxOs that are being spent, for each of these 10 UTxOs (locked by a Plutus script since it is a Smart wallet), the script would get executed. If we had all the logic inside this spending script itself, then that logic would get executed 10 times. We however, save ourselves with redundant computation by delegating checks to a withdrawal script and good thing about withdrawal script is that it's logic is executed once.