How can I store a redeem script in my wallet?

3

3

Imagine that I wrote a redeem script. I calculated the related P2SH address, and sent some bitcoins to that address. In order to spend that bitcoins, I need to remember two things:

  1. The private keys that are needed by the redeem script.
  2. The redeem script itself.

Using the bitcoind RPC interface I can store in my wallet P2PKH addresses and their related private keys. I would like to store also the P2SH address and related redeem script: it would be nice to have an RPC method that parses the script string, stores the script in the wallet and returns the P2SH address.

Is it possible? What if I forget the redeem script that is necessary to spend bitcoins from a P2SH? Am I missing something? Is it true that it's useful to store redeem scripts in the wallet and not only with private keys?

Giuseppe Galano

Posted 2016-10-04T16:02:56.333

Reputation: 131

No answers