I'm a software engineer by profession, so when I started looking at bitcoin, the transaction system immediately grabbed my attention. I think I understand it, but the wiki isn't entirely clear, so I was hoping someone could double-check my understanding.
I checked out https://en.bitcoin.it/wiki/Transactions
and get that each input has half of a script, and each output has half of a script. What has been hanging me up is how the two are combined, but I think I finally figured it out. I think that those two halves don't get paired together. Instead, the input script is paired with the previous transaction's output script, so the input script is basically proving that you're allowed to spend the coins from that transaction. Is that correct?
So if I wanted to, I could create an output that could be used by two different addresses by creating a script that basically said "if sig matches this or this, true" right? (Or I could just say it could be spent by anyone by saying "true" always.)
That being said, do most miners actually accept transactions like this? Or do they just reject any transaction that does not follow the typical pattern? (I read about the mtgox loss, but it seemed like a lot of miners were rejecting that transaction.)