2
when somebody send me BTCs I recognize that by seeing a transaction output is equal to my address. But how can I be sure that it's really me and only me who can spend the output?
I can check, I can unlock the output. But consider I'm an evil, I sell BTCs to somebody. But I create a multisign-script wich unblocks the transaction output also by my private key and when I receive $ I take my BTCs back.
Is there a protection against this? Do wallets check the output scripts somehow before claiming the balance?
so, there is something like set of acceptable script templates which could be used for addr to addr transfer? – smrt28 – 2017-12-08T07:52:22.580
Yes. There are script templates, and most wallets will only watch those script templates. There is no need to try every single output to see if you could spend it; that would be extremely computationally expensive and open up several DoS vectors. – Andrew Chow – 2017-12-08T07:54:22.517