Skip to content

Commit

Permalink
Add score sequence diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
r0qs committed Aug 17, 2022
1 parent aec12a3 commit c53d2d2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
29 changes: 29 additions & 0 deletions uml/certree.puml
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,33 @@ end
Verifier -> Verifier: <latex>Check(t_{total} \ge d_{total} \land d_{total}\ \ge \ p)</latex>
Verifier -> Verifier: <latex>Verify(vkey, proof_{zk}, [h_{0},...,h_{n-1}], Root_{mt}, tsk, d_{total}, p, >=)</latex>
@enduml

@startuml (id=PresentationScore)
Verifier -> Subject: <latex>SendRequirements([T_{0},...,T_{n-1}], [W_{0},...,W_{n-1}])</latex>
Subject -> Contract: <latex>CollectCredentialCreatedEvents()</latex>
Contract --> Subject: <latex>events</latex>
Subject -> Subject: <latex>mt = BuildCertTree(events)</latex>
loop n times
Subject -> Subject: <latex>doc_{i} = GetCredentialWith(T_{i})</latex>
Subject -> Subject: <latex>rct_{i}, ct_{i} = BuildCredTree(doc_{i})</latex>
Subject -> Subject: <latex>mtproof_{i} = merkleProof(mt, h(rct_{i}))</latex>
Subject -> Subject: <latex>fields_{i} = [doc_{i}.tag, doc_{i}.grade]</latex>
Subject -> Subject: <latex>ctproof_{i} = merkleMultiProof(ct_{i}, fields_{i})</latex>
end
Subject -> Subject: <latex>inputs = PrepareInputs(mt, [T_{0},...,T_{n-1}], [W_{0},...,W_{n-1}],\\[h_{0},...,h_{n-1}], [fields_{0},...,fields_{n-1}], [mtproof_{0},...,mtproof_{n-1}],\\[ctproof_{0},...,ctproof_{n-1}])</latex>
Subject -> Subject: <latex>proof_{zk}, sc = ScoreCircuit(zkey, inputs)</latex>
Subject -> Verifier: <latex>(proof_{zk}, [T_{0},...,T_{n-1}], [W_{0},...,W_{n-1}], Root_{mt}, [h_{0},...,h_{n-1}], sc)</latex>
Verifier -> Contract: <latex>IsKnownRoot(Root_{mt})</latex>
Contract --> Verifier: <latex>true/false</latex>
loop n times
Verifier -> Contract: <latex>VerifyCredentialStatus(h_{i})</latex>
alt #lightgreen Successful case
Contract --> Verifier: Credential is valid (not revoked or expired)
else #pink Failure
Contract --> Verifier: Credential is not valid
end
end
Verifier -> Verifier: <latex>Verify(vkey, proof_{zk}, [T_{0},...,T_{n-1}], [W_{0},...,W_{n-1}], Root_{mt}, sc)</latex>
@enduml

@enduml
6 changes: 3 additions & 3 deletions uml/full.puml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ participant "Verifier" as Verifier

!include certree.puml!Registration
!include certree.puml!Approval
' !include certree.puml!Revocation
!include certree.puml!Revocation
!include certree.puml!PresentationAuth
!include certree.puml!PresentationConditionalQuery
' !include certree.puml!PresentationRange
' !include certree.puml!PresentationScore
!include certree.puml!PresentationTimeframe
!include certree.puml!PresentationScore

@enduml

0 comments on commit c53d2d2

Please sign in to comment.