Bitcoin Forum
May 21, 2024, 05:43:39 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: which address will get the money in multisig?  (Read 1024 times)
bit_kevin (OP)
Member
**
Offline Offline

Activity: 64
Merit: 10


btc.com


View Profile WWW
June 23, 2013, 05:03:17 AM
 #1

Transaction:
https://blockchain.info/tx/60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1

Dump Tx raw, here is vout part:

Quote
    "vout" : [
        {
            "value" : 0.01000000,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "1 04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e 6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5 b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG",
                "hex" : "514104cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e 7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4410461cbdcc5409fb4b4d42b 51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911 abe3e7854a26f39f58b25c15342af52ae",
                "reqSigs" : 1,
                "type" : "multisig",
                "addresses" : [
                    "1AJbsFZ64EpEfS5UAjAfcUG8pH8Jn3rn1F",
                    "1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq"
                ]
            }
        },
        {
            "value" : 0.46452304,
            "n" : 1,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 c812a297b8e0e778d7a22bb2cd6d23c3e789472b OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a914c812a297b8e0e778d7a22bb2cd6d23c3e789472b88ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "1KEtUA8f76CpHmFukC28uUsfsUduexvsSB"
                ]
            }
        },
        {
            "value" : 0.00500000,
            "n" : 2,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 641ad5051edd97029a003fe9efb29359fcee409d OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a914641ad5051edd97029a003fe9efb29359fcee409d88ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq"
                ]
            }
        }
    ],

In vout[0], there are two address("1AJbsFZ64EpEfS5UAjAfcUG8pH8Jn3rn1F", "1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq") got value 0.01000000, but which address gets the money?
domob
Legendary
*
Offline Offline

Activity: 1135
Merit: 1166


View Profile WWW
June 23, 2013, 09:14:48 AM
 #2

I would say "neither of those" gets the money, or maybe "both".  Since this seems to be a "1 of 1" multisig (according to blockchain.info), it means that either owner of one of those addresses can spend the 0.01 BTC (think: "whoever comes first").  Where the money is sent in this case is decided by the one spending it.

Use your Namecoin identity as OpenID: https://nameid.org/
Donations: 1domobKsPZ5cWk2kXssD8p8ES1qffGUCm | NMC: NCdomobcmcmVdxC5yxMitojQ4tvAtv99pY
BM-GtQnWM3vcdorfqpKXsmfHQ4rVYPG5pKS | GPG 0xA7330737
bluemeanie1
Sr. Member
****
Offline Offline

Activity: 280
Merit: 257


bluemeanie


View Profile WWW
June 24, 2013, 03:11:07 AM
 #3

Seems a lot of people don't understand what a multisig transaction is.

It requires 2+ crypto keys to unlock the transaction and the output can then be put into any address the owners of those two keys wish.

as far as I know, no wallets will show this particular transaction as part of the balance for either address.

so in that sense, it's in a special JOINT ACCOUNT.  It might be possible to make a special kind of wallet app that can show the balance of such a joint account(perhaps one already exists), however this balance cannot be spent without BOTH private keys.

Just who IS bluemeanie?    On NXTautoDAC and a Million Stolen NXT

feel like your voice isn't being heard? PM me.   |   stole 1M NXT?
bit_kevin (OP)
Member
**
Offline Offline

Activity: 64
Merit: 10


btc.com


View Profile WWW
June 25, 2013, 11:27:26 AM
 #4

Seems a lot of people don't understand what a multisig transaction is.

It requires 2+ crypto keys to unlock the transaction and the output can then be put into any address the owners of those two keys wish.

as far as I know, no wallets will show this particular transaction as part of the balance for either address.

so in that sense, it's in a special JOINT ACCOUNT.  It might be possible to make a special kind of wallet app that can show the balance of such a joint account(perhaps one already exists), however this balance cannot be spent without BOTH private keys.

so what's the difference between p2sh and multisig?
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1025



View Profile
June 25, 2013, 12:07:12 PM
 #5

In P2SH, there are two scripts.  The first script is a stub that makes other nodes recognize it as a P2SH script, and it includes the hash of the second script.  The second script can be anything, and it isn't revealed until the transaction is redeemed.  The hash of the revealed script must match the hash embedded in the stub.

Multisig is just a special script that has an instruction that verifies that at least M-of-N signatures are present.  This script can be in a normal transaction, or it can be in a P2SH transaction.

The stock client understands multisig via P2SH.  There are commands to create P2SH multisig addresses, and the client will understand them correctly.  If the client knows the P2SH address in question, and knows enough of the keys to redeem it, then the transaction will show up in listunspent, and the value will be calculated in your wallet balance, etc.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
bit_kevin (OP)
Member
**
Offline Offline

Activity: 64
Merit: 10


btc.com


View Profile WWW
June 25, 2013, 03:21:22 PM
 #6

In P2SH, there are two scripts.  The first script is a stub that makes other nodes recognize it as a P2SH script, and it includes the hash of the second script.  The second script can be anything, and it isn't revealed until the transaction is redeemed.  The hash of the revealed script must match the hash embedded in the stub.

Multisig is just a special script that has an instruction that verifies that at least M-of-N signatures are present.  This script can be in a normal transaction, or it can be in a P2SH transaction.

The stock client understands multisig via P2SH.  There are commands to create P2SH multisig addresses, and the client will understand them correctly.  If the client knows the P2SH address in question, and knows enough of the keys to redeem it, then the transaction will show up in listunspent, and the value will be calculated in your wallet balance, etc.

They all share some coin, P2SH is just one address(generated from multi public key) with redeemScript, Multisig has at least one address.
The coin which they shared is not belong to any one of these addresses.
To spend the coin, they all need at least one private key to sign.
Use command "#bitcoind gettxout xxxxx n" can find them before spend.

I think they the same thing, just looks different. P2SH looks more simple than multisig.
dserrano5
Legendary
*
Offline Offline

Activity: 1974
Merit: 1029



View Profile
June 25, 2013, 07:14:30 PM
 #7

In P2SH, there are two scripts.  The first script is a stub that makes other nodes recognize it as a P2SH script, and it includes the hash of the second script.  The second script can be anything, and it isn't revealed until the transaction is redeemed.  The hash of the revealed script must match the hash embedded in the stub.

Multisig is just a special script that has an instruction that verifies that at least M-of-N signatures are present.  This script can be in a normal transaction, or it can be in a P2SH transaction.

The stock client understands multisig via P2SH.  There are commands to create P2SH multisig addresses, and the client will understand them correctly.  If the client knows the P2SH address in question, and knows enough of the keys to redeem it, then the transaction will show up in listunspent, and the value will be calculated in your wallet balance, etc.

Thank for this good explanation, however I don't understand a thing in the last paragraph: if the client knows the P2SH address, it knows the hash of the script but doesn't know the script itself, so isn't able to determine if it has enough of the keys to redeem it, therefore it can't appear in listunspent etc. Now, is this correct or am I overseeing something?
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1025



View Profile
June 25, 2013, 07:53:46 PM
 #8

In P2SH, there are two scripts.  The first script is a stub that makes other nodes recognize it as a P2SH script, and it includes the hash of the second script.  The second script can be anything, and it isn't revealed until the transaction is redeemed.  The hash of the revealed script must match the hash embedded in the stub.

Multisig is just a special script that has an instruction that verifies that at least M-of-N signatures are present.  This script can be in a normal transaction, or it can be in a P2SH transaction.

The stock client understands multisig via P2SH.  There are commands to create P2SH multisig addresses, and the client will understand them correctly.  If the client knows the P2SH address in question, and knows enough of the keys to redeem it, then the transaction will show up in listunspent, and the value will be calculated in your wallet balance, etc.

Thank for this good explanation, however I don't understand a thing in the last paragraph: if the client knows the P2SH address, it knows the hash of the script but doesn't know the script itself, so isn't able to determine if it has enough of the keys to redeem it, therefore it can't appear in listunspent etc. Now, is this correct or am I overseeing something?

Knowing the script is what I mean by knowing the address.

The node doesn't try every key it has against every transaction it sees to see if it can redeem it, it cheats.  It stores something called the scriptPubKey and uses that to look up secrets.  The secrets are usually private keys, but in this case, it is the redemption script.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
dserrano5
Legendary
*
Offline Offline

Activity: 1974
Merit: 1029



View Profile
June 26, 2013, 07:14:44 AM
 #9

The secrets are usually private keys, but in this case, it is the redemption script.

Aha this was my missing bit. Thanks again.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!