1

Say I'm creating a multi-sig wallet with a friend to bet on the election. Can my deposit to the multi-sig wallet be dependent on the my friends deposit to the wallet?

Say I'm Alice, and my friend is Bob. Our shared multi-sig wallet is S. Would the following work?

Block N:
TxA
  Input1: A.amountX
  Input2: B.amountX
  Output1: S.amountY
  A.sig
  B.sig

Edit: Received good answer below, to summarize use Partially Signed Bitcoin Transactions (PSBT) BIP-174, it relies on Sighash Flags, this enables parties to sign more than just their own input.

0

1 Answer 1

2

To accomplish this you could create a single transaction that you both supplies inputs to, and that creates an output paying to your multi sig address. In order for the transaction to be valid you will both need to sign it, and of course neither of you should sign it unless the other has supplied an input with the agreed upon value.

See: BIP 174 Partially signed bitcoin transactions

5
  • Very interesting. How does the bitcoin logic allow the unlocking of the input based on a signature that signs both inputs? Does the verifier check for each input to see whether one of the unlocking scripts satisfies it? but the unlocking script (with signature of all inputs) depends on multiple inputs (both Alive and Bobs) being there?
    – miketery
    Commented Jun 4, 2022 at 17:36
  • I did further research, I think what I'm looking for is called a coinjoin.
    – miketery
    Commented Jun 5, 2022 at 18:55
  • 1
    @miketery re: signatures: you'll want to learn about 'sighash flags', they are used to designate which parts of a transaction the signature covers. re: coinjoins: that term generally describes a more specific type of multi-party transaction, that seeks to improve the on-chain privacy of participants, I wouldn't really use that term to describe what you're trying to achieve.
    – chytrik
    Commented Jun 5, 2022 at 21:44
  • I found this wiki.bitcoinsv.io/index.php/SIGHASH_flags (hopefully this is the same in BTC?). What does BIP-174 add if N people can agree on a X inputs and Y outputs, and then use SIGHASH_ALL?
    – miketery
    Commented Jun 6, 2022 at 6:09
  • 1
    @miketery BSV is an altcoin, I would definitely not recommend using that reference. Try perhaps raghavsood.com/blog/2018/06/10/bitcoin-signature-types-sighash ? re: BIP174: it is a standardized protocol for passing partially constructed bitcoin transactions between users/software. Using software that employs it will make collaborating on a multi-party transaction much easier.
    – chytrik
    Commented Jun 6, 2022 at 6:46

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.