Bitcoin Forum
May 08, 2024, 03:00:32 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Enforcing the Recipient with P2SH  (Read 1140 times)
No_2 (OP)
Hero Member
*****
Offline Offline

Activity: 901
Merit: 1033


BTC: the beginning of stake-based public resources


View Profile
March 09, 2015, 03:02:14 PM
 #1

Using P2SH multisig is there a way to create a script which enforces who the recipient will be?

I.e. if you had two parties who had locked funds up under a 4-of-6 escrow, where the two parties are not the signatories required to release the funds and any four of the six escrow could sign to release to either party. Could the script be set up such that it can only be released to party 1 or 2. Because under this scheme four of the escrow could conspire to send the funds to an address other than one of the party address?
Each block is stacked on top of the previous one. Adding another block to the top makes all lower blocks more difficult to remove: there is more "weight" above each block. A transaction in a block 6 blocks deep (6 confirmations) will be very difficult to remove.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715137232
Hero Member
*
Offline Offline

Posts: 1715137232

View Profile Personal Message (Offline)

Ignore
1715137232
Reply with quote  #2

1715137232
Report to moderator
1715137232
Hero Member
*
Offline Offline

Posts: 1715137232

View Profile Personal Message (Offline)

Ignore
1715137232
Reply with quote  #2

1715137232
Report to moderator
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
March 09, 2015, 03:39:02 PM
Last edit: March 10, 2015, 03:45:06 AM by DannyHamilton
 #2

Using P2SH multisig is there a way to create a script which enforces who the recipient will be?

I.e. if you had two parties who had locked funds up under a 4-of-6 escrow, where the two parties are not the signatories required to release the funds and any four of the six escrow could sign to release to either party. Could the script be set up such that it can only be released to party 1 or 2. Because under this scheme four of the escrow could conspire to send the funds to an address other than one of the party address?

Sure.

Make it a 5-of-7 instead of a 4-of-6 and require that one of the 5 signatories be the recipient that you are wanting to enforce.

Now none of the 6 can send the funds anywhere without the approval of the proper recipient, and the recipient can't send the funds anywhere without the approval of at least 4 of the remaining 6 signatories.
jl2012
Legendary
*
Offline Offline

Activity: 1792
Merit: 1097


View Profile
March 09, 2015, 03:49:07 PM
 #3

Using P2SH multisig is there a way to create a script which enforces who the recipient will be?

I.e. if you had two parties who had locked funds up under a 4-of-6 escrow, where the two parties are not the signatories required to release the funds and any four of the six escrow could sign to release to either party. Could the script be set up such that it can only be released to party 1 or 2. Because under this scheme four of the escrow could conspire to send the funds to an address other than one of the party address?


If you want to do it in the protocol level, the answer is no.

If you just want the effect but don't care how it is done, DannyHamilton has suggested.

Donation address: 374iXxS4BuqFHsEwwxUuH3nvJ69Y7Hqur3 (Bitcoin ONLY)
LRDGENPLYrcTRssGoZrsCT1hngaH3BVkM4 (LTC)
PGP: D3CC 1772 8600 5BB8 FF67 3294 C524 2A1A B393 6517
No_2 (OP)
Hero Member
*****
Offline Offline

Activity: 901
Merit: 1033


BTC: the beginning of stake-based public resources


View Profile
March 09, 2015, 07:11:44 PM
 #4

Thanks.
justusranvier
Legendary
*
Offline Offline

Activity: 1400
Merit: 1009



View Profile
March 10, 2015, 03:15:29 AM
 #5

Make it a 5-of-7 instead of a 4-of-6
If the four parties are the payer, payee, and two mediators, then the redeem script could be a p2pkh script for an address controlled by the payee OP_AND a 3-of-3 multisig with the payer and the two mediators.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
March 10, 2015, 03:26:04 AM
 #6

Make it a 5-of-7 instead of a 4-of-6
If the four parties are the payer, payee, and two mediators, then the redeem script could be a p2pkh script for an address controlled by the payee OP_AND a 3-of-3 multisig with the payer and the two mediators.

Certainly, however the question specifically asked about:

- snip -
where the two parties are not the signatories required to release the funds and any four of the six escrow could sign to release
- snip -
justusranvier
Legendary
*
Offline Offline

Activity: 1400
Merit: 1009



View Profile
March 10, 2015, 03:30:29 AM
 #7

Make it a 5-of-7 instead of a 4-of-6
If the four parties are the payer, payee, and two mediators, then the redeem script could be a p2pkh script for an address controlled by the payee OP_AND a 3-of-3 multisig with the payer and the two mediators.

Certainly, however the question specifically asked about:

- snip -
where the two parties are not the signatories required to release the funds and any four of the six escrow could sign to release
- snip -

So that should have been four mediators.

Still, the point is the two scripts connected with an OP_AND approach vs the "higher m and n" approach.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
March 10, 2015, 03:44:19 AM
 #8

Make it a 5-of-7 instead of a 4-of-6
If the four parties are the payer, payee, and two mediators, then the redeem script could be a p2pkh script for an address controlled by the payee OP_AND a 3-of-3 multisig with the payer and the two mediators.

Certainly, however the question specifically asked about:

- snip -
where the two parties are not the signatories required to release the funds and any four of the six escrow could sign to release
- snip -

So that should have been four mediators.

Still, the point is the two scripts connected with an OP_AND approach vs the "higher m and n" approach.

So, you are saying the exact same thing as I did?

The transaction will require a total of 5 out of 7 possible signatures.

It will require:

- snip -
that one of the 5 signatories be the recipient
- snip -

OP_AND

- snip -
the approval of at least 4 of the remaining 6 signatories.

1 required recipient sig + 4 required escrow sigs = 5 total sigs required (M)
1 recipient sig possible + 6 escrow sigs possible = 7 total sigs possible (N)

M-of-N is 5-of-7 with one of the 5 sigs being required to be from the recipient.

justusranvier
Legendary
*
Offline Offline

Activity: 1400
Merit: 1009



View Profile
March 10, 2015, 03:53:50 AM
 #9

So, you are saying the exact same thing as I did?

The transaction will require a total of 5 out of 7 possible signatures.
If we are saying the same thing, then you're playing really fast and lose with terminology.

At least, I'd consider it misleading to talk about a "5-of-7 multisig" transaction where OP_5 and OP_7 never appear as arguments to an OP_CHECKMULTISIG.

If you meant "1-of-1 AND 4-of-6" describing that as "5-of-7" is just a bit ambiguous.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
March 10, 2015, 11:18:20 AM
 #10

- snip -
If we are saying the same thing, then you're playing really fast and lose with terminology.
- snip -
If you meant "1-of-1 AND 4-of-6" describing that as "5-of-7" is just a bit ambiguous.

Perhaps.

I do have a reputation for being far to ambiguous and not focusing enough on the details sometimes.

I suppose I just felt it was clear that the words "require that one of the 5 signatories be the recipient that you are wanting to enforce" implied a 1-of-1 signature.  Is there some other reasonably useful way to require that 1 of the 5 signatures come from a specific private key?
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!