Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Envrin on July 20, 2014, 10:20:31 PM



Title: Multisig Idea -- Mandatory vs. Optional Signatures.
Post by: Envrin on July 20, 2014, 10:20:31 PM
Just an idea.  What about slightly modifying the redeem script, allowing you to define whether the public key is a mandatory or optional signature?  BIP32 HD wallets are excellent for creating a hierarchy, such as if you have a company with multiple departments.  However, the one issue I'm starting to get is there is no limitations / restrictions.

For example, say I'm the boss, and decide to send some BTC to one of my department heads for their budget on a project.  BIP32 is great in the way that I still have full access to those funds, except the department head can do whatever he likes with those funds, with no restrictions, limitations or approval required.  For example, 3 of 5 multisig address:

1st Sig = User / Dept Head
2nd Sig = Boss
3rd Sig = 1 of 3 co-workers.

Right now, the above is impossible, because 2 of the co-workers could just sign the transaction without any approval from the boss.  What about slightly changing the redeem script so you can define the user & boss keys mandatory, and the 3 co-worker keys optional.  Would that be possible?


Title: Re: Multisig Idea -- Mandatory vs. Optional Signatures.
Post by: DeathAndTaxes on July 20, 2014, 10:52:59 PM
It would be possible with a hard fork.  It probably is not going to happen though.  There are however two alternate ways to accomplish the same goal.  

1) Use an AND operator in the the script.  You can make the script require Boss Signatures AND 2 of 4 workers.  Right now however this would be non-standard but hopefully that will change soon.

2) You can recreate #1 as a flat m of n by just giving the boss (mandatory signer) multiple keys.  The advantage of this is it is "standard" but it does result in larger signatures.  It could be used until #1 was included in the IsStandard checks.

Instead of 3 of 5 (with 4 workers and one boss key) make it 5 of 9 (with four workers and five boss keys)
Worker1
Worker2
Worker3
Worker4
Boss
Boss
Boss
Boss
Boss

Even if all 4 workers conspire they can't spend the coins without the boss.   Note in this example the boss (having 5 keys) could spend them without the approval of anyone else. If you don't want that to happen just give the boss one less key and make it 5 of 8.


Title: Re: Multisig Idea -- Mandatory vs. Optional Signatures.
Post by: TimS on July 21, 2014, 12:03:15 AM
1st Sig = User / Dept Head
2nd Sig = Boss
3rd Sig = 1 of 3 co-workers.
7-of-9

User
User
User
Boss
Boss
Boss
Worker1
Worker2
Worker3

This requires the User, Boss, and at least one worker (which I think is what you're asking for).


Title: Re: Multisig Idea -- Mandatory vs. Optional Signatures.
Post by: jl2012 on July 21, 2014, 02:27:17 AM
It would be possible with a hard fork. 

blah blah blah

Most everything is possible with a hard fork


Title: Re: Multisig Idea -- Mandatory vs. Optional Signatures.
Post by: mmeijeri on July 21, 2014, 07:08:52 PM
Right now, the above is impossible, because 2 of the co-workers could just sign the transaction without any approval from the boss.  What about slightly changing the redeem script so you can define the user & boss keys mandatory, and the 3 co-worker keys optional.  Would that be possible?

Scripts are more flexible than just m-of-n. In particular you can use AND and OR to chain m-of-n conditions among other things. User AND Boss AND 1-of-3 coworkers.


Title: Re: Multisig Idea -- Mandatory vs. Optional Signatures.
Post by: kolinko on July 22, 2014, 12:15:17 PM
+1 - custom script, the only problem is that it has to go through Eligius and you'll have to wait 1-10 hours for the block to be mined.

7 of 9 that TimS suggested would also be considered nonstandard due to tx size.


Title: Re: Multisig Idea -- Mandatory vs. Optional Signatures.
Post by: DeathAndTaxes on July 22, 2014, 02:01:02 PM
7 of 9 that TimS suggested would also be considered nonstandard due to tx size.

7 of 9 isn't non-standard. 

Compressed Keys
ScriptSig = 239 bytes (7*34 + 1)

Uncompressed Keys
ScriptSig = 463 bytes (7*66 + 1)