Let's imagine: We have just one BTC address. Users send some coins to this shared address. And can spend only own inputs.
P.S. If someone can provide some example script for this I'll be very thankful.
Let's imagine: We have just one BTC address. Users send some coins to this shared address. And can spend only own inputs.
P.S. If someone can provide some example script for this I'll be very thankful.
No, it is not possible for a script to be able to determine who "owns" the input (as in whether the input was created by Alice or by Bob). Scripts cannot look at things like the txid of the input it belongs to, the index of the output the input spents, or any of the output scripts. There is no facility in Bitcoin to do that. So no, such a script is impossible to do in Bitcoin.