According to this example:
Redeem Script: 2 PubKey1 PubKey2 PubKey3 PubKey4 PubKey5 5 OP_CHECKMULTISIG
Locking Script: OP_HASH160 <20-byte hash of redeem script> OP_EQUAL
Unlocking Script: Sig1 Sig2 redeem script
I want to calculate the <20-byte hash of redeem script> with BitcoinJ but i don't know how to do it.
This <20-byte hash of redeem script> is the result of :
RIPEMD160(SHA256(PubKey1.getPublicKeyAsHex() || PubKey2.getPublicKeyAsHex() || PubKey3.getPublicKeyAsHex() || PubKey4.getPublicKeyAsHex() || PubKey5.getPublicKeyAsHex())) or RIPEMD160(SHA256(input))???
The input (which is String type) from above is the concatenation of each public key of all participants in the redeem script.
And if <20-byte hash of redeem script> it is not the result that i mentioned above...how can i estimate this hash with BitcoinJ?