Author

Topic: About the Multisig Transaction. (Read 1267 times)

newbie
Activity: 3
Merit: 0
July 01, 2014, 07:39:42 AM
#5
Thank you DeathAndTaxes! Kiss

It became study very much.
Moreover, the report taught in the last line was very helpful.

mpdtbtc
donator
Activity: 1218
Merit: 1079
Gerald Davis
June 30, 2014, 09:49:10 AM
#4
You mean encode to an address?  It is already decoded.   No.  It can sometimes be encoded to a set of addresses.

Take the output of this txn for example:
https://blockchain.info/tx/14237b92d26850730ffab1bfb138121e487ddde444734ef195eb7928102bc939

Quote
52410496ec45f878b62c46c4be8e336dff7cc58df9b502178cc240eb3d31b1266f69f5767071aa3 e017d1b82a0bb28dab5e27d4d8e9725b3e68ed5f8a2d45c730621e34104cc71eb30d653c0c31639 90c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf 8f065dec022b51d11fcdd0d348ac4410461cbdcc5409fb4b4d42b51d33381354d80e550078cb532 a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c1534 2af53ae

If you decode this into opcodes it looks a little like this

Quote
d1b82a0bb28dab5e27d4d8e9725b3e68ed5f8a2d45c730621e3> 6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4> b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af>

This is a standard 2-of-3 multisig output. If you take the HASH-160 of each of the PubKeys and then Base58 Encode each of them you get:
1EJs4UCxotGu8QYf5wUjCvmATzCpctUTmF
1AJbsFZ64EpEfS5UAjAfcUG8pH8Jn3rn1F
1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq

I assume you are asking about addresses for the purposes of displaying it in a human readable form.

Quote
2 of 1EJs4UCxotGu8QYf5wUjCvmATzCpctUTmF, 1AJbsFZ64EpEfS5UAjAfcUG8pH8Jn3rn1F, & 1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq

You could represent the outputs in a format like the one above (and if you could store them in a far more compact format) but native-multisig (not to be confused w/ P2SH) can't encode to a single address.  They funds were never "sent" to a single address.  Native-multisig is limited to 3-of-3 so there are only six combinations (yes 1-of-1 is a valid "multisig" output).


To make it a little more fun, there are "custom" scripts which don't conform to the templates for Pay2PubKeyHash, Pay2PubKey, OP_RETURN, or Native-Multisig outputs but they represent <0.1% of the blockchain.  You might find this article useful. http://www.quantabytes.com/articles/a-survey-of-bitcoin-transaction-types  




newbie
Activity: 3
Merit: 0
June 30, 2014, 01:11:30 AM
#3
Thank you DeathAndTaxes!!!

Can't it decode to an address?
I think that I will examine some another methods and I will consider realization of what it is going to do.
I appreciate your help.

Best Regards,
mpdtbtc
donator
Activity: 1218
Merit: 1079
Gerald Davis
June 27, 2014, 04:18:04 PM
#2
There is no Bitcoin address in that case.

Bitcoin addresses only represent one of two things
a) a PubKeyHash
b) a ScriptHash

The client is smart enough that when you say "pay address 1KdesGtkBzctNGN5SjBrH1LkhAVWZJtzGM" (a Pay2PubKeyHash address), it decodes the address into the PubKeyHash cc60d92cc6bade881c0f51dcdf77707db85a5ac7 and creates an Pay2PubKeyHash output (OP_DUP OP_HASH160 cc60d92cc6bade881c0f51dcdf77707db85a5ac7 OP_EQUALVERIFY OP_CHECKSIG).  To "spend" the output, the recipient will include a PubKey which hashes to the PubKeyHash specified and then sign the txn with the correct key.

And likewise if you tell your client to "pay address 3Faj1Lk5dmEhjiVw2RRT5w8iRrAUiwY2z3" (a Pay2ScriptHash address), it decodes the address into the PubKeyHash cc60d92cc6bade881c0f51dcdf77707db85a5ac7 and creates an Pay2ScriptHash output (OP_HASH160 986124b379ef96d971b4cdad450536a0b55e7824 OP_EQUAL ).  To "spend" the output, the recipient will include a redemptionScript in the input which hashes to the ScriptHash specified and then meet the requirements of the script (i.e. if the script is a 2-of-3 multisig the txn must be signed with two of the keys).

Any other output is a raw script in the output portion of the txn (PKScript).  There is no corresponding identifying address.  Going forward this will probably be less common as any possible script can be implements as a P2SH output.  If you are wondering why there are multiple ways to do the "same thing", it is because P2SH didn't exist at the time Bitcoin was launched.  In hindsight it would have made sense to just have ALL outputs contain a hash of the redemption script (and no opcodes) but hindsight is 20/20 so today there are multiple ways to do the same thing.
newbie
Activity: 3
Merit: 0
June 27, 2014, 04:51:34 AM
#1
Hello,

I am in trouble about operation code: "Multisig" in the data of a block chain.
I would like to compute the Bitcoin address of the destination of a Bitcoin from the value of the "Script" tag in the

case of the "Multisig" transaction.
Is this possible?
If possible, how should it do?
Jump to: