- This flow builds upon the the contracts explained and coded in the IOT-Contracts repo.
- Credential Issuer (
CI) - Entity that emits signed credentials that allow citizens to configure their IoT devices to share data with others participating in the DECODE ecosystem. It controls the Credential Issuer API already developed and explained in CREDENTIAL ISSUING NOTES. - Administrator (
CA) - Entity that works with community groups in order to define policies that control how participating citizen's device data should be processed and encrypted. This entity is responsible for making various calls to API endpoints to create new communities - Dashboard (Verifier) (
VE)- The dashboard being operated by Eurecat is an entity that provides a dashboard that allows verified users to view data collected for a community. In reference to the Coconut authentication protocol this entity must be able to verify a blind credential provided by a Citizen and be able to grant or deny access to private resources based on this verification. - Citizen (
CIT) - a citizen taking part in the IoT pilot for DECODE, who has installed theDecode Appand will receive an IoT device and take part in the workshops. - Iot Device Manager (
IOT-DM) - An entity who manages the underlying infrastructure to which the distributed IoT devices connect and submit data. In addition they manage user onboarding via an existing onboarding application which is the point of entry for a citizen (CIT) to become part of the DECODE IoT pilot. Finally this entity also currently is responsible for providing the infrastructure on which the server components for the IoT pilot are running.
POLICYSTORE- server running on infrastructure managed byIOT-DM. Provides read/write API for community policy definitions. Makes calls to theDASHBOARDto register new community dashboards on creationENCODER- server running on infrastructure managed byIOT-DMthat is able to subscribe to the MQTT broker operated byIOT-DMand create encrypted streams of data which are then written to theDATASTOREDATASTORE- server that provides a data storage layer for encrypted events emitted by theENCODERthat runs on infrastructure managed byIOT-DM.DASHBOARD- service operated by theVEthat stores decrypted events read from theDATASTORE, and is able to participate in the Coconut authentication flow to grant or deny access to private dashboards to citizens that are able to present a valid blind credential.CREDENTIAL_ISSUER- service that is required for generating credentials and then verifying them.ONBOARDING_APP- a service created by theIOT-DMthat allows users to configure their physical device to connect to their home network and collects information from the user on the location and exposure of the device.
-
Community creation - the setup and registration of available communities by the
CA -
Device onboarding - new citizens (
CIT) adding the devices to DECODE, and initializing theirDecode Appwith the details of these devices -
Data collection - citizens choose communities to belong to which starts data being collected in encrypted form for that community
-
User authentication - citizen uses Coconut to securely prove their right to access a community
CAworks with a community group in order to define a policy for the community containing a set of operations that the community wishes to apply to participating devices.CAexecutes the setup steps defined in the CREDENTIAL ISSUING NOTES to create a newAUTHORIZABLE ATTRIBUTEfor which credentials can be created. This call provides theCAwith an$authorizable_attribute_idand$credential_issuer_endpoint_url.CAcreates a$community_creation_requestincluding a$community_definitionalong with the obtained$authorizable_attribute_idand$credential_issuer_endpoint_url.CAsends this$community_creation_requestvia a POST request to the$policystore_create_communityendpoint.- The
POLICYSTOREsends a POST request to the$dashboard_api_create_encrypted_dashboardendpoint which causes theDASHBOARDservice to create a new dashboard with associated keypair, and returns the$community_public_keyto thePOLICYSTORE. - The
POLICYSTOREsaves this information after which point the community has been created and is ready for citizens to participate in.
-
CITis guided to install theDecode Appduring the course of a workshop. -
CITuses theONBOARDING_APPin order to configure their physical device and supplies some information on the location and exposure of the device. -
ONBOARDING_APPshows a page which allows theCITto add their device to DECODE. This page shows a QR code (with corresponding short form URL) which encodes the following properties:$device_token,$device_location, and$device_exposure -
CITuses theirDecode Appto scan the QR code (or manually enters the URL in their browser), which captures this information into theDecode App. -
The
Decode Apppresents a UI to the user which is the mechanism by which they will be able to add their device to DECODE. -
The
Decode Appsends a POST request to the$policystore_list_policiesendpoint which returns a list of all available community policies. -
The
Decode Apppresents a UI which shows this list of available community policies. -
CITchooses which community they wish to join, so then theDecode Appexecutes the credential issuing steps defined in the Credential Issuing document to create a blind credential for the specified$authorizable_attribute_id. -
The
Decode Appthen sends a POST request to the$encoder_create_streamendpoint which creates a new stream for the specified device. This new stream causes encrypted data to be written to the encrypted datastore via the$encrypted_datastore_writeendpoint
- The
DASHBOARDis able to start requesting encrypted events as soon as a new dashboard has been registered by sending a POST request to the$read_encrypted_eventsendpoint on theDATASTORE. - This endpoint will initially return no events, but as soon as a
CIThas chosen to add their device to a community, then encrypted events will start to appear in this dataset. - The
DASHBOARDwill use Zenroom to decrypt the events as they have the corresponding private key for the community, and these unencrypted events will be stored in theDASHBOARD'stime series datastore
-
A
CITwishes to view the communities dataset via theDASHBOARD, so they open theDASHBOARDurl and attempt to open the specified dashboard. -
The
DASHBOARDknows the requested dashboard is protected so rather than showing to theCITit instead presents a login page containing a QR code (and a short form URL). This QR code encodes a login link which the wallet must be able to scan to initiate the Coconut blind credential login flow.
The link the dashboard should send to is: https://iot.decodeproject.eu/#/login?sessionId=abc123&callback=http://93ff8837.ngrok.io/oauth/iot_login_callback
See the QR handling notes for reference.
-
The
Decode Appafter scanning the code (or entering the short form) displays a UI which prompts the user as to whether they wish to share their blind proof for the community with the dashboard. If the user agrees, the app creates a$login_requestcontaining their blind proof as well as some additional metadata back to theDASHBOARD'slogin URL (TODO: document this method) -
The
DASHBOARDparses the incoming$login_request, and then sends a request to the$credential_issuer_endpoint_addressto obtain a public verification key for the specified$authorizable_attribute_id. -
The
DASHBOARDthen executes the Coconut script to verify the blind credential, and if the credential is valid, creates a new session for theCIT, i.e. logging them into the requested dashboard, and then redirects the user to that page.
Written by Sam Mulube sam@thingful.net with minor revisions from Oleguer Sagarra ula@dribia.com