add-memberalign-toparrow-leftarrow-rightbellblockcalendarcamerachatchevron-leftchevron-rightchevron-small-downchevron-upcircle-with-crosscomposecrossfacebookflagfolderglobegoogleimagesinstagramkeylocation-pinmedalmoremuplabelShape 3 + Rectangle 1pagepersonpluspollsImported LayersImported LayersImported LayersshieldstartwitterwinbackClosewinbackCompletewinbackDiscountyahoo

Multisig for escrow and wallet security

Explanation of how to make a multi sig address

In a bitcoin transaction, there are two scripts. The first script that satisfies the conditions set by the input transactions' scripts ( you basically assert your right to spend the inputs ), and the second script, that sets conditions for the next transaction that wants to spend the dough further in the block chain.

This creates a little problem. It would be nice to have an address people can pay to, without them having to set the conditions for how the money can be spent further. Let's say you want to pay to an address, from which special requirements are mandated, for how they can be spent further, such as an address, from which more than one private key is needed to spend.

Normally, it would be up to you funding the address, to come up with a script in your input transaction to do that. That is, every transaction must encode the spending constraints.

That means that everyone who funds this special address must be an ace bitcoin programmer. Or they must at least share script snippets with each other, or ask the owner of the address for what script to put in. This would lead to confusion and difficult transactions.

Because of this Bitcoin has something called pay to script hash, sometimes shortened to p2sh. This means that the owner of the address that people are paying to, comes up with the magic script. But where is this script stored and how can the funders use this script? The owner of the address comes up with the script and then hashes the script. And that hash, is the address!

The funders don't need to know what the script is. Simply paying to a hashed address means that the transactions can only be spent further if the correct script is run. A script that when hashed, is equal to the address. But how does anyone know that an bitcoin address is a hash of a script and not as usually a double hashed value of a public key?

Easy, such pay to script hash addresses start with a "3" instead of the usual "1".

However now the owner(s) of the p2sh address have a problem. What if they forget what the script was? This can be mitigated by spending a small sun from the address. That transaction must include the correct script. So once you make an p2sh address, you could fund it a little immediately, spend it a little immediately and in that way the script will get stored in the block chain.

Table of Contents

Page title Most recent update Last edited by
Multisig for escrow and wallet security May 22, 2014 5:58 PM Jorgen
Compile and run Bitcoin wallet on Android April 16, 2014 12:59 AM Jorgen
Bitcoin with python - Electrum April 11, 2014 8:07 PM Jorgen
Bitcoin presentation notes April 9, 2014 2:33 PM Jorgen
About Bitcoinhackers April 18, 2014 5:16 PM Jorgen

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy