<p>Not sure why this question was down voted, some explanation would have helped...</p>

<p>In general: A p2sh tx sends data to a hash. The hash is a one way function, so we cannot know, what content is behind the hash... also there is no double mining or similar. There is a funding tx, and a spending tx. Like with any other tx, you mine a first tx from someone else to my account, and if I spend the tx, another tx is created and mined. Same applies to p2sh transactions.</p>

<p>The funding tx is created, defining a condition for spending the funds (e.g. multisig, with a “type3” address), and post this tx to the network. Everyone can see the tx, but nobody knows, what’s inside (privacy gain). If then one day these funds get spent, the content of the hash is made visible, and only then one can see, what the original funding tx was about.</p>

<p>Advantage beside privacy: the funding of the tx is fairly cheap on fees, cause you have a short tx with several bytes. The spending tx however, reveals the hash contents, and if multisig, can be very long (increasing tx size and thus fee costs).</p>

<p>I found the best explanation for this in Andreas book “Mastering Bitcoin”, which is also available online. </p>

CC BY-SA 4.0
2017-12-23T10:25:09.937Z
2018-08-01T08:08:27.347Z
2018-08-01T08:08:27.347Z
pebwindkraft
<p>I'm a newbie and trying to grasp some concepts that are challenging.</p>

<p>In the case of a p2sh transaction - when is the transaction executed?
I grasp that these transactions give the receiver control of the terms of sending - but what I want to know is if the sender - when initiating the transaction - submits this data to the block and if so does that mean that p2sh transactions are mined twice? Initially from sender to '3' prefaced address and then once again from '3' prefaced address to the receiver..?
Any info is appreciated.
Regards,</p>

CC BY-SA 3.0
2017-12-22T22:02:03.317Z
I also grasp that p2sh transactions consolidate input data so it is more efficeient - but I am still confused about the chain of activity.
Peter
<transactions>
p2sh execution timing info help
Peter
# p2sh execution timing info help

(Asked by: username_0 on 2017-12-22)

I'm a newbie and trying to grasp some concepts that are challenging.

In the case of a p2sh transaction - when is the transaction executed?
I grasp that these transactions give the receiver control of the terms of sending - but what I want to know is if the sender - when initiating the transaction - submits this data to the block and if so does that mean that p2sh transactions are mined twice? Initially from sender to '3' prefaced address and then once again from '3' prefaced address to the receiver..?
Any info is appreciated.
Regards,

**Tags:** transactions

> **Comments:**
> **username_0**: I also grasp that p2sh transactions consolidate input data so it is more efficeient - but I am still confused about the chain of activity.  

---

## 1 answers

### Answer by username_1 on 2017-12-23. Score: 1

Not sure why this question was down voted, some explanation would have helped...

In general: A p2sh tx sends data to a hash. The hash is a one way function, so we cannot know, what content is behind the hash... also there is no double mining or similar. There is a funding tx, and a spending tx. Like with any other tx, you mine a first tx from someone else to my account, and if I spend the tx, another tx is created and mined. Same applies to p2sh transactions.

The funding tx is created, defining a condition for spending the funds (e.g. multisig, with a “type3” address), and post this tx to the network. Everyone can see the tx, but nobody knows, what’s inside (privacy gain). If then one day these funds get spent, the content of the hash is made visible, and only then one can see, what the original funding tx was about.

Advantage beside privacy: the funding of the tx is fairly cheap on fees, cause you have a short tx with several bytes. The spending tx however, reveals the hash contents, and if multisig, can be very long (increasing tx size and thus fee costs).

I found the best explanation for this in Andreas book “Mastering Bitcoin”, which is also available online.


---

