Bitcoin Forum
May 11, 2024, 09:31:56 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: P2SH address additional security  (Read 441 times)
Samarkand (OP)
Sr. Member
****
Offline Offline

Activity: 658
Merit: 282


View Profile
September 12, 2017, 11:39:06 AM
Merited by ABCbits (1)
 #1

I read an article from Bitcoinwiki about Pay to script hash today:
https://en.bitcoin.it/wiki/Pay_to_script_hash

Quote
The recipient might need the signatures of several people to spend these bitcoins, or a password might be required, or the requirements could be completely unique.

This part sounds really interesting to me. What additional security measures are possible that are only hinted at in the quote? Does
anybody have a link where can I find a more detailed explanation of all the features that P2SH addresses offer in terms of security?
1715463116
Hero Member
*
Offline Offline

Posts: 1715463116

View Profile Personal Message (Offline)

Ignore
1715463116
Reply with quote  #2

1715463116
Report to moderator
It is a common myth that Bitcoin is ruled by a majority of miners. This is not true. Bitcoin miners "vote" on the ordering of transactions, but that's all they do. They can't vote to change the network rules.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715463116
Hero Member
*
Offline Offline

Posts: 1715463116

View Profile Personal Message (Offline)

Ignore
1715463116
Reply with quote  #2

1715463116
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6635


Just writing some code


View Profile WWW
September 12, 2017, 02:00:59 PM
 #2

P2SH allows you to make and use whatever scripts you want and still have a standard transaction. There are fancy scripts you can make that would be considered non-standard if they were in an output. P2SH moves those scripts into the input and those scripts can be anything and still be considered standard. The requirements for spending from a P2SH address are unique because you can have any script you want. It is not that P2SH enables special things to be done, but rather it just makes those special things be standard scripts.

mensa84
Full Member
***
Offline Offline

Activity: 184
Merit: 101



View Profile
September 13, 2017, 09:25:39 AM
 #3

P2SH just lets you be even more secure by easily putting more conditions on the redemption of your coins, like requiring more than 1 key to spend.

If I use P2SH, the scriptPubKey is just 23 bytes and the sender doesn't have to worry about what exactly the redeem condition I am setting on my coins is. P2SH works like this. I take the script that I want to be my scriptPubKey and I serialize it (I'll use {} to denote serialization):
Code:
redeemScript = {OP_3 {pubkey1} {pubkey2} {pubkey3} {pubkey4} {pubkey5} OP_5 OP_CHECKMULTISIG}
redeemScript_hash = hash160(sha256(redeemScript))

And then the scriptPubKey that the sender actually uses is:
Code:
OP_HASH160 {redeemScript_hash} OP_EQUAL

Which is just 23 bytes in total. The nice thing is that it provides a layer of abstraction. The person who is sending me coins doesn't need to know how I am keeping my coins secure. All they see is a hash of a redeemScript, but they don't know what conditions that redeemScript actually puts on redeeming the coins.

Basically, P2SH itself is not inherently more secure because the redeem script can be anything. But what it does is enable coin-receivers to easily communicate how coin-senders should send them coins, while letting the coin-receivers dictate the conditions of how/when those coins can be spent.

   ⚡⚡ PRiVCY ⚡⚡   ▂▃▅▆█ PRiVCY (PRIV) is a new PoW/PoS revolutionary privacy project  ☞ Best privacy crypto-market! █▆▅▃▂
    Own Your Privacy! ───────────────── WebsiteGithub  |  Bitcointalk  |  Twitter  |  Discord  |  Explorer ─────────────────
   ✯✯✯✯✯                 ✈✈✈[Free Airdrop - Starts 9th June][Tor]✈✈✈ ║───────────║ Wallet ➢ Windows  |  macOS  |  Linux
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!