<blockquote>
  <p>Is it safe to store bitcoins in this address with this scriptsig ?</p>
</blockquote>

<p>That is actually the <code>scriptPubkey</code>, and it is only safe if you use a safe <code>redeemScript</code>.</p>

<p>A P2SH script is a <a href="https://en.bitcoin.it/wiki/Transaction#Pay-to-Script-Hash" rel="nofollow noreferrer">Pay-to-Script-Hash</a> script, meaning when you spend the coins, you must provide the script (and the hash must match), but this script you provide, called the <code>redeemScript</code> must also succeed when it is executed, and can be any valid script. </p>

<p>Typically this is a script similar (if not exactly the same) as the one you provided, which is a P2PKH or <a href="https://en.bitcoin.it/wiki/Transaction#Pay-to-PubkeyHash" rel="nofollow noreferrer">Pay-to-Public-Key-Hash</a>. Thus, it also requires a signature, so if you use a P2SH(P2PKH) it is still just as secure as using a <code>P2PKH</code> because of the signature requirement in the P2PKH, you just have to also provide the <code>redeemScript</code>.</p>

CC BY-SA 4.0
2018-11-08T03:49:08.963Z
2018-11-08T03:49:08.963Z
JBaczuk
<p>I've just generated p2sh btc address and look in the output script:</p>

<pre><code>HASH160 PUSHDATA(20)[e5c32bdc7f7fb1e6ae7aa1baf42a429803054d2c] EQUALVERIFY 
</code></pre>

<p>while normal (legacy btc address) transaction has signature check</p>

<pre><code>DUP HASH160 PUSHDATA(20)[e5c32bdc7f7fb1e6ae7aa1baf42a429803054d2c]
EQUALVERIFY CHECKSIG
</code></pre>

<p>Is it safe to store bitcoins in this address with this scriptsig ? </p>

<p>Or it use a same key for the signature check? 
If yes, what a reason to check the signature ?</p>

<p>Thanks</p>

<script><bitcoin-core-development><input-script>
Is it safe to store bitcoins on p2sh (no multisig)?
Andrew
# Is it safe to store bitcoins on p2sh (no multisig)?

(Asked by: username_0 on 2018-11-07)

I've just generated p2sh btc address and look in the output script:

```
HASH160 PUSHDATA(20)[e5c32bdc7f7fb1e6ae7aa1baf42a429803054d2c] EQUALVERIFY 

```

while normal (legacy btc address) transaction has signature check

```
DUP HASH160 PUSHDATA(20)[e5c32bdc7f7fb1e6ae7aa1baf42a429803054d2c]
EQUALVERIFY CHECKSIG

```

Is it safe to store bitcoins in this address with this scriptsig ?

Or it use a same key for the signature check?
If yes, what a reason to check the signature ?

Thanks

**Tags:** script, bitcoin-core-development, input-script


---

## 1 answers

### Answer by username_1 on 2018-11-08. Score: 2 | Accepted answer

> Is it safe to store bitcoins in this address with this scriptsig ?

That is actually the `scriptPubkey`, and it is only safe if you use a safe `redeemScript`.

A P2SH script is a [Pay-to-Script-Hash](https://en.bitcoin.it/wiki/Transaction#Pay-to-Script-Hash) script, meaning when you spend the coins, you must provide the script (and the hash must match), but this script you provide, called the `redeemScript` must also succeed when it is executed, and can be any valid script.

Typically this is a script similar (if not exactly the same) as the one you provided, which is a P2PKH or [Pay-to-Public-Key-Hash](https://en.bitcoin.it/wiki/Transaction#Pay-to-PubkeyHash). Thus, it also requires a signature, so if you use a P2SH(P2PKH) it is still just as secure as using a `P2PKH` because of the signature requirement in the P2PKH, you just have to also provide the `redeemScript`.


---

