Author

Topic: Questions about p2sh addresses (Read 680 times)

legendary
Activity: 924
Merit: 1132
April 24, 2015, 04:40:47 PM
#3
If I generated a p2sh address from a raw transaction, would I be able to spend it?
Or is p2sh only for multi signature transactions?

You can certainly create a p2sh address that you can spend.  p2sh is for any script, not just multi-signature scripts.

Of course, you can also create a p2sh address which cannot be spent because there is no script that both hashes to that value and succeeds when checked. 

IOW, anyone can write a script that says, in effect,

if (false) then
   the output may be spent.

and put funds in a p2sh transaction having a hash that corresponds to that script.  It's just not a very useful script.  There's already 1BitcoinEaterAddressDontSendf59kuE, which does the same thing.  But people don't usually create such scripts (which can't be spent) on purpose. 

legendary
Activity: 3472
Merit: 4801
April 23, 2015, 03:44:18 PM
#2
If I generated a p2sh address from a raw transaction, would I be able to spend it?

That depends on the particular script that you choose to create.

P2SH just means "Pay To Script Hash"  So, until you define what script is being hashed, it isn't possible to determine if the output will be spendable.

Or is p2sh only for multi signature transactions?

Nope.  P2SH can be used for any valid bitcoin output script.  Multi-sig is just a common and convenient use.
sr. member
Activity: 433
Merit: 250
April 23, 2015, 03:32:19 PM
#1
If I generated a p2sh address from a raw transaction, would I be able to spend it?
Or is p2sh only for multi signature transactions?
Jump to: