...
Let's consider a situation where a bank wants to allow either 2 tellers or 1 manager to sign off on any transfer transaction over $500 and under $1000. In this case, the condition will be: Condition.asset("usd@nbc").qty(500).comparison(">").qty(1000).comparison("<") and the signatory_sets for the tellers and manager will be OR unioned, so that either the m-of-n signatues from the tellers or the single signature from the manager will be acceptable for transaction signing.
...
Results
Second version of Iroha evolved the design of Iroha 1.x and can't use the same approach while it works to address requirements.
...
The same way Multisignature transactions implementation can be done. Main questions should be answered before that.
Multisignature transaction identification
Given `M` as required amount of signatures to collect and `N` as a set of legal signatories Then if `M` is greater than 1 Transaction should be treated as Multisignature.
Signatories set
As mentioned in "Multisignature transaction identification" `N` is a set of legal signatories. What variants we can have in this set?
- One unique signatory of one account.
- Several unique signatories of one account.
- Several unique signatories of several accounts.
- Any signatories of one account.
- Any signatories of several accounts.
- ...
So how we can describe `N`?
No Format |
---|
enum N {
Quantity(usize),
Holders([AccountId]),
Set([Signatory]),
} |
In this case `Quantity` variant is less restrictive than goes `Holders` and `Set` as most restrictive.
...
Configuration
Multisignature Transactions can be configured by a combination of `CheckSignatures` Iroha Special Instruction mandatory for every transaction with `N` Initial transaction's author Account's Asset.
If `CheckSignatures` passed successfully rest of instructions applied to the state. Otherwise transaction will be send to all peers.
Questions
- Should we guarantee persistence of Multisignature transactions waiting for required signatures on the ledger?
- Should we provide configuration of Multisignature without assets (client only)?
- How to merge Multisignature transactions signatures?