Patient asks his cryptographic USB to create a key pair and attaches it to DID

D.1 Patient USBPatient : DID

D.2 USBPatient Patient : kb

Patient sends his identifier k0 to HAP requests his attributes a 1 , , a n and asks him to link them do DID and kb

D.3 Patient HAP : k0, DID, kb, a 1 , , a n

HAP challenges patient to prove that he is the owner of k0 and kb

D.4 HAP Patient : k0, Np

D.5 Patient USBPatient : HAP, H(k0, Np)

D.6 USBPatient Patient : { H ( k 0 , N p ) } k 0 1

D.7 Patient USBPatient : DID, H(kb, Np)

D.8 USBPatient Patient : { H ( k b , N p ) } k b 1

D.9 Patient HAP : { H ( k 0 , N p ) } k 0 1 , { H ( k b , N p ) } k b 1

HAP asks his USB to sign the link between DID and kb and stores the result in Indy

D.10 HAP USBHAP : HAP, H(DID, kb)

D.11 USBHAP HAP : { H ( D I D , k b ) } k p 1

D.12 HAP Indy : DID, kb, { H ( D I D , k b ) } k p 1

HAP looks for the address of the EMR in his database and requests it from IPFS

D.13 HAP HAPDB : k0

D.14 HAPDB HAP : k0, H(F), { k } k p

D.15 HAP IPFS : H(F)

D.16 IPFS HAP : { E M R } k

HAP attaches EMR to DID and saves it in IPFS

D.17 HAP IPFS : D I D , { E M R } k M , { H ( M ) } k p 1 F 1

HAP sends to Patient the IPFS address of the requested EMR with its protection key

D.18 HAP Patient : H(F1), { k } k 0

Patient saves the name of attributes, the address of their EMR and their protection key in his Wallet

D.19 Patient Wallet : a 1 , , a n , H(F1), { k } k 0