```plantuml
@startuml
participant Identifier as I
participant Witness as W
participant Participant as P
group incept identifier
I -> I : Incept
I -> W : Publish inception event
W -> W : Process inception event \nand save receipt in mailbox
group check own mailbox
I -> W: query mailbox
W --> I: mailbox content
end
note right
no action required,
mailbox should contain
only own inception receipt
end note
end
group incept participant
P -> P : Incept
P -> W : Publish inception event
W -> W : Process inception event and save receipt in mailbox
group check own mailbox
P -> W: query mailbox
W --> P: mailbox content
end
note right
no action required,
mailbox should contain
only own inception receipt
end note
end
group initialize group
I -> I: incept group identifier
I -> I: pack inception event in exn message, to forward it to participants
I -> W: send exn message to forward it to participant
W -> W: validate and insert into participant's mailbox
end
group check own mailbox
P -> W: query mailbox to get participant signature
W --> P: mailbox content
end
note right
mailbox content should
contain **MultisigRequest**
end note
group process multisig request
P -> P: sign and process group inception event
P -> P: sign exn message to forward it to group initiator
P -> W: send exn message to forward it to initiator
end
group check group mailbox
I -> W: query group mailbox
W --> I: mailbox content
note right
no action required,
mailbox should contain
only inception event
signed by participant
end note
group #MediumSeaGreen publish fully signed event to witness
I -> W: send fully signed event to witness
W -> W : Process event and save\n receipt in mailbox
end
note right #MediumSeaGreen
this happends
automagically while
processing mailbox response.
end note
end
group check group mailbox
I -> W: query mailbox to get group inception receipt
W --> I: mailbox content
end
note right
no action required,
mailbox should contain
only receipts
end note
group check group mailbox
P -> W: query mailbox to get group inception receipt
W --> P: mailbox content
end
note right
no action required,
mailbox should contain
only receipts
end note
@enduml
```
### ToDo:
- [x] ~~`newPublicKey` - accepts also a private key without error~~
- [ ] `signatureFromHex` - unwrap
- [x] ~~`queryMailbox` - unwrap when witness incorrect~~
- [x] `queryMailbox` - witness can start with both B and D, no difference
- [ ] `queryMailbox` - witness starting with D is listening, no error when we pass witness starting with B
- [x] ~~`finalizeMailBoxQuery` - if the signature is incorrect, throws Ffiexception with witness error~~
- [x] ~~`inceptGroup` - witness treshold lower than 0/huge works~~
- [x] ~~`inceptGroup` - signature treshold unwrap~~
- [ ] `inceptGroup` - think about exception when initialWitness is incorrect
- [ ] ~~`inceptGroup` - when participant/identifier is unknown, unwrap~~
- [ ] `finalizeGroupIncept` - works when provided toForward signature from other event, not exn
- [ ] ~~`finalizeGroupIncept` - when provided wrong event, unwrap~~
- [ ] `finalizeGroupIncept` - works when provided signature from other event