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.

  • 1
    What do you mean by "can spend only own inputs"? – Andrew Chow Oct 19 '18 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 Oct 19 '18 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 Oct 20 '18 at 9:36
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 acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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