Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: antonimasso on November 07, 2015, 07:57:38 PM



Title: Lock multisig output to a set of addresses
Post by: antonimasso on November 07, 2015, 07:57:38 PM
Hello,

Is it possible to lock the output addresses of a Multisig address?

Thanks


Title: Re: Lock multisig output to a set of addresses
Post by: achow101 on November 07, 2015, 08:13:20 PM
What do you mean by locking the output addresses? A transaction be l by default is locked to the output addresses.


Title: Re: Lock multisig output to a set of addresses
Post by: antonimasso on November 07, 2015, 08:16:43 PM
Lock the the payment to a set of addresses. For example address 3jhGu... Can only spend its bitcoins to pay addresses 1huyt... & 1PLo2...


Title: Re: Lock multisig output to a set of addresses
Post by: achow101 on November 07, 2015, 08:18:22 PM
Lock the the payment to a set of addresses. For example address 3jhGu... Can only spend its bitcoins to pay addresses 1huyt... & 1PLo2...
No, it is not possible to set any address to only be able to send a payment to only a specific set of addresses.


Title: Re: Lock multisig output to a set of addresses
Post by: antonimasso on November 07, 2015, 08:32:02 PM
Ok, thanks.


Title: Re: Lock multisig output to a set of addresses
Post by: omarabid on November 08, 2015, 09:36:09 AM
It's interesting if it is possible though...


Title: Re: Lock multisig output to a set of addresses
Post by: jl2012 on November 08, 2015, 04:53:10 PM
tell what you're trying to do, not how you're  trying to do it


Title: Re: Lock multisig output to a set of addresses
Post by: luv2drnkbr on November 09, 2015, 02:52:04 PM
That would be pretty interesting though.  Something like a OP code for having in the redeem script "X% of this input must be spent to this address in output number 0 of the spending transaction, otherwise invalid"


Title: Re: Lock multisig output to a set of addresses
Post by: fbueller on November 09, 2015, 11:55:12 PM
A simple version is a script that allows funds to be redeemed by one of two parties, but only if 2 of the 3 participants agree. It could be extended to handle more values, but this demonstrates it well enough.

It's important to note, party1-pubkey and party2-pubkey can't be in the list of pubkeys for the multisig. Otherwise signatures produces by those parties could be pushed again to pass the code in the conditionals.

Code:
2 [3 x pubkeys] 3 OP_CHECKSIG
OP_IF
   OP_DUP OP_HASH160 [party1-pubkey-hash] OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
   OP_DUP OP_HASH160 [party2-pubkey-hash] OP_EQUALVERIFY OP_CHECKSIG

To release a UTXO on the P2SH address, your scriptSig would be:
Code:
1 [party1-sig] [party1-pubkey] OP_0 [2 x multisig sig] [serializedScript]

To release them to the second address, trigger the second address by pushing a 'false' value like the number '0'.


Title: Re: Lock multisig output to a set of addresses
Post by: amaclin on November 10, 2015, 02:55:49 PM
Lock the the payment to a set of addresses. For example address 3jhGu... Can only spend its bitcoins to pay addresses 1huyt... & 1PLo2...

Why not to create 1-of-2 msig address with pubkeys of your 1huyt... & 1PLo2...
So, this is your goal - only the owners of 1huyt... & 1PLo2... can transfer funds.


Title: Re: Lock multisig output to a set of addresses
Post by: achow101 on November 10, 2015, 08:18:09 PM
Lock the the payment to a set of addresses. For example address 3jhGu... Can only spend its bitcoins to pay addresses 1huyt... & 1PLo2...

Why not to create 1-of-2 msig address with pubkeys of your 1huyt... & 1PLo2...
So, this is your goal - only the owners of 1huyt... & 1PLo2... can transfer funds.
You misunderstand OP. He wants to be able to only SEND funds to 1huyt... and 1PLo2... The address can only spend TO those addresses and not to anyone else at all. He does not want to spend from those addresses.


Title: Re: Lock multisig output to a set of addresses
Post by: amaclin on November 10, 2015, 08:31:53 PM
You misunderstand OP. He wants to be able to only SEND funds to 1huyt... and 1PLo2...
The address can only spend TO those addresses, not from those.
No difference.
He wants funds can be transferred only to personA or to personB.
Multisig 1-of-2 solves this.


Title: Re: Lock multisig output to a set of addresses
Post by: achow101 on November 10, 2015, 08:41:42 PM
You misunderstand OP. He wants to be able to only SEND funds to 1huyt... and 1PLo2...
The address can only spend TO those addresses, not from those.
No difference.
He wants funds can be transferred only to personA or to personB.
Multisig 1-of-2 solves this.
No it does not. He wants himself to be able to send the funds to personA or personB. Your idea means that he sends funds to a special address where only personA or personB can go retrieve it (from what I understand). This means that personA could steal funds meant for personB or vice versa. This also does not make a address that can only spend to specific addresses.