> For the complete documentation index, see [llms.txt](https://docs.xft.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xft.finance/learn/multisig.md).

# Multisig

n is the number of independent signing keys

m is the number those keys that must sign in order to authorize a transaction

The simple multisig smart contract uses a third type of auth by doing on-contract *authentication*. In a simple multisig transaction all of the multiple signatures needed to approve a transaction are included in a single data payload in a single Ethereum “network transaction”. The data payload also includes the whole “smart contract transaction”, like a submessage of the transaction. The smart contract has its own explicit protocol for how to verify those signatures, using a hash of the submessage as the contents that are being authorized by the multisig signers. That submessage can represent the action of an Ethereum transaction, including moving Eth that’s being held by the multisig contract or doing an operation on another smart contract, such as moving ERC20 tokens held by the multisig contract.

MULTISIG (think Multisignatures)

You create a MULTISIG transaction that requires two of three people to sign in order to redeem the coins. Two of the people in the transactions are you and the store owner. The last in this middle man (Judge). The transaction sends the payment that you deposited only if two of the three sign it. The transaction gets put onto the block chain and then can be said to be “held in escrow”. The store owner can look to the blockchain and be convinced that you paid and decides to send the teddy bear.

**Scenario 1**

After, you say, “I got the goods”, and now the store owner and you can sign the transactions to redeem the escrowed funds. All is well and really the middle man did nothing since there was no need for them to sign anything.

**Scenario 2**

You claim “I never get the teddy bear”. Thus, you would never release the money to the store owner. The middle man has to step in and decide if the money should go back to you or to the store owner based on who they can deduce is right. If the middle person decides that you are lying and the store owner did send the bear, then the middle person and the store owner can sign the multisig to move the funds to the store owner. If the middle person decides that the store owner never sent the teddy bear, then the middle person and you can sign the multisig and move the funds back to you.

M-of-N setup – A specific subset of signers is required to approve a transaction. Typical setups include 2-of-3, 3-of-5, 5-of-7, and so on. For instance, in a 3-of-5 wallet, at least three signers out of the total must validate the transaction before it can be executed.

N-of-N setup – All participants or co-signatories must validate a transaction for it to be executed and processed. For instance, a 3-of-3 setup dictates that all parties sign with their unique private keys for the transaction to be considered valid.

A 2-of-3 multisig wallet *allows a third party to participate in escrow transactions* between two parties.

The 2-of-3 multisig approach, involving signatures from the buyer, seller, and market administrator, is designed to provide stronger protection than centralized escrow models.

[Pay-to-Script-Hash (P2SH)](https://river.com/learn/terms/p/p2sh/)

MULTISIG ESCROW

<table><thead><tr><th width="124.5">Setup</th><th width="196">Meaning</th><th width="317.484375">Typical Use</th></tr></thead><tbody><tr><td>2-of-2</td><td>Both keys required</td><td>Two-party shared control</td></tr><tr><td>2-of-3</td><td>Any 2 of 3 keys</td><td>Individuals with a backup key</td></tr><tr><td>3-of-5</td><td>Any 3 of 5 keys</td><td>Organizations, DAOs, treasuries</td></tr></tbody></table>

For example, one can construct a script that requires signatures from two out of a given three private keys to validate ("multisig"), a setup useful for corporate accounts, secure savings accounts and some merchant escrow situations.

&#x20;

**How Does Multisig Work?**

1. A multisig wallet is configured with a total number of keys (e.g. 3) and a required threshold (e.g. 2).
2. To send a transaction, the required number of keyholders must each sign it.
3. If fewer than the threshold sign, the transaction cannot execute.
4. Keys can be held by different people, on different devices, or in different locations.

\---

In cryptocurrencies, multisig allows one to sign a transaction with more than one private key. Funds protected with multisig can only be spent by signing with M-of-N keys.

Example use cases:

* shared account (1-of-2; both husband and wife individually have full access to their funds)
* consensus account (2-of-2; both husband and wife must agree to spend their funds)
* threshold account (2-of-3; an escrow service is involved as an independent 3rd party, to co-sign with either the seller, or with the buyer, if seller and buyer do not agree)
* secure account (2-of-3; a single owner controls all 3 keys but secures them via different means to diversify risks)
* arbitrary threshold account (M-of-N; some cryptocurrencies provide full flexibility on the number of signers)

\---

**Where Multisig Escrow Falls Short**

In theory, funds in a 2-of-3 multisig wallet are safe because no single party can access them without another’s approval. <mark style="color:$danger;">If disputes arise, the administrator acts as the arbiter.</mark>

In practice, however:

* **Administrator Trust Concentration**: Administrators hold the third signing key, a point of failure that can be abused.
* **Automated Timer Loopholes**: Auto-release mechanisms send funds to vendors after a set period unless disputes are raised. If an administrator executes an exit scam at that moment, buyers lose funds without recourse.
* **Exit Scams as a Business Model**: Historical cases, like the Evolution market shutdown, reveal that some operators deliberately close operations to steal funds, rather than being taken down by law enforcement.

\---

MPC (multi-party computation) wallets split a single private key into encrypted shares, with each party holding a fragment.

Multi-sig wallets, on the other hand, use entirely separate private keys that produce independent signatures typically recorded directly on-chain. These clear audit trails create transparency that MPC solutions lack.

<br>
