3

I'm having a very difficult time finding the first-ever P2SH transaction on the blockchain. I do not have a query tool to answer this question myself, sadly.

All internet searches result in this answer:

9c08a4d78931342b37fd5f72900fb9983087e6f46c4a097d8a1f52c74e28eaf6

(Block 170,052 | March 3, 2012)

But as bitcoin wiki points out, this is the first BIP 13 transaction (first address beginning with a "3") and the P2SH soft-fork was not yet active, since it occurred on April 1st 2012.

I think this means the first legitimate P2SH transaction would be the first "3" address occurring on or after April 1st, 2012. Using vague tools I am under the impression that such a transaction occurred around April 7 or 8, 2012. However I am unable to dig deeper without manually searching every block on those dates.

I'm surprised this information is so hard to find since it seems like such an important moment in bitcoin's history. Maybe I'm misunderstanding something. Help greatly appreciated!!!

2 Answers 2

4

I used Blockchair to only search for transaction outputs of type P2SH, and restricted results to blocks after the activation height of block 173 805. I also checked against any time after March 11th and got the same result.

The first transaction that sent funds to a P2SH output appears to be 2597f4819e1902750b9e1fa1515df22bbf14f3a78a2b82aa7d62a8109d83289d in block 174 717 on 2012-04-08 (UTC).

Then, I further restricted the search to only permit spent outputs of type P2SH sorted by ascending spending block height after 173 805 to find the first P2SH output that was spent in transaction e5779b9e78f9650debc2893fd9636d827b26b4ddfa6a8172fe8708c924f5c39d at block height 174 719.

2
  • Ah I was unaware of the Blockchair tool. Thank you so much!
    – Tom
    Commented Feb 22, 2023 at 22:58
  • 1
    Interestingly, 37paP4uTjmA4Pi85LG6CF9huift3Dw1kFT from the first spending tx is an atypical address. It requires no signature, and leaves a non-standard non-empty stack. In theory, those are "free" coins, provided you can get a miner to include the tx Commented Jun 16 at 4:49
0

BIP-0016 stated:

These new rules should only be applied when validating transactions in blocks with timestamps >= 1333238400 (Apr 1 2012) 1.

The first block enforcing these new rules was block 173805, because it has timestamp 1333240980.

The first P2SH spend happened in block 174719 (TXO was created in block 174718), which the other answer correctly states.

I would like to add that there exist some TXOs that match P2SH output bytecode pattern that were created before P2SH had activated.

Before P2SH activation, they could be spent as just hashlock contracts. After P2SH activation, they could only be spent if the hash preimage also happened to be a redeem script that would pass execution.

The TXO created in block 170052 was actually spent in block 170060 as hashlock, not P2SH, because P2SH rules weren't active at the time.

The other 5 hashlock TXOs were not spent before activation, and so P2SH likely made them forever unspendable, more details here: https://bitcoin.stackexchange.com/a/115804/137501

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.