Bitcoin Forum
August 14, 2024, 08:22:36 PM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Questions about p2sh addresses  (Read 662 times)
yampi (OP)
Sr. Member
****
Offline Offline

Activity: 433
Merit: 250


View Profile
April 23, 2015, 08: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?
DannyHamilton
Legendary
*
Offline Offline

Activity: 3472
Merit: 4771



View Profile
April 23, 2015, 08: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.
Cryddit
Legendary
*
Offline Offline

Activity: 924
Merit: 1130


View Profile
April 24, 2015, 09: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. 

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!