Is it possible to write a Bitcoin script that pays multiple recipients? For instance, a script funded with 2 BTC by Alice that pays 1 BTC each to Bob and Charlie.
Alice creates a 2 of 3 multisig using public keys for Alice, Bob and Charlie.
Alice sends 2 BTC to multisig address.
Bob and Charlie could spend this and send 1 BTC to each of them. So the payment part isn't enforced by script but we could create conditions under which an output can be spent. In this case Bob and Charlie can use their keys to do the payment. If one of them doesn't agree, Alice can use her key to still do the payment.
Eventually I'd like to build a system using Lightning, where Alice, Bob and Charlie are all part of a channel. Alice would fund the channel and the script would determine how much of the funds go to Bob and Charlie.
I am not sure but maybe 3 channels could be opened between them using the concept of channel factories to create a setup in which closing the channels sends bitcoin to Bob and Charlie.