This project is a demonstration of using the TLS Notary protocol to attest to user account specific data fetched from an API and have the results processed into a verifiable credential.
Specifically, the Reddit API is used to fetch information on which subreddit a user is a moderator of and then a verifiable credential stating this is issued to them using their desired DID. The motivation for this choice is based on the understanding that this responsibility is a signal of trust having already been issued to this individual. This enables users to transform their existing trusted role into a verifiable credential.
The project relies on three seperate services: the primary full stack application, a notary server, and a credential issuing service.
- The user inputs their DID and clicks the "Get Your VC" button. They are redirected to Reddit to authorize the application. They are then redirected back to the application with an authorization code.
- The authorization code along with the user's DID are sent to the back-end server. The authorization code is exchanged for an access token.
- The back-end server establishes a connection with the notary server.
- The back-end server establishes a TLS session with the Reddit API, using the MPC protocol with the notary server. This allows secure encryption of the request and decryption of the response, ensuring the notary server never learns the plaintext data while still verifying the session's integrity.
- After the request is processed, the back-end server receives a signed attestation from the notary server, confirming the authenticity of the exchanged data.
- The back-end server prepares a verifiable presentation of the plaintext data received from the TLS session.
- This is sent to the credential issuing service along with the user's DID.
- The credential service verifies the presented data. If valid, the appropriate information (Subreddit name) is extracted from the response data and used to issue a verifiable credential.
- The verifiable credential is returned to the front end and displayed to the user.
- Rust
- Node.js
- Reddit account with moderator privileges (only one subreddit is processed at this time)
- This is automatic when creating a new subreddit
- Reddit Web Application credentials (create at https://www.reddit.com/prefs/apps/)
- Clone repository
- Install
tlsn
submodule:git submodule update --init
- Set
tls: enabled: false
intlsn/crates/notary/server/config/config.yaml
Each component has its own setup instructions:
- Front-end: refer to
front-end/README.md
- Back-end: refer to
back-end/README.md
- Issuer Proxy: refer to
issuer/README.md
- Credential Service: refer to
issuer/credential-service/README.md
- Notary Server: Navigate to
tlsn/crates/notary/server
and runcargo run --release