Difference between revisions of "Multisignature"

From Bitcoin Wiki
Jump to: navigation, search
(add casa multisig wallet)
(Adding sections with more details on each major type of application)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
Multisignature (multisig) refers to requiring more than one key to authorize a Bitcoin [[transaction]]. It is generally used to divide up responsibility for possession of bitcoins.
+
Multisignature (multisig) refers to requiring multiple keys to authorize a Bitcoin [[transaction]], rather than a single signature from one key. It has a number of applications.
 +
 
 +
* Dividing up responsibility for possession of bitcoins among multiple people.
 +
* Avoiding a single-point of failure, making it substantially more difficult for the wallet to be compromised.
 +
* M-of-N backup where loss of a single seed doesn't lead to loss of the wallet.
 +
 
 +
== Use as a joint account ==
  
 
Standard transactions on the Bitcoin network could be called “single-signature transactions,” because transfers require only one signature — from the owner of the private key associated with the Bitcoin address. However, the Bitcoin network supports much more complicated transactions that require the signatures of multiple people before the funds can be transferred. These are often referred to as M-of-N transactions. The idea is that Bitcoins become “encumbered” by providing addresses of multiple parties, thus requiring cooperation of those parties in order to do anything with them. These parties can be people, institutions or programmed scripts.
 
Standard transactions on the Bitcoin network could be called “single-signature transactions,” because transfers require only one signature — from the owner of the private key associated with the Bitcoin address. However, the Bitcoin network supports much more complicated transactions that require the signatures of multiple people before the funds can be transferred. These are often referred to as M-of-N transactions. The idea is that Bitcoins become “encumbered” by providing addresses of multiple parties, thus requiring cooperation of those parties in order to do anything with them. These parties can be people, institutions or programmed scripts.
  
Consider the following scenario:<blockquote>Suppose I am working with a company that wants to accept Bitcoin for international trades.
+
== Use for increasing security ==
 
 
The company, for security reasons, would not want a single one of its employees to have access to the company BTC wallet's password. Any transaction would have to meet the approval of more than one employee.
 
  
Is this possible already? If not, how could it be implemented with public-key cryptography?<ref>https://bitcointalk.org/index.php?topic=507297.msg5594085</ref></blockquote>
+
The private keys needed to spend from a wallet can be spread across multiple machines, eliminating any one of those machines as a single point of failure, with the rationale that malware and hackers are unlikely to infect all of them. The higher the number of keys required to spend the funds (ie the higher M is in M-of-N), the more difficult it would be for an attacker to successfully steal your funds, however the more cumbersome actually using that wallet becomes.  
  
==Implementations==
+
The multisig wallet can be of the m-of-n type where any m private keys out of a possible n are required to move the money. For example a 2-of-3 multisig wallet might have your private keys spread across a desktop, laptop, and smartphone, any two of which are required to move the money, but the compromise of any one key cannot result in theft.
Shamir's [https://en.wikipedia.org/wiki/Secret_sharing Secret Sharing] Scheme (ssss)<ref>https://point-at-infinity.org/ssss/</ref> is a general software implementation of multisig.
 
  
Specific to Bitcoin, [[GreenAddress|GreenAddress.it]], for example, has 2-of-2 and 2-of-3 accounts (requiring at least two keys to authorize a transaction). [[Electrum]] allows a multisig wallet made of any combination of m-of-n. [[Coinbase (business)|Coinbase]] also offers 2-of-3 and 3-of-5 multisig, which they call [https://support.coinbase.com/customer/portal/articles/1743782-what-is-the-multisig-vault- Vault]. [[Blocktrail]] offers 2-of-3 multisig.
+
This can be used in conjunction with hardware wallets. By requiring that keys from multiple hardware wallets sign transactions, it can vastly reduce the likelihood that a malicious party that handled your hardware wallet could steal your funds, because in order for it to do that, the malicious party would have to compromise multiple hardware wallets. If each hardware wallet you use in a multisig wallet is made by a different company, it would be incredibly difficult for them to secretly conspire on an attack.
  
This javascript page can create and spend from multisig addresses: https://coinb.in/ But see the warnings about [[Javascript cryptography]].
+
== Use as a backup ==
  
See also the [[Electrum]] tutorial: http://docs.electrum.org/en/latest/multisig.html
+
Storing multiple keys to an M-of-N wallet in different locations can serve as a backup. For example, in a 2-of-3 multisig wallet, the loss of one key does not result in loss of the wallet, since the other two keys can be used to recover the funds. The redundancy of the backup is the difference N minus M, so for example a 3-of-5 multisig wallet (with no additional seed backups) has a redundancy of 2, meaning that the loss of any 2 keys can still be recovered from.
  
== Multisignature Applications ==
+
== Multisignature Application Examples ==
  
 
* 1-of-2: Husband and wife petty cash joint account — the signature of either spouse is sufficient to spend the funds.
 
* 1-of-2: Husband and wife petty cash joint account — the signature of either spouse is sufficient to spend the funds.
Line 26: Line 29:
 
* 2-of-3: Parents’ savings account for child — the kid can spend the money with the approval of either parent, and money cannot be taken away from the child unless both parents agree
 
* 2-of-3: Parents’ savings account for child — the kid can spend the money with the approval of either parent, and money cannot be taken away from the child unless both parents agree
  
* 2-of-2: Two-factor authentication wallet: One private key is on your primary computer, the other on your smartphone — the funds cannot be spent without a signature from both devices. Thus, an attacker must gain access to both devices in order to steal your funds (much more difficult than one device)
+
* 2-of-2: Two-factor authentication wallet - One private key is on your primary computer, the other on your smartphone — the funds cannot be spent without a signature from both devices. Thus, an attacker must gain access to both devices in order to steal your funds (much more difficult than one device)
  
 
* 3-of-5: Low-trust donation address - five trusted people from a project each hold a private key. Three people are required to actually spend the money but anybody can donate to the project's address. Reduces the risk of embezzlement, hacking/malware or loss due to a single person losing interest in the project. Which private key was used in the final signature is visible on the blockchain which aids accountability.
 
* 3-of-5: Low-trust donation address - five trusted people from a project each hold a private key. Three people are required to actually spend the money but anybody can donate to the project's address. Reduces the risk of embezzlement, hacking/malware or loss due to a single person losing interest in the project. Which private key was used in the final signature is visible on the blockchain which aids accountability.
Line 39: Line 42:
  
 
* 2-of-2: Smart [[contract]]s building block such as tumblebit, coinswap and [[Lightning Network]].
 
* 2-of-2: Smart [[contract]]s building block such as tumblebit, coinswap and [[Lightning Network]].
 +
 +
* 1 OR 3-of-4: Distributed Backup - The primary owner can use the wallet at will, but if that owner loses their private keys, they can recover with the help of 3 of the other 4 trusted friends/organizations. One key could be kept in a security deposit box at a bank, the other 3 could be distribute to friends. In the case of death of the owner, the security deposit box can be willed to one of the trusted friends or someone who can get the help of the trusted friends. More [https://bitcoin.stackexchange.com/questions/89589/is-it-possible-to-do-a-3-of-5-or-1-multi-sig-for-backup-purposes/89590?noredirect=1#comment102505_89590 complex] multisig wallets can be created if desired.
  
 
See also: [[Storing_bitcoins#Multisignature_wallets]]
 
See also: [[Storing_bitcoins#Multisignature_wallets]]
  
 
==History of Multisignature==
 
==History of Multisignature==
 +
 
Multisignature has been used for thousands of years to protect the security of crypts holding the most precious relics of saints. The superior of a monastery would give monks only partial keys for gaining access to the precious relics. Thus, no single monk could gain access to and possibly steal the relics.<ref>[https://www.youtube.com/watch?v=YcmWQe29zro#t=10m27s Monks at Mt. Athos continue to use "hard" "multisignature" security today.]</ref>
 
Multisignature has been used for thousands of years to protect the security of crypts holding the most precious relics of saints. The superior of a monastery would give monks only partial keys for gaining access to the precious relics. Thus, no single monk could gain access to and possibly steal the relics.<ref>[https://www.youtube.com/watch?v=YcmWQe29zro#t=10m27s Monks at Mt. Athos continue to use "hard" "multisignature" security today.]</ref>
  
 
==Multisignature Wallets==
 
==Multisignature Wallets==
  
A number of companies have developed multisig wallets:<ref>https://www.reddit.com/r/Bitcoin/comments/4eabpi/multisig_wallets_review_coinkite_alternatives_and/</ref>  
+
A number of wallets have implemented multisig:<ref>https://www.reddit.com/r/Bitcoin/comments/4eabpi/multisig_wallets_review_coinkite_alternatives_and/</ref>  
 +
 
 
* [[Armory]]
 
* [[Armory]]
 
* [[CarbonWallet]]
 
* [[CarbonWallet]]
Line 55: Line 62:
 
* [[GreenAddress]]
 
* [[GreenAddress]]
 
* [https://keys.casa Casa]
 
* [https://keys.casa Casa]
* [[Coinbase]]
+
* [[Electrum]] - [http://docs.electrum.org/en/latest/multisig.html See tutorial].
* [[Electrum]]
 
 
* [[Xapo]]
 
* [[Xapo]]
 
* [[Coinkite]]
 
* [[Coinkite]]
 +
* Coinb.in - (''See the warnings about [[Javascript cryptography]]'')
  
 
===Creating a Multisignature Address with Bitcoin-Qt===
 
===Creating a Multisignature Address with Bitcoin-Qt===
 +
 
A 2of3 multisig address can be created by following these steps:<ref>https://bitcoin.stackexchange.com/a/10593/4334</ref>
 
A 2of3 multisig address can be created by following these steps:<ref>https://bitcoin.stackexchange.com/a/10593/4334</ref>
  
Line 77: Line 85:
  
 
* [https://bitcoinmagazine.com/11108/multisig-future-bitcoin/ How To Create A Bitcoin Multisig Wallet]
 
* [https://bitcoinmagazine.com/11108/multisig-future-bitcoin/ How To Create A Bitcoin Multisig Wallet]
 +
* [https://bitcointalk.org/index.php?topic=507297.msg5594085 Discussion of multi-sig on Bitcoin talk]

Latest revision as of 04:34, 25 November 2019

Multisignature (multisig) refers to requiring multiple keys to authorize a Bitcoin transaction, rather than a single signature from one key. It has a number of applications.

  • Dividing up responsibility for possession of bitcoins among multiple people.
  • Avoiding a single-point of failure, making it substantially more difficult for the wallet to be compromised.
  • M-of-N backup where loss of a single seed doesn't lead to loss of the wallet.

Use as a joint account

Standard transactions on the Bitcoin network could be called “single-signature transactions,” because transfers require only one signature — from the owner of the private key associated with the Bitcoin address. However, the Bitcoin network supports much more complicated transactions that require the signatures of multiple people before the funds can be transferred. These are often referred to as M-of-N transactions. The idea is that Bitcoins become “encumbered” by providing addresses of multiple parties, thus requiring cooperation of those parties in order to do anything with them. These parties can be people, institutions or programmed scripts.

Use for increasing security

The private keys needed to spend from a wallet can be spread across multiple machines, eliminating any one of those machines as a single point of failure, with the rationale that malware and hackers are unlikely to infect all of them. The higher the number of keys required to spend the funds (ie the higher M is in M-of-N), the more difficult it would be for an attacker to successfully steal your funds, however the more cumbersome actually using that wallet becomes.

The multisig wallet can be of the m-of-n type where any m private keys out of a possible n are required to move the money. For example a 2-of-3 multisig wallet might have your private keys spread across a desktop, laptop, and smartphone, any two of which are required to move the money, but the compromise of any one key cannot result in theft.

This can be used in conjunction with hardware wallets. By requiring that keys from multiple hardware wallets sign transactions, it can vastly reduce the likelihood that a malicious party that handled your hardware wallet could steal your funds, because in order for it to do that, the malicious party would have to compromise multiple hardware wallets. If each hardware wallet you use in a multisig wallet is made by a different company, it would be incredibly difficult for them to secretly conspire on an attack.

Use as a backup

Storing multiple keys to an M-of-N wallet in different locations can serve as a backup. For example, in a 2-of-3 multisig wallet, the loss of one key does not result in loss of the wallet, since the other two keys can be used to recover the funds. The redundancy of the backup is the difference N minus M, so for example a 3-of-5 multisig wallet (with no additional seed backups) has a redundancy of 2, meaning that the loss of any 2 keys can still be recovered from.

Multisignature Application Examples

  • 1-of-2: Husband and wife petty cash joint account — the signature of either spouse is sufficient to spend the funds.
  • 2-of-2: Husband and wife savings account — both signatures are required to spend the funds, preventing one spouse from spending the money without the approval of the other
  • 2-of-3: Parents’ savings account for child — the kid can spend the money with the approval of either parent, and money cannot be taken away from the child unless both parents agree
  • 2-of-2: Two-factor authentication wallet - One private key is on your primary computer, the other on your smartphone — the funds cannot be spent without a signature from both devices. Thus, an attacker must gain access to both devices in order to steal your funds (much more difficult than one device)
  • 3-of-5: Low-trust donation address - five trusted people from a project each hold a private key. Three people are required to actually spend the money but anybody can donate to the project's address. Reduces the risk of embezzlement, hacking/malware or loss due to a single person losing interest in the project. Which private key was used in the final signature is visible on the blockchain which aids accountability.
  • 2-of-3: Buyer-seller with trustless escrow - buyer commits money into a 2-of-3 address with the seller and a third-party arbitrator. If transaction goes smoothly, then both buyer and seller sign the transaction to forward the money to the seller. If something goes wrong, they can sign a transaction to refund the buyer. If they cannot agree, they both appeal to the third-party who will arbitrate and provide a second signature to the party that it deems deserves it. The arbitrator cannot steal the money as they have only one key.
  • 2-of-3: A board of three directors maintaining funds for their organization — those funds cannot be spent unless any two of those directors agrees. Bigger multi-signature transactions are possible for bigger organizations, such as 3-of-5, 5-of-9, etc.
  • 2-of-3: Improved hot wallet security for businesses - A bitcoin business such as an exchange holds one private key online and one private key as paper backup. A separate bitcoin security firm holds the third key online and will only sign transactions after checking certain conditions (blacklists, whitelists, not more than X withdrawn per time period, two-factor authentication, comply with regulatory environment, etc). If the bitcoin business or the security firm's hot wallets individually get hacked, the bitcoins cannot be stolen. If the bitcoin security firm disappears the business can use the paper backup to access coins.
  • 2-of-3: Decentralized cold storage vault - One of the keys is held in your own home, the second in a bank safe deposit box and copies of the third key are distributed to a close friend, a relative and stored in the office. The home vault is not vulnerable to raiding or burglary because spending the money requires a visit to either the friend, bank or office. Losing the safe deposit box also doesn't result in loss.
  • 1 OR 3-of-4: Distributed Backup - The primary owner can use the wallet at will, but if that owner loses their private keys, they can recover with the help of 3 of the other 4 trusted friends/organizations. One key could be kept in a security deposit box at a bank, the other 3 could be distribute to friends. In the case of death of the owner, the security deposit box can be willed to one of the trusted friends or someone who can get the help of the trusted friends. More complex multisig wallets can be created if desired.

See also: Storing_bitcoins#Multisignature_wallets

History of Multisignature

Multisignature has been used for thousands of years to protect the security of crypts holding the most precious relics of saints. The superior of a monastery would give monks only partial keys for gaining access to the precious relics. Thus, no single monk could gain access to and possibly steal the relics.[1]

Multisignature Wallets

A number of wallets have implemented multisig:[2]

Creating a Multisignature Address with Bitcoin-Qt

A 2of3 multisig address can be created by following these steps:[3]

  1. Gather (or generate) 3 bitcoin addresses, on whichever machines will be participating, using getnewaddress or getaccountaddress RPC commands (or copy and paste from the GUI).
  2. Get their public keys using the validateaddress RPC command 3 times.
  3. Then create a 2-of-3 multisig address using addmultisigaddress; e.g.
    bitcoind addmultisigaddress 2 '["044322868cb17d64dcc22185ae2d4493111d73244c3668f8ac79ecc79c0ba8d30a6756d0fa20157 709af3281cc721c7f53321a8cabda29b77900b7e4fe0174b114","..second pubkey..","..third pubkey.."]'
addmultisigaddress returns the multisignature address. Be a little careful, the public keys are raw hexadecimal and don't contain checksums like bitcoin addresses do. You can then send funds into that 2-of-3 transaction using the normal sendtoaddress/sendmany RPC commands, or the GUI (or anything that's been updated to recognize multisig addresses).[4]

Gavin Andresen has an example of using multisig with bitcoin-qt Raw Transactions: https://gist.github.com/gavinandresen/3966071

Notable examples in practice

  • The cold storage wallet of the Bitfinex exchange is a single 3-of-6 multisig address 3D2oetdNuZUqQHPJmcMDDHYoqkyNVsFk9r which as of December 2017 contains 141 177 btc ($1.5 billion). Presumably the keys are kept very safe by Bitfinex's operators.

References