0

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.

3
  • 1
    What do you mean by "can spend only own inputs"?
    – Ava Chow
    Commented Oct 19, 2018 at 19:25
  • Alice and Bob send coins to one address (to Carol). Alice send 5 BTC to Carol and Bob send 2 BTC to Carol. Is it possible to write a script, which allow Alice spend only 5BTC, not 7 BTC ?
    – Andrew
    Commented Oct 19, 2018 at 20:02
  • Though you cannot do this with scripts, you could create a multi-sig payment channel between Alice and Bob for similar effect: Alice and Bob could co-fund the channel, so that there will be an initial state of Alice 5 BTC, Bob 2 BTC. Each person would only be able to spend their share of the BTC, but in this situation they would both need to spend it simultaneously.
    – chytrik
    Commented Oct 20, 2018 at 9:36

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.