I'm not an expert in bitcoinj or bitcoin script but I know that the redeem scripts for multi sig p2sh address and pay-to-pub-key-hash addresses both require public key(s). You need them to verify the signatures, so it kind has to work like that.
Also, in both cases the scriptPubKey only requires a hash. For p2sh it's a hash of the script that contains public keys (in most cases) or with p2pkh it's just a hash of the public key. On Tue, Dec 5, 2017 at 12:23 AM vg-coder <[email protected]> wrote: > Thanks for the answer Ishmael. However, that is not exactly the answer > that I was looking for. I guess that my question was not deep enough and > not properly asked. I'll rephrase: > > In a common ScriptPubKey to pay a single recipient, we use the bitcoin > address (hash of the public key): > > scriptPubKey: OP_HASH160 <scriptHash> OP_EQUAL > > > However, in a multisig (what I guess that createMultiSigOutputScript > creates), the Script requires the public keys: > script: OP_m <pubKey1> ... OP_n OP_CHECKMULTISIG > > Since I guess that there is no way to do a multisig with bitcoin addresses > instead of public keys, then my question is: why was this created like that?, > instead of being more consistent and using addresses like in the scriptPubKey? > > > Kind regards, > V > > > On Monday, December 4, 2017 at 8:19:51 PM UTC+1, Ishmael Riles wrote: >> >> The multisig script is created from the public keys. An address is a hash >> of the public key, the hash goes only one way so you can not derive the >> public key from the address. >> >> On Wednesday, November 22, 2017 at 6:44:25 AM UTC-8, vg-coder wrote: >>> >>> Hi all! >>> >>> I am testing some easy smart contracts and I got a doubt. Why do we need >>> the ECKey in createMultiSigOutputScript instead of using Address? >>> Is there no way to achieve the same with the addresses instead of using >>> keys?, since normally, between two parties, we interchange addresses not >>> public keys. >>> >>> Kind regards, >>> >> -- > You received this message because you are subscribed to a topic in the > Google Groups "bitcoinj" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/bitcoinj/_kfzvTAFUZs/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "bitcoinj" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
