If you have three addresses, lets say A, B and C and they each have 1 BTC. When you create a multisig address out of the three addresses, will it have a balance of 3 BTC or do you have to send the bitcoin from each address to it for the balance to be 3 BTC?
-
next to Amaclin's comment, I recommend reading Andreas' book "Mastering Bitcoin". It is an amazing book that'll definitely get you up to speed, here especially chapter 7 on transactions. It's freely available online here: chimera.labs.oreilly.com/books/1234000001802/index.html– pebwindkraftCommented Mar 19, 2018 at 6:47
2 Answers
wil it have a balance of 3 btc
no
or do you have to send the bitcoin from each address to it for the balance to be 3 btc?
yes
There is a bit of a misunderstanding of what an address is here. When Bitcoin are sent, they're not moved "to an address" so much as they're locked to the fulfillment of some authentication requirement. The standard scheme hereby is "pay-to-public-key-hash (p2pkh)" which could be described as "to spend these funds, you need to reveal a public key which hashes to this address and then provide a signature using the private key that corresponds to the revealed public key to prove ownership".
Multisig addresses are not a combination of p2pkh addresses but actually use a different locking scheme. Current forms of multisig are mostly encoded in a variant of "pay-to-script-hash (p2sh)" instead of p2pkh, i.e. the locking condition is not tied to a single key pair, but to fulfillment of a redeemscript. (The Schnorr-based MuSig scheme works differently, but I'll not go into that here.)
A p2sh locking script might be described as "to spend these funds, you need to reveal the redeemscript that hashed to this address, and fulfill the conditions of the redeemscript".
One popular redeemscript used in p2sh
is for example "2-of-3 multisig".
To fulfill a 2-of-3 multisignature redeemscript you would have to "reveal the full redeemscript that was hashed to create the address (which would be OP_2 pubkey1 pubkey2 pubkey3 OP_CHECKMULTISIG
) and then provide a signatures each with two of the three corresponding private keys".
Getting back to your scenario:
- The original funds are locked with p2pkh, so to spend them you have to reveal the corresponding public key and provide a signature with the corresponding private key.
- You could use three public keys that were previously used to generate p2pkh addresses, but this would simply create a fourth address that is unrelated to the original funds (except for reusing the same keys).
The new address would therefore not have any funds and the funds would have to be spent using the originally defined scheme.