Can P2SH-aware nodes permanently lock bitcoin?

1 reply 160 views
b3ar2015Member
Posts: 23 · Reputation: 191
#1May 19, 2017, 06:37 PM
I've been around here for a bit, but I wanted to get a solid grasp on the technical side of bitcoin before diving into other areas. This question is kinda tough for me, and I'd appreciate some clarity. So, the standard script for a lightning network HTLC output has this conditional branch that needs a user to know the preimage of a hash. Plus, it needs a valid signature. But it got me thinking: what if, back in the early days before P2SH existed, someone made a locking script that accidentally fit the P2SH model? Let's say they only meant to set up a lock that said "the spender needs to know this hash preimage". The thing is, that preimage isn't a bitcoin script, so it can't be executed even if it fits the P2SH structure. Do nodes that recognize P2SH end up locking this bitcoin forever?
2 Reply Quote Share
im_apeHero Member
Posts: 629 · Reputation: 3824
#2May 19, 2017, 11:51 PM
Yes. If the top stack item which has to be interpreted as a script (the redeem script to be exact) is not a valid script for any reason, that output is unspendable forever because according to the consensus rules the transaction spending it would be invalid.
2 Reply Quote Share

Related topics