Run an observer
Overview
The observer is a component of the Clean Hands Stack for programmable privacy, used for GDPR-compliant storage of encrypted user data with the DecryptBabyJubJub method for KYC.
The observer is a primary component in the Clean Hands stack with Zeronym. To interact with the observer, a user generates a ZKP they have passed sanctions checks, and this ZKP outputs the ciphertext of the user's personal identifiable information (PII) and the user's associated blockchain address. The Observer's role in this system is to verify ZKPs, issue attestations to users with valid ZKPs, and to store the public outputs of these ZKPs so that the ciphertext can be decrypted if Mishti network permits.
Endpoints
POST /observations
This endpoint does the following.
Verify the Clean Hands ZKP. Uses this circuit to verify a proof which should have been generated using this package.
Make sure the encryption key output by the circuit is Mishti Network’s public key.
Make sure the issuer address output by the circuit is the configured clean hands issuer.
Make sure the conditions contract signed by the user is on our whitelist.
Verify the user’s signature of the conditions contract.
Store the ZKP’s public values, user's address, user's signature, and signed access contract in the
observations
collection.Issue an attestation on Sign Protocol.
GET /observations?user_address=<address>
This endpoint queries the database for an observation for the provided user address and returns the result.
Schemas
Environment variables
Create a .env file with the following variables. All are necessary.
MONGODB_URI
- URI for MongoDB. The observer stores ZKP outputs, the user's blockchain address, the user's signature, and the address of the access conditions contract in a collection titled "observations".
CLEAN_HANDS_ISSUER_ADDRESS
- The address that issued the credentials used as inputs to the ZKP. This is used to validate the issuer address output by the ZKP.
ATTESTOR_PRIVATE_KEY
- The private key of the account used to issue attestations. This private key is used to create transactions on Optimism. It's account remain funded; otherwise attestations will not be issued.
OP_RPC_URL
- URL for Optimism RPC node.
Run
Last updated