2
user1, pubkey1, 1.1 BTC
user2, pubkey2, 1.2 BTC
user3, pubkey3, 1.3 BTC
user4, pubkey4, 1.4 BTC

user4 sends 0.4 BTC to a 2-of-3 multi-sig account controlled by user1, user2 and user3 using P2SH.

The transaction is successful.

What is the account balance for user1, user2 and user3?

3

Bitcoin balances conceptually are not like bank account balances, but more akin to banknotes: uniquely identifiable, good for a specific amount, and can only be spent in full. The "account balance" shown by your wallet is simply the sum of funds that the wallet knows how to spend. In the case of your multisig example, if user1, user2, and user3 each have their own wallet but each wallet keeps tracks of the multisig unspent transaction output () as its own, they would each see it as part of their balance.

Basically, it's up to the users to decide how to interpret the spendability of their shared funds. The network would enforce that they would only be able to spend the UTXO once in total, though. Alternatively, it's possible that they share one "watch-only" wallet to track the balance, but each hold their own separate key. In that case this shared watch-only wallet would track the balance only once, but they'd each hold their own key independently.

So, concretely, the users' balances after the transaction from user4 would be:

user1, pubkey1, 1.1 BTC
user2, pubkey2, 1.2 BTC
user3, pubkey3, 1.3 BTC
user4, pubkey4, 1.0 BTC
{user1,user2,user3}, 2-of-{pk1,pk2,pk3}, 0.4 BTC

Where the last UTXO is controlled by the multi-party address as described and has different spending properties than the individual balances of the the users.

1

As per my understanding of P2SH transactions, the concept of "account balance" does not really exist.

But the fact that 2 out of the 3 users can unlock the corresponding redeem script with their signatures gives them the opportunity to spend the utxo (0.4BTC) of the said P2SH transaction.

Independently, of course they could also spend the utxos of other transactions that had their public key (hash) in their output.

  • later on user1, user2 wants to spend 2.5 BTC to user5, how should they sign the transaction??? how many inputs? Balance BTC who will get it? – Cisco Mmu Jul 7 '20 at 16:06
  • that new transaction would need multiple inputs. For example, one P2PKH utxo from pubkey1, one P2PKH utxo from pubkey2, and the utxo from said P2SH transaction. Each input of the new transaction would need to be signed with the corresponding private keys. In the output of the new transaction, you specify how much user5 should get. Specify a change adress for the change. Rest goes as fee. – citizenfu Jul 7 '20 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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