Add support in bitcoin for P2SH-P2WSH address format
The goal of this task is to add support for nested P2WSH scripts, which are wrapped within PS2SH script. The main reason of introducing this feature into peerplays is using libbitcoin library as a new efficient client. Libbitcoin library for now, works only with P2SH address format introduced in BIP16.
`To create a P2SH-P2WSH address:
Define a script, called (witnessScript)
Calculate the SHA256 of the witnessScript (scripthash). Please pay attention that a single SHA256 is used, not double SHA256 nor RIPEMD160(SHA256)
The P2SH redeemScript is always 34 bytes. It starts with a OP_0, followed by a canonical push of the scripthash (i.e. 0x0020{32-byte scripthash})
Same as any other P2SH, the scriptPubKey is OP_HASH160 hash160(redeemScript) OP_EQUAL, and the address is the corresponding P2SH address with prefix 3.
`