Where are P2SH full redeem scripts stored?

Where are P2SH full redeem scripts stored?

A pay-to-script-hash/P2SH full redeem script can be up to 520-bytes in size. Just to clarify, prior to being revealed/spent, is the redeem script stored in the spender/Bob's wallet or elsewhere?

The developer guide says:

"When Bob wants to spend the output, he provides his signature along with the full (serialized) redeem script in the signature script." (https://bitcoin.org/en/developer-guide#p2sh-scripts)

enter image description here

Soroushjp states:

"The redeem script itself is only revealed, checked against the redeem script hash, and evaluated during the spending transaction." (http://www.soroushjp.com/2014/12/20/bitcoin-multisig-the-hard-way-understanding-raw-multisignature-bitcoin-transactions/)

Antonpuolous states:

"P2SH shifts the burden in data storage for the long script from the output (which is in the UTXO set and therefore affect memory) to the input (only stored on the blockchain)." (2014:133)

(This question asks almost the same thing: Where the P2SH script gets written?)

(There's an unintended relationship with this question "Storing scripts (smart contracts) outside the blockchain", insofar as the location of redeem scripts.)

https://ift.tt/2PalpnU

Comments

Popular posts from this blog

Need help to recover blpckchain.info wallet, my wife forgot her password and the brute force with btcrecover is not catching the password

When downloading the blockchain my application is become unusable, is there an issue with my code or am I using the BitcoinJ library incorrectly?

Mistakenly sent BTC from my personal wallet back to one of the exchange wallet addresses that I had received BTC from before - help recovering!