@startuml skinparam ParticipantPadding 20 skinparam BoxPadding 20 title Libsovrin anoncreds scale 0.9 box "Issuer" #LightBlue participant "Walleted Issuer" as IW actor Issuer as I endbox box "Prover" actor Prover as P participant "Walleted Prover" as PW endbox actor Verifier as V participant "Ledger" as L note over IW, L #white dashed arrows: a value from Ledger may be cached (in wallet?) bold text: anoncreds libsovrin API call red: internal communication with walleted entity green: submit/get to/from secure wallet blue: submit/get to/from Ledger black: communication between Issuer/Prover/Verifier endnote === Create Claim Definition == I -> IW: 1. sovrin_issuer_create_and_store_claim_def IW -[#green]> IW: store keys IW -> I: I-[#blue]>L: send CLAIM_DEF txn L-[#blue]>I: I -> IW: 2. sovrin_wallet_set_seq_no_for_value IW -[#green]> IW: update claim_def seq_no === Create Revocation Registry == I -> IW: 3. sovrin_issuer_create_and_store_revoc_reg IW -[#green]> IW: get keys IW -[#green]> IW: store revoc reg IW -> I: I-[#blue]>L: send REVOC_REG txn L-[#blue]>I: I -> IW: 4. sovrin_wallet_set_seq_no_for_value IW -[#green]> IW: update revpc_reg seq_no === Create Master secret == P -> PW: 5.sovrin_prover_create_master_secret PW -[#green]> PW: store master secret === Send Claim Offer == I -[#black]> P: send claim offer P -> PW: 6. sovrin_prover_store_claim_offer PW -[#green]> PW: store claim offers === Show Claim Offers in UI == P -> PW: 7.sovrin_prover_get_claim_offers PW -[#green]> PW: get claim offers PW -> P: P -> P: show on UI === Request and Issue Claims == P -[#blue]-> L: send GET_CLAIM_DEF req L -[#blue]-> P: P -> PW: 8.sovrin_prover_create_and_store_claim_req PW -[#green]> PW: get master secret PW -[#green]> PW: store claim_req PW -> P: P -[#black]> I: send claim request I -> IW: 9. sovrin_issuer_create_claim IW -[#green]> IW: get keys IW -[#green]> IW: get revoc reg IW -> I: , I -[#blue]> L: send REVOC_REG_UPDATE txn I -[#black]> P: send claim P -> PW: 10.sovrin_prover_store_claim PW -[#green]> PW: get claim request PW -[#green]> PW: store claim === Show Claims on UI == P -> PW: 11. sovrin_prover_get_claims PW -[#green]> PW: get claims PW -> P: P -> P: show on UI === Present Claim to 3d Party (proof request)== V -[#black]> P: send proof request ||| P -> PW: 12.sovrin_prover_get_claims_for_proof_req PW -> P: P -> P: show on UI P -> P: select claims for the proof ||| P -[#blue]-> L: send GET_SCHEMA req L -[#blue]-> P: P -[#blue]-> L: send GET_CLAIM_DEF req L -[#blue]-> P: P -[#blue]-> L: send GET_REVOC_REG req L -[#blue]-> P: ||| P -> PW: 13.sovrin_prover_create_proof PW -[#green]> PW: get claim PW -> P: ||| P -[#black]> V: send proof ||| V -[#blue]-> L: send GET_SCHEMA req L -[#blue]-> V: V -[#blue]-> L: send GET_CLAIM_DEF req L -[#blue]-> V: V -[#blue]-> L: send GET_REVOC_REG req L -[#blue]-> V: ||| V -> V: 14. sovrin_verifier_verify_proof === Revoke Claims == I -> IW: 15. sovrin_issuer_revoke_claim IW -[#green]> IW: get keys IW -[#green]> IW: get revoc reg IW -> I: I -[#blue]> L: send REVOC_REG_UPDATE txn @enduml